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

Side by Side Diff: cc/output/begin_frame_args.h

Issue 267783004: Refactoring the way begin frame sources inside scheduler work. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 7 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 | Annotate | Revision Log
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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_OUTPUT_BEGIN_FRAME_ARGS_H_ 5 #ifndef CC_OUTPUT_BEGIN_FRAME_ARGS_H_
6 #define CC_OUTPUT_BEGIN_FRAME_ARGS_H_ 6 #define CC_OUTPUT_BEGIN_FRAME_ARGS_H_
7 7
8 #include "base/time/time.h" 8 #include "base/time/time.h"
9 #include "cc/base/cc_export.h" 9 #include "cc/base/cc_export.h"
10 10
(...skipping 21 matching lines...) Expand all
32 static base::TimeDelta DefaultInterval(); 32 static base::TimeDelta DefaultInterval();
33 33
34 // This is the default amount of time after the frame_time to retroactively 34 // This is the default amount of time after the frame_time to retroactively
35 // send a BeginFrame that had been skipped. This only has an effect if the 35 // send a BeginFrame that had been skipped. This only has an effect if the
36 // deadline has passed, since the deadline is also used to trigger BeginFrame 36 // deadline has passed, since the deadline is also used to trigger BeginFrame
37 // retroactively. 37 // retroactively.
38 static base::TimeDelta DefaultRetroactiveBeginFramePeriod(); 38 static base::TimeDelta DefaultRetroactiveBeginFramePeriod();
39 39
40 bool IsValid() const { return interval >= base::TimeDelta(); } 40 bool IsValid() const { return interval >= base::TimeDelta(); }
41 41
42 virtual scoped_ptr<base::Value> AsValue() const {
43 scoped_ptr<base::DictionaryValue> state(new base::DictionaryValue);
44 state->SetString("type", "BeginFrameArgs");
45 state->SetInteger("frame_time_us", frame_time.ToInternalValue());
46 state->SetInteger("deadline_us", deadline_.ToInternalValue());
47 state->SetInteger("interval_us", interval_.InMicroseconds());
48 return state.PassAs<base::Value>();
49 }
50
42 base::TimeTicks frame_time; 51 base::TimeTicks frame_time;
43 base::TimeTicks deadline; 52 base::TimeTicks deadline;
44 base::TimeDelta interval; 53 base::TimeDelta interval;
45 54
46 private: 55 private:
47 BeginFrameArgs(base::TimeTicks frame_time, 56 BeginFrameArgs(base::TimeTicks frame_time,
48 base::TimeTicks deadline, 57 base::TimeTicks deadline,
49 base::TimeDelta interval); 58 base::TimeDelta interval);
50 }; 59 };
51 60
52 } // namespace cc 61 } // namespace cc
53 62
54 #endif // CC_OUTPUT_BEGIN_FRAME_ARGS_H_ 63 #endif // CC_OUTPUT_BEGIN_FRAME_ARGS_H_
OLDNEW
« no previous file with comments | « cc/cc.gyp ('k') | cc/scheduler/frame_source.cc » ('j') | cc/scheduler/frame_source.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698