| OLD | NEW |
| 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 24 matching lines...) Expand all Loading... |
| 35 #include "bindings/core/v8/ScriptPromiseResolver.h" | 35 #include "bindings/core/v8/ScriptPromiseResolver.h" |
| 36 #include "bindings/core/v8/ScriptState.h" | 36 #include "bindings/core/v8/ScriptState.h" |
| 37 #include "bindings/core/v8/SourceLocation.h" | 37 #include "bindings/core/v8/SourceLocation.h" |
| 38 #include "bindings/core/v8/V8ThrowException.h" | 38 #include "bindings/core/v8/V8ThrowException.h" |
| 39 #include "core/dom/ExceptionCode.h" | 39 #include "core/dom/ExceptionCode.h" |
| 40 #include "core/events/Event.h" | 40 #include "core/events/Event.h" |
| 41 #include "core/fetch/MemoryCache.h" | 41 #include "core/fetch/MemoryCache.h" |
| 42 #include "core/fetch/ResourceLoaderOptions.h" | 42 #include "core/fetch/ResourceLoaderOptions.h" |
| 43 #include "core/inspector/ConsoleMessage.h" | 43 #include "core/inspector/ConsoleMessage.h" |
| 44 #include "core/inspector/WorkerInspectorController.h" | 44 #include "core/inspector/WorkerInspectorController.h" |
| 45 #include "core/inspector/WorkerThreadDebugger.h" |
| 45 #include "core/loader/ThreadableLoader.h" | 46 #include "core/loader/ThreadableLoader.h" |
| 46 #include "core/origin_trials/OriginTrialContext.h" | 47 #include "core/origin_trials/OriginTrialContext.h" |
| 47 #include "core/workers/WorkerClients.h" | 48 #include "core/workers/WorkerClients.h" |
| 48 #include "core/workers/WorkerThreadStartupData.h" | 49 #include "core/workers/WorkerThreadStartupData.h" |
| 49 #include "modules/EventTargetModules.h" | 50 #include "modules/EventTargetModules.h" |
| 50 #include "modules/cachestorage/CacheStorage.h" | 51 #include "modules/cachestorage/CacheStorage.h" |
| 51 #include "modules/cachestorage/InspectorCacheStorageAgent.h" | 52 #include "modules/cachestorage/InspectorCacheStorageAgent.h" |
| 52 #include "modules/fetch/GlobalFetch.h" | 53 #include "modules/fetch/GlobalFetch.h" |
| 53 #include "modules/serviceworkers/ServiceWorkerClients.h" | 54 #include "modules/serviceworkers/ServiceWorkerClients.h" |
| 54 #include "modules/serviceworkers/ServiceWorkerGlobalScopeClient.h" | 55 #include "modules/serviceworkers/ServiceWorkerGlobalScopeClient.h" |
| (...skipping 150 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 205 for (Vector<String>::const_iterator it = urls.begin(); it != urls.end(); ++i
t) | 206 for (Vector<String>::const_iterator it = urls.begin(); it != urls.end(); ++i
t) |
| 206 getExecutionContext()->removeURLFromMemoryCache(completeURL(*it)); | 207 getExecutionContext()->removeURLFromMemoryCache(completeURL(*it)); |
| 207 WorkerGlobalScope::importScripts(urls, exceptionState); | 208 WorkerGlobalScope::importScripts(urls, exceptionState); |
| 208 } | 209 } |
| 209 | 210 |
| 210 CachedMetadataHandler* ServiceWorkerGlobalScope::createWorkerScriptCachedMetadat
aHandler(const KURL& scriptURL, const Vector<char>* metaData) | 211 CachedMetadataHandler* ServiceWorkerGlobalScope::createWorkerScriptCachedMetadat
aHandler(const KURL& scriptURL, const Vector<char>* metaData) |
| 211 { | 212 { |
| 212 return ServiceWorkerScriptCachedMetadataHandler::create(this, scriptURL, met
aData); | 213 return ServiceWorkerScriptCachedMetadataHandler::create(this, scriptURL, met
aData); |
| 213 } | 214 } |
| 214 | 215 |
| 215 void ServiceWorkerGlobalScope::logExceptionToConsole(const String& errorMessage,
std::unique_ptr<SourceLocation> location) | 216 void ServiceWorkerGlobalScope::exceptionThrown(const String& errorMessage, std::
unique_ptr<SourceLocation> location) |
| 216 { | 217 { |
| 217 WorkerGlobalScope::logExceptionToConsole(errorMessage, location->clone()); | 218 WorkerGlobalScope::exceptionThrown(errorMessage, location->clone()); |
| 218 ConsoleMessage* consoleMessage = ConsoleMessage::create(JSMessageSource, Err
orMessageLevel, errorMessage, std::move(location)); | 219 if (WorkerThreadDebugger* debugger = WorkerThreadDebugger::from(thread()->is
olate())) |
| 219 addMessageToWorkerConsole(consoleMessage); | 220 debugger->exceptionThrown(errorMessage, std::move(location)); |
| 220 } | 221 } |
| 221 | 222 |
| 222 void ServiceWorkerGlobalScope::scriptLoaded(size_t scriptSize, size_t cachedMeta
dataSize) | 223 void ServiceWorkerGlobalScope::scriptLoaded(size_t scriptSize, size_t cachedMeta
dataSize) |
| 223 { | 224 { |
| 224 ++m_scriptCount; | 225 ++m_scriptCount; |
| 225 m_scriptTotalSize += scriptSize; | 226 m_scriptTotalSize += scriptSize; |
| 226 m_scriptCachedMetadataTotalSize += cachedMetadataSize; | 227 m_scriptCachedMetadataTotalSize += cachedMetadataSize; |
| 227 } | 228 } |
| 228 | 229 |
| 229 } // namespace blink | 230 } // namespace blink |
| OLD | NEW |