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

Unified Diff: shell/android/mojo_main.cc

Issue 782013002: Android: decouple mojo shell from the network service. (Closed) Base URL: https://github.com/domokit/mojo.git@build-rule-for-the-network-service
Patch Set: Rebase. Created 6 years 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/mojo_main.cc
diff --git a/shell/android/mojo_main.cc b/shell/android/mojo_main.cc
index 491b59e8b47cec5695a560ea9b2175fdf85e037b..cbd4ac35b569500f1d0188994ae6228434f4645f 100644
--- a/shell/android/mojo_main.cc
+++ b/shell/android/mojo_main.cc
@@ -6,6 +6,7 @@
#include "base/android/command_line_android.h"
#include "base/android/java_handler_thread.h"
+#include "base/android/jni_android.h"
#include "base/android/jni_string.h"
#include "base/at_exit.h"
#include "base/bind.h"
@@ -50,9 +51,9 @@ void RunShell(std::vector<GURL> app_urls) {
static void Init(JNIEnv* env,
jclass clazz,
jobject context,
- jobjectArray jparameters) {
+ jobjectArray jparameters,
+ jstring j_local_apps_directory) {
base::android::ScopedJavaLocalRef<jobject> scoped_context(env, context);
-
base::android::InitApplicationContext(env, scoped_context);
base::android::InitNativeCommandLineFromJavaArray(env, jparameters);
@@ -62,7 +63,10 @@ static void Init(JNIEnv* env,
// LazyInstances is akin to stack-allocating objects; their destructors
// will be invoked first-in-last-out.
shell::Context* shell_context = new shell::Context();
+ shell_context->mojo_url_resolver()->SetLocalAppsPath(base::FilePath(
+ base::android::ConvertJavaStringToUTF8(env, j_local_apps_directory)));
g_context.Get().reset(shell_context);
+
g_java_message_loop.Get().reset(new base::MessageLoopForUI);
base::MessageLoopForUI::current()->Start();
« shell/BUILD.gn ('K') | « shell/android/library_loader.cc ('k') | shell/context.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698