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

Unified Diff: cc/scheduler/scheduler.h

Issue 1201573002: cc: Remove BeginFrameSourcesConstructor. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Remove refptr changes Created 5 years, 6 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
« no previous file with comments | « cc/scheduler/begin_frame_source.cc ('k') | cc/scheduler/scheduler.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: cc/scheduler/scheduler.h
diff --git a/cc/scheduler/scheduler.h b/cc/scheduler/scheduler.h
index 33ceee91b39863d09f89157157933d475f067f60..bac1a7b71b4de1d76c9a3ce0f5dba9e8f8e815e0 100644
--- a/cc/scheduler/scheduler.h
+++ b/cc/scheduler/scheduler.h
@@ -14,7 +14,6 @@
#include "base/time/time.h"
#include "cc/base/cc_export.h"
#include "cc/output/begin_frame_args.h"
-#include "cc/output/vsync_parameter_observer.h"
#include "cc/scheduler/begin_frame_source.h"
#include "cc/scheduler/begin_frame_tracker.h"
#include "cc/scheduler/delay_based_time_source.h"
@@ -54,24 +53,6 @@ class SchedulerClient {
virtual ~SchedulerClient() {}
};
-class Scheduler;
-// This class exists to allow tests to override the frame source construction.
-// A virtual method can't be used as this needs to happen in the constructor
-// (see C++ FAQ / Section 23 - http://goo.gl/fnrwom for why).
-// This class exists solely long enough to construct the frame sources.
-class CC_EXPORT SchedulerFrameSourcesConstructor {
- public:
- virtual ~SchedulerFrameSourcesConstructor() {}
- virtual BeginFrameSource* ConstructPrimaryFrameSource(Scheduler* scheduler);
- virtual BeginFrameSource* ConstructUnthrottledFrameSource(
- Scheduler* scheduler);
-
- protected:
- SchedulerFrameSourcesConstructor() {}
-
- friend class Scheduler;
-};
-
class CC_EXPORT Scheduler : public BeginFrameObserverBase {
public:
static scoped_ptr<Scheduler> Create(
@@ -79,15 +60,7 @@ class CC_EXPORT Scheduler : public BeginFrameObserverBase {
const SchedulerSettings& scheduler_settings,
int layer_tree_host_id,
const scoped_refptr<base::SingleThreadTaskRunner>& task_runner,
- scoped_ptr<BeginFrameSource> external_begin_frame_source) {
- SchedulerFrameSourcesConstructor frame_sources_constructor;
- return make_scoped_ptr(new Scheduler(client,
- scheduler_settings,
- layer_tree_host_id,
- task_runner,
- external_begin_frame_source.Pass(),
- &frame_sources_constructor));
- }
+ BeginFrameSource* external_frame_source);
~Scheduler() override;
@@ -178,31 +151,27 @@ class CC_EXPORT Scheduler : public BeginFrameObserverBase {
const SchedulerSettings& scheduler_settings,
int layer_tree_host_id,
const scoped_refptr<base::SingleThreadTaskRunner>& task_runner,
- scoped_ptr<BeginFrameSource> external_begin_frame_source,
- SchedulerFrameSourcesConstructor* frame_sources_constructor);
+ BeginFrameSource* external_frame_source,
+ scoped_ptr<SyntheticBeginFrameSource> synthetic_frame_source,
+ scoped_ptr<BackToBackBeginFrameSource> unthrottled_frame_source);
// virtual for testing - Don't call these in the constructor or
// destructor!
virtual base::TimeTicks Now() const;
- scoped_ptr<BeginFrameSourceMultiplexer> frame_source_;
- BeginFrameSource* primary_frame_source_;
- BeginFrameSource* unthrottled_frame_source_;
-
- // Storage when frame sources are internal
- scoped_ptr<BeginFrameSource> primary_frame_source_internal_;
- scoped_ptr<BeginFrameSource> unthrottled_frame_source_internal_;
-
- VSyncParameterObserver* vsync_observer_;
- base::TimeDelta authoritative_vsync_interval_;
- base::TimeTicks last_vsync_timebase_;
-
- bool throttle_frame_production_;
-
const SchedulerSettings settings_;
SchedulerClient* client_;
int layer_tree_host_id_;
scoped_refptr<base::SingleThreadTaskRunner> task_runner_;
+ BeginFrameSource* external_frame_source_;
+ scoped_ptr<SyntheticBeginFrameSource> synthetic_frame_source_;
+ scoped_ptr<BackToBackBeginFrameSource> unthrottled_frame_source_;
+
+ scoped_ptr<BeginFrameSourceMultiplexer> frame_source_;
+ bool throttle_frame_production_;
+
+ base::TimeDelta authoritative_vsync_interval_;
+ base::TimeTicks last_vsync_timebase_;
base::TimeDelta estimated_parent_draw_time_;
@@ -246,10 +215,15 @@ class CC_EXPORT Scheduler : public BeginFrameObserverBase {
return inside_action_ == action;
}
- base::WeakPtrFactory<Scheduler> weak_factory_;
+ BeginFrameSource* primary_frame_source() {
+ if (settings_.use_external_begin_frame_source) {
+ DCHECK(external_frame_source_);
+ return external_frame_source_;
+ }
+ return synthetic_frame_source_.get();
+ }
- friend class SchedulerFrameSourcesConstructor;
- friend class TestSchedulerFrameSourcesConstructor;
+ base::WeakPtrFactory<Scheduler> weak_factory_;
DISALLOW_COPY_AND_ASSIGN(Scheduler);
};
« no previous file with comments | « cc/scheduler/begin_frame_source.cc ('k') | cc/scheduler/scheduler.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698