Index: content/renderer/pepper/pepper_browser_connection.h |
diff --git a/content/renderer/pepper/pepper_browser_connection.h b/content/renderer/pepper/pepper_browser_connection.h |
index 241d6123d9e50966855cc0db6d70f5abc262a15f..4af5970285806ac16e6d1ff9a77b90b68ecf5b8b 100644 |
--- a/content/renderer/pepper/pepper_browser_connection.h |
+++ b/content/renderer/pepper/pepper_browser_connection.h |
@@ -19,6 +19,12 @@ |
class GURL; |
+namespace ppapi { |
+namespace proxy { |
+struct CompletedBrowserResourceHosts; |
+} |
+} |
+ |
namespace content { |
// This class represents a connection from the renderer to the browser for |
@@ -29,8 +35,9 @@ class PepperBrowserConnection |
: public RenderFrameObserver, |
public RenderFrameObserverTracker<PepperBrowserConnection> { |
public: |
- typedef base::Callback<void(const std::vector<int>&)> |
- PendingResourceIDCallback; |
+ typedef |
+ base::Callback<void(const ppapi::proxy::CompletedBrowserResourceHosts&)> |
+ PendingResourceCallback; |
explicit PepperBrowserConnection(RenderFrame* render_frame); |
~PepperBrowserConnection() override; |
@@ -42,10 +49,16 @@ class PepperBrowserConnection |
// Sends a request to the browser to create ResourceHosts for the given |
// |instance| of a plugin identified by |child_process_id|. |callback| will be |
// run when a reply is received with the pending resource IDs. |
- void SendBrowserCreate(PP_Instance instance, |
- int child_process_id, |
- const std::vector<IPC::Message>& create_messages, |
- const PendingResourceIDCallback& callback); |
+ // Returns the sequence id for this message, to aid in correlating the |
+ // responses. |
+ int32_t SendBrowserCreate(PP_Instance instance, |
+ int child_process_id, |
+ const std::vector<IPC::Message>& create_messages, |
+ const PendingResourceCallback& callback); |
+ void GetAllPendingBrowserHosts( |
+ PP_Instance instance, |
+ int child_process_id, |
+ std::vector<ppapi::proxy::CompletedBrowserResourceHosts>* result); |
// Called when the renderer creates an in-process instance. |
void DidCreateInProcessInstance(PP_Instance instance, |
@@ -57,10 +70,18 @@ class PepperBrowserConnection |
void DidDeleteInProcessInstance(PP_Instance instance); |
private: |
+ struct PendingResource { |
+ PendingResource(int child_process_id_param, |
+ PP_Instance instance_param, |
+ const PendingResourceCallback& callback_param); |
+ ~PendingResource(); |
+ int child_process_id; |
+ PP_Instance instance; |
+ PendingResourceCallback callback; |
+ }; |
// Message handlers. |
void OnMsgCreateResourceHostsFromHostReply( |
- int32_t sequence_number, |
- const std::vector<int>& pending_resource_host_ids); |
+ const ppapi::proxy::CompletedBrowserResourceHosts& hosts); |
// Return the next sequence number. |
int32_t GetNextSequence(); |
@@ -69,7 +90,7 @@ class PepperBrowserConnection |
int32_t next_sequence_number_; |
// Maps a sequence number to the callback to be run. |
- std::map<int32_t, PendingResourceIDCallback> pending_create_map_; |
+ std::map<int32_t, PendingResource> pending_create_map_; |
DISALLOW_COPY_AND_ASSIGN(PepperBrowserConnection); |
}; |