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

Unified Diff: content/common/pepper_plugin_registry.cc

Issue 10735011: Add permissions buts for Pepper plugins. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 5 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 | « chrome/common/chrome_content_client.cc ('k') | content/content_common.gypi » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/common/pepper_plugin_registry.cc
diff --git a/content/common/pepper_plugin_registry.cc b/content/common/pepper_plugin_registry.cc
index ed1c8d946e4179e6c62d60dee96a78adda0aa97a..e054999f6d72fb83c880c0b43c805c12376bc744 100644
--- a/content/common/pepper_plugin_registry.cc
+++ b/content/common/pepper_plugin_registry.cc
@@ -12,6 +12,7 @@
#include "base/utf_string_conversions.h"
#include "content/public/common/content_client.h"
#include "content/public/common/content_switches.h"
+#include "ppapi/shared_impl/ppapi_permissions.h"
#include "webkit/plugins/npapi/plugin_list.h"
namespace {
@@ -69,6 +70,11 @@ void ComputePluginsFromCommandLine(
plugin.mime_types.push_back(mime_type);
}
+ // Command-line plugins get full permissions.
+ plugin.permissions = ppapi::PERMISSION_DEV |
+ ppapi::PERMISSION_PRIVATE |
+ ppapi::PERMISSION_BYPASS_USER_GESTURE;
+
plugins->push_back(plugin);
}
}
@@ -217,7 +223,8 @@ PepperPluginRegistry::PepperPluginRegistry() {
continue; // Out of process plugins need no special pre-initialization.
scoped_refptr<webkit::ppapi::PluginModule> module =
- new webkit::ppapi::PluginModule(current.name, current.path, this);
+ new webkit::ppapi::PluginModule(current.name, current.path, this,
+ ppapi::PpapiPermissions(current.permissions));
AddLiveModule(current.path, module);
if (current.is_internal) {
if (!module->InitAsInternalPlugin(current.internal_entry_points)) {
« no previous file with comments | « chrome/common/chrome_content_client.cc ('k') | content/content_common.gypi » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698