Index: ppapi/proxy/plugin_resource.h |
diff --git a/ppapi/proxy/plugin_resource.h b/ppapi/proxy/plugin_resource.h |
index 28d1274954583614340c2b47ad6e83542888b529..972908a6ddfdc9d99bdcb5f185f211116909f228 100644 |
--- a/ppapi/proxy/plugin_resource.h |
+++ b/ppapi/proxy/plugin_resource.h |
@@ -7,6 +7,7 @@ |
#include "base/compiler_specific.h" |
#include "ipc/ipc_sender.h" |
+#include "ppapi/proxy/connection.h" |
#include "ppapi/proxy/ppapi_proxy_export.h" |
#include "ppapi/shared_impl/resource.h" |
@@ -19,40 +20,43 @@ namespace proxy { |
class PluginDispatcher; |
-class PPAPI_PROXY_EXPORT PluginResource : public Resource, |
- public IPC::Sender { |
+class PPAPI_PROXY_EXPORT PluginResource : public Resource { |
public: |
- PluginResource(IPC::Sender* sender, |
- PP_Instance instance); |
+ PluginResource(Connection connection, PP_Instance instance); |
virtual ~PluginResource(); |
- // IPC::Sender implementation. |
- virtual bool Send(IPC::Message* message) OVERRIDE; |
- |
+ // Returns true if we've previously sent a create message to the browser |
+ // or renderer. Generally resources will use these to tell if they should |
+ // lazily send create messages. |
+ bool sent_create_to_browser() const { return sent_create_to_browser_; } |
bool sent_create_to_renderer() const { return sent_create_to_renderer_; } |
protected: |
- // Sends a create message to the renderer for the current resource. |
+ // Sends a create message to the browser or renderer for the current resource. |
+ void SendCreateToBrowser(const IPC::Message& msg); |
void SendCreateToRenderer(const IPC::Message& msg); |
// Sends the given IPC message as a resource request to the host |
// corresponding to this resource object and does not expect a reply. |
+ void PostToBrowser(const IPC::Message& msg); |
void PostToRenderer(const IPC::Message& msg); |
- // Like PostToRenderer but expects a response. |
+ // Like PostToBrowser/Renderer but expects a response. |
// |
// Returns the new request's sequence number which can be used to identify |
// the callback. The host will reply and ppapi::Resource::OnReplyReceived |
// will be called. |
// |
// Note that all integers (including 0 and -1) are valid request IDs. |
+ int32_t CallBrowser(const IPC::Message& msg); |
int32_t CallRenderer(const IPC::Message& msg); |
private: |
- IPC::Sender* sender_; |
+ Connection connection_; |
int32_t next_sequence_number_; |
+ bool sent_create_to_browser_; |
bool sent_create_to_renderer_; |
DISALLOW_COPY_AND_ASSIGN(PluginResource); |