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

Unified Diff: webkit/glue/webmediaplayer_impl.cc

Issue 3026043: Full screen video Chromium patch (Closed)
Patch Set: Rename GetClient/SetClient to client/setClient to match WebKit style. Created 10 years, 5 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « webkit/glue/webmediaplayer_impl.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: webkit/glue/webmediaplayer_impl.cc
diff --git a/webkit/glue/webmediaplayer_impl.cc b/webkit/glue/webmediaplayer_impl.cc
index f5b87cf8da1c0302e9c3f1933948acda4b8aa936..2e5090d59561a210137e984eb5e6cfd747139277 100644
--- a/webkit/glue/webmediaplayer_impl.cc
+++ b/webkit/glue/webmediaplayer_impl.cc
@@ -242,12 +242,25 @@ WebMediaPlayerImpl::~WebMediaPlayerImpl() {
}
}
+WebKit::WebMediaPlayerClient* WebMediaPlayerImpl::client() const {
+ // TODO(boliu): Remove these? Need locks?
+ DCHECK(MessageLoop::current() == main_loop_);
+ DCHECK(client_);
+ return client_;
+}
+
+void WebMediaPlayerImpl::setClient(WebKit::WebMediaPlayerClient* new_client) {
+ // TODO(boliu): Remove these? Need locks?
+ DCHECK(MessageLoop::current() == main_loop_);
+ client_ = new_client;
+}
+
void WebMediaPlayerImpl::load(const WebKit::WebURL& url) {
DCHECK(MessageLoop::current() == main_loop_);
DCHECK(proxy_);
// Handle any volume changes that occured before load().
- setVolume(GetClient()->volume());
+ setVolume(client()->volume());
// Initialize the pipeline.
SetNetworkState(WebKit::WebMediaPlayer::Loading);
@@ -299,7 +312,7 @@ void WebMediaPlayerImpl::seek(float seconds) {
// We still have to notify WebKit that time has changed otherwise
// HTMLMediaElement gets into an inconsistent state.
if (pipeline_->GetCurrentTime().ToInternalValue() == 0 && seconds == 0) {
- GetClient()->timeChanged();
+ client()->timeChanged();
return;
}
@@ -569,7 +582,7 @@ void WebMediaPlayerImpl::WillDestroyCurrentMessageLoop() {
void WebMediaPlayerImpl::Repaint() {
DCHECK(MessageLoop::current() == main_loop_);
- GetClient()->repaint();
+ client()->repaint();
}
void WebMediaPlayerImpl::OnPipelineInitialize() {
@@ -612,14 +625,14 @@ void WebMediaPlayerImpl::OnPipelineSeek() {
}
SetReadyState(WebKit::WebMediaPlayer::HaveEnoughData);
- GetClient()->timeChanged();
+ client()->timeChanged();
}
}
void WebMediaPlayerImpl::OnPipelineEnded() {
DCHECK(MessageLoop::current() == main_loop_);
if (pipeline_->GetError() == media::PIPELINE_OK) {
- GetClient()->timeChanged();
+ client()->timeChanged();
}
}
@@ -675,7 +688,7 @@ void WebMediaPlayerImpl::SetNetworkState(
DCHECK(MessageLoop::current() == main_loop_);
// Always notify to ensure client has the latest value.
network_state_ = state;
- GetClient()->networkStateChanged();
+ client()->networkStateChanged();
}
void WebMediaPlayerImpl::SetReadyState(
@@ -683,7 +696,7 @@ void WebMediaPlayerImpl::SetReadyState(
DCHECK(MessageLoop::current() == main_loop_);
// Always notify to ensure client has the latest value.
ready_state_ = state;
- GetClient()->readyStateChanged();
+ client()->readyStateChanged();
}
void WebMediaPlayerImpl::Destroy() {
@@ -708,10 +721,4 @@ void WebMediaPlayerImpl::PipelineStoppedCallback() {
pipeline_stopped_.Signal();
}
-WebKit::WebMediaPlayerClient* WebMediaPlayerImpl::GetClient() {
- DCHECK(MessageLoop::current() == main_loop_);
- DCHECK(client_);
- return client_;
-}
-
} // namespace webkit_glue
« no previous file with comments | « webkit/glue/webmediaplayer_impl.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698