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

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

Issue 2574703002: Use ParentFrameTaskRunners in WorkerLoaderProxyProvider::postTaskToLoader impls (Closed)
Patch Set: . Created 4 years 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 | « third_party/WebKit/Source/web/WebEmbeddedWorkerImpl.cpp ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/Source/web/WebSharedWorkerImpl.cpp
diff --git a/third_party/WebKit/Source/web/WebSharedWorkerImpl.cpp b/third_party/WebKit/Source/web/WebSharedWorkerImpl.cpp
index 96ac11bc367e1d79dbd3c90620d1ebba46f5772d..dd551aaca469dbb11daf668150ab91a87a2eece0 100644
--- a/third_party/WebKit/Source/web/WebSharedWorkerImpl.cpp
+++ b/third_party/WebKit/Source/web/WebSharedWorkerImpl.cpp
@@ -51,6 +51,7 @@
#include "platform/CrossThreadFunctional.h"
#include "platform/RuntimeEnabledFeatures.h"
#include "platform/heap/Handle.h"
+#include "platform/heap/Persistent.h"
#include "platform/network/ContentSecurityPolicyParsers.h"
#include "platform/network/ResourceResponse.h"
#include "platform/weborigin/KURL.h"
@@ -306,10 +307,12 @@ void WebSharedWorkerImpl::didTerminateWorkerThreadOnMainThread() {
void WebSharedWorkerImpl::postTaskToLoader(
const WebTraceLocation& location,
std::unique_ptr<ExecutionContextTask> task) {
- // TODO(hiroshige,yuryu): Make this not use ExecutionContextTask and
- // consider using m_parentFrameTaskRunners->get(TaskType::Networking)
- // instead.
- m_mainFrame->frame()->document()->postTask(location, std::move(task));
+ m_parentFrameTaskRunners->get(TaskType::Networking)
+ ->postTask(FROM_HERE,
+ crossThreadBind(
+ &ExecutionContextTask::performTaskIfContextIsValid,
+ WTF::passed(std::move(task)),
+ wrapCrossThreadWeakPersistent(m_loadingDocument.get())));
}
void WebSharedWorkerImpl::postTaskToWorkerGlobalScope(
« no previous file with comments | « third_party/WebKit/Source/web/WebEmbeddedWorkerImpl.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698