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

Unified Diff: ppapi/proxy/plugin_message_filter.h

Issue 46433002: Support using TrackedCallbacks as hints to determine the handling thread of resource reply messages (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fix tests Created 7 years 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: ppapi/proxy/plugin_message_filter.h
diff --git a/ppapi/proxy/plugin_message_filter.h b/ppapi/proxy/plugin_message_filter.h
index 5701a96a09acc52e40d99f8bd4645a05ea8956d2..43e117c5580307f7c5385bb227095830764d1949 100644
--- a/ppapi/proxy/plugin_message_filter.h
+++ b/ppapi/proxy/plugin_message_filter.h
@@ -11,23 +11,30 @@
#include "ipc/ipc_channel_proxy.h"
#include "ipc/ipc_sender.h"
#include "ppapi/c/pp_instance.h"
+#include "ppapi/proxy/ppapi_proxy_export.h"
namespace ppapi {
namespace proxy {
+class ResourceMessageReplyParams;
+class ResourceReplyThreadRegistrar;
+
// Listens for messages on the I/O thread of the plugin and handles some of
// them to avoid needing to block on the plugin.
//
// There is one instance of this class for each renderer channel (same as for
// the PluginDispatchers).
-class PluginMessageFilter : public IPC::ChannelProxy::MessageFilter,
- public IPC::Sender {
+class PPAPI_PROXY_EXPORT PluginMessageFilter
+ : public IPC::ChannelProxy::MessageFilter,
+ public IPC::Sender {
public:
// The input is a pointer to a set that will be used to uniquify PP_Instances
dmichael (off chromium) 2013/12/11 21:30:36 nit: this documentation is a little out of date, w
yzshen1 2013/12/11 22:22:07 I think you might be reading an old patchset. Plea
// across all renderer channels. The same pointer should be passed to each
// MessageFilter to ensure uniqueness, and the value should outlive this
// class.
- PluginMessageFilter(std::set<PP_Instance>* seen_instance_ids);
+ PluginMessageFilter(
+ std::set<PP_Instance>* seen_instance_ids,
+ scoped_refptr<ResourceReplyThreadRegistrar> thread_registrar);
virtual ~PluginMessageFilter();
// MessageFilter implementation.
@@ -38,14 +45,26 @@ class PluginMessageFilter : public IPC::ChannelProxy::MessageFilter,
// IPC::Sender implementation.
virtual bool Send(IPC::Message* msg) OVERRIDE;
+ static void DispatchResourceReplyForTest(
+ const ResourceMessageReplyParams& reply_params,
+ const IPC::Message& nested_msg);
+
private:
void OnMsgReserveInstanceId(PP_Instance instance, bool* usable);
+ void OnMsgResourceReply(const ResourceMessageReplyParams& reply_params,
+ const IPC::Message& nested_msg);
+
+ static void DispatchResourceReply(
+ const ResourceMessageReplyParams& reply_params,
+ const IPC::Message& nested_msg);
// All instance IDs every queried by any renderer on this plugin. This is
// used to make sure that new instance IDs are unique. This is a non-owning
// pointer, it will be managed by the later that creates this class.
dmichael (off chromium) 2013/12/11 21:30:36 Not part of your CL, but... "later"->"delegate"?
yzshen1 2013/12/11 22:22:07 Done. I changed to: "It is managed by PluginDispa
std::set<PP_Instance>* seen_instance_ids_;
+ scoped_refptr<ResourceReplyThreadRegistrar> resource_reply_thread_registrar_;
+
// The IPC channel to the renderer. May be NULL if we're not currently
// attached as a filter.
IPC::Channel* channel_;

Powered by Google App Engine
This is Rietveld 408576698