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

Unified Diff: components/scheduler/renderer/auto_advancing_virtual_time_domain.h

Issue 1646583002: [Reland] Per WebViewScheduler virtual time (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: WebViewSchedulerImpl to unregister the virtual_time_domain_ in the destructor Created 4 years, 11 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/renderer/auto_advancing_virtual_time_domain.h
diff --git a/components/scheduler/renderer/auto_advancing_virtual_time_domain.h b/components/scheduler/renderer/auto_advancing_virtual_time_domain.h
new file mode 100644
index 0000000000000000000000000000000000000000..2750ad60f17b81dace0fad029071ee29333e5f1c
--- /dev/null
+++ b/components/scheduler/renderer/auto_advancing_virtual_time_domain.h
@@ -0,0 +1,36 @@
+// Copyright 2016 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_RENDERER_AUTO_ADVANCING_VIRTUAL_TIME_DOMAIN_H_
+#define COMPONENTS_SCHEDULER_RENDERER_AUTO_ADVANCING_VIRTUAL_TIME_DOMAIN_H_
+
+#include "base/macros.h"
+#include "components/scheduler/base/virtual_time_domain.h"
+
+namespace scheduler {
+
+class SCHEDULER_EXPORT AutoAdvancingVirtualTimeDomain
Sami 2016/02/01 11:15:07 Could you add a short description about what this
alex clarke (OOO till 29th) 2016/02/01 14:16:54 Done.
+ : public VirtualTimeDomain {
+ public:
+ explicit AutoAdvancingVirtualTimeDomain(base::TimeTicks initial_time);
+ ~AutoAdvancingVirtualTimeDomain() override;
+
+ // TimeDomain implementation:
+ bool MaybeAdvanceTime() override;
+ void RequestWakeup(base::TimeTicks now, base::TimeDelta delay) override;
+ const char* GetName() const override;
+
+ // Contols whether or not virtual time is allowed to advance, when the
Sami 2016/02/01 11:15:07 typo: Controls
alex clarke (OOO till 29th) 2016/02/01 14:16:54 Done.
+ // TaskQueueManager runs out of immediate work to do.
+ void SetCanAdvanceVirtualTime(bool can_advance_virtual_time);
+
+ private:
+ bool can_advance_virtual_time_;
+
+ DISALLOW_COPY_AND_ASSIGN(AutoAdvancingVirtualTimeDomain);
+};
+
+} // namespace scheduler
+
+#endif // COMPONENTS_SCHEDULER_RENDERER_AUTO_ADVANCING_VIRTUAL_TIME_DOMAIN_H_

Powered by Google App Engine
This is Rietveld 408576698