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

Side by Side Diff: content/renderer/scheduler/renderer_scheduler.h

Issue 930063002: Revert of scheduler: Implement task observers (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 10 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 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 #ifndef CONTENT_RENDERER_SCHEDULER_RENDERER_SCHEDULER_H_ 5 #ifndef CONTENT_RENDERER_SCHEDULER_RENDERER_SCHEDULER_H_
6 #define CONTENT_RENDERER_SCHEDULER_RENDERER_SCHEDULER_H_ 6 #define CONTENT_RENDERER_SCHEDULER_RENDERER_SCHEDULER_H_
7 7
8 #include "content/renderer/scheduler/single_thread_idle_task_runner.h" 8 #include "content/renderer/scheduler/single_thread_idle_task_runner.h"
9 #include "content/renderer/scheduler/task_queue_manager.h" 9 #include "content/renderer/scheduler/task_queue_manager.h"
10 #include "third_party/WebKit/public/web/WebInputEvent.h" 10 #include "third_party/WebKit/public/web/WebInputEvent.h"
(...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after
59 // Must be called from the main thread. 59 // Must be called from the main thread.
60 virtual bool IsHighPriorityWorkAnticipated() = 0; 60 virtual bool IsHighPriorityWorkAnticipated() = 0;
61 61
62 // Returns true if there is high priority work pending on the main thread 62 // Returns true if there is high priority work pending on the main thread
63 // and the caller should yield to let the scheduler service that work. Note 63 // and the caller should yield to let the scheduler service that work. Note
64 // that this is a stricter condition than |IsHighPriorityWorkAnticipated|, 64 // that this is a stricter condition than |IsHighPriorityWorkAnticipated|,
65 // restricted to the case where real work is pending. 65 // restricted to the case where real work is pending.
66 // Must be called from the main thread. 66 // Must be called from the main thread.
67 virtual bool ShouldYieldForHighPriorityWork() = 0; 67 virtual bool ShouldYieldForHighPriorityWork() = 0;
68 68
69 // Adds or removes a task observer from the scheduler. The observer will be
70 // notified before and after every executed task. These functions can only be
71 // called on the main thread.
72 virtual void AddTaskObserver(
73 base::MessageLoop::TaskObserver* task_observer) = 0;
74 virtual void RemoveTaskObserver(
75 base::MessageLoop::TaskObserver* task_observer) = 0;
76
77 // Shuts down the scheduler by dropping any remaining pending work in the work 69 // Shuts down the scheduler by dropping any remaining pending work in the work
78 // queues. After this call any work posted to the task runners will be 70 // queues. After this call any work posted to the task runners will be
79 // silently dropped. 71 // silently dropped.
80 virtual void Shutdown() = 0; 72 virtual void Shutdown() = 0;
81 73
82 protected: 74 protected:
83 RendererScheduler(); 75 RendererScheduler();
84 DISALLOW_COPY_AND_ASSIGN(RendererScheduler); 76 DISALLOW_COPY_AND_ASSIGN(RendererScheduler);
85 }; 77 };
86 78
87 } // namespace content 79 } // namespace content
88 80
89 #endif // CONTENT_RENDERER_SCHEDULER_RENDERER_SCHEDULER_H_ 81 #endif // CONTENT_RENDERER_SCHEDULER_RENDERER_SCHEDULER_H_
OLDNEW
« no previous file with comments | « content/renderer/scheduler/null_renderer_scheduler.cc ('k') | content/renderer/scheduler/renderer_scheduler_impl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698