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 70 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
81 const PP_Var& host_object); | 81 const PP_Var& host_object); |
82 | 82 |
83 // Retrieves the internal reference counts for testing. Returns 0 if we | 83 // Retrieves the internal reference counts for testing. Returns 0 if we |
84 // know about the object but the corresponding value is 0, or -1 if the | 84 // know about the object but the corresponding value is 0, or -1 if the |
85 // given object ID isn't in our map. | 85 // given object ID isn't in our map. |
86 int GetRefCountForObject(const PP_Var& plugin_object); | 86 int GetRefCountForObject(const PP_Var& plugin_object); |
87 int GetTrackedWithNoReferenceCountForObject(const PP_Var& plugin_object); | 87 int GetTrackedWithNoReferenceCountForObject(const PP_Var& plugin_object); |
88 | 88 |
89 private: | 89 private: |
90 friend struct DefaultSingletonTraits<PluginVarTracker>; | 90 friend struct DefaultSingletonTraits<PluginVarTracker>; |
91 friend class PluginProxyTest; | 91 friend class PluginProxyTestHarness; |
92 | 92 |
93 class RefCountedString : public base::RefCounted<RefCountedString> { | 93 class RefCountedString : public base::RefCounted<RefCountedString> { |
94 public: | 94 public: |
95 RefCountedString() { | 95 RefCountedString() { |
96 } | 96 } |
97 RefCountedString(const std::string& str) : value_(str) { | 97 RefCountedString(const std::string& str) : value_(str) { |
98 } | 98 } |
99 RefCountedString(const char* data, size_t len) | 99 RefCountedString(const char* data, size_t len) |
100 : value_(data, len) { | 100 : value_(data, len) { |
101 } | 101 } |
(...skipping 85 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
187 VarID last_plugin_var_id_; | 187 VarID last_plugin_var_id_; |
188 | 188 |
189 // Get a new Var ID and increment last_plugin_var_id_. | 189 // Get a new Var ID and increment last_plugin_var_id_. |
190 VarID GetNewVarID(); | 190 VarID GetNewVarID(); |
191 }; | 191 }; |
192 | 192 |
193 } // namespace proxy | 193 } // namespace proxy |
194 } // namespace pp | 194 } // namespace pp |
195 | 195 |
196 #endif // PPAPI_PROXY_PLUGIN_VAR_TRACKER_H_ | 196 #endif // PPAPI_PROXY_PLUGIN_VAR_TRACKER_H_ |
OLD | NEW |