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

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

Issue 6342018: Fix a teardown hang caused by an Abort() call while there is a pending read. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix DCHECK so it allows a state transition for teardown. Created 9 years, 11 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 | webkit/glue/media/buffered_data_source.h » ('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) 2010 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2010 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 // TODO(scherkus): clean up PipelineImpl... too many crazy function names, 5 // TODO(scherkus): clean up PipelineImpl... too many crazy function names,
6 // potential deadlocks, etc... 6 // potential deadlocks, etc...
7 7
8 #include "base/callback.h" 8 #include "base/callback.h"
9 #include "base/compiler_specific.h" 9 #include "base/compiler_specific.h"
10 #include "base/stl_util-inl.h" 10 #include "base/stl_util-inl.h"
(...skipping 359 matching lines...) Expand 10 before | Expand all | Expand 10 after
370 } 370 }
371 371
372 // static 372 // static
373 PipelineImpl::State PipelineImpl::FindNextState(State current) { 373 PipelineImpl::State PipelineImpl::FindNextState(State current) {
374 // TODO(scherkus): refactor InitializeTask() to make use of this function. 374 // TODO(scherkus): refactor InitializeTask() to make use of this function.
375 if (current == kPausing) { 375 if (current == kPausing) {
376 return kFlushing; 376 return kFlushing;
377 } else if (current == kFlushing) { 377 } else if (current == kFlushing) {
378 // We will always honor Seek() before Stop(). This is based on the 378 // We will always honor Seek() before Stop(). This is based on the
379 // assumption that we never accept Seek() after Stop(). 379 // assumption that we never accept Seek() after Stop().
380 DCHECK(IsPipelineSeeking() || IsPipelineStopPending()); 380 DCHECK(IsPipelineSeeking() ||
381 IsPipelineStopPending() ||
382 IsPipelineTearingDown());
381 return IsPipelineSeeking() ? kSeeking : kStopping; 383 return IsPipelineSeeking() ? kSeeking : kStopping;
382 } else if (current == kSeeking) { 384 } else if (current == kSeeking) {
383 return kStarting; 385 return kStarting;
384 } else if (current == kStarting) { 386 } else if (current == kStarting) {
385 return kStarted; 387 return kStarted;
386 } else if (current == kStopping) { 388 } else if (current == kStopping) {
387 return error_caused_teardown_ ? kError : kStopped; 389 return error_caused_teardown_ ? kError : kStopped;
388 } else { 390 } else {
389 return current; 391 return current;
390 } 392 }
(...skipping 773 matching lines...) Expand 10 before | Expand all | Expand 10 after
1164 case kStopping: 1166 case kStopping:
1165 case kStopped: 1167 case kStopped:
1166 NOTREACHED() << "Unexpected state for teardown: " << state_; 1168 NOTREACHED() << "Unexpected state for teardown: " << state_;
1167 break; 1169 break;
1168 // default: intentionally left out to force new states to cause compiler 1170 // default: intentionally left out to force new states to cause compiler
1169 // errors. 1171 // errors.
1170 }; 1172 };
1171 } 1173 }
1172 1174
1173 } // namespace media 1175 } // namespace media
OLDNEW
« no previous file with comments | « no previous file | webkit/glue/media/buffered_data_source.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698