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

Unified Diff: webkit/glue/webmediaplayer_impl.cc

Issue 7480032: Plumb media data from renderers up to MediaInternals in the browser process. (Closed) Base URL: http://git.chromium.org/git/chromium.git@trunk
Patch Set: s/MessageLoop/MessageLoopProxy Created 9 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
Index: webkit/glue/webmediaplayer_impl.cc
diff --git a/webkit/glue/webmediaplayer_impl.cc b/webkit/glue/webmediaplayer_impl.cc
index 76a99093b2c8c518153216cc69a39ab826d2bde8..161d7219e87a079b6b52480a39edf94006f6f097 100644
--- a/webkit/glue/webmediaplayer_impl.cc
+++ b/webkit/glue/webmediaplayer_impl.cc
@@ -12,6 +12,7 @@
#include "media/base/composite_data_source_factory.h"
#include "media/base/filter_collection.h"
#include "media/base/limits.h"
+#include "media/base/media_log.h"
#include "media/base/media_switches.h"
#include "media/base/pipeline_impl.h"
#include "media/base/video_frame.h"
@@ -319,7 +320,8 @@ WebMediaPlayerImpl::WebMediaPlayerImpl(
WebKit::WebMediaPlayerClient* client,
media::FilterCollection* collection,
media::MessageLoopFactory* message_loop_factory,
- MediaStreamClient* media_stream_client)
+ MediaStreamClient* media_stream_client,
+ media::MediaLog* media_log)
: network_state_(WebKit::WebMediaPlayer::Empty),
ready_state_(WebKit::WebMediaPlayer::HaveNothing),
main_loop_(NULL),
@@ -331,10 +333,12 @@ WebMediaPlayerImpl::WebMediaPlayerImpl(
playback_rate_(0.0f),
client_(client),
proxy_(NULL),
- media_stream_client_(media_stream_client) {
+ media_stream_client_(media_stream_client),
+ media_log_(media_log) {
// Saves the current message loop.
DCHECK(!main_loop_);
main_loop_ = MessageLoop::current();
+ media_log_->AddEventOfType(media::MediaLogEvent::CREATE);
}
bool WebMediaPlayerImpl::Initialize(
@@ -421,6 +425,7 @@ bool WebMediaPlayerImpl::Initialize(
}
WebMediaPlayerImpl::~WebMediaPlayerImpl() {
+ media_log_->AddEventOfType(media::MediaLogEvent::DESTROY);
acolwell GONE FROM CHROMIUM 2011/08/03 16:31:37 Is this intended to indicate when destruction has
Scott Franklin 2011/08/03 20:55:04 Starting destruction (I'll change it to DESTROYING
Destroy();
// Finally tell the |main_loop_| we don't want to be notified of destruction
@@ -458,6 +463,8 @@ void WebMediaPlayerImpl::load(const WebKit::WebURL& url) {
url.spec(),
NewCallback(proxy_.get(),
&WebMediaPlayerImpl::Proxy::PipelineInitializationCallback));
+
+ media_log_->Load(url.spec());
}
void WebMediaPlayerImpl::cancelLoad() {
@@ -469,6 +476,8 @@ void WebMediaPlayerImpl::play() {
paused_ = false;
pipeline_->SetPlaybackRate(playback_rate_);
+
+ media_log_->AddEventOfType(media::MediaLogEvent::PLAY);
}
void WebMediaPlayerImpl::pause() {
@@ -477,6 +486,8 @@ void WebMediaPlayerImpl::pause() {
paused_ = true;
pipeline_->SetPlaybackRate(0.0f);
paused_time_ = pipeline_->GetCurrentTime();
+
+ media_log_->AddEventOfType(media::MediaLogEvent::PAUSE);
}
bool WebMediaPlayerImpl::supportsFullscreen() const {

Powered by Google App Engine
This is Rietveld 408576698