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

Side by Side Diff: third_party/WebKit/Source/web/ServiceWorkerGlobalScopeProxy.cpp

Issue 2010603002: Use SourceLocation when reporting runtime exceptions. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@2004243002
Patch Set: test fixes Created 4 years, 7 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
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2013 Google Inc. All rights reserved. 2 * Copyright (C) 2013 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 12 matching lines...) Expand all
23 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 23 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
24 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 24 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
25 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 25 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
26 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 26 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
27 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 27 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
28 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 28 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
29 */ 29 */
30 30
31 #include "web/ServiceWorkerGlobalScopeProxy.h" 31 #include "web/ServiceWorkerGlobalScopeProxy.h"
32 32
33 #include "bindings/core/v8/SourceLocation.h"
33 #include "bindings/core/v8/WorkerOrWorkletScriptController.h" 34 #include "bindings/core/v8/WorkerOrWorkletScriptController.h"
34 #include "core/dom/CrossThreadTask.h" 35 #include "core/dom/CrossThreadTask.h"
35 #include "core/dom/Document.h" 36 #include "core/dom/Document.h"
36 #include "core/dom/ExecutionContext.h" 37 #include "core/dom/ExecutionContext.h"
37 #include "core/dom/MessagePort.h" 38 #include "core/dom/MessagePort.h"
38 #include "core/inspector/ConsoleMessage.h" 39 #include "core/inspector/ConsoleMessage.h"
39 #include "core/workers/WorkerGlobalScope.h" 40 #include "core/workers/WorkerGlobalScope.h"
40 #include "core/workers/WorkerThread.h" 41 #include "core/workers/WorkerThread.h"
41 #include "modules/background_sync/SyncEvent.h" 42 #include "modules/background_sync/SyncEvent.h"
42 #include "modules/fetch/Headers.h" 43 #include "modules/fetch/Headers.h"
(...skipping 160 matching lines...) Expand 10 before | Expand all | Expand 10 after
203 { 204 {
204 if (!RuntimeEnabledFeatures::backgroundSyncEnabled()) { 205 if (!RuntimeEnabledFeatures::backgroundSyncEnabled()) {
205 ServiceWorkerGlobalScopeClient::from(workerGlobalScope())->didHandleSync Event(eventID, WebServiceWorkerEventResultCompleted); 206 ServiceWorkerGlobalScopeClient::from(workerGlobalScope())->didHandleSync Event(eventID, WebServiceWorkerEventResultCompleted);
206 return; 207 return;
207 } 208 }
208 WaitUntilObserver* observer = WaitUntilObserver::create(workerGlobalScope(), WaitUntilObserver::Sync, eventID); 209 WaitUntilObserver* observer = WaitUntilObserver::create(workerGlobalScope(), WaitUntilObserver::Sync, eventID);
209 Event* event = SyncEvent::create(EventTypeNames::sync, tag, lastChance == Is LastChance, observer); 210 Event* event = SyncEvent::create(EventTypeNames::sync, tag, lastChance == Is LastChance, observer);
210 workerGlobalScope()->dispatchExtendableEvent(event, observer); 211 workerGlobalScope()->dispatchExtendableEvent(event, observer);
211 } 212 }
212 213
213 void ServiceWorkerGlobalScopeProxy::reportException(const String& errorMessage, int lineNumber, int columnNumber, const String& sourceURL, int) 214 void ServiceWorkerGlobalScopeProxy::reportException(const String& errorMessage, PassOwnPtr<SourceLocation> location)
214 { 215 {
215 client().reportException(errorMessage, lineNumber, columnNumber, sourceURL); 216 client().reportException(errorMessage, location->lineNumber(), location->col umnNumber(), location->url());
216 } 217 }
217 218
218 void ServiceWorkerGlobalScopeProxy::reportConsoleMessage(ConsoleMessage* console Message) 219 void ServiceWorkerGlobalScopeProxy::reportConsoleMessage(ConsoleMessage* console Message)
219 { 220 {
220 client().reportConsoleMessage(consoleMessage->source(), consoleMessage->leve l(), consoleMessage->message(), consoleMessage->lineNumber(), consoleMessage->ur l()); 221 client().reportConsoleMessage(consoleMessage->source(), consoleMessage->leve l(), consoleMessage->message(), consoleMessage->lineNumber(), consoleMessage->ur l());
221 } 222 }
222 223
223 void ServiceWorkerGlobalScopeProxy::postMessageToPageInspector(const String& mes sage) 224 void ServiceWorkerGlobalScopeProxy::postMessageToPageInspector(const String& mes sage)
224 { 225 {
225 DCHECK(m_embeddedWorker); 226 DCHECK(m_embeddedWorker);
(...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after
291 return *m_document; 292 return *m_document;
292 } 293 }
293 294
294 ServiceWorkerGlobalScope* ServiceWorkerGlobalScopeProxy::workerGlobalScope() con st 295 ServiceWorkerGlobalScope* ServiceWorkerGlobalScopeProxy::workerGlobalScope() con st
295 { 296 {
296 DCHECK(m_workerGlobalScope); 297 DCHECK(m_workerGlobalScope);
297 return m_workerGlobalScope; 298 return m_workerGlobalScope;
298 } 299 }
299 300
300 } // namespace blink 301 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/web/ServiceWorkerGlobalScopeProxy.h ('k') | third_party/WebKit/Source/web/WebSharedWorkerImpl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698