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

Side by Side Diff: third_party/WebKit/Source/platform/scheduler/base/task_queue_manager.cc

Issue 2464853002: Add crash keys to TaskQueueManager::ProcessTaskFromWorkQueue (Closed)
Patch Set: Fixed compile and changed the other files too. Created 4 years, 1 month 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
« no previous file with comments | « third_party/WebKit/Source/platform/scheduler/DEPS ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "platform/scheduler/base/task_queue_manager.h" 5 #include "platform/scheduler/base/task_queue_manager.h"
6 6
7 #include <queue> 7 #include <queue>
8 #include <set> 8 #include <set>
9 9
10 #include "base/bind.h" 10 #include "base/bind.h"
11 #include "base/debug/crash_logging.h"
11 #include "base/metrics/histogram_macros.h" 12 #include "base/metrics/histogram_macros.h"
12 #include "base/trace_event/trace_event.h" 13 #include "base/trace_event/trace_event.h"
13 #include "platform/scheduler/base/real_time_domain.h" 14 #include "platform/scheduler/base/real_time_domain.h"
14 #include "platform/scheduler/base/task_queue_impl.h" 15 #include "platform/scheduler/base/task_queue_impl.h"
15 #include "platform/scheduler/base/task_queue_manager_delegate.h" 16 #include "platform/scheduler/base/task_queue_manager_delegate.h"
16 #include "platform/scheduler/base/task_queue_selector.h" 17 #include "platform/scheduler/base/task_queue_selector.h"
17 #include "platform/scheduler/base/work_queue.h" 18 #include "platform/scheduler/base/work_queue.h"
18 #include "platform/scheduler/base/work_queue_sets.h" 19 #include "platform/scheduler/base/work_queue_sets.h"
19 #include "public/platform/scheduler/base/task_time_observer.h" 20 #include "public/platform/scheduler/base/task_time_observer.h"
20 21
(...skipping 289 matching lines...) Expand 10 before | Expand all | Expand 10 after
310 task_annotator_.DidQueueTask("TaskQueueManager::PostTask", pending_task); 311 task_annotator_.DidQueueTask("TaskQueueManager::PostTask", pending_task);
311 } 312 }
312 313
313 TaskQueueManager::ProcessTaskResult TaskQueueManager::ProcessTaskFromWorkQueue( 314 TaskQueueManager::ProcessTaskResult TaskQueueManager::ProcessTaskFromWorkQueue(
314 internal::WorkQueue* work_queue) { 315 internal::WorkQueue* work_queue) {
315 DCHECK(main_thread_checker_.CalledOnValidThread()); 316 DCHECK(main_thread_checker_.CalledOnValidThread());
316 scoped_refptr<DeletionSentinel> protect(deletion_sentinel_); 317 scoped_refptr<DeletionSentinel> protect(deletion_sentinel_);
317 internal::TaskQueueImpl::Task pending_task = 318 internal::TaskQueueImpl::Task pending_task =
318 work_queue->TakeTaskFromWorkQueue(); 319 work_queue->TakeTaskFromWorkQueue();
319 320
321 CHECK(!pending_task.task.is_null()) << "Posted from "
Sami 2016/10/31 16:01:53 Could you also mention here: // Temporary for htt
alex clarke (OOO till 29th) 2016/11/01 21:55:22 Done.
322 << pending_task.posted_from.ToString();
323
320 // It's possible the task was canceled, if so bail out. 324 // It's possible the task was canceled, if so bail out.
321 if (pending_task.task.IsCancelled()) 325 if (pending_task.task.IsCancelled())
322 return ProcessTaskResult::EXECUTED; 326 return ProcessTaskResult::EXECUTED;
323 327
328 static const char kBlinkSchedulerTaskFunctionNameKey[] =
329 "blink_scheduler_task_function_name";
330 static const char kBlinkSchedulerTaskFileNameKey[] =
331 "blink_scheduler_task_file_name";
332 base::debug::ScopedCrashKey debug_task_file_name(
333 kBlinkSchedulerTaskFunctionNameKey, pending_task.posted_from.file_name());
334 base::debug::ScopedCrashKey debug_task_function_name(
335 kBlinkSchedulerTaskFileNameKey, pending_task.posted_from.function_name());
336
324 internal::TaskQueueImpl* queue = work_queue->task_queue(); 337 internal::TaskQueueImpl* queue = work_queue->task_queue();
325 if (queue->GetQuiescenceMonitored()) 338 if (queue->GetQuiescenceMonitored())
326 task_was_run_on_quiescence_monitored_queue_ = true; 339 task_was_run_on_quiescence_monitored_queue_ = true;
327 340
328 if (!pending_task.nestable && delegate_->IsNested()) { 341 if (!pending_task.nestable && delegate_->IsNested()) {
329 // Defer non-nestable work to the main task runner. NOTE these tasks can be 342 // Defer non-nestable work to the main task runner. NOTE these tasks can be
330 // arbitrarily delayed so the additional delay should not be a problem. 343 // arbitrarily delayed so the additional delay should not be a problem.
331 // TODO(skyostil): Figure out a way to not forget which task queue the 344 // TODO(skyostil): Figure out a way to not forget which task queue the
332 // task is associated with. See http://crbug.com/522843. 345 // task is associated with. See http://crbug.com/522843.
333 // TODO(tzik): Remove base::UnsafeConvertOnceClosureToRepeating once 346 // TODO(tzik): Remove base::UnsafeConvertOnceClosureToRepeating once
(...skipping 156 matching lines...) Expand 10 before | Expand all | Expand 10 after
490 *work_queue->GetFrontTask()); 503 *work_queue->GetFrontTask());
491 } 504 }
492 } 505 }
493 506
494 bool TaskQueueManager::HasImmediateWorkForTesting() const { 507 bool TaskQueueManager::HasImmediateWorkForTesting() const {
495 return !selector_.EnabledWorkQueuesEmpty(); 508 return !selector_.EnabledWorkQueuesEmpty();
496 } 509 }
497 510
498 } // namespace scheduler 511 } // namespace scheduler
499 } // namespace blink 512 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/platform/scheduler/DEPS ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698