Chromium Code Reviews| 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" |
| 11 #include "chrome/common/render_messages.h" | 11 #include "chrome/common/render_messages.h" |
| 12 #include "chrome/renderer/chrome_content_renderer_client.h" | 12 #include "chrome/renderer/chrome_content_renderer_client.h" |
| 13 #include "content/public/renderer/pepper_plugin_instance.h" | 13 #include "content/public/renderer/pepper_plugin_instance.h" |
| 14 #include "content/public/renderer/render_thread.h" | 14 #include "content/public/renderer/render_thread.h" |
| 15 #include "content/public/renderer/renderer_ppapi_host.h" | 15 #include "content/public/renderer/renderer_ppapi_host.h" |
| 16 #include "extensions/common/constants.h" | 16 #include "extensions/common/constants.h" |
| 17 #include "extensions/common/extension.h" | 17 #include "extensions/common/extension.h" |
| 18 #include "ppapi/c/pp_errors.h" | 18 #include "ppapi/c/pp_errors.h" |
| 19 #include "ppapi/host/dispatch_host_message.h" | 19 #include "ppapi/host/dispatch_host_message.h" |
| 20 #include "ppapi/host/host_message_context.h" | 20 #include "ppapi/host/host_message_context.h" |
| 21 #include "ppapi/host/ppapi_host.h" | 21 #include "ppapi/host/ppapi_host.h" |
| 22 #include "ppapi/proxy/ppapi_messages.h" | 22 #include "ppapi/proxy/ppapi_messages.h" |
| 23 | 23 |
| 24 #include "widevine_cdm_version.h" // In SHARED_INTERMEDIATE_DIR. | |
|
teravest
2014/09/12 17:46:35
I checked the gyp dependencies for this; looks OK.
| |
| 25 | |
| 24 namespace { | 26 namespace { |
| 25 | 27 |
| 26 const char* const kPredefinedAllowedUMAOrigins[] = { | 28 const char* const kPredefinedAllowedUMAOrigins[] = { |
| 27 "6EAED1924DB611B6EEF2A664BD077BE7EAD33B8F", // see http://crbug.com/317833 | 29 "6EAED1924DB611B6EEF2A664BD077BE7EAD33B8F", // see http://crbug.com/317833 |
| 28 "4EB74897CB187C7633357C2FE832E0AD6A44883A" // see http://crbug.com/317833 | 30 "4EB74897CB187C7633357C2FE832E0AD6A44883A" // see http://crbug.com/317833 |
| 29 }; | 31 }; |
| 30 | 32 |
| 31 const char* const kWhitelistedHistogramPrefixes[] = { | 33 const char* const kWhitelistedHistogramPrefixes[] = { |
| 32 "22F67DA2061FFC4DC9A4974036348D9C38C22919" // see http://crbug.com/390221 | 34 "22F67DA2061FFC4DC9A4974036348D9C38C22919" // see http://crbug.com/390221 |
| 33 }; | 35 }; |
| 34 | 36 |
| 35 const char* const kWhitelistedPluginBaseNames[] = { | 37 const char* const kWhitelistedPluginBaseNames[] = { |
| 36 "libwidevinecdmadapter.so", // see http://crbug.com/368743 | 38 #if defined(WIDEVINE_CDM_AVAILABLE) && defined(ENABLE_PEPPER_CDMS) |
| 37 "libpdf.so" // see http://crbug.com/405305 | 39 kWidevineCdmAdapterFileName, // see http://crbug.com/368743 |
| 40 // and http://crbug.com/410630 | |
| 41 #endif | |
| 42 "libpdf.so" // see http://crbug.com/405305 | |
| 38 }; | 43 }; |
| 39 | 44 |
| 40 std::string HashPrefix(const std::string& histogram) { | 45 std::string HashPrefix(const std::string& histogram) { |
| 41 const std::string id_hash = | 46 const std::string id_hash = |
| 42 base::SHA1HashString(histogram.substr(0, histogram.find('.'))); | 47 base::SHA1HashString(histogram.substr(0, histogram.find('.'))); |
| 43 DCHECK_EQ(id_hash.length(), base::kSHA1Length); | 48 DCHECK_EQ(id_hash.length(), base::kSHA1Length); |
| 44 return base::HexEncode(id_hash.c_str(), id_hash.length()); | 49 return base::HexEncode(id_hash.c_str(), id_hash.length()); |
| 45 } | 50 } |
| 46 | 51 |
| 47 } // namespace | 52 } // namespace |
| (...skipping 143 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 191 ppapi::host::HostMessageContext* context) { | 196 ppapi::host::HostMessageContext* context) { |
| 192 if (!IsPluginWhitelisted()) | 197 if (!IsPluginWhitelisted()) |
| 193 return PP_ERROR_NOACCESS; | 198 return PP_ERROR_NOACCESS; |
| 194 bool enabled = false; | 199 bool enabled = false; |
| 195 content::RenderThread::Get()->Send( | 200 content::RenderThread::Get()->Send( |
| 196 new ChromeViewHostMsg_IsCrashReportingEnabled(&enabled)); | 201 new ChromeViewHostMsg_IsCrashReportingEnabled(&enabled)); |
| 197 if (enabled) | 202 if (enabled) |
| 198 return PP_OK; | 203 return PP_OK; |
| 199 return PP_ERROR_FAILED; | 204 return PP_ERROR_FAILED; |
| 200 } | 205 } |
| OLD | NEW |