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); |