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 #include "ppapi/proxy/plugin_var_tracker.h" | 5 #include "ppapi/proxy/plugin_var_tracker.h" |
6 | 6 |
7 #include "base/memory/ref_counted.h" | 7 #include "base/memory/ref_counted.h" |
8 #include "base/memory/singleton.h" | 8 #include "base/memory/singleton.h" |
9 #include "ppapi/c/ppb_var.h" | 9 #include "ppapi/c/ppb_var.h" |
10 #include "ppapi/proxy/plugin_dispatcher.h" | 10 #include "ppapi/proxy/plugin_dispatcher.h" |
11 #include "ppapi/proxy/ppapi_messages.h" | 11 #include "ppapi/proxy/ppapi_messages.h" |
12 #include "ppapi/proxy/interface_id.h" | 12 #include "ppapi/proxy/interface_id.h" |
13 #include "ppapi/proxy/proxy_object_var.h" | 13 #include "ppapi/proxy/proxy_object_var.h" |
14 #include "ppapi/shared_impl/var.h" | 14 #include "ppapi/shared_impl/var.h" |
15 | 15 |
16 using ppapi::ProxyObjectVar; | 16 namespace ppapi { |
17 using ppapi::Var; | |
18 | |
19 namespace pp { | |
20 namespace proxy { | 17 namespace proxy { |
21 | 18 |
22 PluginVarTracker::HostVar::HostVar(PluginDispatcher* d, int32 i) | 19 PluginVarTracker::HostVar::HostVar(PluginDispatcher* d, int32 i) |
23 : dispatcher(d), | 20 : dispatcher(d), |
24 host_object_id(i) { | 21 host_object_id(i) { |
25 } | 22 } |
26 | 23 |
27 bool PluginVarTracker::HostVar::operator<(const HostVar& other) const { | 24 bool PluginVarTracker::HostVar::operator<(const HostVar& other) const { |
28 if (dispatcher < other.dispatcher) | 25 if (dispatcher < other.dispatcher) |
29 return true; | 26 return true; |
(...skipping 239 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
269 // Have this host var, look up the object. | 266 // Have this host var, look up the object. |
270 VarMap::iterator ret = live_vars_.find(found->second); | 267 VarMap::iterator ret = live_vars_.find(found->second); |
271 DCHECK(ret != live_vars_.end()); | 268 DCHECK(ret != live_vars_.end()); |
272 | 269 |
273 // All objects should be proxy objects. | 270 // All objects should be proxy objects. |
274 DCHECK(ret->second.var->AsProxyObjectVar()); | 271 DCHECK(ret->second.var->AsProxyObjectVar()); |
275 return scoped_refptr<ProxyObjectVar>(ret->second.var->AsProxyObjectVar()); | 272 return scoped_refptr<ProxyObjectVar>(ret->second.var->AsProxyObjectVar()); |
276 } | 273 } |
277 | 274 |
278 } // namesace proxy | 275 } // namesace proxy |
279 } // namespace pp | 276 } // namespace ppapi |
OLD | NEW |