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

Unified Diff: content/browser/media/android/browser_media_player_manager.cc

Issue 505233002: Add UMA to study the video types for mobile (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: addressing comments Created 6 years, 4 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 | « no previous file | tools/metrics/histograms/histograms.xml » ('j') | tools/metrics/histograms/histograms.xml » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/browser/media/android/browser_media_player_manager.cc
diff --git a/content/browser/media/android/browser_media_player_manager.cc b/content/browser/media/android/browser_media_player_manager.cc
index c847a275b8f37d484775164dd90079ab69a135e7..429fd510b560299c52c716f7bf26953c2dd78739 100644
--- a/content/browser/media/android/browser_media_player_manager.cc
+++ b/content/browser/media/android/browser_media_player_manager.cc
@@ -6,6 +6,7 @@
#include "base/android/scoped_java_ref.h"
#include "base/command_line.h"
+#include "base/metrics/histogram.h"
#include "content/browser/android/content_view_core_impl.h"
#include "content/browser/media/android/browser_demuxer_android.h"
#include "content/browser/media/android/media_resource_getter_impl.h"
@@ -40,9 +41,16 @@ namespace content {
// attempting to release inactive media players.
const int kMediaPlayerThreshold = 1;
+// Number of media types to be recorded.
+const int kMaxMediaTypes = 2;
Ilya Sherman 2014/08/27 22:14:37 nit: This is now unused.
qinmin 2014/08/28 00:30:09 changed to 3 as we combine the 3 types. On 2014/08
+
static BrowserMediaPlayerManager::Factory g_factory = NULL;
static media::MediaUrlInterceptor* media_url_interceptor_ = NULL;
+void RecordMobileMediaType(bool is_media_url) {
xhwang 2014/08/27 23:02:21 nit: Won't it be easier if you just report MediaPl
qinmin 2014/08/28 00:30:09 Done.
+ UMA_HISTOGRAM_BOOLEAN("Media.Mobile.MediaType", is_media_url);
xhwang 2014/08/27 23:02:21 nit: Since this only applies to Chrome for Android
qinmin 2014/08/28 00:30:09 Done.
+}
+
// static
void BrowserMediaPlayerManager::RegisterFactory(Factory factory) {
g_factory = factory;
@@ -103,10 +111,17 @@ MediaPlayerAndroid* BrowserMediaPlayerManager::CreateMediaPlayer(
media_player_params.url)) {
media_player_bridge->Initialize();
}
+ std::string path = media_player_params.url.path();
+ bool is_hls_media = EndsWith(path, ".m3u8", true) ||
+ EndsWith(path, ".m3u", true);
+ UMA_HISTOGRAM_BOOLEAN("Media.Mobile.IsHttpLiveStreamingMedia",
+ is_hls_media);
xhwang 2014/08/27 23:02:21 nit: Since both UMAs are pretty small (having onl
qinmin 2014/08/28 00:30:09 Done.
ddorwin 2014/08/28 00:59:14 drive-by: Would it make more sense to have a "cont
+ RecordMobileMediaType(true);
return media_player_bridge;
}
case MEDIA_PLAYER_TYPE_MEDIA_SOURCE: {
+ RecordMobileMediaType(false);
return new MediaSourcePlayer(
media_player_params.player_id,
manager,
« no previous file with comments | « no previous file | tools/metrics/histograms/histograms.xml » ('j') | tools/metrics/histograms/histograms.xml » ('J')

Powered by Google App Engine
This is Rietveld 408576698