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

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: Updated TestURLLoader to test blocking callbacks. 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 side-by-side diff with in-line comments
Download patch
Index: webkit/plugins/ppapi/plugin_module.cc
diff --git a/webkit/plugins/ppapi/plugin_module.cc b/webkit/plugins/ppapi/plugin_module.cc
index 0caf655ad4a34ea3f460cc12c9bf68098ed14157..c92ff85fb280d00866dd98b91f7084de4bbafdbb 100644
--- a/webkit/plugins/ppapi/plugin_module.cc
+++ b/webkit/plugins/ppapi/plugin_module.cc
@@ -155,12 +155,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) {
@@ -183,7 +177,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));
@@ -191,7 +185,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 = {
@@ -448,7 +443,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);
}

Powered by Google App Engine
This is Rietveld 408576698