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

Unified Diff: mojo/runner/desktop/main.cc

Issue 1264463005: mandoline sandbox: prewarm libraries before we raise the sandbox. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 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
Index: mojo/runner/desktop/main.cc
diff --git a/mojo/runner/desktop/main.cc b/mojo/runner/desktop/main.cc
index 1764c3f110008845807b793be043b98fdb7c5e87..47e636c7bf722230bb60221e2e18da24750bffc6 100644
--- a/mojo/runner/desktop/main.cc
+++ b/mojo/runner/desktop/main.cc
@@ -4,9 +4,11 @@
#include "base/at_exit.h"
#include "base/command_line.h"
+#include "base/files/file_path.h"
#include "mojo/runner/child_process.h"
#include "mojo/runner/desktop/launcher_process.h"
#include "mojo/runner/init.h"
+#include "mojo/runner/native_application_support.h"
#include "mojo/runner/switches.h"
int main(int argc, char** argv) {
@@ -17,8 +19,16 @@ int main(int argc, char** argv) {
const base::CommandLine& command_line =
*base::CommandLine::ForCurrentProcess();
- if (command_line.HasSwitch(switches::kChildProcess))
- return mojo::runner::ChildProcessMain();
+ if (command_line.HasSwitch(switches::kChildProcess)) {
+ mojo::shell::NativeApplicationCleanup cleanup =
+ command_line.HasSwitch(switches::kDeleteAfterLoad)
+ ? mojo::shell::NativeApplicationCleanup::DELETE
+ : mojo::shell::NativeApplicationCleanup::DONT_DELETE;
+ base::NativeLibrary app_library = mojo::runner::LoadNativeApplication(
+ command_line.GetSwitchValuePath(switches::kChildProcess), cleanup);
+
+ return mojo::runner::ChildProcessMain(app_library);
+ }
return mojo::runner::LauncherProcessMain(argc, argv);
}

Powered by Google App Engine
This is Rietveld 408576698