OLD | NEW |
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_PLUGIN_VAR_TRACKER_H_ | 5 #ifndef PPAPI_PROXY_PLUGIN_VAR_TRACKER_H_ |
6 #define PPAPI_PROXY_PLUGIN_VAR_TRACKER_H_ | 6 #define PPAPI_PROXY_PLUGIN_VAR_TRACKER_H_ |
7 | 7 |
8 #include <map> | 8 #include <map> |
9 #include <string> | 9 #include <string> |
10 | 10 |
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
49 PP_Var GetHostObject(const PP_Var& plugin_object) const; | 49 PP_Var GetHostObject(const PP_Var& plugin_object) const; |
50 | 50 |
51 PluginDispatcher* DispatcherForPluginObject( | 51 PluginDispatcher* DispatcherForPluginObject( |
52 const PP_Var& plugin_object) const; | 52 const PP_Var& plugin_object) const; |
53 | 53 |
54 // Like Release() but the var is identified by its host object ID (as | 54 // Like Release() but the var is identified by its host object ID (as |
55 // returned by GetHostObject). | 55 // returned by GetHostObject). |
56 void ReleaseHostObject(PluginDispatcher* dispatcher, | 56 void ReleaseHostObject(PluginDispatcher* dispatcher, |
57 const PP_Var& host_object); | 57 const PP_Var& host_object); |
58 | 58 |
59 // Retrieves the internal reference counts for testing. Returns 0 if we | |
60 // know about the object but the corresponding value is 0, or -1 if the | |
61 // given object ID isn't in our map. | |
62 int GetRefCountForObject(const PP_Var& plugin_object); | |
63 int GetTrackedWithNoReferenceCountForObject(const PP_Var& plugin_object); | |
64 | |
65 private: | 59 private: |
66 // VarTracker protected overrides. | 60 // VarTracker protected overrides. |
67 virtual int32 AddVarInternal(Var* var, AddVarRefMode mode) OVERRIDE; | 61 virtual int32 AddVarInternal(Var* var, AddVarRefMode mode) OVERRIDE; |
68 virtual void TrackedObjectGettingOneRef(VarMap::const_iterator iter) OVERRIDE; | 62 virtual void TrackedObjectGettingOneRef(VarMap::const_iterator iter) OVERRIDE; |
69 virtual void ObjectGettingZeroRef(VarMap::iterator iter) OVERRIDE; | 63 virtual void ObjectGettingZeroRef(VarMap::iterator iter) OVERRIDE; |
70 virtual bool DeleteObjectInfoIfNecessary(VarMap::iterator iter) OVERRIDE; | 64 virtual bool DeleteObjectInfoIfNecessary(VarMap::iterator iter) OVERRIDE; |
71 virtual ArrayBufferVar* CreateArrayBuffer(uint32 size_in_bytes) OVERRIDE; | 65 virtual ArrayBufferVar* CreateArrayBuffer(uint32 size_in_bytes) OVERRIDE; |
72 | 66 |
73 private: | 67 private: |
74 friend struct DefaultSingletonTraits<PluginVarTracker>; | 68 friend struct DefaultSingletonTraits<PluginVarTracker>; |
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
112 typedef std::map<HostVar, int32> HostVarToPluginVarMap; | 106 typedef std::map<HostVar, int32> HostVarToPluginVarMap; |
113 HostVarToPluginVarMap host_var_to_plugin_var_; | 107 HostVarToPluginVarMap host_var_to_plugin_var_; |
114 | 108 |
115 DISALLOW_COPY_AND_ASSIGN(PluginVarTracker); | 109 DISALLOW_COPY_AND_ASSIGN(PluginVarTracker); |
116 }; | 110 }; |
117 | 111 |
118 } // namespace proxy | 112 } // namespace proxy |
119 } // namespace ppapi | 113 } // namespace ppapi |
120 | 114 |
121 #endif // PPAPI_PROXY_PLUGIN_VAR_TRACKER_H_ | 115 #endif // PPAPI_PROXY_PLUGIN_VAR_TRACKER_H_ |
OLD | NEW |