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

Unified Diff: third_party/WebKit/Source/web/WebEmbeddedWorkerImpl.cpp

Issue 2709193002: WorkerLoaderProxy: stop accessing cross-thread execution context (Closed)
Patch Set: . 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/web/WebEmbeddedWorkerImpl.cpp
diff --git a/third_party/WebKit/Source/web/WebEmbeddedWorkerImpl.cpp b/third_party/WebKit/Source/web/WebEmbeddedWorkerImpl.cpp
index e0a9d558acb65289bea90d605e977dbd72c2c208..ebae808087cf66ed33b0058781fb022bb7dde33d 100644
--- a/third_party/WebKit/Source/web/WebEmbeddedWorkerImpl.cpp
+++ b/third_party/WebKit/Source/web/WebEmbeddedWorkerImpl.cpp
@@ -262,16 +262,9 @@ void WebEmbeddedWorkerImpl::postMessageToPageInspector(const String& message) {
void WebEmbeddedWorkerImpl::postTaskToLoader(
const WebTraceLocation& location,
- std::unique_ptr<ExecutionContextTask> task) {
- // This cross-thread operation is brittle wrt per-thread heaps,
- // posting a task to main-thread owned objects.
+ std::unique_ptr<WTF::CrossThreadClosure> task) {
m_mainThreadTaskRunners->get(TaskType::Networking)
- ->postTask(
- BLINK_FROM_HERE,
- crossThreadBind(
- &ExecutionContextTask::performTaskIfContextIsValid,
- WTF::passed(std::move(task)),
- wrapCrossThreadWeakPersistent(m_mainFrame->frame()->document())));
+ ->postTask(BLINK_FROM_HERE, std::move(task));
}
void WebEmbeddedWorkerImpl::postTaskToWorkerGlobalScope(
@@ -282,6 +275,10 @@ void WebEmbeddedWorkerImpl::postTaskToWorkerGlobalScope(
m_workerThread->postTask(location, std::move(task));
}
+ExecutionContext* WebEmbeddedWorkerImpl::getLoaderExecutionContext() {
+ return m_mainFrame->frame()->document();
+}
+
void WebEmbeddedWorkerImpl::prepareShadowPageForLoader() {
// Create 'shadow page', which is never displayed and is used mainly to
// provide a context for loading on the main thread.

Powered by Google App Engine
This is Rietveld 408576698