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

Unified Diff: webkit/plugins/ppapi/plugin_module.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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « webkit/plugins/ppapi/file_callbacks.cc ('k') | webkit/plugins/ppapi/ppapi_plugin_instance.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: webkit/plugins/ppapi/plugin_module.cc
diff --git a/webkit/plugins/ppapi/plugin_module.cc b/webkit/plugins/ppapi/plugin_module.cc
index 423209f1dbca0fe81666536adb7c5219e21cfa08..7098f70d44008cc8e6dcadec6264ccd396726695 100644
--- a/webkit/plugins/ppapi/plugin_module.cc
+++ b/webkit/plugins/ppapi/plugin_module.cc
@@ -154,12 +154,6 @@ PluginModuleSet* GetLivePluginSet() {
return &live_plugin_libs;
}
-base::MessageLoopProxy* GetMainThreadMessageLoop() {
- CR_DEFINE_STATIC_LOCAL(scoped_refptr<base::MessageLoopProxy>, proxy,
- (base::MessageLoopProxy::current()));
- return proxy.get();
-}
-
// PPB_Core --------------------------------------------------------------------
void AddRefResource(PP_Resource resource) {
@@ -182,7 +176,7 @@ void CallOnMainThread(int delay_in_msec,
PP_CompletionCallback callback,
int32_t result) {
if (callback.func) {
- GetMainThreadMessageLoop()->PostDelayedTask(
+ PpapiGlobals::Get()->GetMainThreadMessageLoop()->PostDelayedTask(
FROM_HERE,
base::Bind(callback.func, callback.user_data, result),
base::TimeDelta::FromMilliseconds(delay_in_msec));
@@ -190,7 +184,8 @@ void CallOnMainThread(int delay_in_msec,
}
PP_Bool IsMainThread() {
- return BoolToPPBool(GetMainThreadMessageLoop()->BelongsToCurrentThread());
+ return BoolToPPBool(PpapiGlobals::Get()->
+ GetMainThreadMessageLoop()->BelongsToCurrentThread());
}
const PPB_Core core_interface = {
@@ -427,7 +422,8 @@ PluginModule::PluginModule(const std::string& name,
memset(&entry_points_, 0, sizeof(entry_points_));
pp_module_ = HostGlobals::Get()->AddModule(this);
- GetMainThreadMessageLoop(); // Initialize the main thread message loop.
+ // Initialize the main thread message loop.
+ PpapiGlobals::Get()->GetMainThreadMessageLoop();
GetLivePluginSet()->insert(this);
}
« no previous file with comments | « webkit/plugins/ppapi/file_callbacks.cc ('k') | webkit/plugins/ppapi/ppapi_plugin_instance.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698