Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(5)

Side by Side Diff: Source/web/SharedWorkerRepository.cpp

Issue 24469004: Amusingly deprecate the generic version of 'ExceptionState::throwDOMException'. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 7 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « Source/modules/webmidi/MIDIOutput.cpp ('k') | Source/web/StorageAreaProxy.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2009 Google Inc. All rights reserved. 2 * Copyright (C) 2009 Google Inc. All rights reserved.
3 * 3 *
4 * Redistribution and use in source and binary forms, with or without 4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions are 5 * modification, are permitted provided that the following conditions are
6 * met: 6 * met:
7 * 7 *
8 * * Redistributions of source code must retain the above copyright 8 * * Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer. 9 * notice, this list of conditions and the following disclaimer.
10 * * Redistributions in binary form must reproduce the above 10 * * Redistributions in binary form must reproduce the above
(...skipping 217 matching lines...) Expand 10 before | Expand all | Expand 10 after
228 228
229 // No nested workers (for now) - connect() should only be called from docume nt context. 229 // No nested workers (for now) - connect() should only be called from docume nt context.
230 ASSERT(worker->scriptExecutionContext()->isDocument()); 230 ASSERT(worker->scriptExecutionContext()->isDocument());
231 Document* document = toDocument(worker->scriptExecutionContext()); 231 Document* document = toDocument(worker->scriptExecutionContext());
232 WebFrameImpl* webFrame = WebFrameImpl::fromFrame(document->frame()); 232 WebFrameImpl* webFrame = WebFrameImpl::fromFrame(document->frame());
233 OwnPtr<WebSharedWorker> webWorker; 233 OwnPtr<WebSharedWorker> webWorker;
234 webWorker = adoptPtr(webFrame->client()->createSharedWorker(webFrame, url, n ame, getId(document))); 234 webWorker = adoptPtr(webFrame->client()->createSharedWorker(webFrame, url, n ame, getId(document)));
235 235
236 if (!webWorker) { 236 if (!webWorker) {
237 // Existing worker does not match this url, so return an error back to t he caller. 237 // Existing worker does not match this url, so return an error back to t he caller.
238 es.throwDOMException(URLMismatchError); 238 es.throwUninformativeAndGenericDOMException(URLMismatchError);
239 return; 239 return;
240 } 240 }
241 241
242 repository->addSharedWorker(webWorker.get(), getId(document)); 242 repository->addSharedWorker(webWorker.get(), getId(document));
243 243
244 // The loader object manages its own lifecycle (and the lifecycles of the tw o worker objects). 244 // The loader object manages its own lifecycle (and the lifecycles of the tw o worker objects).
245 // It will free itself once loading is completed. 245 // It will free itself once loading is completed.
246 SharedWorkerScriptLoader* loader = new SharedWorkerScriptLoader(worker, url, name, port, webWorker.release()); 246 SharedWorkerScriptLoader* loader = new SharedWorkerScriptLoader(worker, url, name, port, webWorker.release());
247 loader->load(); 247 loader->load();
248 } 248 }
(...skipping 11 matching lines...) Expand all
260 } 260 }
261 261
262 bool SharedWorkerRepository::hasSharedWorkers(Document* document) 262 bool SharedWorkerRepository::hasSharedWorkers(Document* document)
263 { 263 {
264 WebKit::WebSharedWorkerRepository* repository = WebKit::sharedWorkerReposito ry(); 264 WebKit::WebSharedWorkerRepository* repository = WebKit::sharedWorkerReposito ry();
265 265
266 return repository && repository->hasSharedWorkers(getId(document)); 266 return repository && repository->hasSharedWorkers(getId(document));
267 } 267 }
268 268
269 } // namespace WebCore 269 } // namespace WebCore
OLDNEW
« no previous file with comments | « Source/modules/webmidi/MIDIOutput.cpp ('k') | Source/web/StorageAreaProxy.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698