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

Unified Diff: chrome/browser/chrome_content_browser_client.cc

Issue 11368019: Add support for external out-of-process PPAPI plugins in the browser. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 8 years, 1 month 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/browser/chrome_content_browser_client.h ('k') | chrome/browser/nacl_host/nacl_process_host.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/chrome_content_browser_client.cc
===================================================================
--- chrome/browser/chrome_content_browser_client.cc (revision 166155)
+++ chrome/browser/chrome_content_browser_client.cc (working copy)
@@ -40,6 +40,7 @@
#include "chrome/browser/google/google_util.h"
#include "chrome/browser/infobars/infobar_tab_helper.h"
#include "chrome/browser/media/media_internals.h"
+#include "chrome/browser/nacl_host/nacl_process_host.h"
#include "chrome/browser/net/chrome_net_log.h"
#include "chrome/browser/notifications/desktop_notification_service.h"
#include "chrome/browser/notifications/desktop_notification_service_factory.h"
@@ -89,6 +90,7 @@
#include "content/public/browser/browser_main_parts.h"
#include "content/public/browser/browser_ppapi_host.h"
#include "content/public/browser/browser_url_handler.h"
+#include "content/public/browser/child_process_data.h"
#include "content/public/browser/child_process_security_policy.h"
#include "content/public/browser/compositor_util.h"
#include "content/public/browser/render_process_host.h"
@@ -147,6 +149,7 @@
using base::FileDescriptor;
using content::AccessTokenStore;
+using content::BrowserChildProcessHostIterator;
using content::BrowserThread;
using content::BrowserURLHandler;
using content::ChildProcessSecurityPolicy;
@@ -1712,6 +1715,22 @@
new ChromeBrowserPepperHostFactory(browser_host)));
}
+content::BrowserPpapiHost*
+ ChromeContentBrowserClient::GetExternalBrowserPpapiHost(
+ int plugin_process_id) {
+ BrowserChildProcessHostIterator iter(content::PROCESS_TYPE_NACL_LOADER);
+ while (!iter.Done()) {
+ NaClProcessHost* host = static_cast<NaClProcessHost*>(iter.GetDelegate());
+ if (host->process() &&
+ host->process()->GetData().id == plugin_process_id) {
+ // Found the plugin.
+ return host->browser_ppapi_host();
+ }
+ ++iter;
+ }
+ return NULL;
+}
+
bool ChromeContentBrowserClient::AllowPepperSocketAPI(
content::BrowserContext* browser_context,
const GURL& url,
« no previous file with comments | « chrome/browser/chrome_content_browser_client.h ('k') | chrome/browser/nacl_host/nacl_process_host.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698