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

Unified Diff: components/scheduler/base/delayed_task_delegate_impl.h

Issue 1432263002: (reland) Adds TimeDomains to the TaskQueueManager (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebased Created 5 years, 1 month 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/base/delayed_task_delegate_impl.h
diff --git a/components/scheduler/base/delayed_task_delegate_impl.h b/components/scheduler/base/delayed_task_delegate_impl.h
new file mode 100644
index 0000000000000000000000000000000000000000..86a3ef41203d831d848e4afb922d2f386b38644e
--- /dev/null
+++ b/components/scheduler/base/delayed_task_delegate_impl.h
@@ -0,0 +1,47 @@
+// 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_BASE_DELAYED_TASK_DELEGATE_IMPL_H_
+#define COMPONENTS_SCHEDULER_BASE_DELAYED_TASK_DELEGATE_IMPL_H_
+
+#include "base/callback.h"
+#include "base/macros.h"
+#include "base/memory/weak_ptr.h"
+#include "components/scheduler/base/delayed_task_delegate.h"
+#include "components/scheduler/scheduler_export.h"
+
+namespace scheduler {
+class TaskQueueManagerDelegate;
+
+class SCHEDULER_EXPORT DelayedTaskDelegateImpl : public DelayedTaskDelegate {
+ public:
+ DelayedTaskDelegateImpl(TaskQueueManagerDelegate* delegate,
+ base::Closure do_work_closure);
+
+ // TimeSource implementation:
+ base::TimeTicks CachedNow() override;
+ void InvalidateNowCache() override;
+
+ protected:
+ // TimeSource protected implementation:
Sami 2015/11/17 10:31:06 TimeSource?
alex clarke (OOO till 29th) 2015/11/18 15:30:15 Done.
+ bool BelongsToCurrentThread() const override;
+ void PostScheduleDelayedWorkTaskOnMainThread(
+ internal::TaskQueueImpl* queue,
+ base::TimeTicks delayed_run_time) override;
+ void ScheduleDoWork(base::TimeDelta delay) override;
+
+ private:
+ TaskQueueManagerDelegate* delegate_; // NOT OWNED
+ base::TimeTicks cached_now_;
+ base::Closure do_work_closure_;
+ base::WeakPtrFactory<DelayedTaskDelegateImpl> weak_factory_;
+
+ ~DelayedTaskDelegateImpl() override;
+
+ DISALLOW_COPY_AND_ASSIGN(DelayedTaskDelegateImpl);
+};
+
+} // namespace scheduler
+
+#endif // COMPONENTS_SCHEDULER_BASE_DELAYED_TASK_DELEGATE_IMPL_H_

Powered by Google App Engine
This is Rietveld 408576698