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

Side by Side Diff: cc/scheduler/begin_frame_tracker.h

Issue 2832503005: Revert "cc: Make scheduler run incoming frame after previous deadline." (Closed)
Patch Set: Created 3 years, 8 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 unified diff | Download patch
« no previous file with comments | « no previous file | cc/scheduler/begin_frame_tracker.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #ifndef CC_SCHEDULER_BEGIN_FRAME_TRACKER_H_ 5 #ifndef CC_SCHEDULER_BEGIN_FRAME_TRACKER_H_
6 #define CC_SCHEDULER_BEGIN_FRAME_TRACKER_H_ 6 #define CC_SCHEDULER_BEGIN_FRAME_TRACKER_H_
7 7
8 #include <set> 8 #include <set>
9 #include <string> 9 #include <string>
10 10
(...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after
60 // Get the last used BFA. 60 // Get the last used BFA.
61 // **Must** only be called when **not** between the start and finish method 61 // **Must** only be called when **not** between the start and finish method
62 // calls. 62 // calls.
63 const BeginFrameArgs& Last() const; 63 const BeginFrameArgs& Last() const;
64 64
65 // Helper method to try and return a valid interval property. Defaults to 65 // Helper method to try and return a valid interval property. Defaults to
66 // BFA::DefaultInterval() is no other interval can be found. Can be called at 66 // BFA::DefaultInterval() is no other interval can be found. Can be called at
67 // any time. 67 // any time.
68 base::TimeDelta Interval() const; 68 base::TimeDelta Interval() const;
69 69
70 void AsValueInto(base::trace_event::TracedValue* dict) const; 70 void AsValueInto(base::TimeTicks now,
71 base::trace_event::TracedValue* dict) const;
71 72
72 // The following methods violate principles of how BeginFrameArgs should be 73 // The following methods violate principles of how BeginFrameArgs should be
73 // used. These methods should only be used when there is no other choice. 74 // used. These methods should only be used when there is no other choice.
74 bool DangerousMethodHasStarted() const { 75 bool DangerousMethodHasStarted() const {
75 return !current_updated_at_.is_null(); 76 return !current_updated_at_.is_null();
76 } 77 }
77 bool DangerousMethodHasFinished() const { return HasFinished(); } 78 bool DangerousMethodHasFinished() const { return HasFinished(); }
78 const BeginFrameArgs& DangerousMethodCurrentOrLast() const; 79 const BeginFrameArgs& DangerousMethodCurrentOrLast() const;
79 80
80 private: 81 private:
81 // Return if currently not between the start/end period. This method should 82 // Return if currently not between the start/end period. This method should
82 // be used extremely sparingly and normal indicates incorrect management of 83 // be used extremely sparingly and normal indicates incorrect management of
83 // the BFA object. Can be called at any time. 84 // the BFA object. Can be called at any time.
84 bool HasFinished() const { return !current_finished_at_.is_null(); } 85 bool HasFinished() const { return !current_finished_at_.is_null(); }
85 86
86 const tracked_objects::Location location_; 87 const tracked_objects::Location location_;
87 const std::string location_string_; 88 const std::string location_string_;
88 89
89 base::TimeTicks current_updated_at_; 90 base::TimeTicks current_updated_at_;
90 BeginFrameArgs current_args_; 91 BeginFrameArgs current_args_;
91 base::TimeTicks current_finished_at_; 92 base::TimeTicks current_finished_at_;
92 }; 93 };
93 94
94 } // namespace cc 95 } // namespace cc
95 96
96 #endif // CC_SCHEDULER_BEGIN_FRAME_TRACKER_H_ 97 #endif // CC_SCHEDULER_BEGIN_FRAME_TRACKER_H_
OLDNEW
« no previous file with comments | « no previous file | cc/scheduler/begin_frame_tracker.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698