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

Unified Diff: content/ppapi_plugin/ppapi_thread.cc

Issue 10984094: Hook up PpapiPermissions in more places. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 3 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
Index: content/ppapi_plugin/ppapi_thread.cc
diff --git a/content/ppapi_plugin/ppapi_thread.cc b/content/ppapi_plugin/ppapi_thread.cc
index 7e1c3bc368e489ffcccf825d6b081858d0115d89..4a6b03e3a2cac9f7acdee56295d8b19c2c7e191a 100644
--- a/content/ppapi_plugin/ppapi_thread.cc
+++ b/content/ppapi_plugin/ppapi_thread.cc
@@ -211,9 +211,14 @@ void PpapiThread::Unregister(uint32 plugin_dispatcher_id) {
plugin_dispatchers_.erase(plugin_dispatcher_id);
}
-void PpapiThread::OnMsgLoadPlugin(const FilePath& path) {
+void PpapiThread::OnMsgLoadPlugin(const FilePath& path,
+ const ppapi::PpapiPermissions& permissions) {
SavePluginName(path);
+ // This must be set before calling into the plugin so it can get the
+ // interfaces it has permission for.
+ ppapi::proxy::InterfaceList::SetProcessGlobalPermissions(permissions);
+
std::string error;
base::ScopedNativeLibrary library(base::LoadNativeLibrary(path, &error));
@@ -294,10 +299,11 @@ void PpapiThread::OnMsgLoadPlugin(const FilePath& path) {
}
library_.Reset(library.Release());
+
+ permissions_ = permissions;
}
-void PpapiThread::OnMsgCreateChannel(int renderer_id,
- bool incognito) {
+void PpapiThread::OnMsgCreateChannel(int renderer_id, bool incognito) {
IPC::ChannelHandle channel_handle;
if (!library_.is_valid() || // Plugin couldn't be loaded.
!SetupRendererChannel(renderer_id, incognito, &channel_handle)) {
@@ -358,7 +364,9 @@ bool PpapiThread::SetupRendererChannel(int renderer_id,
dispatcher = broker_dispatcher;
} else {
PluginProcessDispatcher* plugin_dispatcher =
- new PluginProcessDispatcher(get_plugin_interface_, incognito);
+ new PluginProcessDispatcher(get_plugin_interface_,
+ permissions_,
+ incognito);
init_result = plugin_dispatcher->InitPluginWithChannel(this,
plugin_handle,
false);
« no previous file with comments | « content/ppapi_plugin/ppapi_thread.h ('k') | content/renderer/browser_plugin/old/guest_to_embedder_channel.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698