Index: third_party/WebKit/Source/web/WebEmbeddedWorkerImpl.h |
diff --git a/third_party/WebKit/Source/web/WebEmbeddedWorkerImpl.h b/third_party/WebKit/Source/web/WebEmbeddedWorkerImpl.h |
index 71295710b7d0f3a234fa9feeabc0dba07f65975c..e407dd80db180cae4d7a44c9238b650002ec4a22 100644 |
--- a/third_party/WebKit/Source/web/WebEmbeddedWorkerImpl.h |
+++ b/third_party/WebKit/Source/web/WebEmbeddedWorkerImpl.h |
@@ -122,7 +122,9 @@ class WebEmbeddedWorkerImpl final : public WebEmbeddedWorker, |
// Kept around only while main script loading is ongoing. |
RefPtr<WorkerScriptLoader> m_mainScriptLoader; |
- Persistent<ParentFrameTaskRunners> m_mainThreadTaskRunners; |
+ // Owned by the main thread, but will be accessed by the worker when |
+ // posting tasks. |
+ CrossThreadPersistent<ParentFrameTaskRunners> m_mainThreadTaskRunners; |
std::unique_ptr<WorkerThread> m_workerThread; |
RefPtr<WorkerLoaderProxy> m_loaderProxy; |
@@ -134,7 +136,11 @@ class WebEmbeddedWorkerImpl final : public WebEmbeddedWorker, |
// deref'ed) when this EmbeddedWorkerImpl is destructed, therefore they |
// are guaranteed to exist while this object is around. |
WebView* m_webView; |
- Persistent<WebLocalFrameImpl> m_mainFrame; |
+ |
+ // Accessed cross-thread when worker thread posts tasks to the parent. |
+ // |
+ // TODO: avoid reaching into the local frame object when posting. |
+ CrossThreadPersistent<WebLocalFrameImpl> m_mainFrame; |
bool m_loadingShadowPage; |
bool m_askedToTerminate; |