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

Unified Diff: Source/core/workers/WorkerScriptLoader.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/WorkerScriptLoader.h ('k') | Source/web/WebEmbeddedWorkerImpl.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/workers/WorkerScriptLoader.cpp
diff --git a/Source/core/workers/WorkerScriptLoader.cpp b/Source/core/workers/WorkerScriptLoader.cpp
index ec75c5e063dbc16bfbb74f746c39348d7aa1c038..e8cd1ad04e0a1d5241aca4e22d91b810cbf89c93 100644
--- a/Source/core/workers/WorkerScriptLoader.cpp
+++ b/Source/core/workers/WorkerScriptLoader.cpp
@@ -100,11 +100,15 @@ void WorkerScriptLoader::loadAsynchronously(ExecutionContext& executionContext,
ResourceLoaderOptions resourceLoaderOptions;
resourceLoaderOptions.allowCredentials = AllowStoredCredentials;
+ // During create, callbacks may happen which could remove the last reference
+ // to this object, while some of the callchain assumes that the client and
+ // loader wouldn't be deleted within callbacks.
+ // (E.g. see crbug.com/524694 for why we can't easily remove this protect)
+ RefPtr<WorkerScriptLoader> protect(this);
m_needToCancel = true;
m_threadableLoader = ThreadableLoader::create(executionContext, this, *request, options, resourceLoaderOptions);
if (m_failed)
notifyFinished();
- // Do nothing here since notifyFinished() could delete |this|.
}
const KURL& WorkerScriptLoader::responseURL() const
« no previous file with comments | « Source/core/workers/WorkerScriptLoader.h ('k') | Source/web/WebEmbeddedWorkerImpl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698