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

Unified Diff: services/java_handler/java_handler.cc

Issue 2010283006: Almost done: ApplicationDelegate -> ApplicationImplBase conversion. (Closed) Base URL: https://github.com/domokit/mojo.git@work798-x-work797-x-work796_no_run_main_app
Patch Set: rebased Created 4 years, 7 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
« no previous file with comments | « services/java_handler/java_handler.h ('k') | services/js/pingpong_apptest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: services/java_handler/java_handler.cc
diff --git a/services/java_handler/java_handler.cc b/services/java_handler/java_handler.cc
index 177eee15ca59897315afffd2c50b4334eee46444..64d7bfdfd19bd4cb47142fb65dbbbd9cdc0dcb89 100644
--- a/services/java_handler/java_handler.cc
+++ b/services/java_handler/java_handler.cc
@@ -18,11 +18,12 @@
#include "jni/JavaHandler_jni.h"
#include "mojo/android/system/base_run_loop.h"
#include "mojo/android/system/core_impl.h"
-#include "mojo/application/application_runner_chromium.h"
#include "mojo/application/content_handler_factory.h"
+#include "mojo/environment/scoped_chromium_init.h"
#include "mojo/public/c/system/main.h"
-#include "mojo/public/cpp/application/application_impl.h"
#include "mojo/public/cpp/application/connect.h"
+#include "mojo/public/cpp/application/run_application.h"
+#include "mojo/public/cpp/application/service_provider_impl.h"
using base::android::AttachCurrentThread;
using base::android::ScopedJavaLocalRef;
@@ -89,10 +90,10 @@ void JavaHandler::RunApplication(
application_request.PassMessagePipe().release().value());
}
-void JavaHandler::Initialize(mojo::ApplicationImpl* app) {
- tracing_.Initialize(app->shell(), &app->args());
+void JavaHandler::OnInitialize() {
+ tracing_.Initialize(shell(), &args());
handler_task_runner_ = base::MessageLoop::current()->task_runner();
- mojo::ConnectToService(app->shell(), "mojo:url_response_disk_cache",
+ mojo::ConnectToService(shell(), "mojo:url_response_disk_cache",
GetProxy(&url_response_disk_cache_));
}
@@ -118,7 +119,7 @@ void JavaHandler::GetApplication(base::FilePath* archive_path,
});
}
-bool JavaHandler::ConfigureIncomingConnection(
+bool JavaHandler::OnAcceptConnection(
mojo::ServiceProviderImpl* service_provider_impl) {
service_provider_impl->AddService<mojo::ContentHandler>(
mojo::ContentHandlerFactory::GetInterfaceRequestHandler(this));
@@ -133,8 +134,9 @@ void PreInvokeEvent(JNIEnv* env, jclass jcaller) {
} // namespace services
MojoResult MojoMain(MojoHandle application_request) {
- mojo::ApplicationRunnerChromium runner(new services::android::JavaHandler());
- return runner.Run(application_request);
+ mojo::ScopedChromiumInit init;
+ services::android::JavaHandler java_handler;
+ return mojo::RunApplication(application_request, &java_handler);
}
JNI_EXPORT jint JNI_OnLoad(JavaVM* vm, void* reserved) {
« no previous file with comments | « services/java_handler/java_handler.h ('k') | services/js/pingpong_apptest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698