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

Unified Diff: ppapi/proxy/ppb_message_loop_proxy.h

Issue 10910099: PPAPI: Make CompletionCallbacks work right on background threads. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: merge Created 8 years, 1 month 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 | « ppapi/proxy/plugin_globals.cc ('k') | ppapi/proxy/ppb_message_loop_proxy.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ppapi/proxy/ppb_message_loop_proxy.h
diff --git a/ppapi/proxy/ppb_message_loop_proxy.h b/ppapi/proxy/ppb_message_loop_proxy.h
index 325be78c9f42bed43b44d33399bae67c1a5e7147..689e439bd57797e642a6d7f93e7d7c0eb9a28ac7 100644
--- a/ppapi/proxy/ppb_message_loop_proxy.h
+++ b/ppapi/proxy/ppb_message_loop_proxy.h
@@ -11,7 +11,7 @@
#include "base/memory/scoped_ptr.h"
#include "base/message_loop.h"
#include "ppapi/proxy/interface_proxy.h"
-#include "ppapi/shared_impl/resource.h"
+#include "ppapi/shared_impl/ppb_message_loop_shared.h"
#include "ppapi/thunk/ppb_message_loop_api.h"
struct PPB_MessageLoop_Dev_0_1;
@@ -19,13 +19,12 @@ struct PPB_MessageLoop_Dev_0_1;
namespace ppapi {
namespace proxy {
-class MessageLoopResource : public Resource, public thunk::PPB_MessageLoop_API {
+class MessageLoopResource : public MessageLoopShared {
public:
explicit MessageLoopResource(PP_Instance instance);
// Construct the one MessageLoopResource for the main thread. This must be
// invoked on the main thread.
- struct ForMainThread {};
- MessageLoopResource(ForMainThread);
+ explicit MessageLoopResource(ForMainThread);
virtual ~MessageLoopResource();
// Resource overrides.
@@ -38,6 +37,7 @@ class MessageLoopResource : public Resource, public thunk::PPB_MessageLoop_API {
int64_t delay_ms) OVERRIDE;
virtual int32_t PostQuit(PP_Bool should_destroy) OVERRIDE;
+ static MessageLoopResource* GetCurrent();
void DetachFromThread();
bool is_main_thread_loop() const {
return is_main_thread_loop_;
@@ -58,9 +58,9 @@ class MessageLoopResource : public Resource, public thunk::PPB_MessageLoop_API {
// NOTE: The given closure will be run *WITHOUT* acquiring the Proxy lock.
// This only makes sense for user code and completely thread-safe
// proxy operations (e.g., MessageLoop::QuitClosure).
- void PostClosure(const tracked_objects::Location& from_here,
- const base::Closure& closure,
- int64 delay_ms);
+ virtual void PostClosure(const tracked_objects::Location& from_here,
+ const base::Closure& closure,
+ int64 delay_ms) OVERRIDE;
// TLS destructor function.
static void ReleaseMessageLoop(void* value);
« no previous file with comments | « ppapi/proxy/plugin_globals.cc ('k') | ppapi/proxy/ppb_message_loop_proxy.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698