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

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

Issue 204983007: Make ThreadableLoader class to use references (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: review comments Created 6 years, 9 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
« no previous file with comments | « Source/core/workers/Worker.cpp ('k') | Source/core/workers/WorkerScriptLoader.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/workers/WorkerGlobalScope.cpp
diff --git a/Source/core/workers/WorkerGlobalScope.cpp b/Source/core/workers/WorkerGlobalScope.cpp
index ceb06a07857d6c949fe48899dd1e365dc2784970..efa79db060ca0bf8e979e368909dea2c46cd6124 100644
--- a/Source/core/workers/WorkerGlobalScope.cpp
+++ b/Source/core/workers/WorkerGlobalScope.cpp
@@ -211,10 +211,14 @@ void WorkerGlobalScope::dispose()
void WorkerGlobalScope::importScripts(const Vector<String>& urls, ExceptionState& exceptionState)
{
ASSERT(contentSecurityPolicy());
+ ASSERT(executionContext());
+
+ ExecutionContext& executionContext = *this->executionContext();
+
Vector<String>::const_iterator urlsEnd = urls.end();
Vector<KURL> completedURLs;
for (Vector<String>::const_iterator it = urls.begin(); it != urlsEnd; ++it) {
- const KURL& url = executionContext()->completeURL(*it);
+ const KURL& url = executionContext.completeURL(*it);
if (!url.isValid()) {
exceptionState.throwDOMException(SyntaxError, "The URL '" + *it + "' is invalid.");
return;
@@ -226,7 +230,7 @@ void WorkerGlobalScope::importScripts(const Vector<String>& urls, ExceptionState
for (Vector<KURL>::const_iterator it = completedURLs.begin(); it != end; ++it) {
RefPtr<WorkerScriptLoader> scriptLoader(WorkerScriptLoader::create());
scriptLoader->setTargetType(ResourceRequest::TargetIsScript);
- scriptLoader->loadSynchronously(executionContext(), *it, AllowCrossOriginRequests);
+ scriptLoader->loadSynchronously(executionContext, *it, AllowCrossOriginRequests);
// If the fetching attempt failed, throw a NetworkError exception and abort all these steps.
if (scriptLoader->failed()) {
@@ -234,7 +238,7 @@ void WorkerGlobalScope::importScripts(const Vector<String>& urls, ExceptionState
return;
}
- InspectorInstrumentation::scriptImported(executionContext(), scriptLoader->identifier(), scriptLoader->script());
+ InspectorInstrumentation::scriptImported(&executionContext, scriptLoader->identifier(), scriptLoader->script());
RefPtrWillBeRawPtr<ErrorEvent> errorEvent = nullptr;
m_script->evaluate(ScriptSourceCode(scriptLoader->script(), scriptLoader->responseURL()), &errorEvent);
« no previous file with comments | « Source/core/workers/Worker.cpp ('k') | Source/core/workers/WorkerScriptLoader.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698