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

Side by Side Diff: cc/scheduler/begin_frame_source.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/resources/video_resource_updater_unittest.cc ('k') | cc/scheduler/scheduler.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 192 matching lines...) Expand 10 before | Expand all | Expand 10 after
203 BeginFrameSourceBase::AsValueInto(dict); 203 BeginFrameSourceBase::AsValueInto(dict);
204 dict->SetBoolean("send_begin_frame_posted_", send_begin_frame_posted_); 204 dict->SetBoolean("send_begin_frame_posted_", send_begin_frame_posted_);
205 } 205 }
206 206
207 // SyntheticBeginFrameSource --------------------------------------------- 207 // SyntheticBeginFrameSource ---------------------------------------------
208 scoped_ptr<SyntheticBeginFrameSource> SyntheticBeginFrameSource::Create( 208 scoped_ptr<SyntheticBeginFrameSource> SyntheticBeginFrameSource::Create(
209 base::SingleThreadTaskRunner* task_runner, 209 base::SingleThreadTaskRunner* task_runner,
210 base::TimeDelta initial_vsync_interval) { 210 base::TimeDelta initial_vsync_interval) {
211 scoped_ptr<DelayBasedTimeSource> time_source = 211 scoped_ptr<DelayBasedTimeSource> time_source =
212 DelayBasedTimeSource::Create(initial_vsync_interval, task_runner); 212 DelayBasedTimeSource::Create(initial_vsync_interval, task_runner);
213 return make_scoped_ptr(new SyntheticBeginFrameSource(time_source.Pass())); 213 return make_scoped_ptr(new SyntheticBeginFrameSource(std::move(time_source)));
214 } 214 }
215 215
216 SyntheticBeginFrameSource::SyntheticBeginFrameSource( 216 SyntheticBeginFrameSource::SyntheticBeginFrameSource(
217 scoped_ptr<DelayBasedTimeSource> time_source) 217 scoped_ptr<DelayBasedTimeSource> time_source)
218 : BeginFrameSourceBase(), time_source_(time_source.Pass()) { 218 : BeginFrameSourceBase(), time_source_(std::move(time_source)) {
219 time_source_->SetActive(false); 219 time_source_->SetActive(false);
220 time_source_->SetClient(this); 220 time_source_->SetClient(this);
221 } 221 }
222 222
223 SyntheticBeginFrameSource::~SyntheticBeginFrameSource() { 223 SyntheticBeginFrameSource::~SyntheticBeginFrameSource() {
224 time_source_->SetActive(false); 224 time_source_->SetActive(false);
225 } 225 }
226 226
227 void SyntheticBeginFrameSource::OnUpdateVSyncParameters( 227 void SyntheticBeginFrameSource::OnUpdateVSyncParameters(
228 base::TimeTicks new_vsync_timebase, 228 base::TimeTicks new_vsync_timebase,
(...skipping 231 matching lines...) Expand 10 before | Expand all | Expand 10 after
460 if (!observer_->LastUsedBeginFrameArgs().IsValid()) 460 if (!observer_->LastUsedBeginFrameArgs().IsValid())
461 return true; 461 return true;
462 462
463 // Only allow new args have a *strictly bigger* frame_time value and statisfy 463 // Only allow new args have a *strictly bigger* frame_time value and statisfy
464 // minimum interval requirement. 464 // minimum interval requirement.
465 return (args.frame_time >= 465 return (args.frame_time >=
466 observer_->LastUsedBeginFrameArgs().frame_time + minimum_interval_); 466 observer_->LastUsedBeginFrameArgs().frame_time + minimum_interval_);
467 } 467 }
468 468
469 } // namespace cc 469 } // namespace cc
OLDNEW
« no previous file with comments | « cc/resources/video_resource_updater_unittest.cc ('k') | cc/scheduler/scheduler.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698