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

Unified Diff: Source/web/WebEmbeddedWorkerImpl.h

Issue 887463003: Turn WorkerLoaderProxy into a threadsafe, ref-counted object. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Explicitly detach instead of using a weak abstraction 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
Index: Source/web/WebEmbeddedWorkerImpl.h
diff --git a/Source/web/WebEmbeddedWorkerImpl.h b/Source/web/WebEmbeddedWorkerImpl.h
index 10820baa69da098692c31f5ffd2266d177701f9e..5fa8fd55b1489f1ca5de5d33d0a925f7052f9e6b 100644
--- a/Source/web/WebEmbeddedWorkerImpl.h
+++ b/Source/web/WebEmbeddedWorkerImpl.h
@@ -31,6 +31,8 @@
#ifndef WebEmbeddedWorkerImpl_h
#define WebEmbeddedWorkerImpl_h
+#include "core/workers/WorkerLoaderProxy.h"
+
#include "public/web/WebContentSecurityPolicy.h"
#include "public/web/WebDevToolsAgentClient.h"
#include "public/web/WebEmbeddedWorker.h"
@@ -48,12 +50,11 @@ class WorkerThread;
class WebEmbeddedWorkerImpl final
: public WebEmbeddedWorker
, public WebFrameClient
- , public WebDevToolsAgentClient {
+ , public WebDevToolsAgentClient
+ , private WorkerLoaderProxyProvider {
WTF_MAKE_NONCOPYABLE(WebEmbeddedWorkerImpl);
public:
- WebEmbeddedWorkerImpl(
- PassOwnPtr<WebServiceWorkerContextClient>,
- PassOwnPtr<WebWorkerPermissionClientProxy>);
+ WebEmbeddedWorkerImpl(PassOwnPtr<WebServiceWorkerContextClient>, PassOwnPtr<WebWorkerPermissionClientProxy>);
virtual ~WebEmbeddedWorkerImpl();
// Terminate all WebEmbeddedWorkerImpl for testing purposes.
@@ -74,7 +75,6 @@ public:
private:
class Loader;
- class LoaderProxy;
void prepareShadowPageForLoader();
void loadShadowPage();
@@ -92,6 +92,10 @@ private:
void onScriptLoaderFinished();
void startWorkerThread();
+ // WorkerLoaderProxyProvider
+ virtual void postTaskToLoader(PassOwnPtr<ExecutionContextTask>) override;
+ virtual bool postTaskToWorkerGlobalScope(PassOwnPtr<ExecutionContextTask>) override;
kinuko 2015/02/05 01:41:16 It doesn't seem really necessary to make this chan
sof 2015/02/05 08:05:27 The methods are private and the "provider" class i
kinuko 2015/02/05 08:58:06 Ok this works for me too. I overlooked that now i
+
WebEmbeddedWorkerStartData m_workerStartData;
OwnPtr<WebServiceWorkerContextClient> m_workerContextClient;
@@ -108,7 +112,7 @@ private:
OwnPtr<Loader> m_mainScriptLoader;
RefPtr<WorkerThread> m_workerThread;
- OwnPtr<LoaderProxy> m_loaderProxy;
+ RefPtr<WorkerLoaderProxy> m_loaderProxy;
OwnPtr<ServiceWorkerGlobalScopeProxy> m_workerGlobalScopeProxy;
OwnPtr<WorkerInspectorProxy> m_workerInspectorProxy;

Powered by Google App Engine
This is Rietveld 408576698