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

Unified Diff: mojo/runner/android/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/android/main.cc
diff --git a/mojo/runner/android/main.cc b/mojo/runner/android/main.cc
index c395dfa0037012cefffcca96cbe1b82cb32f72dd..024405f86dc8825586fff4793a24cccdfe8e0d23 100644
--- a/mojo/runner/android/main.cc
+++ b/mojo/runner/android/main.cc
@@ -28,6 +28,8 @@
#include "mojo/runner/child_process.h"
#include "mojo/runner/context.h"
#include "mojo/runner/init.h"
+#include "mojo/runner/native_application_support.h"
+#include "mojo/runner/switches.h"
#include "mojo/shell/application_loader.h"
#include "ui/gl/gl_surface_egl.h"
@@ -185,5 +187,15 @@ int main(int argc, char** argv) {
base::CommandLine::Init(argc, argv);
mojo::runner::InitializeLogging();
- return mojo::runner::ChildProcessMain();
+
+ const base::CommandLine& command_line =
+ *base::CommandLine::ForCurrentProcess();
+ CHECK(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);
}

Powered by Google App Engine
This is Rietveld 408576698