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

Side by Side Diff: third_party/WebKit/Source/web/WebEmbeddedWorkerImpl.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 unified diff | Download patch
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2013 Google Inc. All rights reserved. 2 * Copyright (C) 2013 Google Inc. All rights reserved.
3 * 3 *
4 * Redistribution and use in source and binary forms, with or without 4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions are 5 * modification, are permitted provided that the following conditions are
6 * met: 6 * met:
7 * 7 *
8 * * Redistributions of source code must retain the above copyright 8 * * Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer. 9 * notice, this list of conditions and the following disclaimer.
10 * * Redistributions in binary form must reproduce the above 10 * * Redistributions in binary form must reproduce the above
(...skipping 245 matching lines...) Expand 10 before | Expand all | Expand 10 after
256 message.columnNumber, nullptr))); 256 message.columnNumber, nullptr)));
257 } 257 }
258 258
259 void WebEmbeddedWorkerImpl::postMessageToPageInspector(const String& message) { 259 void WebEmbeddedWorkerImpl::postMessageToPageInspector(const String& message) {
260 m_workerInspectorProxy->dispatchMessageFromWorker(message); 260 m_workerInspectorProxy->dispatchMessageFromWorker(message);
261 } 261 }
262 262
263 void WebEmbeddedWorkerImpl::postTaskToLoader( 263 void WebEmbeddedWorkerImpl::postTaskToLoader(
264 const WebTraceLocation& location, 264 const WebTraceLocation& location,
265 std::unique_ptr<ExecutionContextTask> task) { 265 std::unique_ptr<ExecutionContextTask> task) {
266 // TODO(hiroshige,yuryu): Make this not use ExecutionContextTask and 266 m_mainThreadTaskRunners->get(TaskType::Networking)
267 // consider using m_mainThreadTaskRunners->get(TaskType::Networking) 267 ->postTask(
268 // instead. 268 BLINK_FROM_HERE,
269 m_mainFrame->frame()->document()->postTask(location, std::move(task)); 269 crossThreadBind(
270 &ExecutionContextTask::performTaskIfContextIsValid,
271 WTF::passed(std::move(task)),
272 wrapCrossThreadWeakPersistent(m_mainFrame->frame()->document())));
270 } 273 }
271 274
272 void WebEmbeddedWorkerImpl::postTaskToWorkerGlobalScope( 275 void WebEmbeddedWorkerImpl::postTaskToWorkerGlobalScope(
273 const WebTraceLocation& location, 276 const WebTraceLocation& location,
274 std::unique_ptr<ExecutionContextTask> task) { 277 std::unique_ptr<ExecutionContextTask> task) {
275 if (m_askedToTerminate || !m_workerThread) 278 if (m_askedToTerminate || !m_workerThread)
276 return; 279 return;
277 m_workerThread->postTask(location, std::move(task)); 280 m_workerThread->postTask(location, std::move(task));
278 } 281 }
279 282
(...skipping 187 matching lines...) Expand 10 before | Expand all | Expand 10 after
467 *this, *document, *m_workerContextClient); 470 *this, *document, *m_workerContextClient);
468 m_loaderProxy = WorkerLoaderProxy::create(this); 471 m_loaderProxy = WorkerLoaderProxy::create(this);
469 m_workerThread = 472 m_workerThread =
470 ServiceWorkerThread::create(m_loaderProxy, *m_workerGlobalScopeProxy); 473 ServiceWorkerThread::create(m_loaderProxy, *m_workerGlobalScopeProxy);
471 m_workerThread->start(std::move(startupData)); 474 m_workerThread->start(std::move(startupData));
472 m_workerInspectorProxy->workerThreadCreated(document, m_workerThread.get(), 475 m_workerInspectorProxy->workerThreadCreated(document, m_workerThread.get(),
473 scriptURL); 476 scriptURL);
474 } 477 }
475 478
476 } // namespace blink 479 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698