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

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

Issue 10855167: Downgrade media::Pipeline CHECKs into NOTREACHED() + no-op. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 4 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 | Annotate | Revision Log
« no previous file with comments | « no previous file | no next file » | 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/pipeline.h" 5 #include "media/base/pipeline.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 8
9 #include "base/bind.h" 9 #include "base/bind.h"
10 #include "base/callback.h" 10 #include "base/callback.h"
(...skipping 92 matching lines...) Expand 10 before | Expand all | Expand 10 after
103 103
104 media_log_->AddEvent( 104 media_log_->AddEvent(
105 media_log_->CreateEvent(MediaLogEvent::PIPELINE_DESTROYED)); 105 media_log_->CreateEvent(MediaLogEvent::PIPELINE_DESTROYED));
106 } 106 }
107 107
108 void Pipeline::Start(scoped_ptr<FilterCollection> collection, 108 void Pipeline::Start(scoped_ptr<FilterCollection> collection,
109 const PipelineStatusCB& ended_cb, 109 const PipelineStatusCB& ended_cb,
110 const PipelineStatusCB& error_cb, 110 const PipelineStatusCB& error_cb,
111 const PipelineStatusCB& start_cb) { 111 const PipelineStatusCB& start_cb) {
112 base::AutoLock auto_lock(lock_); 112 base::AutoLock auto_lock(lock_);
113 CHECK(!running_) << "Media pipeline is already running"; 113 if (running_) {
Ami GONE FROM CHROMIUM 2012/08/15 05:08:11 wait, what? How can this happen?
scherkus (not reviewing) 2012/08/15 05:08:59 being silly (i.e., calling Start() twice)
114 NOTREACHED() << "Media pipeline is already running";
115 return;
116 }
114 117
115 running_ = true; 118 running_ = true;
116 message_loop_->PostTask(FROM_HERE, base::Bind( 119 message_loop_->PostTask(FROM_HERE, base::Bind(
117 &Pipeline::StartTask, this, base::Passed(&collection), 120 &Pipeline::StartTask, this, base::Passed(&collection),
118 ended_cb, error_cb, start_cb)); 121 ended_cb, error_cb, start_cb));
119 } 122 }
120 123
121 void Pipeline::Stop(const base::Closure& stop_cb) { 124 void Pipeline::Stop(const base::Closure& stop_cb) {
122 base::AutoLock auto_lock(lock_); 125 base::AutoLock auto_lock(lock_);
123 message_loop_->PostTask(FROM_HERE, base::Bind( 126 message_loop_->PostTask(FROM_HERE, base::Bind(
124 &Pipeline::StopTask, this, stop_cb)); 127 &Pipeline::StopTask, this, stop_cb));
125 } 128 }
126 129
127 void Pipeline::Seek(TimeDelta time, const PipelineStatusCB& seek_cb) { 130 void Pipeline::Seek(TimeDelta time, const PipelineStatusCB& seek_cb) {
128 base::AutoLock auto_lock(lock_); 131 base::AutoLock auto_lock(lock_);
129 CHECK(running_) << "Media pipeline isn't running"; 132 if (!running_) {
133 NOTREACHED() << "Media pipeline isn't running";
134 return;
135 }
130 136
131 message_loop_->PostTask(FROM_HERE, base::Bind( 137 message_loop_->PostTask(FROM_HERE, base::Bind(
132 &Pipeline::SeekTask, this, time, seek_cb)); 138 &Pipeline::SeekTask, this, time, seek_cb));
133 } 139 }
134 140
135 bool Pipeline::IsRunning() const { 141 bool Pipeline::IsRunning() const {
136 base::AutoLock auto_lock(lock_); 142 base::AutoLock auto_lock(lock_);
137 return running_; 143 return running_;
138 } 144 }
139 145
(...skipping 1071 matching lines...) Expand 10 before | Expand all | Expand 10 after
1211 void Pipeline::StartClockIfWaitingForTimeUpdate_Locked() { 1217 void Pipeline::StartClockIfWaitingForTimeUpdate_Locked() {
1212 lock_.AssertAcquired(); 1218 lock_.AssertAcquired();
1213 if (!waiting_for_clock_update_) 1219 if (!waiting_for_clock_update_)
1214 return; 1220 return;
1215 1221
1216 waiting_for_clock_update_ = false; 1222 waiting_for_clock_update_ = false;
1217 clock_->Play(); 1223 clock_->Play();
1218 } 1224 }
1219 1225
1220 } // namespace media 1226 } // namespace media
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698