Index: ppapi/proxy/resource_reply_thread_registrar.h |
diff --git a/ppapi/proxy/resource_reply_thread_registrar.h b/ppapi/proxy/resource_reply_thread_registrar.h |
index eef6d615965cf6a4656ecba302f028b541ff3b2d..ded54e9de3d90850122c9404fbef7e61d528e1bd 100644 |
--- a/ppapi/proxy/resource_reply_thread_registrar.h |
+++ b/ppapi/proxy/resource_reply_thread_registrar.h |
@@ -6,6 +6,7 @@ |
#define PPAPI_PROXY_RESOURCE_REPLY_THREAD_REGISTRAR_H_ |
#include <map> |
+#include <set> |
#include "base/basictypes.h" |
#include "base/memory/ref_counted.h" |
@@ -18,12 +19,18 @@ namespace base { |
class MessageLoopProxy; |
} |
+namespace IPC { |
+class Message; |
+} |
+ |
namespace ppapi { |
class TrackedCallback; |
namespace proxy { |
+class ResourceMessageReplyParams; |
+ |
// ResourceReplyThreadRegistrar records the handling thread for |
// PpapiPluginMsg_ResourceReply messages. |
// This class is thread safe. |
@@ -31,26 +38,32 @@ class PPAPI_PROXY_EXPORT ResourceReplyThreadRegistrar |
: public base::RefCountedThreadSafe<ResourceReplyThreadRegistrar> { |
public: |
explicit ResourceReplyThreadRegistrar( |
- scoped_refptr<base::MessageLoopProxy> default_thread); |
+ scoped_refptr<base::MessageLoopProxy> main_thread); |
// This method can only be called while holding the Pepper proxy lock; the |
// other methods can be called with/without the Pepper proxy lock. |
void Register(PP_Resource resource, |
int32_t sequence_number, |
scoped_refptr<TrackedCallback> reply_thread_hint); |
- |
void Unregister(PP_Resource resource); |
- scoped_refptr<base::MessageLoopProxy> GetTargetThreadAndUnregister( |
- PP_Resource resource, |
- int32_t sequence_number); |
+ // This results in Resource::OnReplyReceived() for the specified message type |
+ // to be called on the IO thread directly, while holding the Pepper proxy |
+ // lock. |
+ void HandleOnIOThread(uint32 nested_msg_type); |
+ |
+ // This method returns NULL if the target thread is the IO thread (because |
+ // that is the thread on which this method is supposed to be called). |
+ scoped_refptr<base::MessageLoopProxy> GetTargetThread( |
+ const ResourceMessageReplyParams& reply_params, |
+ const IPC::Message& nested_msg); |
private: |
friend class base::RefCountedThreadSafe<ResourceReplyThreadRegistrar>; |
typedef std::map<int32_t, scoped_refptr<base::MessageLoopProxy> > |
- SequenceNumberMap; |
- typedef std::map<PP_Resource, SequenceNumberMap> ResourceMap; |
+ SequenceThreadMap; |
+ typedef std::map<PP_Resource, SequenceThreadMap> ResourceMap; |
~ResourceReplyThreadRegistrar(); |
@@ -59,7 +72,8 @@ class PPAPI_PROXY_EXPORT ResourceReplyThreadRegistrar |
// holding |lock_|, otherwise we will cause deadlock. |
base::Lock lock_; |
ResourceMap map_; |
- scoped_refptr<base::MessageLoopProxy> default_thread_; |
+ std::set<uint32> io_thread_message_types_; |
+ scoped_refptr<base::MessageLoopProxy> main_thread_; |
DISALLOW_COPY_AND_ASSIGN(ResourceReplyThreadRegistrar); |
}; |