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

Unified Diff: content/ppapi_plugin/ppapi_thread.cc

Issue 6930059: Make Pepper work out-of-process in the windows sandbox (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 9 years, 7 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/ppapi_plugin/ppapi_plugin_main.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/ppapi_plugin/ppapi_thread.cc
===================================================================
--- content/ppapi_plugin/ppapi_thread.cc (revision 84503)
+++ content/ppapi_plugin/ppapi_thread.cc (working copy)
@@ -17,6 +17,16 @@
#include "ppapi/c/ppp.h"
#include "ppapi/proxy/ppapi_messages.h"
+#if defined(OS_WIN)
+#include "sandbox/src/sandbox.h"
+#endif
+
+#if defined(OS_WIN)
+extern sandbox::TargetServices* g_target_services;
+#else
+extern void* g_target_services;
+#endif
+
typedef int32_t (*InitializeBrokerFunc)
(PP_ConnectInstance_Func* connect_instance_func);
@@ -72,8 +82,19 @@
void PpapiThread::OnMsgLoadPlugin(const FilePath& path) {
base::ScopedNativeLibrary library(base::LoadNativeLibrary(path, NULL));
- if (!library.is_valid())
+
+#if defined(OS_WIN)
+ // Once we lower the token the sandbox is locked down and no new modules
+ // can be loaded. TODO(cpu): consider changing to the loading style of
+ // regular plugins.
+ if (g_target_services)
+ g_target_services->LowerToken();
+#endif
+
+ if (!library.is_valid()) {
+ LOG(ERROR) << "Failed to load pepper module";
return;
+ }
if (is_broker_) {
// Get the InitializeBroker function (required).
« no previous file with comments | « content/ppapi_plugin/ppapi_plugin_main.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698