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

Side by Side Diff: third_party/WebKit/Source/core/workers/WorkerThread.cpp

Issue 2098433002: Remove ExecutionContextTask::taskNameForInstrumentation() (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 5 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) 2008 Apple Inc. All Rights Reserved. 2 * Copyright (C) 2008 Apple 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 5 * modification, are permitted provided that the following conditions
6 * are met: 6 * are met:
7 * 1. Redistributions of source code must retain the above copyright 7 * 1. Redistributions of source code must retain the above copyright
8 * notice, this list of conditions and the following disclaimer. 8 * notice, this list of conditions and the following disclaimer.
9 * 2. Redistributions in binary form must reproduce the above copyright 9 * 2. Redistributions in binary form must reproduce the above copyright
10 * notice, this list of conditions and the following disclaimer in the 10 * notice, this list of conditions and the following disclaimer in the
(...skipping 222 matching lines...) Expand 10 before | Expand all | Expand 10 after
233 v8::Isolate* WorkerThread::isolate() 233 v8::Isolate* WorkerThread::isolate()
234 { 234 {
235 return workerBackingThread().isolate(); 235 return workerBackingThread().isolate();
236 } 236 }
237 237
238 bool WorkerThread::isCurrentThread() 238 bool WorkerThread::isCurrentThread()
239 { 239 {
240 return m_started && workerBackingThread().backingThread().isCurrentThread(); 240 return m_started && workerBackingThread().backingThread().isCurrentThread();
241 } 241 }
242 242
243 void WorkerThread::postTask(const WebTraceLocation& location, std::unique_ptr<Ex ecutionContextTask> task) 243 void WorkerThread::postTask(const WebTraceLocation& location, std::unique_ptr<Ex ecutionContextTask> task, bool isInstrumented)
244 { 244 {
245 { 245 {
246 MutexLocker lock(m_threadStateMutex); 246 MutexLocker lock(m_threadStateMutex);
247 if (m_terminated || m_readyToShutdown) 247 if (m_terminated || m_readyToShutdown)
248 return; 248 return;
249 } 249 }
250 250
251 bool isInstrumented = !task->taskNameForInstrumentation().isEmpty();
252 if (isInstrumented) { 251 if (isInstrumented) {
253 DCHECK(isCurrentThread()); 252 DCHECK(isCurrentThread());
254 InspectorInstrumentation::asyncTaskScheduled(workerGlobalScope(), "Worke r task", task.get()); 253 InspectorInstrumentation::asyncTaskScheduled(workerGlobalScope(), "Worke r task", task.get());
255 } 254 }
256 workerBackingThread().backingThread().postTask(location, threadSafeBind(&Wor kerThread::performTaskOnWorkerThread, AllowCrossThreadAccess(this), passed(std:: move(task)), isInstrumented)); 255 workerBackingThread().backingThread().postTask(location, threadSafeBind(&Wor kerThread::performTaskOnWorkerThread, AllowCrossThreadAccess(this), passed(std:: move(task)), isInstrumented));
257 } 256 }
258 257
259 void WorkerThread::appendDebuggerTask(std::unique_ptr<CrossThreadClosure> task) 258 void WorkerThread::appendDebuggerTask(std::unique_ptr<CrossThreadClosure> task)
260 { 259 {
261 DCHECK(isMainThread()); 260 DCHECK(isMainThread());
(...skipping 356 matching lines...) Expand 10 before | Expand all | Expand 10 after
618 (*task)(); 617 (*task)();
619 } 618 }
620 619
621 WorkerThread::ExitCode WorkerThread::getExitCode() 620 WorkerThread::ExitCode WorkerThread::getExitCode()
622 { 621 {
623 MutexLocker lock(m_threadStateMutex); 622 MutexLocker lock(m_threadStateMutex);
624 return m_exitCode; 623 return m_exitCode;
625 } 624 }
626 625
627 } // namespace blink 626 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/workers/WorkerThread.h ('k') | third_party/WebKit/Source/core/workers/WorkletGlobalScope.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698