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

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

Issue 111373003: Migrate bindings constructors to the new ExceptionState model. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 7 years 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
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 144 matching lines...) Expand 10 before | Expand all | Expand 10 after
155 void SharedWorkerRepositoryClientImpl::connect(PassRefPtr<SharedWorker> worker, PassOwnPtr<WebMessagePortChannel> port, const KURL& url, const String& name, Exc eptionState& exceptionState) 155 void SharedWorkerRepositoryClientImpl::connect(PassRefPtr<SharedWorker> worker, PassOwnPtr<WebMessagePortChannel> port, const KURL& url, const String& name, Exc eptionState& exceptionState)
156 { 156 {
157 ASSERT(m_client); 157 ASSERT(m_client);
158 158
159 // No nested workers (for now) - connect() should only be called from docume nt context. 159 // No nested workers (for now) - connect() should only be called from docume nt context.
160 ASSERT(worker->executionContext()->isDocument()); 160 ASSERT(worker->executionContext()->isDocument());
161 Document* document = toDocument(worker->executionContext()); 161 Document* document = toDocument(worker->executionContext());
162 OwnPtr<WebSharedWorker> webWorker = adoptPtr(m_client->createSharedWorker(ur l, name, getId(document))); 162 OwnPtr<WebSharedWorker> webWorker = adoptPtr(m_client->createSharedWorker(ur l, name, getId(document)));
163 if (!webWorker) { 163 if (!webWorker) {
164 // Existing worker does not match this url, so return an error back to t he caller. 164 // Existing worker does not match this url, so return an error back to t he caller.
165 exceptionState.throwDOMException(URLMismatchError, ExceptionMessages::fa iledToConstruct("SharedWorker", "The location of the SharedWorker named '" + nam e + "' does not exactly match the provided URL ('" + url.elidedString() + "').") ); 165 exceptionState.throwDOMException(URLMismatchError, "The location of the SharedWorker named '" + name + "' does not exactly match the provided URL ('" + url.elidedString() + "').");
166 return; 166 return;
167 } 167 }
168 168
169 // The loader object manages its own lifecycle (and the lifecycles of the tw o worker objects). 169 // The loader object manages its own lifecycle (and the lifecycles of the tw o worker objects).
170 // It will free itself once loading is completed. 170 // It will free itself once loading is completed.
171 SharedWorkerScriptLoader* loader = new SharedWorkerScriptLoader(worker, url, name, port, webWorker.release()); 171 SharedWorkerScriptLoader* loader = new SharedWorkerScriptLoader(worker, url, name, port, webWorker.release());
172 loader->load(); 172 loader->load();
173 } 173 }
174 174
175 void SharedWorkerRepositoryClientImpl::documentDetached(Document* document) 175 void SharedWorkerRepositoryClientImpl::documentDetached(Document* document)
176 { 176 {
177 ASSERT(m_client); 177 ASSERT(m_client);
178 m_client->documentDetached(getId(document)); 178 m_client->documentDetached(getId(document));
179 } 179 }
180 180
181 SharedWorkerRepositoryClientImpl::SharedWorkerRepositoryClientImpl(WebSharedWork erRepositoryClient* client) 181 SharedWorkerRepositoryClientImpl::SharedWorkerRepositoryClientImpl(WebSharedWork erRepositoryClient* client)
182 : m_client(client) 182 : m_client(client)
183 { 183 {
184 } 184 }
185 185
186 } // namespace blink 186 } // namespace blink
OLDNEW
« Source/modules/webaudio/DelayNode.cpp ('K') | « Source/modules/webaudio/OfflineAudioContext.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698