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

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

Issue 1455023002: cc: Replace Pass() with std::move() in some subdirs. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@pass-cc
Patch Set: pass-cc2: . Created 5 years, 1 month 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.cc ('k') | cc/scheduler/scheduler_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 24 matching lines...) Expand all
35 scoped_ptr<CompositorTimingHistory> compositor_timing_history) { 35 scoped_ptr<CompositorTimingHistory> compositor_timing_history) {
36 scoped_ptr<SyntheticBeginFrameSource> synthetic_frame_source; 36 scoped_ptr<SyntheticBeginFrameSource> synthetic_frame_source;
37 if (!settings.use_external_begin_frame_source) { 37 if (!settings.use_external_begin_frame_source) {
38 synthetic_frame_source = SyntheticBeginFrameSource::Create( 38 synthetic_frame_source = SyntheticBeginFrameSource::Create(
39 task_runner, BeginFrameArgs::DefaultInterval()); 39 task_runner, BeginFrameArgs::DefaultInterval());
40 } 40 }
41 scoped_ptr<BackToBackBeginFrameSource> unthrottled_frame_source = 41 scoped_ptr<BackToBackBeginFrameSource> unthrottled_frame_source =
42 BackToBackBeginFrameSource::Create(task_runner); 42 BackToBackBeginFrameSource::Create(task_runner);
43 return make_scoped_ptr(new Scheduler( 43 return make_scoped_ptr(new Scheduler(
44 client, settings, layer_tree_host_id, task_runner, external_frame_source, 44 client, settings, layer_tree_host_id, task_runner, external_frame_source,
45 synthetic_frame_source.Pass(), unthrottled_frame_source.Pass(), 45 std::move(synthetic_frame_source), std::move(unthrottled_frame_source),
46 compositor_timing_history.Pass())); 46 std::move(compositor_timing_history)));
47 } 47 }
48 48
49 Scheduler::Scheduler( 49 Scheduler::Scheduler(
50 SchedulerClient* client, 50 SchedulerClient* client,
51 const SchedulerSettings& settings, 51 const SchedulerSettings& settings,
52 int layer_tree_host_id, 52 int layer_tree_host_id,
53 base::SingleThreadTaskRunner* task_runner, 53 base::SingleThreadTaskRunner* task_runner,
54 BeginFrameSource* external_frame_source, 54 BeginFrameSource* external_frame_source,
55 scoped_ptr<SyntheticBeginFrameSource> synthetic_frame_source, 55 scoped_ptr<SyntheticBeginFrameSource> synthetic_frame_source,
56 scoped_ptr<BackToBackBeginFrameSource> unthrottled_frame_source, 56 scoped_ptr<BackToBackBeginFrameSource> unthrottled_frame_source,
57 scoped_ptr<CompositorTimingHistory> compositor_timing_history) 57 scoped_ptr<CompositorTimingHistory> compositor_timing_history)
58 : settings_(settings), 58 : settings_(settings),
59 client_(client), 59 client_(client),
60 layer_tree_host_id_(layer_tree_host_id), 60 layer_tree_host_id_(layer_tree_host_id),
61 task_runner_(task_runner), 61 task_runner_(task_runner),
62 external_frame_source_(external_frame_source), 62 external_frame_source_(external_frame_source),
63 synthetic_frame_source_(synthetic_frame_source.Pass()), 63 synthetic_frame_source_(std::move(synthetic_frame_source)),
64 unthrottled_frame_source_(unthrottled_frame_source.Pass()), 64 unthrottled_frame_source_(std::move(unthrottled_frame_source)),
65 frame_source_(BeginFrameSourceMultiplexer::Create()), 65 frame_source_(BeginFrameSourceMultiplexer::Create()),
66 throttle_frame_production_(false), 66 throttle_frame_production_(false),
67 compositor_timing_history_(compositor_timing_history.Pass()), 67 compositor_timing_history_(std::move(compositor_timing_history)),
68 begin_impl_frame_deadline_mode_( 68 begin_impl_frame_deadline_mode_(
69 SchedulerStateMachine::BEGIN_IMPL_FRAME_DEADLINE_MODE_NONE), 69 SchedulerStateMachine::BEGIN_IMPL_FRAME_DEADLINE_MODE_NONE),
70 begin_impl_frame_tracker_(BEGINFRAMETRACKER_FROM_HERE), 70 begin_impl_frame_tracker_(BEGINFRAMETRACKER_FROM_HERE),
71 state_machine_(settings), 71 state_machine_(settings),
72 inside_process_scheduled_actions_(false), 72 inside_process_scheduled_actions_(false),
73 inside_action_(SchedulerStateMachine::ACTION_NONE), 73 inside_action_(SchedulerStateMachine::ACTION_NONE),
74 weak_factory_(this) { 74 weak_factory_(this) {
75 TRACE_EVENT1("cc", "Scheduler::Scheduler", "settings", settings_.AsValue()); 75 TRACE_EVENT1("cc", "Scheduler::Scheduler", "settings", settings_.AsValue());
76 DCHECK(client_); 76 DCHECK(client_);
77 DCHECK(!state_machine_.BeginFrameNeeded()); 77 DCHECK(!state_machine_.BeginFrameNeeded());
(...skipping 765 matching lines...) Expand 10 before | Expand all | Expand 10 after
843 } 843 }
844 844
845 bool Scheduler::IsBeginMainFrameSentOrStarted() const { 845 bool Scheduler::IsBeginMainFrameSentOrStarted() const {
846 return (state_machine_.begin_main_frame_state() == 846 return (state_machine_.begin_main_frame_state() ==
847 SchedulerStateMachine::BEGIN_MAIN_FRAME_STATE_SENT || 847 SchedulerStateMachine::BEGIN_MAIN_FRAME_STATE_SENT ||
848 state_machine_.begin_main_frame_state() == 848 state_machine_.begin_main_frame_state() ==
849 SchedulerStateMachine::BEGIN_MAIN_FRAME_STATE_STARTED); 849 SchedulerStateMachine::BEGIN_MAIN_FRAME_STATE_STARTED);
850 } 850 }
851 851
852 } // namespace cc 852 } // namespace cc
OLDNEW
« no previous file with comments | « cc/scheduler/begin_frame_source.cc ('k') | cc/scheduler/scheduler_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698