summaryrefslogtreecommitdiffstats
path: root/webkit/glue
diff options
context:
space:
mode:
authorfischman@chromium.org <fischman@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-03-17 22:03:12 +0000
committerfischman@chromium.org <fischman@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-03-17 22:03:12 +0000
commitea431e54446816d680168b7a603fc50663072945 (patch)
tree04aa2dd64a5e7f7e24cef4bfc49f6134c8a9f74c /webkit/glue
parent5b8874a6ca3399ab8950b26b7ddd1f52acc189f1 (diff)
downloadchromium_src-ea431e54446816d680168b7a603fc50663072945.zip
chromium_src-ea431e54446816d680168b7a603fc50663072945.tar.gz
chromium_src-ea431e54446816d680168b7a603fc50663072945.tar.bz2
Use PipelineStatusNotification instead of a condvar for pipeline stopping.
BUG=none TEST={,http/tests/}media layouttests pass. Review URL: http://codereview.chromium.org/6688014 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@78611 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'webkit/glue')
-rw-r--r--webkit/glue/webmediaplayer_impl.cc13
-rw-r--r--webkit/glue/webmediaplayer_impl.h7
2 files changed, 4 insertions, 16 deletions
diff --git a/webkit/glue/webmediaplayer_impl.cc b/webkit/glue/webmediaplayer_impl.cc
index 61bb454..7ac8e76 100644
--- a/webkit/glue/webmediaplayer_impl.cc
+++ b/webkit/glue/webmediaplayer_impl.cc
@@ -281,8 +281,7 @@ WebMediaPlayerImpl::WebMediaPlayerImpl(
seeking_(false),
playback_rate_(0.0f),
client_(client),
- proxy_(NULL),
- pipeline_stopped_(false, false) {
+ proxy_(NULL) {
// Saves the current message loop.
DCHECK(!main_loop_);
main_loop_ = MessageLoop::current();
@@ -884,9 +883,9 @@ void WebMediaPlayerImpl::Destroy() {
// Make sure to kill the pipeline so there's no more media threads running.
// Note: stopping the pipeline might block for a long time.
if (pipeline_) {
- pipeline_->Stop(NewCallback(this,
- &WebMediaPlayerImpl::PipelineStoppedCallback));
- pipeline_stopped_.Wait();
+ media::PipelineStatusNotification note;
+ pipeline_->Stop(note.Callback());
+ note.Wait();
}
message_loop_factory_.reset();
@@ -899,10 +898,6 @@ void WebMediaPlayerImpl::Destroy() {
}
}
-void WebMediaPlayerImpl::PipelineStoppedCallback(PipelineStatus status) {
- pipeline_stopped_.Signal();
-}
-
WebKit::WebMediaPlayerClient* WebMediaPlayerImpl::GetClient() {
DCHECK(MessageLoop::current() == main_loop_);
DCHECK(client_);
diff --git a/webkit/glue/webmediaplayer_impl.h b/webkit/glue/webmediaplayer_impl.h
index ef356b5..400c89e 100644
--- a/webkit/glue/webmediaplayer_impl.h
+++ b/webkit/glue/webmediaplayer_impl.h
@@ -281,10 +281,6 @@ class WebMediaPlayerImpl : public WebKit::WebMediaPlayer,
// Destroy resources held.
void Destroy();
- // Callback executed after |pipeline_| stops which signals Destroy()
- // to continue.
- void PipelineStoppedCallback(media::PipelineStatus status);
-
// Getter method to |client_|.
WebKit::WebMediaPlayerClient* GetClient();
@@ -328,9 +324,6 @@ class WebMediaPlayerImpl : public WebKit::WebMediaPlayer,
scoped_refptr<Proxy> proxy_;
- // Used to block Destroy() until Pipeline::Stop() is completed.
- base::WaitableEvent pipeline_stopped_;
-
#if WEBKIT_USING_CG
scoped_ptr<skia::PlatformCanvas> skia_canvas_;
#endif