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

Side by Side Diff: chrome/renderer/plugins/plugin_uma.cc

Issue 2852193002: PDF: Add UMA to track successful / failed PDF loads (Closed)
Patch Set: reformat Created 3 years, 7 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 unified diff | Download patch
OLDNEW
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "chrome/renderer/plugins/plugin_uma.h" 5 #include "chrome/renderer/plugins/plugin_uma.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 #include <cstring> 8 #include <cstring>
9 9
10 #include "base/macros.h" 10 #include "base/macros.h"
(...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after
72 GetPluginType(plugin_mime_type, plugin_src)); 72 GetPluginType(plugin_mime_type, plugin_src));
73 } 73 }
74 74
75 void PluginUMAReporter::ReportPluginDisabled( 75 void PluginUMAReporter::ReportPluginDisabled(
76 const std::string& plugin_mime_type, 76 const std::string& plugin_mime_type,
77 const GURL& plugin_src) { 77 const GURL& plugin_src) {
78 report_sender_->SendPluginUMA(DISABLED_PLUGIN, 78 report_sender_->SendPluginUMA(DISABLED_PLUGIN,
79 GetPluginType(plugin_mime_type, plugin_src)); 79 GetPluginType(plugin_mime_type, plugin_src));
80 } 80 }
81 81
82 // static
83 void PluginUMAReporter::ReportPDFLoadStatus(PDFLoadStatus status) {
84 UMA_HISTOGRAM_ENUMERATION("PDF.LoadStatus", status,
85 PluginUMAReporter::PDF_LOAD_STATUS_MAX);
86 }
87
82 PluginUMAReporter::PluginUMAReporter() : report_sender_(new UMASenderImpl()) {} 88 PluginUMAReporter::PluginUMAReporter() : report_sender_(new UMASenderImpl()) {}
83 89
84 PluginUMAReporter::~PluginUMAReporter() {} 90 PluginUMAReporter::~PluginUMAReporter() {}
85 91
86 // static. 92 // static.
87 bool PluginUMAReporter::CompareCStrings(const char* first, const char* second) { 93 bool PluginUMAReporter::CompareCStrings(const char* first, const char* second) {
88 return strcmp(first, second) < 0; 94 return strcmp(first, second) < 0;
89 } 95 }
90 96
91 bool PluginUMAReporter::CStringArrayContainsCString(const char* const* array, 97 bool PluginUMAReporter::CStringArrayContainsCString(const char* const* array,
(...skipping 87 matching lines...) Expand 10 before | Expand all | Expand 10 after
179 return SHOCKWAVE_FLASH; 185 return SHOCKWAVE_FLASH;
180 } 186 }
181 187
182 #if BUILDFLAG(ENABLE_PEPPER_CDMS) 188 #if BUILDFLAG(ENABLE_PEPPER_CDMS)
183 if (mime_type == kWidevineCdmPluginMimeType) 189 if (mime_type == kWidevineCdmPluginMimeType)
184 return WIDEVINE_CDM; 190 return WIDEVINE_CDM;
185 #endif 191 #endif
186 192
187 return UNSUPPORTED_MIMETYPE; 193 return UNSUPPORTED_MIMETYPE;
188 } 194 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698