OLD | NEW |
1 // Copyright 2011 The Chromium Authors. All rights reserved. | 1 // Copyright 2011 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/scheduler.h" | 5 #include "cc/scheduler/scheduler.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 | 8 |
9 #include "base/auto_reset.h" | 9 #include "base/auto_reset.h" |
10 #include "base/logging.h" | 10 #include "base/logging.h" |
(...skipping 722 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
733 break; | 733 break; |
734 } | 734 } |
735 } while (action != SchedulerStateMachine::ACTION_NONE); | 735 } while (action != SchedulerStateMachine::ACTION_NONE); |
736 | 736 |
737 SetupNextBeginFrameIfNeeded(); | 737 SetupNextBeginFrameIfNeeded(); |
738 client_->DidAnticipatedDrawTimeChange(AnticipatedDrawTime()); | 738 client_->DidAnticipatedDrawTimeChange(AnticipatedDrawTime()); |
739 | 739 |
740 RescheduleBeginImplFrameDeadlineIfNeeded(); | 740 RescheduleBeginImplFrameDeadlineIfNeeded(); |
741 } | 741 } |
742 | 742 |
743 scoped_refptr<base::debug::ConvertableToTraceFormat> Scheduler::AsValue() | 743 scoped_refptr<base::trace_event::ConvertableToTraceFormat> Scheduler::AsValue() |
744 const { | 744 const { |
745 scoped_refptr<base::debug::TracedValue> state = | 745 scoped_refptr<base::trace_event::TracedValue> state = |
746 new base::debug::TracedValue(); | 746 new base::trace_event::TracedValue(); |
747 AsValueInto(state.get()); | 747 AsValueInto(state.get()); |
748 return state; | 748 return state; |
749 } | 749 } |
750 | 750 |
751 void Scheduler::AsValueInto(base::debug::TracedValue* state) const { | 751 void Scheduler::AsValueInto(base::trace_event::TracedValue* state) const { |
752 state->BeginDictionary("state_machine"); | 752 state->BeginDictionary("state_machine"); |
753 state_machine_.AsValueInto(state, Now()); | 753 state_machine_.AsValueInto(state, Now()); |
754 state->EndDictionary(); | 754 state->EndDictionary(); |
755 | 755 |
756 // Only trace frame sources when explicitly enabled - http://crbug.com/420607 | 756 // Only trace frame sources when explicitly enabled - http://crbug.com/420607 |
757 bool frame_tracing_enabled = false; | 757 bool frame_tracing_enabled = false; |
758 TRACE_EVENT_CATEGORY_GROUP_ENABLED( | 758 TRACE_EVENT_CATEGORY_GROUP_ENABLED( |
759 TRACE_DISABLED_BY_DEFAULT("cc.debug.scheduler.frames"), | 759 TRACE_DISABLED_BY_DEFAULT("cc.debug.scheduler.frames"), |
760 &frame_tracing_enabled); | 760 &frame_tracing_enabled); |
761 if (frame_tracing_enabled) { | 761 if (frame_tracing_enabled) { |
(...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
818 } | 818 } |
819 | 819 |
820 bool Scheduler::IsBeginMainFrameSentOrStarted() const { | 820 bool Scheduler::IsBeginMainFrameSentOrStarted() const { |
821 return (state_machine_.commit_state() == | 821 return (state_machine_.commit_state() == |
822 SchedulerStateMachine::COMMIT_STATE_BEGIN_MAIN_FRAME_SENT || | 822 SchedulerStateMachine::COMMIT_STATE_BEGIN_MAIN_FRAME_SENT || |
823 state_machine_.commit_state() == | 823 state_machine_.commit_state() == |
824 SchedulerStateMachine::COMMIT_STATE_BEGIN_MAIN_FRAME_STARTED); | 824 SchedulerStateMachine::COMMIT_STATE_BEGIN_MAIN_FRAME_STARTED); |
825 } | 825 } |
826 | 826 |
827 } // namespace cc | 827 } // namespace cc |
OLD | NEW |