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/file_path.h" | 7 #include "base/file_path.h" |
8 #include "base/logging.h" | 8 #include "base/logging.h" |
9 #include "content/renderer/pepper/pepper_graphics_2d_host.h" | 9 #include "content/renderer/pepper/pepper_graphics_2d_host.h" |
10 #include "content/renderer/pepper/pepper_in_process_resource_creation.h" | 10 #include "content/renderer/pepper/pepper_in_process_resource_creation.h" |
(...skipping 15 matching lines...) Expand all Loading... |
26 using webkit::ppapi::PluginInstance; | 26 using webkit::ppapi::PluginInstance; |
27 using webkit::ppapi::PluginModule; | 27 using webkit::ppapi::PluginModule; |
28 | 28 |
29 namespace content { | 29 namespace content { |
30 | 30 |
31 // static | 31 // static |
32 CONTENT_EXPORT RendererPpapiHost* | 32 CONTENT_EXPORT RendererPpapiHost* |
33 RendererPpapiHost::CreateExternalPluginModule( | 33 RendererPpapiHost::CreateExternalPluginModule( |
34 scoped_refptr<PluginModule> plugin_module, | 34 scoped_refptr<PluginModule> plugin_module, |
35 PluginInstance* plugin_instance, | 35 PluginInstance* plugin_instance, |
36 const FilePath& file_path, | 36 const base::FilePath& file_path, |
37 ppapi::PpapiPermissions permissions, | 37 ppapi::PpapiPermissions permissions, |
38 const IPC::ChannelHandle& channel_handle, | 38 const IPC::ChannelHandle& channel_handle, |
39 base::ProcessId plugin_pid, | 39 base::ProcessId plugin_pid, |
40 int plugin_child_id) { | 40 int plugin_child_id) { |
41 RendererPpapiHost* renderer_ppapi_host = NULL; | 41 RendererPpapiHost* renderer_ppapi_host = NULL; |
42 // Since we're the embedder, we can make assumptions about the delegate on | 42 // Since we're the embedder, we can make assumptions about the delegate on |
43 // the instance. | 43 // the instance. |
44 PepperPluginDelegateImpl* pepper_plugin_delegate = | 44 PepperPluginDelegateImpl* pepper_plugin_delegate = |
45 static_cast<PepperPluginDelegateImpl*>(plugin_instance->delegate()); | 45 static_cast<PepperPluginDelegateImpl*>(plugin_instance->delegate()); |
46 if (pepper_plugin_delegate) { | 46 if (pepper_plugin_delegate) { |
(...skipping 213 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
260 PP_Instance pp_instance) const { | 260 PP_Instance pp_instance) const { |
261 PluginInstance* instance = HostGlobals::Get()->GetInstance(pp_instance); | 261 PluginInstance* instance = HostGlobals::Get()->GetInstance(pp_instance); |
262 if (!instance) | 262 if (!instance) |
263 return NULL; | 263 return NULL; |
264 if (!instance->IsValidInstanceOf(module_)) | 264 if (!instance->IsValidInstanceOf(module_)) |
265 return NULL; | 265 return NULL; |
266 return instance; | 266 return instance; |
267 } | 267 } |
268 | 268 |
269 } // namespace content | 269 } // namespace content |
OLD | NEW |