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