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

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

Issue 1322523002: Make WorkerScriptLoader back to RefCounted class (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 5 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
« no previous file with comments | « Source/core/workers/InProcessWorkerBase.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 e6312b9faadc0865b551150f2b75df2dc14bea45..fc043d19cd529fd7f608162ff21172527ed2ecfb 100644
--- a/Source/core/workers/WorkerGlobalScope.cpp
+++ b/Source/core/workers/WorkerGlobalScope.cpp
@@ -248,23 +248,23 @@ void WorkerGlobalScope::importScripts(const Vector<String>& urls, ExceptionState
}
for (const KURL& completeURL : completedURLs) {
- WorkerScriptLoader scriptLoader;
- scriptLoader.setRequestContext(WebURLRequest::RequestContextScript);
- scriptLoader.loadSynchronously(executionContext, completeURL, AllowCrossOriginRequests);
+ RefPtr<WorkerScriptLoader> scriptLoader(WorkerScriptLoader::create());
+ scriptLoader->setRequestContext(WebURLRequest::RequestContextScript);
+ scriptLoader->loadSynchronously(executionContext, completeURL, AllowCrossOriginRequests);
// If the fetching attempt failed, throw a NetworkError exception and abort all these steps.
- if (scriptLoader.failed()) {
+ if (scriptLoader->failed()) {
exceptionState.throwDOMException(NetworkError, "The script at '" + completeURL.elidedString() + "' failed to load.");
return;
}
- InspectorInstrumentation::scriptImported(&executionContext, scriptLoader.identifier(), scriptLoader.script());
- scriptLoaded(scriptLoader.script().length(), scriptLoader.cachedMetadata() ? scriptLoader.cachedMetadata()->size() : 0);
+ InspectorInstrumentation::scriptImported(&executionContext, scriptLoader->identifier(), scriptLoader->script());
+ scriptLoaded(scriptLoader->script().length(), scriptLoader->cachedMetadata() ? scriptLoader->cachedMetadata()->size() : 0);
RefPtrWillBeRawPtr<ErrorEvent> errorEvent = nullptr;
- OwnPtr<Vector<char>> cachedMetaData(scriptLoader.releaseCachedMetadata());
+ OwnPtr<Vector<char>> cachedMetaData(scriptLoader->releaseCachedMetadata());
OwnPtrWillBeRawPtr<CachedMetadataHandler> handler(createWorkerScriptCachedMetadataHandler(completeURL, cachedMetaData.get()));
- m_script->evaluate(ScriptSourceCode(scriptLoader.script(), scriptLoader.responseURL()), &errorEvent, handler.get(), m_v8CacheOptions);
+ m_script->evaluate(ScriptSourceCode(scriptLoader->script(), scriptLoader->responseURL()), &errorEvent, handler.get(), m_v8CacheOptions);
if (errorEvent) {
m_script->rethrowExceptionFromImportedScript(errorEvent.release(), exceptionState);
return;
« no previous file with comments | « Source/core/workers/InProcessWorkerBase.cpp ('k') | Source/core/workers/WorkerScriptLoader.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698