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

Unified Diff: shell/android/android_handler.cc

Issue 868463008: Remove Client relationship between mojo.Shell/mojo.Application (Closed) Base URL: git@github.com:domokit/mojo.git@app_impl_init
Patch Set: fix android Created 5 years, 11 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/android_handler.cc
diff --git a/shell/android/android_handler.cc b/shell/android/android_handler.cc
index 5b29ad75b8839f4ff64a81fb014ec74ea6774d2d..f88d6dc0bbe34a8e0b81a4dc4328c90c9a208ccb 100644
--- a/shell/android/android_handler.cc
+++ b/shell/android/android_handler.cc
@@ -33,7 +33,8 @@ void RunAndroidApplication(JNIEnv* env,
jobject j_context,
const base::FilePath& app_path,
jint j_handle) {
- ScopedMessagePipeHandle handle((mojo::MessagePipeHandle(j_handle)));
+ InterfaceRequest<Application> application_request = MakeRequest<Application>(
+ MakeScopedHandle(mojo::MessagePipeHandle(j_handle)));
// Load the library, so that we can set the application context there if
// needed.
@@ -63,7 +64,8 @@ void RunAndroidApplication(JNIEnv* env,
// Run the application.
base::ScopedNativeLibrary app_library_from_runner(
- shell::DynamicServiceRunner::LoadAndRunService(app_path, handle.Pass()));
+ shell::DynamicServiceRunner::LoadAndRunService(
+ app_path, application_request.Pass()));
}
} // namespace
@@ -73,7 +75,9 @@ AndroidHandler::AndroidHandler() : content_handler_factory_(this) {
AndroidHandler::~AndroidHandler() {
}
-void AndroidHandler::RunApplication(ShellPtr shell, URLResponsePtr response) {
+void AndroidHandler::RunApplication(
+ InterfaceRequest<Application> application_request,
+ URLResponsePtr response) {
JNIEnv* env = AttachCurrentThread();
ScopedJavaLocalRef<jstring> j_archive_path =
Java_AndroidHandler_getNewTempArchivePath(env, GetApplicationContext());
@@ -84,7 +88,7 @@ void AndroidHandler::RunApplication(ShellPtr shell, URLResponsePtr response) {
RunAndroidApplicationFn run_android_application_fn = &RunAndroidApplication;
Java_AndroidHandler_bootstrap(
env, GetApplicationContext(), j_archive_path.obj(),
- shell.PassMessagePipe().release().value(),
+ application_request.PassMessagePipe().release().value(),
reinterpret_cast<jlong>(run_android_application_fn));
}

Powered by Google App Engine
This is Rietveld 408576698