OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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/pepper/pepper_uma_host.h" | 5 #include "chrome/renderer/pepper/pepper_uma_host.h" |
6 | 6 |
7 #include "base/metrics/histogram.h" | 7 #include "base/metrics/histogram.h" |
8 #include "base/sha1.h" | 8 #include "base/sha1.h" |
9 #include "base/strings/string_number_conversions.h" | 9 #include "base/strings/string_number_conversions.h" |
10 #include "chrome/common/chrome_switches.h" | 10 #include "chrome/common/chrome_switches.h" |
(...skipping 17 matching lines...) Expand all Loading... |
28 const char* const kPredefinedAllowedUMAOrigins[] = { | 28 const char* const kPredefinedAllowedUMAOrigins[] = { |
29 "6EAED1924DB611B6EEF2A664BD077BE7EAD33B8F", // see http://crbug.com/317833 | 29 "6EAED1924DB611B6EEF2A664BD077BE7EAD33B8F", // see http://crbug.com/317833 |
30 "4EB74897CB187C7633357C2FE832E0AD6A44883A" // see http://crbug.com/317833 | 30 "4EB74897CB187C7633357C2FE832E0AD6A44883A" // see http://crbug.com/317833 |
31 }; | 31 }; |
32 | 32 |
33 const char* const kWhitelistedHistogramPrefixes[] = { | 33 const char* const kWhitelistedHistogramPrefixes[] = { |
34 "22F67DA2061FFC4DC9A4974036348D9C38C22919" // see http://crbug.com/390221 | 34 "22F67DA2061FFC4DC9A4974036348D9C38C22919" // see http://crbug.com/390221 |
35 }; | 35 }; |
36 | 36 |
37 const char* const kWhitelistedPluginBaseNames[] = { | 37 const char* const kWhitelistedPluginBaseNames[] = { |
38 #if defined(WIDEVINE_CDM_AVAILABLE) && defined(ENABLE_PEPPER_CDMS) | 38 #if defined(ENABLE_WIDEVINE_CDM) && defined(ENABLE_PEPPER_CDMS) |
39 kWidevineCdmAdapterFileName, // see http://crbug.com/368743 | 39 kWidevineCdmAdapterFileName, // see http://crbug.com/368743 |
40 // and http://crbug.com/410630 | 40 // and http://crbug.com/410630 |
41 #endif | 41 #endif |
42 "libpdf.so" // see http://crbug.com/405305 | 42 "libpdf.so" // see http://crbug.com/405305 |
43 }; | 43 }; |
44 | 44 |
45 std::string HashPrefix(const std::string& histogram) { | 45 std::string HashPrefix(const std::string& histogram) { |
46 const std::string id_hash = | 46 const std::string id_hash = |
47 base::SHA1HashString(histogram.substr(0, histogram.find('.'))); | 47 base::SHA1HashString(histogram.substr(0, histogram.find('.'))); |
48 DCHECK_EQ(id_hash.length(), base::kSHA1Length); | 48 DCHECK_EQ(id_hash.length(), base::kSHA1Length); |
(...skipping 151 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
200 ppapi::host::HostMessageContext* context) { | 200 ppapi::host::HostMessageContext* context) { |
201 if (!IsPluginWhitelisted()) | 201 if (!IsPluginWhitelisted()) |
202 return PP_ERROR_NOACCESS; | 202 return PP_ERROR_NOACCESS; |
203 bool enabled = false; | 203 bool enabled = false; |
204 content::RenderThread::Get()->Send( | 204 content::RenderThread::Get()->Send( |
205 new ChromeViewHostMsg_IsCrashReportingEnabled(&enabled)); | 205 new ChromeViewHostMsg_IsCrashReportingEnabled(&enabled)); |
206 if (enabled) | 206 if (enabled) |
207 return PP_OK; | 207 return PP_OK; |
208 return PP_ERROR_FAILED; | 208 return PP_ERROR_FAILED; |
209 } | 209 } |
OLD | NEW |