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

Unified Diff: third_party/WebKit/Source/core/workers/WorkerLoaderProxy.h

Issue 2706903002: Worker: Add comments about thread restriction to WorkerLoaderProxy (Closed)
Patch Set: Created 3 years, 10 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 | third_party/WebKit/Source/core/workers/WorkerLoaderProxy.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/Source/core/workers/WorkerLoaderProxy.h
diff --git a/third_party/WebKit/Source/core/workers/WorkerLoaderProxy.h b/third_party/WebKit/Source/core/workers/WorkerLoaderProxy.h
index 5951d8b3ac153689a3d84c96e9f2e7041965d52f..770719fe2b78f6f1ea953bd73d5768a7a0f5ffa8 100644
--- a/third_party/WebKit/Source/core/workers/WorkerLoaderProxy.h
+++ b/third_party/WebKit/Source/core/workers/WorkerLoaderProxy.h
@@ -62,11 +62,12 @@ class CORE_EXPORT WorkerLoaderProxyProvider {
virtual ~WorkerLoaderProxyProvider() {}
// Posts a task to the thread which runs the loading code (normally, the main
- // thread).
+ // thread). This must be called from a worker thread.
virtual void postTaskToLoader(const WebTraceLocation&,
std::unique_ptr<ExecutionContextTask>) = 0;
- // Posts callbacks from loading code to the WorkerGlobalScope.
+ // Posts callbacks from loading code to the WorkerGlobalScope. This must be
+ // called from the main thread.
virtual void postTaskToWorkerGlobalScope(
const WebTraceLocation&,
std::unique_ptr<WTF::CrossThreadClosure>) = 0;
@@ -82,14 +83,17 @@ class CORE_EXPORT WorkerLoaderProxy final
~WorkerLoaderProxy();
+ // This must be called from a worker thread.
void postTaskToLoader(const WebTraceLocation&,
std::unique_ptr<ExecutionContextTask>);
+
+ // This must be called from the main thread.
void postTaskToWorkerGlobalScope(const WebTraceLocation&,
std::unique_ptr<WTF::CrossThreadClosure>);
// Notification from the provider that it can no longer be accessed. An
// implementation of WorkerLoaderProxyProvider is required to call
- // detachProvider() when finalizing.
+ // detachProvider() when finalizing. This must be called from the main thread.
void detachProvider(WorkerLoaderProxyProvider*);
private:
« no previous file with comments | « no previous file | third_party/WebKit/Source/core/workers/WorkerLoaderProxy.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698