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

Unified Diff: Source/web/WebSharedWorkerImpl.h

Issue 887463003: Turn WorkerLoaderProxy into a threadsafe, ref-counted object. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Clarify WorkerLoaderProxyProvider's obligations on shutdown Created 5 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 | « Source/web/WebEmbeddedWorkerImpl.cpp ('k') | Source/web/WebSharedWorkerImpl.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/web/WebSharedWorkerImpl.h
diff --git a/Source/web/WebSharedWorkerImpl.h b/Source/web/WebSharedWorkerImpl.h
index 92df5f1263bf0d2f3aad2c7dc007b54fd5ab2523..a8fa786ce9f3ac3d85ad4eb315e8f03ebc4e00d3 100644
--- a/Source/web/WebSharedWorkerImpl.h
+++ b/Source/web/WebSharedWorkerImpl.h
@@ -44,7 +44,6 @@
#include "public/web/WebSharedWorkerClient.h"
#include "wtf/PassOwnPtr.h"
#include "wtf/RefPtr.h"
-#include "wtf/WeakPtr.h"
namespace blink {
@@ -63,10 +62,10 @@ class WorkerInspectorProxy;
// convert to Chrome data types first and then call the supplied WebCommonWorkerClient.
class WebSharedWorkerImpl final
: public WorkerReportingProxy
- , public WorkerLoaderProxy
, public WebFrameClient
, public WebSharedWorker
- , public WebDevToolsAgentClient {
+ , public WebDevToolsAgentClient
+ , private WorkerLoaderProxyProvider {
public:
explicit WebSharedWorkerImpl(WebSharedWorkerClient*);
@@ -82,10 +81,6 @@ public:
virtual void workerThreadTerminated() override;
virtual void willDestroyWorkerGlobalScope() override { }
- // WorkerLoaderProxy methods:
- virtual void postTaskToLoader(PassOwnPtr<ExecutionContextTask>) override;
- virtual bool postTaskToWorkerGlobalScope(PassOwnPtr<ExecutionContextTask>) override;
-
// WebFrameClient methods to support resource loading thru the 'shadow page'.
virtual WebApplicationCacheHost* createApplicationCacheHost(WebLocalFrame*, WebApplicationCacheHostClient*) override;
virtual void didFinishDocumentLoad(WebLocalFrame*) override;
@@ -133,6 +128,10 @@ private:
void postMessageToPageInspectorOnMainThread(const String& message);
+ // WorkerLoaderProxyProvider
+ void postTaskToLoader(PassOwnPtr<ExecutionContextTask>);
+ bool postTaskToWorkerGlobalScope(PassOwnPtr<ExecutionContextTask>);
+
// 'shadow page' - created to proxy loading requests from the worker.
RefPtrWillBePersistent<ExecutionContext> m_loadingDocument;
WebView* m_webView;
@@ -156,6 +155,9 @@ private:
// Kept around only while main script loading is ongoing.
OwnPtr<Loader> m_mainScriptLoader;
+
+ RefPtr<WorkerLoaderProxy> m_loaderProxy;
+
WebURL m_url;
WebString m_name;
WebString m_contentSecurityPolicy;
@@ -164,4 +166,4 @@ private:
} // namespace blink
-#endif
+#endif // WebSharedWorkerImpl_h
« no previous file with comments | « Source/web/WebEmbeddedWorkerImpl.cpp ('k') | Source/web/WebSharedWorkerImpl.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698