OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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/debug/trace_event.h" | 9 #include "base/debug/trace_event.h" |
10 #include "base/logging.h" | 10 #include "base/logging.h" |
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
54 ~BoolRestorer() { | 54 ~BoolRestorer() { |
55 *var_ = old_value_; | 55 *var_ = old_value_; |
56 } | 56 } |
57 private: | 57 private: |
58 bool* var_; | 58 bool* var_; |
59 bool old_value_; | 59 bool old_value_; |
60 }; | 60 }; |
61 | 61 |
62 } // namespace | 62 } // namespace |
63 | 63 |
64 HostDispatcher::HostDispatcher(base::ProcessHandle remote_process_handle, | 64 HostDispatcher::HostDispatcher(PP_Module module, |
65 PP_Module module, | |
66 PP_GetInterface_Func local_get_interface, | 65 PP_GetInterface_Func local_get_interface, |
67 SyncMessageStatusReceiver* sync_status) | 66 SyncMessageStatusReceiver* sync_status) |
68 : Dispatcher(remote_process_handle, local_get_interface), | 67 : Dispatcher(local_get_interface), |
69 sync_status_(sync_status), | 68 sync_status_(sync_status), |
70 pp_module_(module), | 69 pp_module_(module), |
71 ppb_proxy_(NULL), | 70 ppb_proxy_(NULL), |
72 allow_plugin_reentrancy_(false) { | 71 allow_plugin_reentrancy_(false) { |
73 if (!g_module_to_dispatcher) | 72 if (!g_module_to_dispatcher) |
74 g_module_to_dispatcher = new ModuleToDispatcherMap; | 73 g_module_to_dispatcher = new ModuleToDispatcherMap; |
75 (*g_module_to_dispatcher)[pp_module_] = this; | 74 (*g_module_to_dispatcher)[pp_module_] = this; |
76 | 75 |
77 SetSerializationRules(new HostVarSerializationRules); | 76 SetSerializationRules(new HostVarSerializationRules); |
78 | 77 |
(...skipping 177 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
256 } | 255 } |
257 } | 256 } |
258 | 257 |
259 ScopedModuleReference::~ScopedModuleReference() { | 258 ScopedModuleReference::~ScopedModuleReference() { |
260 if (dispatcher_) | 259 if (dispatcher_) |
261 dispatcher_->ppb_proxy()->ReleaseModule(dispatcher_->pp_module()); | 260 dispatcher_->ppb_proxy()->ReleaseModule(dispatcher_->pp_module()); |
262 } | 261 } |
263 | 262 |
264 } // namespace proxy | 263 } // namespace proxy |
265 } // namespace ppapi | 264 } // namespace ppapi |
OLD | NEW |