OLD | NEW |
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 "content/renderer/scheduler/renderer_scheduler_impl.h" | 5 #include "content/renderer/scheduler/renderer_scheduler_impl.h" |
6 | 6 |
7 #include "base/bind.h" | 7 #include "base/bind.h" |
8 #include "base/message_loop/message_loop_proxy.h" | 8 #include "base/message_loop/message_loop_proxy.h" |
9 #include "base/trace_event/trace_event.h" | 9 #include "base/trace_event/trace_event.h" |
10 #include "base/trace_event/trace_event_argument.h" | 10 #include "base/trace_event/trace_event_argument.h" |
(...skipping 320 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
331 case NORMAL_PRIORITY_POLICY: | 331 case NORMAL_PRIORITY_POLICY: |
332 return "normal"; | 332 return "normal"; |
333 case COMPOSITOR_PRIORITY_POLICY: | 333 case COMPOSITOR_PRIORITY_POLICY: |
334 return "compositor"; | 334 return "compositor"; |
335 default: | 335 default: |
336 NOTREACHED(); | 336 NOTREACHED(); |
337 return nullptr; | 337 return nullptr; |
338 } | 338 } |
339 } | 339 } |
340 | 340 |
341 scoped_refptr<base::debug::ConvertableToTraceFormat> | 341 scoped_refptr<base::trace_event::ConvertableToTraceFormat> |
342 RendererSchedulerImpl::AsValueLocked(base::TimeTicks optional_now) const { | 342 RendererSchedulerImpl::AsValueLocked(base::TimeTicks optional_now) const { |
343 DCHECK(main_thread_checker_.CalledOnValidThread()); | 343 DCHECK(main_thread_checker_.CalledOnValidThread()); |
344 incoming_signals_lock_.AssertAcquired(); | 344 incoming_signals_lock_.AssertAcquired(); |
345 | 345 |
346 if (optional_now.is_null()) | 346 if (optional_now.is_null()) |
347 optional_now = Now(); | 347 optional_now = Now(); |
348 scoped_refptr<base::debug::TracedValue> state = | 348 scoped_refptr<base::trace_event::TracedValue> state = |
349 new base::debug::TracedValue(); | 349 new base::trace_event::TracedValue(); |
350 | 350 |
351 state->SetString("current_policy", PolicyToString(current_policy_)); | 351 state->SetString("current_policy", PolicyToString(current_policy_)); |
352 state->SetDouble("now", (optional_now - base::TimeTicks()).InMillisecondsF()); | 352 state->SetDouble("now", (optional_now - base::TimeTicks()).InMillisecondsF()); |
353 state->SetDouble("last_input_time", | 353 state->SetDouble("last_input_time", |
354 (last_input_time_ - base::TimeTicks()).InMillisecondsF()); | 354 (last_input_time_ - base::TimeTicks()).InMillisecondsF()); |
355 state->SetDouble( | 355 state->SetDouble( |
356 "estimated_next_frame_begin", | 356 "estimated_next_frame_begin", |
357 (estimated_next_frame_begin_ - base::TimeTicks()).InMillisecondsF()); | 357 (estimated_next_frame_begin_ - base::TimeTicks()).InMillisecondsF()); |
358 | 358 |
359 return state; | 359 return state; |
360 } | 360 } |
361 | 361 |
362 } // namespace content | 362 } // namespace content |
OLD | NEW |