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/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 27 matching lines...) Expand all Loading... |
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 typedef std::set<PluginDispatcher*> DispatcherSet; | 42 typedef std::set<PluginDispatcher*> DispatcherSet; |
43 DispatcherSet* g_live_dispatchers = NULL; | 43 DispatcherSet* g_live_dispatchers = NULL; |
44 | 44 |
45 } // namespace | 45 } // namespace |
46 | 46 |
47 InstanceData::InstanceData() | 47 InstanceData::InstanceData() |
48 : flash_fullscreen(PP_FALSE), | 48 : flash_fullscreen(PP_FALSE) { |
49 mouse_lock_callback(PP_BlockUntilComplete()) { | |
50 } | 49 } |
51 | 50 |
52 InstanceData::~InstanceData() { | 51 InstanceData::~InstanceData() { |
53 // Run any pending mouse lock callback to prevent leaks. | 52 // Run any pending mouse lock callback to prevent leaks. |
54 if (mouse_lock_callback.func) { | 53 if (mouse_lock_callback) |
55 CallWhileUnlocked(PP_RunAndClearCompletionCallback, | 54 mouse_lock_callback->Abort(); |
56 &mouse_lock_callback, | |
57 static_cast<int32_t>(PP_ERROR_ABORTED)); | |
58 } | |
59 } | 55 } |
60 | 56 |
61 PluginDispatcher::PluginDispatcher(PP_GetInterface_Func get_interface, | 57 PluginDispatcher::PluginDispatcher(PP_GetInterface_Func get_interface, |
62 bool incognito) | 58 bool incognito) |
63 : Dispatcher(get_interface), | 59 : Dispatcher(get_interface), |
64 plugin_delegate_(NULL), | 60 plugin_delegate_(NULL), |
65 received_preferences_(false), | 61 received_preferences_(false), |
66 plugin_dispatcher_id_(0), | 62 plugin_dispatcher_id_(0), |
67 incognito_(incognito) { | 63 incognito_(incognito) { |
68 SetSerializationRules(new PluginVarSerializationRules(AsWeakPtr())); | 64 SetSerializationRules(new PluginVarSerializationRules(AsWeakPtr())); |
(...skipping 229 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
298 // once they're set. The user will have to restart to get new font prefs | 294 // once they're set. The user will have to restart to get new font prefs |
299 // propogated to plugins. | 295 // propogated to plugins. |
300 if (!received_preferences_) { | 296 if (!received_preferences_) { |
301 received_preferences_ = true; | 297 received_preferences_ = true; |
302 preferences_ = prefs; | 298 preferences_ = prefs; |
303 } | 299 } |
304 } | 300 } |
305 | 301 |
306 } // namespace proxy | 302 } // namespace proxy |
307 } // namespace ppapi | 303 } // namespace ppapi |
OLD | NEW |