OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "content/browser/renderer_host/pepper/pepper_renderer_connection.h" | 5 #include "content/browser/renderer_host/pepper/pepper_renderer_connection.h" |
6 | 6 |
7 #include <stddef.h> | 7 #include <stddef.h> |
8 #include <stdint.h> | 8 #include <stdint.h> |
| 9 #include <utility> |
9 | 10 |
10 #include "base/bind.h" | 11 #include "base/bind.h" |
11 #include "base/macros.h" | 12 #include "base/macros.h" |
12 #include "base/memory/ref_counted.h" | 13 #include "base/memory/ref_counted.h" |
13 #include "content/browser/browser_child_process_host_impl.h" | 14 #include "content/browser/browser_child_process_host_impl.h" |
14 #include "content/browser/ppapi_plugin_process_host.h" | 15 #include "content/browser/ppapi_plugin_process_host.h" |
15 #include "content/browser/renderer_host/pepper/browser_ppapi_host_impl.h" | 16 #include "content/browser/renderer_host/pepper/browser_ppapi_host_impl.h" |
16 #include "content/browser/renderer_host/pepper/pepper_file_ref_host.h" | 17 #include "content/browser/renderer_host/pepper/pepper_file_ref_host.h" |
17 #include "content/browser/renderer_host/pepper/pepper_file_system_browser_host.h
" | 18 #include "content/browser/renderer_host/pepper/pepper_file_system_browser_host.h
" |
18 #include "content/common/frame_messages.h" | 19 #include "content/common/frame_messages.h" |
(...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
75 : host_(host), | 76 : host_(host), |
76 connection_(connection), | 77 connection_(connection), |
77 routing_id_(routing_id), | 78 routing_id_(routing_id), |
78 sequence_id_(sequence_id), | 79 sequence_id_(sequence_id), |
79 pending_resource_host_ids_(nested_msgs_size, 0) {} | 80 pending_resource_host_ids_(nested_msgs_size, 0) {} |
80 | 81 |
81 void PendingHostCreator::AddPendingResourceHost( | 82 void PendingHostCreator::AddPendingResourceHost( |
82 size_t index, | 83 size_t index, |
83 scoped_ptr<ppapi::host::ResourceHost> resource_host) { | 84 scoped_ptr<ppapi::host::ResourceHost> resource_host) { |
84 pending_resource_host_ids_[index] = | 85 pending_resource_host_ids_[index] = |
85 host_->GetPpapiHost()->AddPendingResourceHost(resource_host.Pass()); | 86 host_->GetPpapiHost()->AddPendingResourceHost(std::move(resource_host)); |
86 } | 87 } |
87 | 88 |
88 PendingHostCreator::~PendingHostCreator() { | 89 PendingHostCreator::~PendingHostCreator() { |
89 connection_->Send(new PpapiHostMsg_CreateResourceHostsFromHostReply( | 90 connection_->Send(new PpapiHostMsg_CreateResourceHostsFromHostReply( |
90 routing_id_, sequence_id_, pending_resource_host_ids_)); | 91 routing_id_, sequence_id_, pending_resource_host_ids_)); |
91 } | 92 } |
92 | 93 |
93 } // namespace | 94 } // namespace |
94 | 95 |
95 PepperRendererConnection::PepperRendererConnection(int render_process_id) | 96 PepperRendererConnection::PepperRendererConnection(int render_process_id) |
(...skipping 115 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
211 } | 212 } |
212 } | 213 } |
213 } | 214 } |
214 | 215 |
215 if (!resource_host.get()) { | 216 if (!resource_host.get()) { |
216 resource_host = host->GetPpapiHost()->CreateResourceHost( | 217 resource_host = host->GetPpapiHost()->CreateResourceHost( |
217 params.pp_resource(), instance, nested_msg); | 218 params.pp_resource(), instance, nested_msg); |
218 } | 219 } |
219 | 220 |
220 if (resource_host.get()) | 221 if (resource_host.get()) |
221 creator->AddPendingResourceHost(i, resource_host.Pass()); | 222 creator->AddPendingResourceHost(i, std::move(resource_host)); |
222 } | 223 } |
223 | 224 |
224 // Note: All of the pending host IDs that were added as part of this | 225 // Note: All of the pending host IDs that were added as part of this |
225 // operation will automatically be sent to the plugin when |creator| is | 226 // operation will automatically be sent to the plugin when |creator| is |
226 // released. This may happen immediately, or (if there are asynchronous | 227 // released. This may happen immediately, or (if there are asynchronous |
227 // requests to create resource hosts), once all of them complete. | 228 // requests to create resource hosts), once all of them complete. |
228 } | 229 } |
229 | 230 |
230 void PepperRendererConnection::OnMsgDidCreateInProcessInstance( | 231 void PepperRendererConnection::OnMsgDidCreateInProcessInstance( |
231 PP_Instance instance, | 232 PP_Instance instance, |
232 const PepperRendererInstanceData& instance_data) { | 233 const PepperRendererInstanceData& instance_data) { |
233 PepperRendererInstanceData data = instance_data; | 234 PepperRendererInstanceData data = instance_data; |
234 data.render_process_id = render_process_id_; | 235 data.render_process_id = render_process_id_; |
235 in_process_host_->AddInstance(instance, data); | 236 in_process_host_->AddInstance(instance, data); |
236 } | 237 } |
237 | 238 |
238 void PepperRendererConnection::OnMsgDidDeleteInProcessInstance( | 239 void PepperRendererConnection::OnMsgDidDeleteInProcessInstance( |
239 PP_Instance instance) { | 240 PP_Instance instance) { |
240 in_process_host_->DeleteInstance(instance); | 241 in_process_host_->DeleteInstance(instance); |
241 } | 242 } |
242 | 243 |
243 } // namespace content | 244 } // namespace content |
OLD | NEW |