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

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

Issue 1778853003: Fold BeginFrameSource::SetClientReady into AddObserver (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@scheduler_always_external
Patch Set: Created 4 years, 9 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/surfaces/surface_manager_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 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 50 matching lines...) Expand 10 before | Expand all | Expand 10 after
61 weak_factory_(this) { 61 weak_factory_(this) {
62 TRACE_EVENT1("cc", "Scheduler::Scheduler", "settings", settings_.AsValue()); 62 TRACE_EVENT1("cc", "Scheduler::Scheduler", "settings", settings_.AsValue());
63 DCHECK(client_); 63 DCHECK(client_);
64 DCHECK(!state_machine_.BeginFrameNeeded()); 64 DCHECK(!state_machine_.BeginFrameNeeded());
65 65
66 begin_retro_frame_closure_ = 66 begin_retro_frame_closure_ =
67 base::Bind(&Scheduler::BeginRetroFrame, weak_factory_.GetWeakPtr()); 67 base::Bind(&Scheduler::BeginRetroFrame, weak_factory_.GetWeakPtr());
68 begin_impl_frame_deadline_closure_ = base::Bind( 68 begin_impl_frame_deadline_closure_ = base::Bind(
69 &Scheduler::OnBeginImplFrameDeadline, weak_factory_.GetWeakPtr()); 69 &Scheduler::OnBeginImplFrameDeadline, weak_factory_.GetWeakPtr());
70 70
71 begin_frame_source_->SetClientReady();
72 ProcessScheduledActions(); 71 ProcessScheduledActions();
73 } 72 }
74 73
75 Scheduler::~Scheduler() { 74 Scheduler::~Scheduler() {
76 if (observing_begin_frame_source_) 75 if (observing_begin_frame_source_)
77 begin_frame_source_->RemoveObserver(this); 76 begin_frame_source_->RemoveObserver(this);
78 } 77 }
79 78
80 base::TimeTicks Scheduler::Now() const { 79 base::TimeTicks Scheduler::Now() const {
81 base::TimeTicks now = base::TimeTicks::Now(); 80 base::TimeTicks now = base::TimeTicks::Now();
(...skipping 770 matching lines...) Expand 10 before | Expand all | Expand 10 after
852 } 851 }
853 852
854 bool Scheduler::IsBeginMainFrameSentOrStarted() const { 853 bool Scheduler::IsBeginMainFrameSentOrStarted() const {
855 return (state_machine_.begin_main_frame_state() == 854 return (state_machine_.begin_main_frame_state() ==
856 SchedulerStateMachine::BEGIN_MAIN_FRAME_STATE_SENT || 855 SchedulerStateMachine::BEGIN_MAIN_FRAME_STATE_SENT ||
857 state_machine_.begin_main_frame_state() == 856 state_machine_.begin_main_frame_state() ==
858 SchedulerStateMachine::BEGIN_MAIN_FRAME_STATE_STARTED); 857 SchedulerStateMachine::BEGIN_MAIN_FRAME_STATE_STARTED);
859 } 858 }
860 859
861 } // namespace cc 860 } // namespace cc
OLDNEW
« no previous file with comments | « cc/scheduler/begin_frame_source.h ('k') | cc/surfaces/surface_manager_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698