OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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/renderer/pepper/renderer_ppapi_host_impl.h" | 5 #include "content/renderer/pepper/renderer_ppapi_host_impl.h" |
6 | 6 |
7 #include "base/files/file_path.h" | 7 #include "base/files/file_path.h" |
8 #include "base/logging.h" | 8 #include "base/logging.h" |
9 #include "base/process/process_handle.h" | 9 #include "base/process/process_handle.h" |
10 #include "content/common/sandbox_util.h" | 10 #include "content/common/sandbox_util.h" |
(...skipping 207 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
218 base::GetCurrentProcId(), | 218 base::GetCurrentProcId(), |
219 should_close_source); | 219 should_close_source); |
220 } | 220 } |
221 return dispatcher_->ShareHandleWithRemote(handle, should_close_source); | 221 return dispatcher_->ShareHandleWithRemote(handle, should_close_source); |
222 } | 222 } |
223 | 223 |
224 bool RendererPpapiHostImpl::IsRunningInProcess() const { | 224 bool RendererPpapiHostImpl::IsRunningInProcess() const { |
225 return is_running_in_process_; | 225 return is_running_in_process_; |
226 } | 226 } |
227 | 227 |
228 void RendererPpapiHostImpl::CreateBrowserResourceHost( | 228 void RendererPpapiHostImpl::CreateBrowserResourceHosts( |
229 PP_Instance instance, | 229 PP_Instance instance, |
230 const IPC::Message& nested_msg, | 230 const std::vector<IPC::Message>& nested_msgs, |
231 const base::Callback<void(int)>& callback) const { | 231 const base::Callback<void(const std::vector<int>&)>& callback) const { |
232 RenderView* render_view = GetRenderViewForInstance(instance); | 232 RenderView* render_view = GetRenderViewForInstance(instance); |
233 PepperBrowserConnection* browser_connection = | 233 PepperBrowserConnection* browser_connection = |
234 PepperBrowserConnection::Get(render_view); | 234 PepperBrowserConnection::Get(render_view); |
235 if (!browser_connection) { | 235 if (!browser_connection) { |
236 callback.Run(0); | 236 callback.Run(std::vector<int>(nested_msgs.size(), 0)); |
237 } else { | 237 } else { |
238 browser_connection->SendBrowserCreate(module_->GetPluginChildId(), | 238 browser_connection->SendBrowserCreate(module_->GetPluginChildId(), |
239 instance, | 239 instance, |
240 nested_msg, | 240 nested_msgs, |
241 callback); | 241 callback); |
242 } | 242 } |
243 } | 243 } |
244 | 244 |
245 PepperPluginInstanceImpl* RendererPpapiHostImpl::GetAndValidateInstance( | 245 PepperPluginInstanceImpl* RendererPpapiHostImpl::GetAndValidateInstance( |
246 PP_Instance pp_instance) const { | 246 PP_Instance pp_instance) const { |
247 PepperPluginInstanceImpl* instance = | 247 PepperPluginInstanceImpl* instance = |
248 HostGlobals::Get()->GetInstance(pp_instance); | 248 HostGlobals::Get()->GetInstance(pp_instance); |
249 if (!instance) | 249 if (!instance) |
250 return NULL; | 250 return NULL; |
251 if (!instance->IsValidInstanceOf(module_)) | 251 if (!instance->IsValidInstanceOf(module_)) |
252 return NULL; | 252 return NULL; |
253 return instance; | 253 return instance; |
254 } | 254 } |
255 | 255 |
256 } // namespace content | 256 } // namespace content |
OLD | NEW |