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

Unified Diff: chrome/renderer/pepper/pepper_uma_host.cc

Issue 290733016: Merge 270616 "Whitelist libwidevinecdmadapter.so for pepper UMA ..." (Closed) Base URL: svn://svn.chromium.org/chrome/branches/1985/src/
Patch Set: Created 6 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/renderer/pepper/pepper_uma_host.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/renderer/pepper/pepper_uma_host.cc
===================================================================
--- chrome/renderer/pepper/pepper_uma_host.cc (revision 272402)
+++ chrome/renderer/pepper/pepper_uma_host.cc (working copy)
@@ -10,6 +10,7 @@
#include "chrome/common/chrome_switches.h"
#include "chrome/common/render_messages.h"
#include "chrome/renderer/chrome_content_renderer_client.h"
+#include "content/public/renderer/pepper_plugin_instance.h"
#include "content/public/renderer/render_thread.h"
#include "content/public/renderer/renderer_ppapi_host.h"
#include "extensions/common/constants.h"
@@ -31,6 +32,10 @@
"CD190EA2B764EDF0BB97552A638D32072F3CFD41", // see http://crbug.com/317833
};
+const char* const kWhitelistedPluginBaseNames[] = {
+ "libwidevinecdmadapter.so" // see http://crbug.com/368743
+};
+
std::string HashPrefix(const std::string& histogram) {
const std::string id_hash =
base::SHA1HashString(histogram.substr(0, histogram.find('.')));
@@ -46,10 +51,17 @@
: ResourceHost(host->GetPpapiHost(), instance, resource),
document_url_(host->GetDocumentURL(instance)),
is_plugin_in_process_(host->IsRunningInProcess()) {
+ if (host->GetPluginInstance(instance)) {
+ plugin_base_name_ =
+ host->GetPluginInstance(instance)->GetModulePath().BaseName();
+ }
+
for (size_t i = 0; i < arraysize(kPredefinedAllowedUMAOrigins); ++i)
allowed_origins_.insert(kPredefinedAllowedUMAOrigins[i]);
for (size_t i = 0; i < arraysize(kWhitelistedHistogramPrefixes); ++i)
allowed_histogram_prefixes_.insert(kWhitelistedHistogramPrefixes[i]);
+ for (size_t i = 0; i < arraysize(kWhitelistedPluginBaseNames); ++i)
+ allowed_plugin_base_names_.insert(kWhitelistedPluginBaseNames[i]);
}
PepperUMAHost::~PepperUMAHost() {}
@@ -86,6 +98,11 @@
return true;
}
+ if (allowed_plugin_base_names_.find(plugin_base_name_.MaybeAsASCII()) !=
+ allowed_plugin_base_names_.end()) {
+ return true;
+ }
+
LOG(ERROR) << "Host or histogram name is not allowed to use the UMA API.";
return false;
}
« no previous file with comments | « chrome/renderer/pepper/pepper_uma_host.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698