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

Unified Diff: cc/scheduler/begin_frame_tracker.cc

Issue 1122153002: Fixit: Fork base::TimeTicks --> TimeTicks + ThreadTicks + TraceTicks (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@FIXIT_timeclasses_1of2
Patch Set: REBASE after it passed CQ but did not commit to tree Created 5 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « cc/scheduler/begin_frame_tracker.h ('k') | components/tracing/child_trace_message_filter.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: cc/scheduler/begin_frame_tracker.cc
diff --git a/cc/scheduler/begin_frame_tracker.cc b/cc/scheduler/begin_frame_tracker.cc
index fcc3313e6c9a0b65d58b41de889feeea2681bae0..3b526ccad0002b71088d8848817783fb98787429 100644
--- a/cc/scheduler/begin_frame_tracker.cc
+++ b/cc/scheduler/begin_frame_tracker.cc
@@ -11,7 +11,7 @@ BeginFrameTracker::BeginFrameTracker(const tracked_objects::Location& location)
location_string_(location.ToString()),
current_updated_at_(),
current_args_(),
- current_finished_at_(base::TimeTicks::FromInternalValue(-1)) {
+ current_finished_at_(base::TraceTicks::FromInternalValue(-1)) {
}
BeginFrameTracker::~BeginFrameTracker() {
@@ -35,9 +35,9 @@ void BeginFrameTracker::Start(BeginFrameArgs new_args) {
DCHECK(HasFinished())
<< "Tried to start a new frame before finishing an existing frame.";
- current_updated_at_ = base::TimeTicks::NowFromSystemTraceTime();
+ current_updated_at_ = base::TraceTicks::Now();
current_args_ = new_args;
- current_finished_at_ = base::TimeTicks();
+ current_finished_at_ = base::TraceTicks();
// TODO(mithro): Add UMA tracking of delta between current_updated_at_ time
// and the new_args.frame_time argument. This will give us how long after a
@@ -54,7 +54,7 @@ const BeginFrameArgs& BeginFrameTracker::Current() const {
void BeginFrameTracker::Finish() {
DCHECK(!HasFinished()) << "Tried to finish an already finished frame";
- current_finished_at_ = base::TimeTicks::NowFromSystemTraceTime();
+ current_finished_at_ = base::TraceTicks::Now();
TRACE_EVENT_ASYNC_END0(TRACE_DISABLED_BY_DEFAULT("cc.debug.scheduler.frames"),
location_string_.c_str(),
current_args_.frame_time.ToInternalValue());
@@ -81,8 +81,10 @@ base::TimeDelta BeginFrameTracker::Interval() const {
void BeginFrameTracker::AsValueInto(
base::TimeTicks now,
base::trace_event::TracedValue* state) const {
- state->SetInteger("updated_at_us", current_updated_at_.ToInternalValue());
- state->SetInteger("finished_at_us", current_finished_at_.ToInternalValue());
+ state->SetInteger("updated_at_us", (current_updated_at_ - base::TraceTicks())
+ .InMicroseconds());
+ state->SetInteger("finished_at_us", (current_finished_at_ -
+ base::TraceTicks()).InMicroseconds());
if (HasFinished()) {
state->SetString("state", "FINISHED");
state->BeginDictionary("current_args_");
« no previous file with comments | « cc/scheduler/begin_frame_tracker.h ('k') | components/tracing/child_trace_message_filter.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698