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

Unified Diff: ppapi/proxy/interface_list.h

Issue 566243004: Revert of PPAPI: Fix GetBrowserInterface race conditions (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 3 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/nacl_irt/plugin_main.cc ('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 dc109e5c5afd45ca1395ff1dec3d658684e12bbf..a2b4569c8f1b3b3693af6f85b068e82095a334c4 100644
--- a/ppapi/proxy/interface_list.h
+++ b/ppapi/proxy/interface_list.h
@@ -9,8 +9,6 @@
#include <string>
#include "base/basictypes.h"
-#include "base/containers/scoped_ptr_hash_map.h"
-#include "base/synchronization/lock.h"
#include "ppapi/proxy/interface_proxy.h"
#include "ppapi/proxy/ppapi_proxy_export.h"
#include "ppapi/shared_impl/ppapi_permissions.h"
@@ -49,39 +47,30 @@
private:
friend class InterfaceListTest;
- class InterfaceInfo {
- public:
+ struct InterfaceInfo {
+ InterfaceInfo()
+ : iface(NULL),
+ required_permission(PERMISSION_NONE),
+ interface_logged(false) {
+ }
InterfaceInfo(const void* in_interface, Permission in_perm)
- : iface_(in_interface),
- required_permission_(in_perm),
- sent_to_uma_(false) {
+ : iface(in_interface),
+ required_permission(in_perm),
+ interface_logged(false) {
}
- const void* iface() { return iface_; }
+ const void* iface;
// Permission required to return non-null for this interface. This will
// be checked with the value set via SetProcessGlobalPermissionBits when
// an interface is requested.
- Permission required_permission() { return required_permission_; };
+ Permission required_permission;
- // Call this any time the interface is requested. It will log a UMA count
- // only the first time. This is safe to call from any thread, regardless of
- // whether the proxy lock is held.
- void LogWithUmaOnce(IPC::Sender* sender, const std::string& name);
- private:
- DISALLOW_COPY_AND_ASSIGN(InterfaceInfo);
+ // Interface usage is logged just once per-interface-per-plugin-process.
+ bool interface_logged;
+ };
- const void* const iface_;
- const Permission required_permission_;
-
- bool sent_to_uma_;
- base::Lock sent_to_uma_lock_;
- };
- // Give friendship for HashInterfaceName.
- friend class InterfaceInfo;
-
- typedef base::ScopedPtrHashMap<std::string, InterfaceInfo>
- NameToInterfaceInfoMap;
+ typedef std::map<std::string, InterfaceInfo> NameToInterfaceInfoMap;
void AddProxy(ApiID id, InterfaceProxy::Factory factory);
« no previous file with comments | « ppapi/nacl_irt/plugin_main.cc ('k') | ppapi/proxy/interface_list.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698