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

Side by Side Diff: base/task_scheduler/scheduler_worker_pool_impl.cc

Issue 2420973002: Plumb Task Scheduler Histograms to the Task Scheduler Internals Page (Closed)
Patch Set: The Return of std::move Created 4 years, 2 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
« no previous file with comments | « base/task_scheduler/scheduler_worker_pool_impl.h ('k') | base/task_scheduler/task_scheduler.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 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 "base/task_scheduler/scheduler_worker_pool_impl.h" 5 #include "base/task_scheduler/scheduler_worker_pool_impl.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 8
9 #include <algorithm> 9 #include <algorithm>
10 #include <utility> 10 #include <utility>
(...skipping 429 matching lines...) Expand 10 before | Expand all | Expand 10 after
440 sequence_sort_key); 440 sequence_sort_key);
441 441
442 // Wake up a worker to process |sequence|. 442 // Wake up a worker to process |sequence|.
443 if (worker) 443 if (worker)
444 WakeUpWorker(worker); 444 WakeUpWorker(worker);
445 else 445 else
446 WakeUpOneWorker(); 446 WakeUpOneWorker();
447 } 447 }
448 } 448 }
449 449
450 void SchedulerWorkerPoolImpl::GetHistograms(
451 std::vector<const HistogramBase*>* histograms) const {
452 histograms->push_back(detach_duration_histogram_);
453 histograms->push_back(num_tasks_between_waits_histogram_);
454 }
455
450 SchedulerWorkerPoolImpl::SchedulerSingleThreadTaskRunner:: 456 SchedulerWorkerPoolImpl::SchedulerSingleThreadTaskRunner::
451 SchedulerSingleThreadTaskRunner(const TaskTraits& traits, 457 SchedulerSingleThreadTaskRunner(const TaskTraits& traits,
452 SchedulerWorkerPool* worker_pool, 458 SchedulerWorkerPool* worker_pool,
453 SchedulerWorker* worker) 459 SchedulerWorker* worker)
454 : traits_(traits), 460 : traits_(traits),
455 worker_pool_(worker_pool), 461 worker_pool_(worker_pool),
456 worker_(worker) { 462 worker_(worker) {
457 DCHECK(worker_pool_); 463 DCHECK(worker_pool_);
458 DCHECK(worker_); 464 DCHECK(worker_);
459 static_cast<SchedulerWorkerDelegateImpl*>(worker_->delegate())-> 465 static_cast<SchedulerWorkerDelegateImpl*>(worker_->delegate())->
(...skipping 326 matching lines...) Expand 10 before | Expand all | Expand 10 after
786 AutoSchedulerLock auto_lock(idle_workers_stack_lock_); 792 AutoSchedulerLock auto_lock(idle_workers_stack_lock_);
787 idle_workers_stack_.Remove(worker); 793 idle_workers_stack_.Remove(worker);
788 } 794 }
789 795
790 bool SchedulerWorkerPoolImpl::CanWorkerDetachForTesting() { 796 bool SchedulerWorkerPoolImpl::CanWorkerDetachForTesting() {
791 return !worker_detachment_disallowed_.IsSet(); 797 return !worker_detachment_disallowed_.IsSet();
792 } 798 }
793 799
794 } // namespace internal 800 } // namespace internal
795 } // namespace base 801 } // namespace base
OLDNEW
« no previous file with comments | « base/task_scheduler/scheduler_worker_pool_impl.h ('k') | base/task_scheduler/task_scheduler.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698