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

Unified Diff: content/browser/ppapi_plugin_process_host.cc

Issue 1415483008: Get rid of SandboxedProcessLauncherDelegate::PreSandbox. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Missed one clang error. Created 5 years, 1 month 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/browser/ppapi_plugin_process_host.cc
diff --git a/content/browser/ppapi_plugin_process_host.cc b/content/browser/ppapi_plugin_process_host.cc
index 794a5a108034f13d46a3dc8d49a14f746891e62d..ea078c6a510138df8a609e5878af4d61971dbd34 100644
--- a/content/browser/ppapi_plugin_process_host.cc
+++ b/content/browser/ppapi_plugin_process_host.cc
@@ -59,23 +59,27 @@ class PpapiPluginSandboxedProcessLauncherDelegate
return !is_broker_;
}
- void PreSpawnTarget(sandbox::TargetPolicy* policy, bool* success) override {
- if (is_broker_)
- return;
- *success = false;
+ bool PreSpawnTarget(sandbox::TargetPolicy* policy) override {
+ if (is_broker_) {
+ return true;
+ }
+
// The Pepper process is as locked-down as a renderer except that it can
// create the server side of Chrome pipes.
sandbox::ResultCode result;
result = policy->AddRule(sandbox::TargetPolicy::SUBSYS_NAMED_PIPES,
sandbox::TargetPolicy::NAMEDPIPES_ALLOW_ANY,
L"\\\\.\\pipe\\chrome.*");
- if (result != sandbox::SBOX_ALL_OK)
- return;
+ if (result != sandbox::SBOX_ALL_OK) {
+ return false;
+ }
+
#if !defined(NACL_WIN64)
for (const auto& mime_type : info_.mime_types) {
if (IsWin32kLockdownEnabledForMimeType(mime_type.mime_type)) {
- if (!AddWin32kLockdownPolicy(policy))
- return;
+ if (!AddWin32kLockdownPolicy(policy)) {
+ return false;
+ }
break;
}
}
@@ -86,7 +90,7 @@ class PpapiPluginSandboxedProcessLauncherDelegate
if (!sid.empty())
AddAppContainerPolicy(policy, sid.c_str());
- *success = true;
+ return true;
}
#elif defined(OS_POSIX)

Powered by Google App Engine
This is Rietveld 408576698