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

Unified Diff: webkit/glue/webmediaplayer_impl.cc

Issue 8468011: Only report Media.AcceleratedCompositingActive for video-having playbacks and add Media.URLScheme. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: anonymous namespace Created 9 years, 1 month 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 01ddcc06c9191fef3966592df87892058792b880..94642d4b7f807769eae729a77d13cd813b3f1370 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,44 @@ WebMediaPlayerImpl::~WebMediaPlayerImpl() {
}
}
+namespace {
+
+// Helper enum for reporting scheme histograms.
+enum URLSchemeForHistogram {
+ kUnknownURLScheme,
+ kMissingURLScheme,
+ kHttpURLScheme,
+ kHttpsURLScheme,
+ kFtpURLScheme,
+ kChromeExtensionURLScheme,
+ kJavascriptURLScheme,
+ kFileURLScheme,
+ kBlobURLScheme,
+ kDataURLScheme,
+ kMaxURLScheme = kDataURLScheme // Must be equal to highest enum value.
+};
+
+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("ftp")) return kFtpURLScheme;
+ if (url.SchemeIs("chrome-extension")) return kChromeExtensionURLScheme;
+ if (url.SchemeIs("javascript")) return kJavascriptURLScheme;
+ if (url.SchemeIs("file")) return kFileURLScheme;
+ if (url.SchemeIs("blob")) return kBlobURLScheme;
+ if (url.SchemeIs("data")) return kDataURLScheme;
+ return kUnknownURLScheme;
+}
+
+} // anonymous namespace
+
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 +743,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);
}
« 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