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

Side by Side Diff: cc/scheduler/begin_frame_source.cc

Issue 879913002: mechanical rename of base::debug -> base::trace_event for /cc (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@move_trace_part3
Patch Set: Edited a comment Created 5 years, 10 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 | « cc/scheduler/begin_frame_source.h ('k') | cc/scheduler/begin_frame_source_unittest.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 #include "cc/scheduler/begin_frame_source.h" 5 #include "cc/scheduler/begin_frame_source.h"
6 6
7 #include "base/auto_reset.h" 7 #include "base/auto_reset.h"
8 #include "base/location.h" 8 #include "base/location.h"
9 #include "base/logging.h" 9 #include "base/logging.h"
10 #include "base/strings/string_number_conversions.h" 10 #include "base/strings/string_number_conversions.h"
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after
46 DCHECK(args.frame_time >= last_begin_frame_args_.frame_time); 46 DCHECK(args.frame_time >= last_begin_frame_args_.frame_time);
47 bool used = OnBeginFrameMixInDelegate(args); 47 bool used = OnBeginFrameMixInDelegate(args);
48 if (used) { 48 if (used) {
49 last_begin_frame_args_ = args; 49 last_begin_frame_args_ = args;
50 } else { 50 } else {
51 ++dropped_begin_frame_args_; 51 ++dropped_begin_frame_args_;
52 } 52 }
53 } 53 }
54 54
55 void BeginFrameObserverMixIn::AsValueInto( 55 void BeginFrameObserverMixIn::AsValueInto(
56 base::debug::TracedValue* dict) const { 56 base::trace_event::TracedValue* dict) const {
57 dict->BeginDictionary("last_begin_frame_args_"); 57 dict->BeginDictionary("last_begin_frame_args_");
58 last_begin_frame_args_.AsValueInto(dict); 58 last_begin_frame_args_.AsValueInto(dict);
59 dict->EndDictionary(); 59 dict->EndDictionary();
60 dict->SetInteger("dropped_begin_frame_args_", dropped_begin_frame_args_); 60 dict->SetInteger("dropped_begin_frame_args_", dropped_begin_frame_args_);
61 } 61 }
62 62
63 // BeginFrameSourceMixIn ------------------------------------------------------ 63 // BeginFrameSourceMixIn ------------------------------------------------------
64 BeginFrameSourceMixIn::BeginFrameSourceMixIn() 64 BeginFrameSourceMixIn::BeginFrameSourceMixIn()
65 : observer_(NULL), 65 : observer_(NULL),
66 needs_begin_frames_(false), 66 needs_begin_frames_(false),
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after
110 "current observer", 110 "current observer",
111 observer_, 111 observer_,
112 "args", 112 "args",
113 args.AsValue()); 113 args.AsValue());
114 if (observer_) { 114 if (observer_) {
115 return observer_->OnBeginFrame(args); 115 return observer_->OnBeginFrame(args);
116 } 116 }
117 } 117 }
118 118
119 // Tracing support 119 // Tracing support
120 void BeginFrameSourceMixIn::AsValueInto(base::debug::TracedValue* dict) const { 120 void BeginFrameSourceMixIn::AsValueInto(
121 base::trace_event::TracedValue* dict) const {
121 // As the observer might try to trace the source, prevent an infinte loop 122 // As the observer might try to trace the source, prevent an infinte loop
122 // from occuring. 123 // from occuring.
123 if (inside_as_value_into_) { 124 if (inside_as_value_into_) {
124 dict->SetString("observer", "<loop detected>"); 125 dict->SetString("observer", "<loop detected>");
125 return; 126 return;
126 } 127 }
127 128
128 if (observer_) { 129 if (observer_) {
129 base::AutoReset<bool> prevent_loops( 130 base::AutoReset<bool> prevent_loops(
130 const_cast<bool*>(&inside_as_value_into_), true); 131 const_cast<bool*>(&inside_as_value_into_), true);
(...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after
191 // BeginFrameSource support 192 // BeginFrameSource support
192 193
193 void BackToBackBeginFrameSource::DidFinishFrame(size_t remaining_frames) { 194 void BackToBackBeginFrameSource::DidFinishFrame(size_t remaining_frames) {
194 if (remaining_frames == 0) { 195 if (remaining_frames == 0) {
195 OnNeedsBeginFramesChange(NeedsBeginFrames()); 196 OnNeedsBeginFramesChange(NeedsBeginFrames());
196 } 197 }
197 } 198 }
198 199
199 // Tracing support 200 // Tracing support
200 void BackToBackBeginFrameSource::AsValueInto( 201 void BackToBackBeginFrameSource::AsValueInto(
201 base::debug::TracedValue* dict) const { 202 base::trace_event::TracedValue* dict) const {
202 dict->SetString("type", "BackToBackBeginFrameSource"); 203 dict->SetString("type", "BackToBackBeginFrameSource");
203 BeginFrameSourceMixIn::AsValueInto(dict); 204 BeginFrameSourceMixIn::AsValueInto(dict);
204 dict->SetBoolean("send_begin_frame_posted_", send_begin_frame_posted_); 205 dict->SetBoolean("send_begin_frame_posted_", send_begin_frame_posted_);
205 } 206 }
206 207
207 // SyntheticBeginFrameSource --------------------------------------------- 208 // SyntheticBeginFrameSource ---------------------------------------------
208 scoped_ptr<SyntheticBeginFrameSource> SyntheticBeginFrameSource::Create( 209 scoped_ptr<SyntheticBeginFrameSource> SyntheticBeginFrameSource::Create(
209 base::SingleThreadTaskRunner* task_runner, 210 base::SingleThreadTaskRunner* task_runner,
210 base::TimeTicks initial_vsync_timebase, 211 base::TimeTicks initial_vsync_timebase,
211 base::TimeDelta initial_vsync_interval) { 212 base::TimeDelta initial_vsync_interval) {
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after
263 CreateBeginFrameArgs(missed_tick_time, BeginFrameArgs::MISSED)); 264 CreateBeginFrameArgs(missed_tick_time, BeginFrameArgs::MISSED));
264 } 265 }
265 } 266 }
266 267
267 bool SyntheticBeginFrameSource::NeedsBeginFrames() const { 268 bool SyntheticBeginFrameSource::NeedsBeginFrames() const {
268 return time_source_->Active(); 269 return time_source_->Active();
269 } 270 }
270 271
271 // Tracing support 272 // Tracing support
272 void SyntheticBeginFrameSource::AsValueInto( 273 void SyntheticBeginFrameSource::AsValueInto(
273 base::debug::TracedValue* dict) const { 274 base::trace_event::TracedValue* dict) const {
274 dict->SetString("type", "SyntheticBeginFrameSource"); 275 dict->SetString("type", "SyntheticBeginFrameSource");
275 BeginFrameSourceMixIn::AsValueInto(dict); 276 BeginFrameSourceMixIn::AsValueInto(dict);
276 277
277 dict->BeginDictionary("time_source"); 278 dict->BeginDictionary("time_source");
278 time_source_->AsValueInto(dict); 279 time_source_->AsValueInto(dict);
279 dict->EndDictionary(); 280 dict->EndDictionary();
280 } 281 }
281 282
282 // BeginFrameSourceMultiplexer ------------------------------------------- 283 // BeginFrameSourceMultiplexer -------------------------------------------
283 scoped_ptr<BeginFrameSourceMultiplexer> BeginFrameSourceMultiplexer::Create() { 284 scoped_ptr<BeginFrameSourceMultiplexer> BeginFrameSourceMultiplexer::Create() {
(...skipping 148 matching lines...) Expand 10 before | Expand all | Expand 10 after
432 active_source_, 433 active_source_,
433 "remaining_frames", 434 "remaining_frames",
434 remaining_frames); 435 remaining_frames);
435 if (active_source_) { 436 if (active_source_) {
436 active_source_->DidFinishFrame(remaining_frames); 437 active_source_->DidFinishFrame(remaining_frames);
437 } 438 }
438 } 439 }
439 440
440 // Tracing support 441 // Tracing support
441 void BeginFrameSourceMultiplexer::AsValueInto( 442 void BeginFrameSourceMultiplexer::AsValueInto(
442 base::debug::TracedValue* dict) const { 443 base::trace_event::TracedValue* dict) const {
443 dict->SetString("type", "BeginFrameSourceMultiplexer"); 444 dict->SetString("type", "BeginFrameSourceMultiplexer");
444 445
445 dict->SetInteger("minimum_interval_us", minimum_interval_.InMicroseconds()); 446 dict->SetInteger("minimum_interval_us", minimum_interval_.InMicroseconds());
446 if (observer_) { 447 if (observer_) {
447 dict->BeginDictionary("last_begin_frame_args"); 448 dict->BeginDictionary("last_begin_frame_args");
448 observer_->LastUsedBeginFrameArgs().AsValueInto(dict); 449 observer_->LastUsedBeginFrameArgs().AsValueInto(dict);
449 dict->EndDictionary(); 450 dict->EndDictionary();
450 } 451 }
451 452
452 if (active_source_) { 453 if (active_source_) {
(...skipping 29 matching lines...) Expand all
482 if (!observer_->LastUsedBeginFrameArgs().IsValid()) 483 if (!observer_->LastUsedBeginFrameArgs().IsValid())
483 return true; 484 return true;
484 485
485 // Only allow new args have a *strictly bigger* frame_time value and statisfy 486 // Only allow new args have a *strictly bigger* frame_time value and statisfy
486 // minimum interval requirement. 487 // minimum interval requirement.
487 return (args.frame_time >= 488 return (args.frame_time >=
488 observer_->LastUsedBeginFrameArgs().frame_time + minimum_interval_); 489 observer_->LastUsedBeginFrameArgs().frame_time + minimum_interval_);
489 } 490 }
490 491
491 } // namespace cc 492 } // namespace cc
OLDNEW
« no previous file with comments | « cc/scheduler/begin_frame_source.h ('k') | cc/scheduler/begin_frame_source_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698