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

Side by Side Diff: ppapi/proxy/interface_list.h

Issue 7874002: This patch tries to remove most of the manual registration for Pepper interfaces, and replaces it... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 9 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « ppapi/proxy/interface_id.h ('k') | ppapi/proxy/interface_list.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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 #ifndef PPAPI_PROXY_INTERFACE_LIST_H_ 5 #ifndef PPAPI_PROXY_INTERFACE_LIST_H_
6 #define PPAPI_PROXY_INTERFACE_LIST_H_ 6 #define PPAPI_PROXY_INTERFACE_LIST_H_
7 7
8 #include <map> 8 #include <map>
9 #include <string> 9 #include <string>
10 10
(...skipping 21 matching lines...) Expand all
32 32
33 // Returns the interface pointer for the given browser or plugin interface, 33 // Returns the interface pointer for the given browser or plugin interface,
34 // or NULL if it's not supported. 34 // or NULL if it's not supported.
35 const void* GetInterfaceForPPB(const std::string& name) const; 35 const void* GetInterfaceForPPB(const std::string& name) const;
36 const void* GetInterfaceForPPP(const std::string& name) const; 36 const void* GetInterfaceForPPP(const std::string& name) const;
37 37
38 private: 38 private:
39 struct InterfaceInfo { 39 struct InterfaceInfo {
40 InterfaceInfo() 40 InterfaceInfo()
41 : id(INTERFACE_ID_NONE), 41 : id(INTERFACE_ID_NONE),
42 interface(NULL) { 42 iface(NULL) {
43 } 43 }
44 InterfaceInfo(InterfaceID in_id, const void* in_interface) 44 InterfaceInfo(InterfaceID in_id, const void* in_interface)
45 : id(in_id), 45 : id(in_id),
46 interface(in_interface) { 46 iface(in_interface) {
47 } 47 }
48 48
49 InterfaceID id; 49 InterfaceID id;
50 const void* interface; 50 const void* iface;
51 }; 51 };
52 52
53 typedef std::map<std::string, InterfaceInfo> NameToInterfaceInfoMap; 53 typedef std::map<std::string, InterfaceInfo> NameToInterfaceInfoMap;
54 54
55 void AddProxy(InterfaceID id, InterfaceProxy::Factory factory); 55 void AddProxy(InterfaceID id, InterfaceProxy::Factory factory);
56 56
57 void AddPPB(const char* name, InterfaceID id, const void* interface); 57 void AddPPB(const char* name, InterfaceID id, const void* iface);
58 void AddPPP(const char* name, InterfaceID id, const void* interface); 58 void AddPPP(const char* name, InterfaceID id, const void* iface);
59 59
60 // Old-style add functions. These should be removed when the rest of the 60 // Old-style add functions. These should be removed when the rest of the
61 // proxies are converted over to using the new system. 61 // proxies are converted over to using the new system.
62 void AddPPB(const InterfaceProxy::Info* info); 62 void AddPPB(const InterfaceProxy::Info* info);
63 void AddPPP(const InterfaceProxy::Info* info); 63 void AddPPP(const InterfaceProxy::Info* info);
64 64
65 NameToInterfaceInfoMap name_to_browser_info_; 65 NameToInterfaceInfoMap name_to_browser_info_;
66 NameToInterfaceInfoMap name_to_plugin_info_; 66 NameToInterfaceInfoMap name_to_plugin_info_;
67 67
68 InterfaceProxy::Factory id_to_factory_[INTERFACE_ID_COUNT]; 68 InterfaceProxy::Factory id_to_factory_[INTERFACE_ID_COUNT];
69 69
70 DISALLOW_COPY_AND_ASSIGN(InterfaceList); 70 DISALLOW_COPY_AND_ASSIGN(InterfaceList);
71 }; 71 };
72 72
73 } // namespace proxy 73 } // namespace proxy
74 } // namespace ppapi 74 } // namespace ppapi
75 75
76 #endif // PPAPI_PROXY_INTERFACE_LIST_H_ 76 #endif // PPAPI_PROXY_INTERFACE_LIST_H_
77 77
OLDNEW
« no previous file with comments | « ppapi/proxy/interface_id.h ('k') | ppapi/proxy/interface_list.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698