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

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

Issue 11140046: Add a content API to connect a Native Client module to an out-of-process PPAPI proxy. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 8 years, 2 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/pepper_plugin_delegate_impl.h" 5 #include "content/renderer/pepper/pepper_plugin_delegate_impl.h"
6 6
7 #include <cmath> 7 #include <cmath>
8 #include <cstddef> 8 #include <cstddef>
9 #include <map> 9 #include <map>
10 #include <queue> 10 #include <queue>
(...skipping 397 matching lines...) Expand 10 before | Expand all | Expand 10 after
408 RendererPpapiHostImpl* host_impl = 408 RendererPpapiHostImpl* host_impl =
409 content::RendererPpapiHostImpl::CreateOnModuleForOutOfProcess( 409 content::RendererPpapiHostImpl::CreateOnModuleForOutOfProcess(
410 module, dispatcher->dispatcher(), permissions); 410 module, dispatcher->dispatcher(), permissions);
411 render_view_->PpapiPluginCreated(host_impl); 411 render_view_->PpapiPluginCreated(host_impl);
412 412
413 module->InitAsProxied(dispatcher.release()); 413 module->InitAsProxied(dispatcher.release());
414 return module; 414 return module;
415 } 415 }
416 416
417 scoped_refptr<webkit::ppapi::PluginModule> 417 scoped_refptr<webkit::ppapi::PluginModule>
418 PepperPluginDelegateImpl::CreateNaClPluginModule(
brettw 2012/10/16 18:23:53 Let's call this "CreateExternalPluginModule" and p
bbudge 2012/10/16 21:03:38 Done.
419 webkit::ppapi::PluginInstance* plugin_instance,
420 ppapi::PpapiPermissions permissions,
421 const IPC::ChannelHandle& channel_handle,
422 int nacl_process_id) {
423 // Create a new module for each instance of the NaCl plugin that is using
424 // the IPC based out-of-process proxy. We can't use the existing module,
425 // because it is configured for the in-process NaCl plugin, and we must
426 // keep it that way to allow the page to create other instances.
427 webkit::ppapi::PluginModule* plugin_module = plugin_instance->module();
428 scoped_refptr<webkit::ppapi::PluginModule> nacl_plugin_module(
429 plugin_module->CreateModuleForNaClInstance());
430
431 scoped_refptr<PepperHungPluginFilter> hung_filter(
432 new PepperHungPluginFilter(
433 FilePath(FILE_PATH_LITERAL("NaCl")),
434 render_view_->routing_id(),
435 nacl_process_id));
436
437 // Create a new HostDispatcher for the proxy, and hook it up to the new
438 // PluginModule.
439 scoped_ptr<HostDispatcherWrapper> dispatcher(
440 new HostDispatcherWrapper(nacl_plugin_module,
441 nacl_process_id,
442 permissions));
443 if (!dispatcher->Init(
444 channel_handle,
445 webkit::ppapi::PluginModule::GetLocalGetInterfaceFunc(),
446 GetPreferences(),
447 permissions,
448 hung_filter.get()))
449 return scoped_refptr<webkit::ppapi::PluginModule>();
450
451 RendererPpapiHostImpl* host_impl =
452 content::RendererPpapiHostImpl::CreateOnModuleForOutOfProcess(
453 nacl_plugin_module, dispatcher->dispatcher(), permissions);
454 render_view_->PpapiPluginCreated(host_impl);
455
456 nacl_plugin_module->InitAsProxiedNaCl(
457 dispatcher.release(),
458 plugin_instance);
459 return nacl_plugin_module;
460 }
461
462 scoped_refptr<webkit::ppapi::PluginModule>
418 PepperPluginDelegateImpl::CreateBrowserPluginModule( 463 PepperPluginDelegateImpl::CreateBrowserPluginModule(
419 const IPC::ChannelHandle& channel_handle, 464 const IPC::ChannelHandle& channel_handle,
420 int guest_process_id) { 465 int guest_process_id) {
421 content::old::BrowserPluginRegistry* registry = 466 content::old::BrowserPluginRegistry* registry =
422 RenderThreadImpl::current()->browser_plugin_registry(); 467 RenderThreadImpl::current()->browser_plugin_registry();
423 scoped_refptr<webkit::ppapi::PluginModule> module = 468 scoped_refptr<webkit::ppapi::PluginModule> module =
424 registry->GetModule(guest_process_id); 469 registry->GetModule(guest_process_id);
425 if (module) 470 if (module)
426 return module; 471 return module;
427 472
(...skipping 1432 matching lines...) Expand 10 before | Expand all | Expand 10 after
1860 else 1905 else
1861 return render_view_->mouse_lock_dispatcher(); 1906 return render_view_->mouse_lock_dispatcher();
1862 } 1907 }
1863 1908
1864 webkit_glue::ClipboardClient* 1909 webkit_glue::ClipboardClient*
1865 PepperPluginDelegateImpl::CreateClipboardClient() const { 1910 PepperPluginDelegateImpl::CreateClipboardClient() const {
1866 return new RendererClipboardClient; 1911 return new RendererClipboardClient;
1867 } 1912 }
1868 1913
1869 } // namespace content 1914 } // namespace content
OLDNEW
« no previous file with comments | « content/renderer/pepper/pepper_plugin_delegate_impl.h ('k') | webkit/plugins/ppapi/plugin_module.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698