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

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: export AssertLockHeld Created 8 years, 6 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
« no previous file with comments | « ppapi/proxy/plugin_dispatcher.h ('k') | ppapi/proxy/ppb_audio_input_proxy.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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(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
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
OLDNEW
« no previous file with comments | « ppapi/proxy/plugin_dispatcher.h ('k') | ppapi/proxy/ppb_audio_input_proxy.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698