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

Unified Diff: Source/core/workers/WorkerThread.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/core/workers/WorkerMessagingProxy.cpp ('k') | Source/core/workers/WorkerThread.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/workers/WorkerThread.h
diff --git a/Source/core/workers/WorkerThread.h b/Source/core/workers/WorkerThread.h
index e1fdc1423b25c28c548cc897042228df0c532f30..3e4addbdd49ff2e600b182d194db60c82a2ba575 100644
--- a/Source/core/workers/WorkerThread.h
+++ b/Source/core/workers/WorkerThread.h
@@ -30,6 +30,7 @@
#include "core/dom/ExecutionContextTask.h"
#include "core/frame/csp/ContentSecurityPolicy.h"
#include "core/workers/WorkerGlobalScope.h"
+#include "core/workers/WorkerLoaderProxy.h"
#include "platform/SharedTimer.h"
#include "platform/WebThreadSupportingGC.h"
#include "platform/weborigin/SecurityOrigin.h"
@@ -44,7 +45,6 @@ namespace blink {
class WebWaitableEvent;
class WorkerGlobalScope;
class WorkerInspectorController;
-class WorkerLoaderProxy;
class WorkerReportingProxy;
class WorkerSharedTimer;
class WorkerThreadShutdownFinishTask;
@@ -75,7 +75,12 @@ public:
static void terminateAndWaitForAllWorkers();
bool isCurrentThread() const;
- WorkerLoaderProxy& workerLoaderProxy() const { return m_workerLoaderProxy; }
+ WorkerLoaderProxy* workerLoaderProxy() const
+ {
+ RELEASE_ASSERT(m_workerLoaderProxy);
+ return m_workerLoaderProxy.get();
+ }
+
WorkerReportingProxy& workerReportingProxy() const { return m_workerReportingProxy; }
void postTask(PassOwnPtr<ExecutionContextTask>);
@@ -101,7 +106,7 @@ public:
void setWorkerInspectorController(WorkerInspectorController*);
protected:
- WorkerThread(WorkerLoaderProxy&, WorkerReportingProxy&, PassOwnPtrWillBeRawPtr<WorkerThreadStartupData>);
+ WorkerThread(PassRefPtr<WorkerLoaderProxy>, WorkerReportingProxy&, PassOwnPtrWillBeRawPtr<WorkerThreadStartupData>);
// Factory method for creating a new worker context for the thread.
virtual PassRefPtrWillBeRawPtr<WorkerGlobalScope> createWorkerGlobalScope(PassOwnPtrWillBeRawPtr<WorkerThreadStartupData>) = 0;
@@ -125,7 +130,7 @@ private:
MessageQueue<WorkerThreadTask> m_debuggerMessageQueue;
OwnPtr<WebThread::TaskObserver> m_microtaskRunner;
- WorkerLoaderProxy& m_workerLoaderProxy;
+ RefPtr<WorkerLoaderProxy> m_workerLoaderProxy;
WorkerReportingProxy& m_workerReportingProxy;
RefPtrWillBePersistent<WorkerInspectorController> m_workerInspectorController;
« no previous file with comments | « Source/core/workers/WorkerMessagingProxy.cpp ('k') | Source/core/workers/WorkerThread.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698