| OLD | NEW |
| 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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 65 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 76 PP_Var GetHostObject(const PP_Var& plugin_object) const; | 76 PP_Var GetHostObject(const PP_Var& plugin_object) const; |
| 77 | 77 |
| 78 // Retrieves the internal reference counts for testing. Returns 0 if we | 78 // Retrieves the internal reference counts for testing. Returns 0 if we |
| 79 // know about the object but the corresponding value is 0, or -1 if the | 79 // know about the object but the corresponding value is 0, or -1 if the |
| 80 // given object ID isn't in our map. | 80 // given object ID isn't in our map. |
| 81 int GetRefCountForObject(const PP_Var& plugin_object); | 81 int GetRefCountForObject(const PP_Var& plugin_object); |
| 82 int GetTrackedWithNoReferenceCountForObject(const PP_Var& plugin_object); | 82 int GetTrackedWithNoReferenceCountForObject(const PP_Var& plugin_object); |
| 83 | 83 |
| 84 private: | 84 private: |
| 85 friend struct DefaultSingletonTraits<PluginVarTracker>; | 85 friend struct DefaultSingletonTraits<PluginVarTracker>; |
| 86 friend class PluginVarTrackerTest; |
| 86 | 87 |
| 87 // Represents a var as received from the host. | 88 // Represents a var as received from the host. |
| 88 struct HostVar { | 89 struct HostVar { |
| 89 HostVar(Sender* s, int64_t i); | 90 HostVar(Sender* s, int64_t i); |
| 90 | 91 |
| 91 bool operator<(const HostVar& other) const; | 92 bool operator<(const HostVar& other) const; |
| 92 | 93 |
| 93 // The host that sent us this object. This is used so we know how to send | 94 // The host that sent us this object. This is used so we know how to send |
| 94 // back requests on this object. | 95 // back requests on this object. |
| 95 Sender* channel; | 96 Sender* channel; |
| (...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 153 | 154 |
| 154 // The last plugin object ID we've handed out. This must be unique for the | 155 // The last plugin object ID we've handed out. This must be unique for the |
| 155 // process. | 156 // process. |
| 156 VarID last_plugin_object_id_; | 157 VarID last_plugin_object_id_; |
| 157 }; | 158 }; |
| 158 | 159 |
| 159 } // namespace proxy | 160 } // namespace proxy |
| 160 } // namespace pp | 161 } // namespace pp |
| 161 | 162 |
| 162 #endif // PPAPI_PROXY_PLUGIN_VAR_TRACKER_H_ | 163 #endif // PPAPI_PROXY_PLUGIN_VAR_TRACKER_H_ |
| OLD | NEW |