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

Unified Diff: content/browser/plugin_service_impl.cc

Issue 12315023: Merge 180159 (Closed) Base URL: svn://svn.chromium.org/chrome/branches/1364/src/
Patch Set: Created 7 years, 10 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « content/browser/plugin_service_impl.h ('k') | content/browser/plugin_service_impl_browsertest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/browser/plugin_service_impl.cc
===================================================================
--- content/browser/plugin_service_impl.cc (revision 183671)
+++ content/browser/plugin_service_impl.cc (working copy)
@@ -243,9 +243,13 @@
}
PluginProcessHost* PluginServiceImpl::FindOrStartNpapiPluginProcess(
+ int render_process_id,
const FilePath& plugin_path) {
DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO));
+ if (filter_ && !filter_->CanLoadPlugin(render_process_id, plugin_path))
+ return NULL;
+
PluginProcessHost* plugin_host = FindNpapiPluginProcess(plugin_path);
if (plugin_host)
return plugin_host;
@@ -265,12 +269,16 @@
}
PpapiPluginProcessHost* PluginServiceImpl::FindOrStartPpapiPluginProcess(
+ int render_process_id,
const FilePath& plugin_path,
const FilePath& profile_data_directory,
PpapiPluginProcessHost::PluginClient* client) {
#if defined(ENABLE_PLUGINS)
DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO));
+ if (filter_ && !filter_->CanLoadPlugin(render_process_id, plugin_path))
+ return NULL;
+
PpapiPluginProcessHost* plugin_host =
FindPpapiPluginProcess(plugin_path, profile_data_directory);
if (plugin_host)
@@ -291,9 +299,13 @@
}
PpapiPluginProcessHost* PluginServiceImpl::FindOrStartPpapiBrokerProcess(
+ int render_process_id,
const FilePath& plugin_path) {
DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO));
+ if (filter_ && !filter_->CanLoadPlugin(render_process_id, plugin_path))
+ return NULL;
+
PpapiPluginProcessHost* plugin_host = FindPpapiBrokerProcess(plugin_path);
if (plugin_host)
return plugin_host;
@@ -334,11 +346,12 @@
}
void PluginServiceImpl::OpenChannelToPpapiPlugin(
+ int render_process_id,
const FilePath& plugin_path,
const FilePath& profile_data_directory,
PpapiPluginProcessHost::PluginClient* client) {
PpapiPluginProcessHost* plugin_host = FindOrStartPpapiPluginProcess(
- plugin_path, profile_data_directory, client);
+ render_process_id, plugin_path, profile_data_directory, client);
if (plugin_host) {
plugin_host->OpenChannelToPlugin(client);
} else {
@@ -348,10 +361,12 @@
}
void PluginServiceImpl::OpenChannelToPpapiBroker(
+ int render_process_id,
const FilePath& path,
PpapiPluginProcessHost::BrokerClient* client) {
#if defined(ENABLE_PLUGINS)
- PpapiPluginProcessHost* plugin_host = FindOrStartPpapiBrokerProcess(path);
+ PpapiPluginProcessHost* plugin_host = FindOrStartPpapiBrokerProcess(
+ render_process_id, path);
if (plugin_host) {
plugin_host->OpenChannelToPlugin(client);
} else {
@@ -401,10 +416,14 @@
BrowserThread::PostTask(
BrowserThread::IO, FROM_HERE,
base::Bind(&PluginServiceImpl::FinishOpenChannelToPlugin,
- base::Unretained(this), plugin_path, client));
+ base::Unretained(this),
+ render_process_id,
+ plugin_path,
+ client));
}
void PluginServiceImpl::FinishOpenChannelToPlugin(
+ int render_process_id,
const FilePath& plugin_path,
PluginProcessHost::Client* client) {
DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO));
@@ -414,7 +433,8 @@
return;
pending_plugin_clients_.erase(client);
- PluginProcessHost* plugin_host = FindOrStartNpapiPluginProcess(plugin_path);
+ PluginProcessHost* plugin_host = FindOrStartNpapiPluginProcess(
+ render_process_id, plugin_path);
if (plugin_host) {
client->OnFoundPluginProcessHost(plugin_host);
plugin_host->OpenChannelToPlugin(client);
@@ -453,7 +473,7 @@
*is_stale = stale;
for (size_t i = 0; i < plugins.size(); ++i) {
- if (!filter_ || filter_->ShouldUsePlugin(render_process_id,
+ if (!filter_ || filter_->IsPluginEnabled(render_process_id,
render_view_id,
context,
url,
« no previous file with comments | « content/browser/plugin_service_impl.h ('k') | content/browser/plugin_service_impl_browsertest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698