OLD | NEW |
(Empty) | |
| 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 |
| 3 // found in the LICENSE file. |
| 4 |
| 5 #ifndef CONTENT_RENDERER_SCHEDULER_RENDERER_SCHEDULER_MESSAGE_LOOP_DELEGATE_H_ |
| 6 #define CONTENT_RENDERER_SCHEDULER_RENDERER_SCHEDULER_MESSAGE_LOOP_DELEGATE_H_ |
| 7 |
| 8 #include "base/message_loop/message_loop.h" |
| 9 #include "content/common/content_export.h" |
| 10 #include "content/renderer/scheduler/nestable_single_thread_task_runner.h" |
| 11 |
| 12 namespace content { |
| 13 |
| 14 class CONTENT_EXPORT RendererSchedulerMessageLoopDelegate |
| 15 : public NestableSingleThreadTaskRunner { |
| 16 public: |
| 17 // |message_loop| is not owned and must outlive the lifetime of this object. |
| 18 static scoped_refptr<RendererSchedulerMessageLoopDelegate> Create( |
| 19 base::MessageLoop* message_loop); |
| 20 |
| 21 // NestableSingleThreadTaskRunner implementation |
| 22 bool PostDelayedTask(const tracked_objects::Location& from_here, |
| 23 const base::Closure& task, |
| 24 base::TimeDelta delay) override; |
| 25 bool PostNonNestableDelayedTask(const tracked_objects::Location& from_here, |
| 26 const base::Closure& task, |
| 27 base::TimeDelta delay) override; |
| 28 bool RunsTasksOnCurrentThread() const override; |
| 29 bool IsNested() const override; |
| 30 |
| 31 protected: |
| 32 ~RendererSchedulerMessageLoopDelegate() override; |
| 33 |
| 34 private: |
| 35 RendererSchedulerMessageLoopDelegate(base::MessageLoop* message_loop); |
| 36 |
| 37 // Not owned. |
| 38 base::MessageLoop* message_loop_; |
| 39 |
| 40 DISALLOW_COPY_AND_ASSIGN(RendererSchedulerMessageLoopDelegate); |
| 41 }; |
| 42 |
| 43 } // namespace content |
| 44 |
| 45 #endif // CONTENT_RENDERER_SCHEDULER_RENDERER_SCHEDULER_MESSAGE_LOOP_DELEGATE_H
_ |
OLD | NEW |