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

Unified Diff: cc/scheduler/begin_frame_source.h

Issue 2583483002: [cc] Adds source_id and sequence_number to BeginFrameArgs. (Closed)
Patch Set: fix field ordering Created 4 years 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/output/begin_frame_args_unittest.cc ('k') | cc/scheduler/begin_frame_source.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: cc/scheduler/begin_frame_source.h
diff --git a/cc/scheduler/begin_frame_source.h b/cc/scheduler/begin_frame_source.h
index bde01afd79ec6bd72a1d525c85b9d6d49bafe9d0..c25fff651426ef031f8d22ae2446809f81f2256a 100644
--- a/cc/scheduler/begin_frame_source.h
+++ b/cc/scheduler/begin_frame_source.h
@@ -26,8 +26,10 @@ class CC_EXPORT BeginFrameObserver {
virtual ~BeginFrameObserver() {}
// The |args| given to OnBeginFrame is guaranteed to have
- // |args|.IsValid()==true and have |args|.frame_time
- // field be strictly greater than the previous call.
+ // |args|.IsValid()==true. If |args|.source_id did not change between
+ // invocations, |args|.sequence_number is guaranteed to be be strictly greater
+ // than the previous call. Further, |args|.frame_time is guaranteed to be
+ // greater than or equal to the previous call even if the source_id changes.
//
// Side effects: This function can (and most of the time *will*) change the
// return value of the LastUsedBeginFrameArgs method. See the documentation
@@ -99,6 +101,7 @@ class CC_EXPORT BeginFrameObserverBase : public BeginFrameObserver {
// all BeginFrameSources *must* provide.
class CC_EXPORT BeginFrameSource {
public:
+ BeginFrameSource();
virtual ~BeginFrameSource() {}
// DidFinishFrame provides back pressure to a frame source about frame
@@ -116,6 +119,15 @@ class CC_EXPORT BeginFrameSource {
// Returns false if the begin frame source will just continue to produce
// begin frames without waiting.
virtual bool IsThrottled() const = 0;
+
+ // Returns an identifier for this BeginFrameSource. Guaranteed unique within a
+ // process, but not across processes. This is used to create BeginFrames that
+ // originate at this source. Note that BeginFrameSources may pass on
+ // BeginFrames created by other sources, with different IDs.
+ uint32_t source_id() const;
+
+ private:
+ uint32_t source_id_;
};
// A BeginFrameSource that does nothing.
@@ -167,6 +179,7 @@ class CC_EXPORT BackToBackBeginFrameSource : public SyntheticBeginFrameSource,
std::unique_ptr<DelayBasedTimeSource> time_source_;
std::unordered_set<BeginFrameObserver*> observers_;
std::unordered_set<BeginFrameObserver*> pending_begin_frame_observers_;
+ uint64_t next_sequence_number_;
base::WeakPtrFactory<BackToBackBeginFrameSource> weak_factory_;
DISALLOW_COPY_AND_ASSIGN(BackToBackBeginFrameSource);
@@ -204,6 +217,8 @@ class CC_EXPORT DelayBasedBeginFrameSource : public SyntheticBeginFrameSource,
std::unordered_set<BeginFrameObserver*> observers_;
base::TimeTicks last_timebase_;
base::TimeDelta authoritative_interval_;
+ BeginFrameArgs current_begin_frame_args_;
+ uint64_t next_sequence_number_;
DISALLOW_COPY_AND_ASSIGN(DelayBasedBeginFrameSource);
};
« no previous file with comments | « cc/output/begin_frame_args_unittest.cc ('k') | cc/scheduler/begin_frame_source.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698