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

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

Issue 1308183005: Introduce WebTaskRunner Patch 2/5 (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Missed one rename Created 5 years, 3 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/web_task_runner_impl.h
diff --git a/components/scheduler/child/web_task_runner_impl.h b/components/scheduler/child/web_task_runner_impl.h
new file mode 100644
index 0000000000000000000000000000000000000000..d0d851b2e169830f03ade72f3acff41ee1e140bc
--- /dev/null
+++ b/components/scheduler/child/web_task_runner_impl.h
@@ -0,0 +1,52 @@
+// 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_WEB_TASK_RUNNER_H_
+#define COMPONENTS_SCHEDULER_CHILD_WEB_TASK_RUNNER_H_
+
+#include "base/macros.h"
+#include "base/memory/ref_counted.h"
+#include "base/memory/scoped_ptr.h"
+#include "components/scheduler/scheduler_export.h"
+#include "third_party/WebKit/public/platform/WebTaskRunner.h"
+
+namespace base {
+class SingleThreadTaskRunner;
+} // namespace base
+
+namespace scheduler {
+
+class FrameQueueHolder;
Sami 2015/09/02 14:55:53 Unused?
alex clarke (OOO till 29th) 2015/09/02 15:49:33 Done.
+
+class SCHEDULER_EXPORT WebTaskRunnerImpl : public blink::WebTaskRunner {
+ public:
+ explicit WebTaskRunnerImpl(
+ scoped_refptr<base::SingleThreadTaskRunner> task_runner);
+
+ ~WebTaskRunnerImpl() override;
+
+ const scoped_refptr<base::SingleThreadTaskRunner>& TaskRunner() const {
Sami 2015/09/02 14:55:53 nit: task_runner()
alex clarke (OOO till 29th) 2015/09/02 15:49:33 Done.
+ return task_runner_;
+ }
+
+ // blink::WebTaskRunner implementation:
+ virtual void postTask(const blink::WebTraceLocation& web_location,
+ blink::WebTaskRunner::Task* task);
+ // TODO(alexclarke): Remove this when possible.
+ virtual void postDelayedTask(const blink::WebTraceLocation& web_location,
+ blink::WebTaskRunner::Task* task,
+ long long delayMs);
+ virtual void postDelayedTask(const blink::WebTraceLocation& web_location,
+ blink::WebTaskRunner::Task* task,
+ double delayMs);
+
+ private:
+ scoped_refptr<base::SingleThreadTaskRunner> task_runner_;
+
+ DISALLOW_COPY_AND_ASSIGN(WebTaskRunnerImpl);
+};
+
+} // namespace scheduler
+
+#endif // COMPONENTS_SCHEDULER_CHILD_WEB_TASK_RUNNER_H_

Powered by Google App Engine
This is Rietveld 408576698