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

Unified Diff: Source/core/workers/WorkerScriptLoader.h

Issue 1213443006: Invoke WorkerScriptLoader's m_finishedCallback callback safely. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: review #7 and notify* Created 5 years, 6 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 | « no previous file | Source/core/workers/WorkerScriptLoader.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/workers/WorkerScriptLoader.h
diff --git a/Source/core/workers/WorkerScriptLoader.h b/Source/core/workers/WorkerScriptLoader.h
index c8c8f13ff34d6f1625eecf4bc867104cfc7cc9c4..64a61163a2b8f5d245457800b0cf23ed57abba01 100644
--- a/Source/core/workers/WorkerScriptLoader.h
+++ b/Source/core/workers/WorkerScriptLoader.h
@@ -54,14 +54,13 @@ public:
~WorkerScriptLoader() override;
void loadSynchronously(ExecutionContext&, const KURL&, CrossOriginRequestPolicy);
- // TODO: finishedCallback is not currently guaranteed to be invoked if used
- // from worker context and the worker shuts down in the middle of an
+ // TODO: |finishedCallback| is not currently guaranteed to be invoked if
+ // used from worker context and the worker shuts down in the middle of an
// operation. This will cause leaks when we support nested workers.
+ // Note that callbacks could be invoked before loadAsynchronously() returns.
void loadAsynchronously(ExecutionContext&, const KURL&, CrossOriginRequestPolicy, PassOwnPtr<Closure> responseCallback, PassOwnPtr<Closure> finishedCallback);
- void notifyError();
-
- // This will immediately lead to notifyFinished() if loadAsynchronously
+ // This will immediately invoke |finishedCallback| if loadAsynchronously()
// is in progress.
void cancel();
@@ -90,6 +89,7 @@ public:
private:
PassOwnPtr<ResourceRequest> createResourceRequest();
+ void notifyError();
void notifyFinished();
void processContentSecurityPolicy(const ResourceResponse&);
@@ -107,7 +107,6 @@ private:
bool m_failed;
unsigned long m_identifier;
long long m_appCacheID;
- bool m_finishing;
OwnPtr<Vector<char>> m_cachedMetadata;
WebURLRequest::RequestContext m_requestContext;
RefPtr<ContentSecurityPolicy> m_contentSecurityPolicy;
« no previous file with comments | « no previous file | Source/core/workers/WorkerScriptLoader.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698