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/plugin_dispatcher.h" | 5 #include "ppapi/proxy/plugin_dispatcher.h" |
6 | 6 |
7 #include <map> | 7 #include <map> |
8 | 8 |
9 #include "base/compiler_specific.h" | 9 #include "base/compiler_specific.h" |
10 #include "base/logging.h" | 10 #include "base/logging.h" |
(...skipping 12 matching lines...) Expand all Loading... |
23 | 23 |
24 PluginDispatcher* g_dispatcher = NULL; | 24 PluginDispatcher* g_dispatcher = NULL; |
25 | 25 |
26 const void* GetInterfaceFromDispatcher(const char* interface) { | 26 const void* GetInterfaceFromDispatcher(const char* interface) { |
27 // TODO(brettw) need some kind of lock for multi-thread access. | 27 // TODO(brettw) need some kind of lock for multi-thread access. |
28 return pp::proxy::PluginDispatcher::Get()->GetProxiedInterface(interface); | 28 return pp::proxy::PluginDispatcher::Get()->GetProxiedInterface(interface); |
29 } | 29 } |
30 | 30 |
31 } // namespace | 31 } // namespace |
32 | 32 |
33 PluginDispatcher::PluginDispatcher(GetInterfaceFunc get_interface, | 33 PluginDispatcher::PluginDispatcher(base::ProcessHandle remote_process_handle, |
| 34 GetInterfaceFunc get_interface, |
34 InitModuleFunc init_module, | 35 InitModuleFunc init_module, |
35 ShutdownModuleFunc shutdown_module) | 36 ShutdownModuleFunc shutdown_module) |
36 : Dispatcher(get_interface), | 37 : Dispatcher(remote_process_handle, get_interface), |
37 init_module_(init_module), | 38 init_module_(init_module), |
38 shutdown_module_(shutdown_module), | 39 shutdown_module_(shutdown_module), |
39 plugin_resource_tracker_(new PluginResourceTracker( | 40 plugin_resource_tracker_(new PluginResourceTracker( |
40 ALLOW_THIS_IN_INITIALIZER_LIST(this))), | 41 ALLOW_THIS_IN_INITIALIZER_LIST(this))), |
41 plugin_var_tracker_(new PluginVarTracker( | 42 plugin_var_tracker_(new PluginVarTracker( |
42 ALLOW_THIS_IN_INITIALIZER_LIST(this))) { | 43 ALLOW_THIS_IN_INITIALIZER_LIST(this))) { |
43 SetSerializationRules( | 44 SetSerializationRules( |
44 new PluginVarSerializationRules(plugin_var_tracker_.get())); | 45 new PluginVarSerializationRules(plugin_var_tracker_.get())); |
45 | 46 |
46 // As a plugin, we always support the PPP_Class interface. There's no | 47 // As a plugin, we always support the PPP_Class interface. There's no |
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
82 } | 83 } |
83 | 84 |
84 void PluginDispatcher::OnInitializeModule(PP_Module pp_module, bool* result) { | 85 void PluginDispatcher::OnInitializeModule(PP_Module pp_module, bool* result) { |
85 set_pp_module(pp_module); | 86 set_pp_module(pp_module); |
86 *result = init_module_(pp_module, &GetInterfaceFromDispatcher) == PP_OK; | 87 *result = init_module_(pp_module, &GetInterfaceFromDispatcher) == PP_OK; |
87 } | 88 } |
88 | 89 |
89 } // namespace proxy | 90 } // namespace proxy |
90 } // namespace pp | 91 } // namespace pp |
91 | 92 |
OLD | NEW |