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

Side by Side Diff: third_party/WebKit/Source/platform/scheduler/child/scheduler_helper.h

Issue 2259013003: Move and rename TaskTimeTracker to public interface exposed to WebThread, use in WebPerf Agent. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: remaining fixes for remove observer 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 // Copyright 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 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 #ifndef THIRD_PARTY_WEBKIT_SOURCE_PLATFORM_SCHEDULER_CHILD_SCHEDULER_HELPER_H_ 5 #ifndef THIRD_PARTY_WEBKIT_SOURCE_PLATFORM_SCHEDULER_CHILD_SCHEDULER_HELPER_H_
6 #define THIRD_PARTY_WEBKIT_SOURCE_PLATFORM_SCHEDULER_CHILD_SCHEDULER_HELPER_H_ 6 #define THIRD_PARTY_WEBKIT_SOURCE_PLATFORM_SCHEDULER_CHILD_SCHEDULER_HELPER_H_
7 7
8 #include <stddef.h> 8 #include <stddef.h>
9 9
10 #include "base/macros.h" 10 #include "base/macros.h"
11 #include "base/time/tick_clock.h" 11 #include "base/time/tick_clock.h"
12 #include "platform/scheduler/base/task_queue_manager.h" 12 #include "platform/scheduler/base/task_queue_manager.h"
13 #include "platform/scheduler/base/task_queue_selector.h" 13 #include "platform/scheduler/base/task_queue_selector.h"
14 #include "public/platform/WebThread.h"
14 15
15 namespace base { 16 namespace base {
16 class TickClock; 17 class TickClock;
17 } 18 }
18 19
19 namespace blink { 20 namespace blink {
20 namespace scheduler { 21 namespace scheduler {
21 22
22 class SchedulerTqmDelegate; 23 class SchedulerTqmDelegate;
23 24
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after
56 // notified before and after every executed task. These functions can only be 57 // notified before and after every executed task. These functions can only be
57 // called on the thread this class was created on. 58 // called on the thread this class was created on.
58 void AddTaskObserver(base::MessageLoop::TaskObserver* task_observer); 59 void AddTaskObserver(base::MessageLoop::TaskObserver* task_observer);
59 void RemoveTaskObserver(base::MessageLoop::TaskObserver* task_observer); 60 void RemoveTaskObserver(base::MessageLoop::TaskObserver* task_observer);
60 61
61 void SetTaskTimeTracker(TaskTimeTracker* task_time_tracker) { 62 void SetTaskTimeTracker(TaskTimeTracker* task_time_tracker) {
62 if (task_queue_manager_) 63 if (task_queue_manager_)
63 task_queue_manager_->SetTaskTimeTracker(task_time_tracker); 64 task_queue_manager_->SetTaskTimeTracker(task_time_tracker);
64 } 65 }
65 66
67 void AddTaskTimeObserver(WebThread::TaskTimeObserver* task_time_observer) {
68 if (task_queue_manager_)
69 task_queue_manager_->AddTaskTimeObserver(task_time_observer);
70 }
71
72 void RemoveTaskTimeObserver(WebThread::TaskTimeObserver* task_time_observer) {
73 if (task_queue_manager_)
74 task_queue_manager_->RemoveTaskTimeObserver(task_time_observer);
75 }
76
66 // Shuts down the scheduler by dropping any remaining pending work in the work 77 // Shuts down the scheduler by dropping any remaining pending work in the work
67 // queues. After this call any work posted to the task runners will be 78 // queues. After this call any work posted to the task runners will be
68 // silently dropped. 79 // silently dropped.
69 void Shutdown(); 80 void Shutdown();
70 81
71 // Returns true if Shutdown() has been called. Otherwise returns false. 82 // Returns true if Shutdown() has been called. Otherwise returns false.
72 bool IsShutdown() const { return !task_queue_manager_.get(); } 83 bool IsShutdown() const { return !task_queue_manager_.get(); }
73 84
74 void CheckOnValidThread() const { 85 void CheckOnValidThread() const {
75 DCHECK(thread_checker_.CalledOnValidThread()); 86 DCHECK(thread_checker_.CalledOnValidThread());
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after
123 const char* tracing_category_; 134 const char* tracing_category_;
124 const char* disabled_by_default_tracing_category_; 135 const char* disabled_by_default_tracing_category_;
125 136
126 DISALLOW_COPY_AND_ASSIGN(SchedulerHelper); 137 DISALLOW_COPY_AND_ASSIGN(SchedulerHelper);
127 }; 138 };
128 139
129 } // namespace scheduler 140 } // namespace scheduler
130 } // namespace blink 141 } // namespace blink
131 142
132 #endif // THIRD_PARTY_WEBKIT_SOURCE_PLATFORM_SCHEDULER_CHILD_SCHEDULER_HELPER_H _ 143 #endif // THIRD_PARTY_WEBKIT_SOURCE_PLATFORM_SCHEDULER_CHILD_SCHEDULER_HELPER_H _
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698