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

Unified Diff: third_party/WebKit/Source/core/workers/WorkerGlobalScope.cpp

Issue 2118243002: [proof-of-concept] SW thread independent of the main thread Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebase Created 4 years, 4 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 side-by-side diff with in-line comments
Download patch
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;

Powered by Google App Engine
This is Rietveld 408576698