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

Unified Diff: shell/android/main.cc

Issue 1061413002: Shell: Make a separate binary for child processes. (Closed) Base URL: https://github.com/domokit/mojo.git@master
Patch Set: Don't look at kChildProcess in desktop/main.cc. Created 5 years, 8 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: shell/android/main.cc
diff --git a/shell/android/main.cc b/shell/android/main.cc
index aa26a13086d497f86368728544981a546fbd3e0f..221a5d08092ce7af8eb810b858b921887a72e087 100644
--- a/shell/android/main.cc
+++ b/shell/android/main.cc
@@ -46,14 +46,20 @@ const char kFifoPath[] = "fifo-path";
class MojoShellRunner : public base::DelegateSimpleThread::Delegate {
public:
- MojoShellRunner(const std::vector<std::string>& parameters)
- : parameters_(parameters) {}
+ MojoShellRunner(const base::FilePath& mojo_shell_path,
+ const base::FilePath& mojo_shell_child_path,
+ const std::vector<std::string>& parameters)
+ : mojo_shell_path_(mojo_shell_path),
+ mojo_shell_child_path_(mojo_shell_child_path),
+ parameters_(parameters) {}
~MojoShellRunner() override {}
private:
void Run() override;
- std::vector<std::string> parameters_;
+ const base::FilePath mojo_shell_path_;
+ const base::FilePath mojo_shell_child_path_;
+ const std::vector<std::string> parameters_;
DISALLOW_COPY_AND_ASSIGN(MojoShellRunner);
};
@@ -105,9 +111,9 @@ void MojoShellRunner::Run() {
base::MessageLoop loop(common::MessagePumpMojo::Create());
Context* context = g_context.Pointer()->get();
ConfigureAndroidServices(context);
- context->Init();
+ context->InitWithPaths(mojo_shell_path_, mojo_shell_child_path_);
- for (auto& args : parameters_)
+ for (const auto& args : parameters_)
ApplyApplicationArgs(context, args);
RunCommandLineApps(context);
@@ -142,6 +148,7 @@ static void Init(JNIEnv* env,
jclass clazz,
jobject activity,
jstring mojo_shell_path,
+ jstring mojo_shell_child_path,
jobjectArray jparameters,
jstring j_local_apps_directory,
jstring j_tmp_dir) {
@@ -164,7 +171,12 @@ static void Init(JNIEnv* env,
&parameters);
base::CommandLine::Init(0, nullptr);
base::CommandLine::ForCurrentProcess()->InitFromArgv(parameters);
- g_shell_runner.Get().reset(new MojoShellRunner(parameters));
+ g_shell_runner.Get().reset(new MojoShellRunner(
+ base::FilePath(
+ base::android::ConvertJavaStringToUTF8(env, mojo_shell_path)),
+ base::FilePath(
+ base::android::ConvertJavaStringToUTF8(env, mojo_shell_child_path)),
+ parameters));
InitializeLogging();
@@ -214,3 +226,9 @@ bool RegisterShellMain(JNIEnv* env) {
} // namespace shell
} // namespace mojo
+
+// TODO(vtl): We need a main(), even though it should never be called.
qsr 2015/04/08 09:27:44 If we do not need to run this anymore, I'll need t
+int main(int argc, char** argv) {
+ NOTREACHED();
+ return 1;
+}

Powered by Google App Engine
This is Rietveld 408576698