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

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

Issue 1432263002: (reland) Adds TimeDomains to the TaskQueueManager (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Addressing some more feedback. 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/real_time_domain.h
diff --git a/components/scheduler/base/real_time_domain.h b/components/scheduler/base/real_time_domain.h
new file mode 100644
index 0000000000000000000000000000000000000000..c9db08e7b142507717167a37a1e5a5dd981db62a
--- /dev/null
+++ b/components/scheduler/base/real_time_domain.h
@@ -0,0 +1,41 @@
+// 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_REAL_TIME_DOMAIN_H_
+#define COMPONENTS_SCHEDULER_BASE_REAL_TIME_DOMAIN_H_
+
+#include "base/callback.h"
+#include "base/macros.h"
+#include "components/scheduler/base/time_domain.h"
+#include "components/scheduler/scheduler_export.h"
+
+namespace scheduler {
+class TaskQueueManagerDelegate;
+
+class SCHEDULER_EXPORT RealTimeDomain : public TimeDomain {
+ public:
+ RealTimeDomain(TaskQueueManagerDelegate* delegate,
+ base::Closure do_work_closure);
+
+ // TimeDomain implementation:
+ LazyNow GetLazyNow() override;
+ bool MaybeAdvanceTime() override;
+ const char* GetName() const override;
+
+ protected:
+ void ScheduleDoWork(base::TimeDelta delay) override;
+ void AsValueIntoInternal(
+ base::trace_event::TracedValue* state) const override;
+
+ private:
+ base::Closure do_work_closure_;
+
+ ~RealTimeDomain() override;
+
+ DISALLOW_COPY_AND_ASSIGN(RealTimeDomain);
+};
+
+} // namespace scheduler
+
+#endif // COMPONENTS_SCHEDULER_BASE_REAL_TIME_DOMAIN_H_

Powered by Google App Engine
This is Rietveld 408576698