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

Side by Side Diff: third_party/WebKit/Source/web/WebEmbeddedWorkerImpl.cpp

Issue 2196833002: Propagate proper FROM_HERE to postTask() in worker code (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebase Created 4 years, 4 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 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 236 matching lines...) Expand 10 before | Expand all | Expand 10 after
247 } 247 }
248 248
249 m_mainFrame->frame()->document()->addConsoleMessage(ConsoleMessage::create(O therMessageSource, webCoreMessageLevel, message.text, SourceLocation::create(mes sage.url, message.lineNumber, message.columnNumber, nullptr))); 249 m_mainFrame->frame()->document()->addConsoleMessage(ConsoleMessage::create(O therMessageSource, webCoreMessageLevel, message.text, SourceLocation::create(mes sage.url, message.lineNumber, message.columnNumber, nullptr)));
250 } 250 }
251 251
252 void WebEmbeddedWorkerImpl::postMessageToPageInspector(const String& message) 252 void WebEmbeddedWorkerImpl::postMessageToPageInspector(const String& message)
253 { 253 {
254 m_workerInspectorProxy->dispatchMessageFromWorker(message); 254 m_workerInspectorProxy->dispatchMessageFromWorker(message);
255 } 255 }
256 256
257 void WebEmbeddedWorkerImpl::postTaskToLoader(std::unique_ptr<ExecutionContextTas k> task) 257 void WebEmbeddedWorkerImpl::postTaskToLoader(const WebTraceLocation& location, s td::unique_ptr<ExecutionContextTask> task)
258 { 258 {
259 // TODO(hiroshige,yuryu): Make this not use ExecutionContextTask and 259 // TODO(hiroshige,yuryu): Make this not use ExecutionContextTask and
260 // consider using m_mainThreadTaskRunners->getLoadingTaskRunner() instead. 260 // consider using m_mainThreadTaskRunners->getLoadingTaskRunner() instead.
261 m_mainFrame->frame()->document()->postTask(BLINK_FROM_HERE, std::move(task)) ; 261 m_mainFrame->frame()->document()->postTask(location, std::move(task));
262 } 262 }
263 263
264 bool WebEmbeddedWorkerImpl::postTaskToWorkerGlobalScope(std::unique_ptr<Executio nContextTask> task) 264 bool WebEmbeddedWorkerImpl::postTaskToWorkerGlobalScope(const WebTraceLocation& location, std::unique_ptr<ExecutionContextTask> task)
265 { 265 {
266 if (m_askedToTerminate || !m_workerThread) 266 if (m_askedToTerminate || !m_workerThread)
267 return false; 267 return false;
268 268
269 m_workerThread->postTask(BLINK_FROM_HERE, std::move(task)); 269 m_workerThread->postTask(location, std::move(task));
270 return !m_workerThread->terminated(); 270 return !m_workerThread->terminated();
271 } 271 }
272 272
273 void WebEmbeddedWorkerImpl::prepareShadowPageForLoader() 273 void WebEmbeddedWorkerImpl::prepareShadowPageForLoader()
274 { 274 {
275 // Create 'shadow page', which is never displayed and is used mainly to 275 // Create 'shadow page', which is never displayed and is used mainly to
276 // provide a context for loading on the main thread. 276 // provide a context for loading on the main thread.
277 // 277 //
278 // FIXME: This does mostly same as WebSharedWorkerImpl::initializeLoader. 278 // FIXME: This does mostly same as WebSharedWorkerImpl::initializeLoader.
279 // This code, and probably most of the code in this class should be shared 279 // This code, and probably most of the code in this class should be shared
(...skipping 166 matching lines...) Expand 10 before | Expand all | Expand 10 after
446 m_mainThreadTaskRunners = ParentFrameTaskRunners::create(nullptr); 446 m_mainThreadTaskRunners = ParentFrameTaskRunners::create(nullptr);
447 447
448 m_workerGlobalScopeProxy = ServiceWorkerGlobalScopeProxy::create(*this, *doc ument, *m_workerContextClient); 448 m_workerGlobalScopeProxy = ServiceWorkerGlobalScopeProxy::create(*this, *doc ument, *m_workerContextClient);
449 m_loaderProxy = WorkerLoaderProxy::create(this); 449 m_loaderProxy = WorkerLoaderProxy::create(this);
450 m_workerThread = ServiceWorkerThread::create(m_loaderProxy, *m_workerGlobalS copeProxy); 450 m_workerThread = ServiceWorkerThread::create(m_loaderProxy, *m_workerGlobalS copeProxy);
451 m_workerThread->start(std::move(startupData)); 451 m_workerThread->start(std::move(startupData));
452 m_workerInspectorProxy->workerThreadCreated(document, m_workerThread.get(), scriptURL); 452 m_workerInspectorProxy->workerThreadCreated(document, m_workerThread.get(), scriptURL);
453 } 453 }
454 454
455 } // namespace blink 455 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/web/WebEmbeddedWorkerImpl.h ('k') | third_party/WebKit/Source/web/WebSharedWorkerImpl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698