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

Unified Diff: content/renderer/pepper/pepper_plugin_delegate_impl.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 | « content/renderer/pepper/pepper_in_process_resource_creation.cc ('k') | ppapi/host/ppapi_host.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/renderer/pepper/pepper_plugin_delegate_impl.cc
diff --git a/content/renderer/pepper/pepper_plugin_delegate_impl.cc b/content/renderer/pepper/pepper_plugin_delegate_impl.cc
index 28b5577e258cf83cdf2bad2d79a5cb3569438874..ec8057ddbdd56ed900ef686130045b13e1305eda 100644
--- a/content/renderer/pepper/pepper_plugin_delegate_impl.cc
+++ b/content/renderer/pepper/pepper_plugin_delegate_impl.cc
@@ -68,6 +68,7 @@
#include "ppapi/proxy/ppapi_messages.h"
#include "ppapi/shared_impl/file_path.h"
#include "ppapi/shared_impl/platform_file.h"
+#include "ppapi/shared_impl/ppapi_permissions.h"
#include "ppapi/shared_impl/ppapi_preferences.h"
#include "ppapi/shared_impl/ppb_device_ref_shared.h"
#include "ppapi/thunk/enter.h"
@@ -300,6 +301,7 @@ PepperPluginDelegateImpl::CreatePepperPluginModule(
// In-process plugin not preloaded, it probably couldn't be initialized.
return scoped_refptr<webkit::ppapi::PluginModule>();
}
+ ppapi::PpapiPermissions permissions(info->permissions);
// Out of process: have the browser start the plugin process for us.
IPC::ChannelHandle channel_handle;
@@ -318,8 +320,10 @@ PepperPluginDelegateImpl::CreatePepperPluginModule(
// Create a new HostDispatcher for the proxying, and hook it to a new
// PluginModule. Note that AddLiveModule must be called before any early
// returns since the module's destructor will remove itself.
- module = new webkit::ppapi::PluginModule(info->name, path,
- PepperPluginRegistry::GetInstance());
+ module = new webkit::ppapi::PluginModule(
+ info->name, path,
+ PepperPluginRegistry::GetInstance(),
+ permissions);
PepperPluginRegistry::GetInstance()->AddLiveModule(path, module);
scoped_ptr<HostDispatcherWrapper> dispatcher(new HostDispatcherWrapper);
if (!dispatcher->Init(
@@ -353,7 +357,8 @@ scoped_refptr<webkit::ppapi::PluginModule>
// PluginModule.
module = new webkit::ppapi::PluginModule(kBrowserPluginName,
path,
- registry);
+ registry,
+ ppapi::PpapiPermissions());
RenderThreadImpl::current()->browser_plugin_registry()->AddModule(
guest_process_id, module);
scoped_ptr<HostDispatcherWrapper> dispatcher(new HostDispatcherWrapper);
@@ -666,7 +671,8 @@ scoped_ptr< ::ppapi::thunk::ResourceCreationAPI>
PepperPluginDelegateImpl::CreateResourceCreationAPI(
webkit::ppapi::PluginInstance* instance) {
return scoped_ptr< ::ppapi::thunk::ResourceCreationAPI>(
- new PepperInProcessResourceCreation(render_view_, instance));
+ new PepperInProcessResourceCreation(render_view_, instance,
+ instance->module()->permissions()));
}
SkBitmap* PepperPluginDelegateImpl::GetSadPluginBitmap() {
« no previous file with comments | « content/renderer/pepper/pepper_in_process_resource_creation.cc ('k') | ppapi/host/ppapi_host.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698