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 #include "ppapi/proxy/host_dispatcher.h" | 5 #include "ppapi/proxy/host_dispatcher.h" |
6 | 6 |
7 #include <map> | 7 #include <map> |
8 | 8 |
9 #include "base/logging.h" | 9 #include "base/logging.h" |
10 #include "ppapi/proxy/host_var_serialization_rules.h" | 10 #include "ppapi/proxy/host_var_serialization_rules.h" |
11 | 11 |
12 namespace pp { | 12 namespace pp { |
13 namespace proxy { | 13 namespace proxy { |
14 | 14 |
15 namespace { | 15 namespace { |
16 | 16 |
17 typedef std::map<PP_Instance, HostDispatcher*> InstanceToDispatcherMap; | 17 typedef std::map<PP_Instance, HostDispatcher*> InstanceToDispatcherMap; |
18 InstanceToDispatcherMap* g_instance_to_dispatcher = NULL; | 18 InstanceToDispatcherMap* g_instance_to_dispatcher = NULL; |
19 | 19 |
20 } // namespace | 20 } // namespace |
21 | 21 |
22 HostDispatcher::HostDispatcher(const PPB_Var_Deprecated* var_interface, | 22 HostDispatcher::HostDispatcher(base::ProcessHandle remote_process_handle, |
| 23 const PPB_Var_Deprecated* var_interface, |
23 PP_Module module, | 24 PP_Module module, |
24 GetInterfaceFunc local_get_interface) | 25 GetInterfaceFunc local_get_interface) |
25 : Dispatcher(local_get_interface) { | 26 : Dispatcher(remote_process_handle, local_get_interface) { |
26 SetSerializationRules(new HostVarSerializationRules(var_interface, module)); | 27 SetSerializationRules(new HostVarSerializationRules(var_interface, module)); |
27 } | 28 } |
28 | 29 |
29 HostDispatcher::~HostDispatcher() { | 30 HostDispatcher::~HostDispatcher() { |
30 } | 31 } |
31 | 32 |
32 // static | 33 // static |
33 HostDispatcher* HostDispatcher::GetForInstance(PP_Instance instance) { | 34 HostDispatcher* HostDispatcher::GetForInstance(PP_Instance instance) { |
34 if (!g_instance_to_dispatcher) | 35 if (!g_instance_to_dispatcher) |
35 return NULL; | 36 return NULL; |
(...skipping 18 matching lines...) Expand all Loading... |
54 return; | 55 return; |
55 InstanceToDispatcherMap::iterator found = g_instance_to_dispatcher->find( | 56 InstanceToDispatcherMap::iterator found = g_instance_to_dispatcher->find( |
56 instance); | 57 instance); |
57 if (found != g_instance_to_dispatcher->end()) | 58 if (found != g_instance_to_dispatcher->end()) |
58 g_instance_to_dispatcher->erase(found); | 59 g_instance_to_dispatcher->erase(found); |
59 } | 60 } |
60 | 61 |
61 } // namespace proxy | 62 } // namespace proxy |
62 } // namespace pp | 63 } // namespace pp |
63 | 64 |
OLD | NEW |