Chromium Code Reviews| 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..b2dca8732ceba1ca3be79eddc671f6417a10c8ea 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,17 @@ namespace content { |
| // attempting to release inactive media players. |
| const int kMediaPlayerThreshold = 1; |
| +// Number of media types to be recorded. |
| +const int kMaxMediaTypes = 2; |
| + |
| static BrowserMediaPlayerManager::Factory g_factory = NULL; |
| static media::MediaUrlInterceptor* media_url_interceptor_ = NULL; |
| +void RecordMobileMediaType(bool is_media_url) { |
| + UMA_HISTOGRAM_ENUMERATION("Media.Mobile.MediaType", |
|
Ilya Sherman
2014/08/27 00:31:27
Why not use UMA_HISTOGRAM_BOOLEAN?
qinmin
2014/08/27 17:29:38
Done.
|
| + is_media_url ? 0 : 1, kMaxMediaTypes); |
| +} |
| + |
| // static |
| void BrowserMediaPlayerManager::RegisterFactory(Factory factory) { |
| g_factory = factory; |
| @@ -103,10 +112,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); |
| + RecordMobileMediaType(true); |
| return media_player_bridge; |
| } |
| case MEDIA_PLAYER_TYPE_MEDIA_SOURCE: { |
| + RecordMobileMediaType(false); |
| return new MediaSourcePlayer( |
| media_player_params.player_id, |
| manager, |