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

Unified Diff: components/scheduler/child/scheduler_message_loop_delegate.h

Issue 1238483003: Revert of Redirect the MessageLoop's task runner to the renderer scheduler (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 5 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 side-by-side diff with in-line comments
Download patch
Index: components/scheduler/child/scheduler_message_loop_delegate.h
diff --git a/components/scheduler/child/scheduler_message_loop_delegate.h b/components/scheduler/child/scheduler_message_loop_delegate.h
new file mode 100644
index 0000000000000000000000000000000000000000..164ab31768a413eb607c0d2fd14c1cda36727641
--- /dev/null
+++ b/components/scheduler/child/scheduler_message_loop_delegate.h
@@ -0,0 +1,48 @@
+// 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 COMPONENTS_SCHEDULER_CHILD_SCHEDULER_MESSAGE_LOOP_DELEGATE_H_
+#define COMPONENTS_SCHEDULER_CHILD_SCHEDULER_MESSAGE_LOOP_DELEGATE_H_
+
+#include "base/message_loop/message_loop.h"
+#include "components/scheduler/child/nestable_single_thread_task_runner.h"
+#include "components/scheduler/scheduler_export.h"
+
+namespace scheduler {
+
+class SCHEDULER_EXPORT SchedulerMessageLoopDelegate
+ : public NestableSingleThreadTaskRunner {
+ public:
+ // |message_loop| is not owned and must outlive the lifetime of this object.
+ static scoped_refptr<SchedulerMessageLoopDelegate> Create(
+ base::MessageLoop* message_loop);
+
+ // NestableSingleThreadTaskRunner implementation
+ bool PostDelayedTask(const tracked_objects::Location& from_here,
+ const base::Closure& task,
+ base::TimeDelta delay) override;
+ bool PostNonNestableDelayedTask(const tracked_objects::Location& from_here,
+ const base::Closure& task,
+ base::TimeDelta delay) override;
+ bool RunsTasksOnCurrentThread() const override;
+ bool IsNested() const override;
+ void AddTaskObserver(base::MessageLoop::TaskObserver* task_observer) override;
+ void RemoveTaskObserver(
+ base::MessageLoop::TaskObserver* task_observer) override;
+
+ protected:
+ ~SchedulerMessageLoopDelegate() override;
+
+ private:
+ SchedulerMessageLoopDelegate(base::MessageLoop* message_loop);
+
+ // Not owned.
+ base::MessageLoop* message_loop_;
+
+ DISALLOW_COPY_AND_ASSIGN(SchedulerMessageLoopDelegate);
+};
+
+} // namespace scheduler
+
+#endif // COMPONENTS_SCHEDULER_CHILD_SCHEDULER_MESSAGE_LOOP_DELEGATE_H_
« no previous file with comments | « components/scheduler/child/scheduler_helper_unittest.cc ('k') | components/scheduler/child/scheduler_message_loop_delegate.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698