Chromium Code Reviews| Index: content/child/scheduler/worker_scheduler.h |
| diff --git a/content/renderer/scheduler/renderer_scheduler.h b/content/child/scheduler/worker_scheduler.h |
| similarity index 43% |
| copy from content/renderer/scheduler/renderer_scheduler.h |
| copy to content/child/scheduler/worker_scheduler.h |
| index 924c4b19fdca881c9efbab5b6a02f5216b5aebc9..12216382a350e827d78b4f62094fba8b76e37301 100644 |
| --- a/content/renderer/scheduler/renderer_scheduler.h |
| +++ b/content/child/scheduler/worker_scheduler.h |
| @@ -1,76 +1,37 @@ |
| -// Copyright 2014 The Chromium Authors. All rights reserved. |
| +// Copyright 2015 The Chromium Authors. All rights reserved. |
| // Use of this source code is governed by a BSD-style license that can be |
| // found in the LICENSE file. |
| -#ifndef CONTENT_RENDERER_SCHEDULER_RENDERER_SCHEDULER_H_ |
| -#define CONTENT_RENDERER_SCHEDULER_RENDERER_SCHEDULER_H_ |
| +#ifndef CONTENT_CHILD_SCHEDULER_WORKER_SCHEDULER_H_ |
| +#define CONTENT_CHILD_SCHEDULER_WORKER_SCHEDULER_H_ |
| #include "base/message_loop/message_loop.h" |
| #include "content/child/scheduler/single_thread_idle_task_runner.h" |
| #include "content/common/content_export.h" |
| -#include "third_party/WebKit/public/web/WebInputEvent.h" |
| -namespace cc { |
| -struct BeginFrameArgs; |
| +namespace base { |
| +class MessageLoop; |
| } |
| namespace content { |
| -class CONTENT_EXPORT RendererScheduler { |
| +class CONTENT_EXPORT WorkerScheduler { |
| public: |
| - virtual ~RendererScheduler(); |
| - static scoped_ptr<RendererScheduler> Create(); |
| + virtual ~WorkerScheduler(); |
| + static scoped_ptr<WorkerScheduler> Create(base::MessageLoop* message_loop); |
| + |
| + // Must be called before the scheduler can be used. Does any post construction |
| + // initialization needed such as initiating long idle periods. |
|
rmcilroy
2015/04/08 18:34:24
nit - /s/initiating long idle periods/initializing
alex clarke (OOO till 29th)
2015/04/09 10:02:37
Done.
|
| + virtual void Init() = 0; |
| // Returns the default task runner. |
| virtual scoped_refptr<base::SingleThreadTaskRunner> DefaultTaskRunner() = 0; |
| - // Returns the compositor task runner. |
| - virtual scoped_refptr<base::SingleThreadTaskRunner> |
| - CompositorTaskRunner() = 0; |
| - |
| // Returns the idle task runner. Tasks posted to this runner may be reordered |
| // relative to other task types and may be starved for an arbitrarily long |
| // time if no idle time is available. |
| virtual scoped_refptr<SingleThreadIdleTaskRunner> IdleTaskRunner() = 0; |
| - // Returns the loading task runner. This queue is intended for tasks related |
| - // to resource dispatch, foreground HTML parsing, etc... |
| - virtual scoped_refptr<base::SingleThreadTaskRunner> LoadingTaskRunner() = 0; |
| - |
| - // Called to notify about the start of an extended period where no frames |
| - // need to be drawn. Must be called from the main thread. |
| - virtual void BeginFrameNotExpectedSoon() = 0; |
| - |
| - // Called to notify about the start of a new frame. Must be called from the |
| - // main thread. |
| - virtual void WillBeginFrame(const cc::BeginFrameArgs& args) = 0; |
| - |
| - // Called to notify that a previously begun frame was committed. Must be |
| - // called from the main thread. |
| - virtual void DidCommitFrameToCompositor() = 0; |
| - |
| - // Tells the scheduler that the system received an input event. Called by the |
| - // compositor (impl) thread. |
| - virtual void DidReceiveInputEventOnCompositorThread( |
| - const blink::WebInputEvent& web_input_event) = 0; |
| - |
| - // Tells the scheduler that the system is displaying an input animation (e.g. |
| - // a fling). Called by the compositor (impl) thread. |
| - virtual void DidAnimateForInputOnCompositorThread() = 0; |
| - |
| - // Returns true if the scheduler has reason to believe that high priority work |
| - // may soon arrive on the main thread, e.g., if gesture events were observed |
| - // recently. |
| - // Must be called from the main thread. |
| - virtual bool IsHighPriorityWorkAnticipated() = 0; |
| - |
| - // Returns true if there is high priority work pending on the main thread |
| - // and the caller should yield to let the scheduler service that work. Note |
| - // that this is a stricter condition than |IsHighPriorityWorkAnticipated|, |
| - // restricted to the case where real work is pending. |
| - // Must be called from the main thread. |
| - virtual bool ShouldYieldForHighPriorityWork() = 0; |
| - |
| // Returns true if a currently running idle task could exceed its deadline |
| // without impacting user experience too much. This should only be used if |
| // there is a task which cannot be pre-empted and is likely to take longer |
| @@ -95,10 +56,10 @@ class CONTENT_EXPORT RendererScheduler { |
| virtual void Shutdown() = 0; |
| protected: |
| - RendererScheduler(); |
| - DISALLOW_COPY_AND_ASSIGN(RendererScheduler); |
| + WorkerScheduler(); |
| + DISALLOW_COPY_AND_ASSIGN(WorkerScheduler); |
| }; |
| } // namespace content |
| -#endif // CONTENT_RENDERER_SCHEDULER_RENDERER_SCHEDULER_H_ |
| +#endif // CONTENT_CHILD_SCHEDULER_WORKER_SCHEDULER_H_ |