| Index: content/renderer/pepper/pepper_browser_connection.cc
|
| diff --git a/content/renderer/pepper/pepper_browser_connection.cc b/content/renderer/pepper/pepper_browser_connection.cc
|
| index 892506ede2f22526f71e64034407459c69121ee6..8ec80d32958d5f6db19544a1ce58e2516755b00a 100644
|
| --- a/content/renderer/pepper/pepper_browser_connection.cc
|
| +++ b/content/renderer/pepper/pepper_browser_connection.cc
|
| @@ -13,6 +13,7 @@
|
| #include "ipc/ipc_message_macros.h"
|
| #include "ppapi/proxy/ppapi_messages.h"
|
| #include "ppapi/proxy/resource_message_params.h"
|
| +#include "ppapi/proxy/serialized_structs.h"
|
|
|
| namespace content {
|
|
|
| @@ -53,27 +54,40 @@ void PepperBrowserConnection::DidDeleteInProcessInstance(PP_Instance instance) {
|
| Send(new ViewHostMsg_DidDeleteInProcessInstance(instance));
|
| }
|
|
|
| -void PepperBrowserConnection::SendBrowserCreate(
|
| +int32_t PepperBrowserConnection::SendBrowserCreate(
|
| int child_process_id,
|
| PP_Instance instance,
|
| const std::vector<IPC::Message>& nested_msgs,
|
| - const PendingResourceIDCallback& callback) {
|
| + const ResourceHostCreationCallback& callback) {
|
| int32_t sequence_number = GetNextSequence();
|
| - pending_create_map_[sequence_number] = callback;
|
| + pending_create_map_.insert(std::map<int32_t, PendingResource>::value_type(
|
| + sequence_number, PendingResource(child_process_id, instance, callback)));
|
| ppapi::proxy::ResourceMessageCallParams params(0, sequence_number);
|
| Send(new PpapiHostMsg_CreateResourceHostsFromHost(
|
| routing_id(), child_process_id, params, instance, nested_msgs));
|
| + return sequence_number;
|
| +}
|
| +
|
| +PepperBrowserConnection::PendingResource::PendingResource(
|
| + int child_process_id_param,
|
| + PP_Instance instance_param,
|
| + const ResourceHostCreationCallback& callback_param)
|
| + : child_process_id(child_process_id_param),
|
| + instance(instance_param),
|
| + callback(callback_param) {
|
| +}
|
| +
|
| +PepperBrowserConnection::PendingResource::~PendingResource() {
|
| }
|
|
|
| void PepperBrowserConnection::OnMsgCreateResourceHostsFromHostReply(
|
| - int32_t sequence_number,
|
| - const std::vector<int>& pending_resource_host_ids) {
|
| + const ppapi::proxy::CompletedBrowserResourceHosts& hosts) {
|
| // Check that the message is destined for the plugin this object is associated
|
| // with.
|
| - std::map<int32_t, PendingResourceIDCallback>::iterator it =
|
| - pending_create_map_.find(sequence_number);
|
| + std::map<int32_t, PendingResource>::iterator it =
|
| + pending_create_map_.find(hosts.sequence_number);
|
| if (it != pending_create_map_.end()) {
|
| - it->second.Run(pending_resource_host_ids);
|
| + it->second.callback.Run(hosts);
|
| pending_create_map_.erase(it);
|
| } else {
|
| NOTREACHED();
|
|
|