Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(354)

Side by Side Diff: content/renderer/pepper/renderer_ppapi_host_impl.cc

Issue 11722017: Use an explicit PID for duplicating Pepper handles rather than the Channel's. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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 18 matching lines...) Expand all
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 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 int plugin_child_id) { 40 int plugin_child_id) {
40 RendererPpapiHost* renderer_ppapi_host = NULL; 41 RendererPpapiHost* renderer_ppapi_host = NULL;
41 // 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
42 // the instance. 43 // the instance.
43 PepperPluginDelegateImpl* pepper_plugin_delegate = 44 PepperPluginDelegateImpl* pepper_plugin_delegate =
44 static_cast<PepperPluginDelegateImpl*>(plugin_instance->delegate()); 45 static_cast<PepperPluginDelegateImpl*>(plugin_instance->delegate());
45 if (pepper_plugin_delegate) { 46 if (pepper_plugin_delegate) {
46 renderer_ppapi_host = pepper_plugin_delegate->CreateExternalPluginModule( 47 renderer_ppapi_host = pepper_plugin_delegate->CreateExternalPluginModule(
47 plugin_module, 48 plugin_module,
48 file_path, 49 file_path,
49 permissions, 50 permissions,
50 channel_handle, 51 channel_handle,
52 plugin_pid,
51 plugin_child_id); 53 plugin_child_id);
52 } 54 }
53 return renderer_ppapi_host; 55 return renderer_ppapi_host;
54 } 56 }
55 57
56 // static 58 // static
57 CONTENT_EXPORT RendererPpapiHost* 59 CONTENT_EXPORT RendererPpapiHost*
58 RendererPpapiHost::GetForPPInstance(PP_Instance instance) { 60 RendererPpapiHost::GetForPPInstance(PP_Instance instance) {
59 return RendererPpapiHostImpl::GetForPPInstance(instance); 61 return RendererPpapiHostImpl::GetForPPInstance(instance);
60 } 62 }
(...skipping 197 matching lines...) Expand 10 before | Expand all | Expand 10 after
258 PP_Instance pp_instance) const { 260 PP_Instance pp_instance) const {
259 PluginInstance* instance = HostGlobals::Get()->GetInstance(pp_instance); 261 PluginInstance* instance = HostGlobals::Get()->GetInstance(pp_instance);
260 if (!instance) 262 if (!instance)
261 return NULL; 263 return NULL;
262 if (instance->module() != module_) 264 if (instance->module() != module_)
263 return NULL; 265 return NULL;
264 return instance; 266 return instance;
265 } 267 }
266 268
267 } // namespace content 269 } // namespace content
OLDNEW
« no previous file with comments | « content/renderer/pepper/pepper_proxy_channel_delegate_impl.cc ('k') | content/renderer/render_view_impl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698