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

Side by Side Diff: media/base/serial_runner.cc

Issue 1544313002: Convert Pass()→std::move() in //media (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 12 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 | « media/base/pipeline_unittest.cc ('k') | media/base/text_renderer.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 (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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 "media/base/serial_runner.h" 5 #include "media/base/serial_runner.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/callback_helpers.h" 8 #include "base/callback_helpers.h"
9 #include "base/location.h" 9 #include "base/location.h"
10 #include "base/single_thread_task_runner.h" 10 #include "base/single_thread_task_runner.h"
(...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after
84 84
85 RunNextInSeries(PIPELINE_OK); 85 RunNextInSeries(PIPELINE_OK);
86 } 86 }
87 87
88 SerialRunner::~SerialRunner() {} 88 SerialRunner::~SerialRunner() {}
89 89
90 scoped_ptr<SerialRunner> SerialRunner::Run( 90 scoped_ptr<SerialRunner> SerialRunner::Run(
91 const Queue& bound_fns, const PipelineStatusCB& done_cb) { 91 const Queue& bound_fns, const PipelineStatusCB& done_cb) {
92 scoped_ptr<SerialRunner> callback_series( 92 scoped_ptr<SerialRunner> callback_series(
93 new SerialRunner(bound_fns, done_cb)); 93 new SerialRunner(bound_fns, done_cb));
94 return callback_series.Pass(); 94 return callback_series;
95 } 95 }
96 96
97 void SerialRunner::RunNextInSeries(PipelineStatus last_status) { 97 void SerialRunner::RunNextInSeries(PipelineStatus last_status) {
98 DCHECK(task_runner_->BelongsToCurrentThread()); 98 DCHECK(task_runner_->BelongsToCurrentThread());
99 DCHECK(!done_cb_.is_null()); 99 DCHECK(!done_cb_.is_null());
100 100
101 if (bound_fns_.empty() || last_status != PIPELINE_OK) { 101 if (bound_fns_.empty() || last_status != PIPELINE_OK) {
102 base::ResetAndReturn(&done_cb_).Run(last_status); 102 base::ResetAndReturn(&done_cb_).Run(last_status);
103 return; 103 return;
104 } 104 }
105 105
106 BoundPipelineStatusCB bound_fn = bound_fns_.Pop(); 106 BoundPipelineStatusCB bound_fn = bound_fns_.Pop();
107 bound_fn.Run(base::Bind( 107 bound_fn.Run(base::Bind(
108 &RunOnTaskRunner, 108 &RunOnTaskRunner,
109 task_runner_, 109 task_runner_,
110 base::Bind(&SerialRunner::RunNextInSeries, weak_factory_.GetWeakPtr()))); 110 base::Bind(&SerialRunner::RunNextInSeries, weak_factory_.GetWeakPtr())));
111 } 111 }
112 112
113 } // namespace media 113 } // namespace media
OLDNEW
« no previous file with comments | « media/base/pipeline_unittest.cc ('k') | media/base/text_renderer.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698