Commit d0ebc15e authored by scherkus@chromium.org's avatar scherkus@chromium.org

Replace VideoRendererImpl's kError state with a CHECK().

If the process is unable to create a new thread we've got bigger issues
to deal with than reporting an error. A CHECK() will also give us
a sense for how often this happens in the wild.

BUG=110814

Review URL: https://codereview.chromium.org/276593007

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@269621 0039d316-1c4b-4281-b951-d872f2087c98
parent c8333331
......@@ -60,7 +60,7 @@ void VideoRendererImpl::Play(const base::Closure& callback) {
void VideoRendererImpl::Pause(const base::Closure& callback) {
DCHECK(task_runner_->BelongsToCurrentThread());
base::AutoLock auto_lock(lock_);
DCHECK(state_ != kUninitialized || state_ == kError);
DCHECK_NE(state_, kUninitialized);
state_ = kPaused;
callback.Run();
}
......@@ -212,12 +212,7 @@ void VideoRendererImpl::OnVideoFrameStreamInitialized(bool success) {
state_ = kFlushed;
// Create our video thread.
if (!base::PlatformThread::Create(0, this, &thread_)) {
NOTREACHED() << "Video thread creation failed";
state_ = kError;
base::ResetAndReturn(&init_cb_).Run(PIPELINE_ERROR_INITIALIZATION_FAILED);
return;
}
CHECK(base::PlatformThread::Create(0, this, &thread_));
#if defined(OS_WIN)
// Bump up our priority so our sleeping is more accurate.
......@@ -363,7 +358,7 @@ void VideoRendererImpl::FrameReady(VideoFrameStream::Status status,
// Already-queued VideoFrameStream ReadCB's can fire after various state
// transitions have happened; in that case just drop those frames immediately.
if (state_ == kStopped || state_ == kError || state_ == kFlushing)
if (state_ == kStopped || state_ == kFlushing)
return;
if (!frame.get()) {
......@@ -468,7 +463,6 @@ void VideoRendererImpl::AttemptRead_Locked() {
case kFlushing:
case kFlushed:
case kStopped:
case kError:
return;
}
}
......
......@@ -154,7 +154,7 @@ class MEDIA_EXPORT VideoRendererImpl
base::ConditionVariable frame_available_;
// State transition Diagram of this class:
// [kUninitialized] -------> [kError]
// [kUninitialized]
// |
// | Initialize()
// [kInitializing]
......@@ -173,7 +173,7 @@ class MEDIA_EXPORT VideoRendererImpl
// | Pause() ^ Pause()
// | |
// +-----> [kStopped] [Any state other than]
// [kUninitialized/kError]
// [ kUninitialized ]
// Simple state tracking variable.
enum State {
......@@ -186,7 +186,6 @@ class MEDIA_EXPORT VideoRendererImpl
kPrerolling,
kPlaying,
kStopped,
kError,
};
State state_;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment