| Index: third_party/WebKit/Source/core/workers/WorkerGlobalScope.cpp
|
| diff --git a/third_party/WebKit/Source/core/workers/WorkerGlobalScope.cpp b/third_party/WebKit/Source/core/workers/WorkerGlobalScope.cpp
|
| index ba9f02c4601f906c33c04cf771a1238ea6ef7a84..65370c767c33eb695e382b8dded2db99f481dafa 100644
|
| --- a/third_party/WebKit/Source/core/workers/WorkerGlobalScope.cpp
|
| +++ b/third_party/WebKit/Source/core/workers/WorkerGlobalScope.cpp
|
| @@ -54,6 +54,7 @@
|
| #include "core/workers/WorkerScriptLoader.h"
|
| #include "core/workers/WorkerThread.h"
|
| #include "platform/network/ContentSecurityPolicyParsers.h"
|
| +#include "platform/TraceEvent.h"
|
| #include "platform/weborigin/KURL.h"
|
| #include "platform/weborigin/SecurityOrigin.h"
|
| #include "public/platform/Platform.h"
|
| @@ -181,6 +182,7 @@ void WorkerGlobalScope::close()
|
|
|
| void WorkerGlobalScope::importScripts(const Vector<String>& urls, ExceptionState& exceptionState)
|
| {
|
| + TRACE_EVENT0("ServiceWorker", "WorkerGlobalScope::importScripts");
|
| DCHECK(contentSecurityPolicy());
|
| DCHECK(getExecutionContext());
|
|
|
| @@ -203,7 +205,10 @@ void WorkerGlobalScope::importScripts(const Vector<String>& urls, ExceptionState
|
| for (const KURL& completeURL : completedURLs) {
|
| RefPtr<WorkerScriptLoader> scriptLoader(WorkerScriptLoader::create());
|
| scriptLoader->setRequestContext(WebURLRequest::RequestContextScript);
|
| - scriptLoader->loadSynchronously(executionContext, completeURL, AllowCrossOriginRequests, executionContext.securityContext().addressSpace());
|
| + {
|
| + TRACE_EVENT0("ServiceWorker", "WorkerGlobalScope::importScripts::loadSynchronously");
|
| + scriptLoader->loadSynchronously(executionContext, completeURL, AllowCrossOriginRequests, executionContext.securityContext().addressSpace());
|
| + }
|
|
|
| // If the fetching attempt failed, throw a NetworkError exception and
|
| // abort all these steps.
|
| @@ -218,7 +223,10 @@ void WorkerGlobalScope::importScripts(const Vector<String>& urls, ExceptionState
|
| ErrorEvent* errorEvent = nullptr;
|
| std::unique_ptr<Vector<char>> cachedMetaData(scriptLoader->releaseCachedMetadata());
|
| CachedMetadataHandler* handler(createWorkerScriptCachedMetadataHandler(completeURL, cachedMetaData.get()));
|
| - m_scriptController->evaluate(ScriptSourceCode(scriptLoader->script(), scriptLoader->responseURL()), &errorEvent, handler, m_v8CacheOptions);
|
| + {
|
| + TRACE_EVENT0("ServiceWorker", "WorkerGlobalScope::importScripts::evaluate");
|
| + m_scriptController->evaluate(ScriptSourceCode(scriptLoader->script(), scriptLoader->responseURL()), &errorEvent, handler, m_v8CacheOptions);
|
| + }
|
| if (errorEvent) {
|
| m_scriptController->rethrowExceptionFromImportedScript(errorEvent, exceptionState);
|
| return;
|
|
|