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 #include <utility> |
10 | 10 |
(...skipping 214 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
225 // 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 |
226 // operation will automatically be sent to the plugin when |creator| is | 226 // operation will automatically be sent to the plugin when |creator| is |
227 // released. This may happen immediately, or (if there are asynchronous | 227 // released. This may happen immediately, or (if there are asynchronous |
228 // requests to create resource hosts), once all of them complete. | 228 // requests to create resource hosts), once all of them complete. |
229 } | 229 } |
230 | 230 |
231 void PepperRendererConnection::OnMsgDidCreateInProcessInstance( | 231 void PepperRendererConnection::OnMsgDidCreateInProcessInstance( |
232 PP_Instance instance, | 232 PP_Instance instance, |
233 const PepperRendererInstanceData& instance_data) { | 233 const PepperRendererInstanceData& instance_data) { |
234 PepperRendererInstanceData data = instance_data; | 234 PepperRendererInstanceData data = instance_data; |
| 235 // It's important that we supply the render process ID ourselves since the |
| 236 // message may be coming from a compromised renderer. |
235 data.render_process_id = render_process_id_; | 237 data.render_process_id = render_process_id_; |
| 238 // 'instance' is possibly invalid. The host must be careful not to trust it. |
236 in_process_host_->AddInstance(instance, data); | 239 in_process_host_->AddInstance(instance, data); |
237 } | 240 } |
238 | 241 |
239 void PepperRendererConnection::OnMsgDidDeleteInProcessInstance( | 242 void PepperRendererConnection::OnMsgDidDeleteInProcessInstance( |
240 PP_Instance instance) { | 243 PP_Instance instance) { |
| 244 // 'instance' is possibly invalid. The host must be careful not to trust it. |
241 in_process_host_->DeleteInstance(instance); | 245 in_process_host_->DeleteInstance(instance); |
242 } | 246 } |
243 | 247 |
244 } // namespace content | 248 } // namespace content |
OLD | NEW |