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

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

Issue 2702243003: Disallow cross-thread Persistent<> read access. (Closed)
Patch Set: rebase fixup 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
Index: third_party/WebKit/Source/core/workers/ThreadedMessagingProxyBase.h
diff --git a/third_party/WebKit/Source/core/workers/ThreadedMessagingProxyBase.h b/third_party/WebKit/Source/core/workers/ThreadedMessagingProxyBase.h
index 09a841d57e6bf69c930f57b84822ea9812728017..3aeea1f09eb5d22dadfa8382431b3b5fa6e7ec57 100644
--- a/third_party/WebKit/Source/core/workers/ThreadedMessagingProxyBase.h
+++ b/third_party/WebKit/Source/core/workers/ThreadedMessagingProxyBase.h
@@ -8,13 +8,13 @@
#include "core/CoreExport.h"
#include "core/frame/UseCounter.h"
#include "core/inspector/ConsoleTypes.h"
+#include "core/workers/ParentFrameTaskRunners.h"
#include "core/workers/WorkerLoaderProxy.h"
#include "wtf/Forward.h"
namespace blink {
class ExecutionContext;
-class ParentFrameTaskRunners;
class SourceLocation;
class WorkerInspectorProxy;
class WorkerLoaderProxy;
@@ -44,10 +44,12 @@ class CORE_EXPORT ThreadedMessagingProxyBase
// 'virtual' for testing.
virtual void workerThreadTerminated();
+ // Accessed from both the parent thread and the worker.
ExecutionContext* getExecutionContext() const {
return m_executionContext.get();
}
+ // Accessed from both the parent thread and the worker.
ParentFrameTaskRunners* getParentFrameTaskRunners() {
return m_parentFrameTaskRunners.get();
}
@@ -68,7 +70,7 @@ class CORE_EXPORT ThreadedMessagingProxyBase
bool askedToTerminate() const { return m_askedToTerminate; }
PassRefPtr<WorkerLoaderProxy> loaderProxy() { return m_loaderProxy; }
- WorkerInspectorProxy* workerInspectorProxy() {
+ WorkerInspectorProxy* workerInspectorProxy() const {
return m_workerInspectorProxy.get();
}
@@ -90,9 +92,11 @@ class CORE_EXPORT ThreadedMessagingProxyBase
void parentObjectDestroyedInternal();
- Persistent<ExecutionContext> m_executionContext;
+ // Accessed cross-thread when worker thread posts tasks to the parent.
+ CrossThreadPersistent<ExecutionContext> m_executionContext;
haraken 2017/02/20 23:57:18 Ditto.
Persistent<WorkerInspectorProxy> m_workerInspectorProxy;
- Persistent<ParentFrameTaskRunners> m_parentFrameTaskRunners;
+ // Accessed cross-thread when worker thread posts tasks to the parent.
+ CrossThreadPersistent<ParentFrameTaskRunners> m_parentFrameTaskRunners;
std::unique_ptr<WorkerThread> m_workerThread;

Powered by Google App Engine
This is Rietveld 408576698