Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(232)

Side by Side Diff: ppapi/proxy/plugin_dispatcher.cc

Issue 10081020: PPAPI: Make blocking completion callbacks work. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Cleaned up for review. Created 8 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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
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(base::ProcessHandle remote_process_handle, 57 PluginDispatcher::PluginDispatcher(base::ProcessHandle remote_process_handle,
62 PP_GetInterface_Func get_interface) 58 PP_GetInterface_Func get_interface)
63 : Dispatcher(remote_process_handle, get_interface), 59 : Dispatcher(remote_process_handle, 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 SetSerializationRules(new PluginVarSerializationRules(AsWeakPtr())); 63 SetSerializationRules(new PluginVarSerializationRules(AsWeakPtr()));
68 64
(...skipping 222 matching lines...) Expand 10 before | Expand all | Expand 10 after
291 // once they're set. The user will have to restart to get new font prefs 287 // once they're set. The user will have to restart to get new font prefs
292 // propogated to plugins. 288 // propogated to plugins.
293 if (!received_preferences_) { 289 if (!received_preferences_) {
294 received_preferences_ = true; 290 received_preferences_ = true;
295 preferences_ = prefs; 291 preferences_ = prefs;
296 } 292 }
297 } 293 }
298 294
299 } // namespace proxy 295 } // namespace proxy
300 } // namespace ppapi 296 } // namespace ppapi
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698