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), | 45 : fullscreen(PP_FALSE), flash_fullscreen(PP_FALSE) { |
46 flash_fullscreen(PP_FALSE), | |
47 mouse_lock_callback(PP_BlockUntilComplete()) { | |
48 memset(&position, 0, sizeof(position)); | 46 memset(&position, 0, sizeof(position)); |
49 } | 47 } |
50 | 48 |
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 | |
57 PluginDispatcher::PluginDispatcher(base::ProcessHandle remote_process_handle, | 49 PluginDispatcher::PluginDispatcher(base::ProcessHandle remote_process_handle, |
58 GetInterfaceFunc get_interface) | 50 GetInterfaceFunc get_interface) |
59 : Dispatcher(remote_process_handle, get_interface), | 51 : Dispatcher(remote_process_handle, get_interface), |
60 plugin_delegate_(NULL), | 52 plugin_delegate_(NULL), |
61 received_preferences_(false), | 53 received_preferences_(false), |
62 plugin_dispatcher_id_(0) { | 54 plugin_dispatcher_id_(0) { |
63 SetSerializationRules(new PluginVarSerializationRules); | 55 SetSerializationRules(new PluginVarSerializationRules); |
64 } | 56 } |
65 | 57 |
66 PluginDispatcher::~PluginDispatcher() { | 58 PluginDispatcher::~PluginDispatcher() { |
(...skipping 177 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
244 // once they're set. The user will have to restart to get new font prefs | 236 // once they're set. The user will have to restart to get new font prefs |
245 // propogated to plugins. | 237 // propogated to plugins. |
246 if (!received_preferences_) { | 238 if (!received_preferences_) { |
247 received_preferences_ = true; | 239 received_preferences_ = true; |
248 preferences_ = prefs; | 240 preferences_ = prefs; |
249 } | 241 } |
250 } | 242 } |
251 | 243 |
252 } // namespace proxy | 244 } // namespace proxy |
253 } // namespace ppapi | 245 } // namespace ppapi |
OLD | NEW |