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

Unified Diff: ppapi/proxy/interface_list.h

Issue 141523010: Pepper: Log in UMA when an interface is used. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebased again Created 6 years, 10 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 | « ppapi/PRESUBMIT.py ('k') | ppapi/proxy/interface_list.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ppapi/proxy/interface_list.h
diff --git a/ppapi/proxy/interface_list.h b/ppapi/proxy/interface_list.h
index 85b7eb6be70f2400bb91f91a1ee426e347c8f578..a2b4569c8f1b3b3693af6f85b068e82095a334c4 100644
--- a/ppapi/proxy/interface_list.h
+++ b/ppapi/proxy/interface_list.h
@@ -41,7 +41,7 @@ class PPAPI_PROXY_EXPORT InterfaceList {
// Returns the interface pointer for the given browser or plugin interface,
// or NULL if it's not supported.
- const void* GetInterfaceForPPB(const std::string& name) const;
+ const void* GetInterfaceForPPB(const std::string& name);
const void* GetInterfaceForPPP(const std::string& name) const;
private:
@@ -50,11 +50,13 @@ class PPAPI_PROXY_EXPORT InterfaceList {
struct InterfaceInfo {
InterfaceInfo()
: iface(NULL),
- required_permission(PERMISSION_NONE) {
+ required_permission(PERMISSION_NONE),
+ interface_logged(false) {
}
InterfaceInfo(const void* in_interface, Permission in_perm)
: iface(in_interface),
- required_permission(in_perm) {
+ required_permission(in_perm),
+ interface_logged(false) {
}
const void* iface;
@@ -63,6 +65,9 @@ class PPAPI_PROXY_EXPORT InterfaceList {
// be checked with the value set via SetProcessGlobalPermissionBits when
// an interface is requested.
Permission required_permission;
+
+ // Interface usage is logged just once per-interface-per-plugin-process.
+ bool interface_logged;
};
typedef std::map<std::string, InterfaceInfo> NameToInterfaceInfoMap;
@@ -75,6 +80,9 @@ class PPAPI_PROXY_EXPORT InterfaceList {
void AddPPB(const char* name, const void* iface, Permission permission);
void AddPPP(const char* name, const void* iface);
+ // Hash the interface name for UMA logging.
+ static int HashInterfaceName(const std::string& name);
+
PpapiPermissions permissions_;
NameToInterfaceInfoMap name_to_browser_info_;
« no previous file with comments | « ppapi/PRESUBMIT.py ('k') | ppapi/proxy/interface_list.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698