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 <stddef.h> | 7 #include <stddef.h> |
8 | 8 |
9 #include "base/macros.h" | 9 #include "base/macros.h" |
10 #include "base/metrics/histogram.h" | 10 #include "base/metrics/histogram.h" |
11 #include "base/sha1.h" | 11 #include "base/sha1.h" |
12 #include "base/strings/string_number_conversions.h" | 12 #include "base/strings/string_number_conversions.h" |
13 #include "base/strings/string_util.h" | 13 #include "base/strings/string_util.h" |
14 #include "chrome/common/chrome_content_client.h" | 14 #include "chrome/common/chrome_content_client.h" |
15 #include "chrome/common/chrome_switches.h" | 15 #include "chrome/common/chrome_switches.h" |
16 #include "chrome/common/render_messages.h" | 16 #include "chrome/common/render_messages.h" |
17 #include "chrome/renderer/chrome_content_renderer_client.h" | 17 #include "chrome/renderer/chrome_content_renderer_client.h" |
18 #include "content/public/renderer/pepper_plugin_instance.h" | 18 #include "content/public/renderer/pepper_plugin_instance.h" |
19 #include "content/public/renderer/render_thread.h" | 19 #include "content/public/renderer/render_thread.h" |
20 #include "content/public/renderer/renderer_ppapi_host.h" | 20 #include "content/public/renderer/renderer_ppapi_host.h" |
21 #include "ppapi/c/pp_errors.h" | 21 #include "ppapi/c/pp_errors.h" |
22 #include "ppapi/features/features.h" | |
23 #include "ppapi/host/dispatch_host_message.h" | 22 #include "ppapi/host/dispatch_host_message.h" |
24 #include "ppapi/host/host_message_context.h" | 23 #include "ppapi/host/host_message_context.h" |
25 #include "ppapi/host/ppapi_host.h" | 24 #include "ppapi/host/ppapi_host.h" |
26 #include "ppapi/proxy/ppapi_messages.h" | 25 #include "ppapi/proxy/ppapi_messages.h" |
27 | 26 |
28 #include "widevine_cdm_version.h" // In SHARED_INTERMEDIATE_DIR. | 27 #include "widevine_cdm_version.h" // In SHARED_INTERMEDIATE_DIR. |
29 | 28 |
30 #if defined(ENABLE_EXTENSIONS) | 29 #if defined(ENABLE_EXTENSIONS) |
31 #include "extensions/common/constants.h" | 30 #include "extensions/common/constants.h" |
32 #include "extensions/common/extension.h" | 31 #include "extensions/common/extension.h" |
(...skipping 12 matching lines...) Expand all Loading... |
45 "01E9FFA9A8F3C18271FE91BEE46207F3B81755CC", // see http://crbug.com/521189 | 44 "01E9FFA9A8F3C18271FE91BEE46207F3B81755CC", // see http://crbug.com/521189 |
46 "97B23E01B2AA064E8332EE43A7A85C628AADC3F2", // see http://crbug.com/521189 | 45 "97B23E01B2AA064E8332EE43A7A85C628AADC3F2", // see http://crbug.com/521189 |
47 }; | 46 }; |
48 | 47 |
49 const char* const kWhitelistedHistogramPrefixes[] = { | 48 const char* const kWhitelistedHistogramPrefixes[] = { |
50 "22F67DA2061FFC4DC9A4974036348D9C38C22919", // see http://crbug.com/390221 | 49 "22F67DA2061FFC4DC9A4974036348D9C38C22919", // see http://crbug.com/390221 |
51 "3FEA4650221C5E6C39CF5C5C9F464FF74EAB6CE1", // see http://crbug.com/521189 | 50 "3FEA4650221C5E6C39CF5C5C9F464FF74EAB6CE1", // see http://crbug.com/521189 |
52 }; | 51 }; |
53 | 52 |
54 const char* const kWhitelistedPluginBaseNames[] = { | 53 const char* const kWhitelistedPluginBaseNames[] = { |
55 #if defined(WIDEVINE_CDM_AVAILABLE) && BUILDFLAG(ENABLE_PEPPER_CDMS) | 54 #if defined(WIDEVINE_CDM_AVAILABLE) && defined(ENABLE_PEPPER_CDMS) |
56 kWidevineCdmAdapterFileName, // see http://crbug.com/368743 | 55 kWidevineCdmAdapterFileName, // see http://crbug.com/368743 |
57 // and http://crbug.com/410630 | 56 // and http://crbug.com/410630 |
58 #endif | 57 #endif |
59 ChromeContentClient::kPDFPluginPath, | 58 ChromeContentClient::kPDFPluginPath, |
60 }; | 59 }; |
61 | 60 |
62 std::string HashPrefix(const std::string& histogram) { | 61 std::string HashPrefix(const std::string& histogram) { |
63 const std::string id_hash = | 62 const std::string id_hash = |
64 base::SHA1HashString(histogram.substr(0, histogram.find('.'))); | 63 base::SHA1HashString(histogram.substr(0, histogram.find('.'))); |
65 DCHECK_EQ(id_hash.length(), base::kSHA1Length); | 64 DCHECK_EQ(id_hash.length(), base::kSHA1Length); |
(...skipping 151 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
217 ppapi::host::HostMessageContext* context) { | 216 ppapi::host::HostMessageContext* context) { |
218 if (!IsPluginWhitelisted()) | 217 if (!IsPluginWhitelisted()) |
219 return PP_ERROR_NOACCESS; | 218 return PP_ERROR_NOACCESS; |
220 bool enabled = false; | 219 bool enabled = false; |
221 content::RenderThread::Get()->Send( | 220 content::RenderThread::Get()->Send( |
222 new ChromeViewHostMsg_IsCrashReportingEnabled(&enabled)); | 221 new ChromeViewHostMsg_IsCrashReportingEnabled(&enabled)); |
223 if (enabled) | 222 if (enabled) |
224 return PP_OK; | 223 return PP_OK; |
225 return PP_ERROR_FAILED; | 224 return PP_ERROR_FAILED; |
226 } | 225 } |
OLD | NEW |