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_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 24 matching lines...) Expand all Loading... |
35 namespace proxy { | 35 namespace proxy { |
36 | 36 |
37 namespace { | 37 namespace { |
38 | 38 |
39 typedef std::map<PP_Instance, PluginDispatcher*> InstanceToDispatcherMap; | 39 typedef std::map<PP_Instance, PluginDispatcher*> InstanceToDispatcherMap; |
40 InstanceToDispatcherMap* g_instance_to_dispatcher = NULL; | 40 InstanceToDispatcherMap* g_instance_to_dispatcher = NULL; |
41 | 41 |
42 } // namespace | 42 } // namespace |
43 | 43 |
44 InstanceData::InstanceData() | 44 InstanceData::InstanceData() |
45 : fullscreen(PP_FALSE), flash_fullscreen(PP_FALSE) { | 45 : fullscreen(PP_FALSE), |
| 46 flash_fullscreen(PP_FALSE), |
| 47 mouse_lock_callback(PP_BlockUntilComplete()) { |
46 memset(&position, 0, sizeof(position)); | 48 memset(&position, 0, sizeof(position)); |
47 } | 49 } |
48 | 50 |
| 51 InstanceData::~InstanceData() { |
| 52 // Run any pending mouse lock callback to prevent leaks. |
| 53 if (mouse_lock_callback.func) |
| 54 PP_RunAndClearCompletionCallback(&mouse_lock_callback, PP_ERROR_ABORTED); |
| 55 } |
| 56 |
49 PluginDispatcher::PluginDispatcher(base::ProcessHandle remote_process_handle, | 57 PluginDispatcher::PluginDispatcher(base::ProcessHandle remote_process_handle, |
50 GetInterfaceFunc get_interface) | 58 GetInterfaceFunc get_interface) |
51 : Dispatcher(remote_process_handle, get_interface), | 59 : Dispatcher(remote_process_handle, get_interface), |
52 plugin_delegate_(NULL), | 60 plugin_delegate_(NULL), |
53 received_preferences_(false), | 61 received_preferences_(false), |
54 plugin_dispatcher_id_(0) { | 62 plugin_dispatcher_id_(0) { |
55 SetSerializationRules(new PluginVarSerializationRules); | 63 SetSerializationRules(new PluginVarSerializationRules); |
56 } | 64 } |
57 | 65 |
58 PluginDispatcher::~PluginDispatcher() { | 66 PluginDispatcher::~PluginDispatcher() { |
(...skipping 177 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
236 // once they're set. The user will have to restart to get new font prefs | 244 // once they're set. The user will have to restart to get new font prefs |
237 // propogated to plugins. | 245 // propogated to plugins. |
238 if (!received_preferences_) { | 246 if (!received_preferences_) { |
239 received_preferences_ = true; | 247 received_preferences_ = true; |
240 preferences_ = prefs; | 248 preferences_ = prefs; |
241 } | 249 } |
242 } | 250 } |
243 | 251 |
244 } // namespace proxy | 252 } // namespace proxy |
245 } // namespace ppapi | 253 } // namespace ppapi |
OLD | NEW |