Chromium Code Reviews| Index: webkit/glue/webmediaplayer_impl.cc |
| diff --git a/webkit/glue/webmediaplayer_impl.cc b/webkit/glue/webmediaplayer_impl.cc |
| index 01ddcc06c9191fef3966592df87892058792b880..17a3186c7fd88a504ca6581676f4d0675e7f66db 100644 |
| --- a/webkit/glue/webmediaplayer_impl.cc |
| +++ b/webkit/glue/webmediaplayer_impl.cc |
| @@ -120,6 +120,7 @@ WebMediaPlayerImpl::WebMediaPlayerImpl( |
| delegate_(delegate), |
| media_stream_client_(media_stream_client), |
| media_log_(media_log), |
| + is_accelerated_compositing_active_(false), |
| incremented_externally_allocated_memory_(false) { |
| // Saves the current message loop. |
| DCHECK(!main_loop_); |
| @@ -152,8 +153,8 @@ bool WebMediaPlayerImpl::Initialize( |
| AsWeakPtr())); |
| } |
| - UMA_HISTOGRAM_BOOLEAN("Media.AcceleratedCompositingActive", |
| - frame->view()->isAcceleratedCompositingActive()); |
| + is_accelerated_compositing_active_ = |
| + frame->view()->isAcceleratedCompositingActive(); |
| pipeline_ = new media::PipelineImpl(pipeline_message_loop, media_log_); |
| @@ -237,10 +238,34 @@ WebMediaPlayerImpl::~WebMediaPlayerImpl() { |
| } |
| } |
| +// Helper enum for reporting scheme histograms. |
| +enum URLSchemeForHistogram { |
| + kUnknownURLScheme, |
| + kMissingURLScheme, |
| + kHttpURLScheme, |
| + kHttpsURLScheme, |
| + kFileURLScheme, |
| + kBlobURLScheme, |
| + kDataURLScheme, |
| + kMaxURLScheme = kDataURLScheme // Must be equal to highest enum value. |
| +}; |
| + |
| +static URLSchemeForHistogram URLScheme(const GURL& url) { |
| + if (!url.has_scheme()) return kMissingURLScheme; |
| + if (url.SchemeIs("http")) return kHttpURLScheme; |
| + if (url.SchemeIs("https")) return kHttpsURLScheme; |
| + if (url.SchemeIs("file")) return kFileURLScheme; |
| + if (url.SchemeIs("blob")) return kBlobURLScheme; |
| + if (url.SchemeIs("data")) return kDataURLScheme; |
|
scherkus (not reviewing)
2011/11/15 20:01:07
chrome-extension is another good one
what about s
Ami GONE FROM CHROMIUM
2011/11/15 20:33:28
Added.
|
| + return kUnknownURLScheme; |
| +} |
| + |
| void WebMediaPlayerImpl::load(const WebKit::WebURL& url) { |
| DCHECK_EQ(main_loop_, MessageLoop::current()); |
| DCHECK(proxy_); |
| + UMA_HISTOGRAM_ENUMERATION("Media.URLScheme", URLScheme(url), kMaxURLScheme); |
| + |
| if (media_stream_client_) { |
| bool has_video = false; |
| bool has_audio = false; |
| @@ -708,6 +733,11 @@ void WebMediaPlayerImpl::OnPipelineInitialize(PipelineStatus status) { |
| static_cast<float>(pipeline_->GetMediaDuration().InSecondsF()); |
| buffered_.swap(new_buffered); |
| + if (hasVideo()) { |
| + UMA_HISTOGRAM_BOOLEAN("Media.AcceleratedCompositingActive", |
| + is_accelerated_compositing_active_); |
| + } |
| + |
| if (pipeline_->IsLoaded()) { |
| SetNetworkState(WebKit::WebMediaPlayer::Loaded); |
| } |