Index: chrome/renderer/chrome_content_renderer_client.cc |
diff --git a/chrome/renderer/chrome_content_renderer_client.cc b/chrome/renderer/chrome_content_renderer_client.cc |
index fb0c665961f17172aec8d86c08e48f78e1510cfd..72aa62d0550c729bbe26b90abc13be90c3d30ace 100644 |
--- a/chrome/renderer/chrome_content_renderer_client.cc |
+++ b/chrome/renderer/chrome_content_renderer_client.cc |
@@ -185,6 +185,16 @@ using extensions::Extension; |
namespace { |
+enum YouTubeRewriteStatus { |
+ SUCCESS = 0, |
+ SUCCESS_PARAMS_REWRITE = 1, |
+ SUCCESS_ENABLEJSAPI = 2, |
+ FAILURE_ENABLEJSAPI = 3, |
+ NUM_PLUGIN_ERROR = 4 |
mlamouri (slow - plz ping)
2016/08/04 12:42:02
Can you add a comment that says that this one shou
kdsilva
2016/08/04 14:13:21
Done.
|
+}; |
+ |
+const char kFlashYouTubeRewrite[] = "Plugin.Flash.YouTubeRewrite"; |
mlamouri (slow - plz ping)
2016/08/04 12:42:02
Maybe name this `kFlashYouTubeRewriteUma`?
kdsilva
2016/08/04 14:13:22
Done.
|
+ |
// Whitelist PPAPI for Android Runtime for Chromium. (See crbug.com/383937) |
#if defined(ENABLE_PLUGINS) |
const char* const kPredefinedAllowedCameraDeviceOrigins[] = { |
@@ -1430,8 +1440,11 @@ GURL ChromeContentRendererClient::OverrideFlashEmbedWithHTML(const GURL& url) { |
// We don't modify any URLs that contain the enablejsapi=1 parameter |
// since the page may be interacting with the YouTube Flash player in |
// Javascript and we don't want to break working content. |
- if (corrected_url.query().find("enablejsapi=1") != std::string::npos) |
+ if (corrected_url.query().find("enablejsapi=1") != std::string::npos) { |
+ UMA_HISTOGRAM_ENUMERATION(kFlashYouTubeRewrite, FAILURE_ENABLEJSAPI, |
+ NUM_PLUGIN_ERROR); |
return GURL(); |
+ } |
// Change the path to use the YouTube HTML5 API |
std::string path = corrected_url.path(); |
@@ -1440,5 +1453,7 @@ GURL ChromeContentRendererClient::OverrideFlashEmbedWithHTML(const GURL& url) { |
url::Replacements<char> r; |
r.SetPath(path.c_str(), url::Component(0, path.length())); |
+ UMA_HISTOGRAM_ENUMERATION(kFlashYouTubeRewrite, |
+ invalid_url ? SUCCESS_PARAMS_REWRITE : SUCCESS, NUM_PLUGIN_ERROR); |
return corrected_url.ReplaceComponents(r); |
} |