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 ca5b06b68576d4b1a475ac824db48af0f95cf6d6..6f1f9fde73af9c1684b8d9cfaa109cd94e1158b0 100644 |
--- a/chrome/renderer/chrome_content_renderer_client.cc |
+++ b/chrome/renderer/chrome_content_renderer_client.cc |
@@ -185,6 +185,12 @@ using extensions::Extension; |
namespace { |
+const char kFlashYouTubeRewriteUMA[] = "Plugin.Flash.YouTubeRewrite"; |
+ |
+void RecordYouTubeRewriteUMA(int status) { |
Alexei Svitkine (slow)
2016/08/05 16:34:56
Param can be a YouTubeRewriteStatus type.
kdsilva
2016/08/08 11:04:42
Done.
|
+ UMA_HISTOGRAM_ENUMERATION(kFlashYouTubeRewriteUMA, status, NUM_PLUGIN_ERROR); |
+} |
+ |
// Whitelist PPAPI for Android Runtime for Chromium. (See crbug.com/383937) |
#if defined(ENABLE_PLUGINS) |
const char* const kPredefinedAllowedCameraDeviceOrigins[] = { |
@@ -1433,8 +1439,10 @@ 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) { |
+ RecordYouTubeRewriteUMA(FAILURE_ENABLEJSAPI); |
return GURL(); |
+ } |
// Change the path to use the YouTube HTML5 API |
std::string path = corrected_url.path(); |
@@ -1443,5 +1451,6 @@ GURL ChromeContentRendererClient::OverrideFlashEmbedWithHTML(const GURL& url) { |
url::Replacements<char> r; |
r.SetPath(path.c_str(), url::Component(0, path.length())); |
+ RecordYouTubeRewriteUMA(invalid_url ? SUCCESS_PARAMS_REWRITE : SUCCESS); |
return corrected_url.ReplaceComponents(r); |
} |