| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "services/java_handler/java_handler.h" | 5 #include "services/java_handler/java_handler.h" |
| 6 | 6 |
| 7 #include "base/android/base_jni_onload.h" | 7 #include "base/android/base_jni_onload.h" |
| 8 #include "base/android/base_jni_registrar.h" | 8 #include "base/android/base_jni_registrar.h" |
| 9 #include "base/android/jni_android.h" | 9 #include "base/android/jni_android.h" |
| 10 #include "base/android/jni_string.h" | 10 #include "base/android/jni_string.h" |
| (...skipping 108 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 119 }); | 119 }); |
| 120 } | 120 } |
| 121 | 121 |
| 122 bool JavaHandler::OnAcceptConnection( | 122 bool JavaHandler::OnAcceptConnection( |
| 123 mojo::ServiceProviderImpl* service_provider_impl) { | 123 mojo::ServiceProviderImpl* service_provider_impl) { |
| 124 service_provider_impl->AddService<mojo::ContentHandler>( | 124 service_provider_impl->AddService<mojo::ContentHandler>( |
| 125 mojo::ContentHandlerFactory::GetInterfaceRequestHandler(this)); | 125 mojo::ContentHandlerFactory::GetInterfaceRequestHandler(this)); |
| 126 return true; | 126 return true; |
| 127 } | 127 } |
| 128 | 128 |
| 129 void PreInvokeEvent(JNIEnv* env, jclass jcaller) { | 129 void PreInvokeEvent(JNIEnv* env, const JavaParamRef<jclass>& jcaller) { |
| 130 TRACE_EVENT_END0("java_handler", "JavaHandler::RunApplication"); | 130 TRACE_EVENT_END0("java_handler", "JavaHandler::RunApplication"); |
| 131 } | 131 } |
| 132 | 132 |
| 133 } // namespace android | 133 } // namespace android |
| 134 } // namespace services | 134 } // namespace services |
| 135 | 135 |
| 136 MojoResult MojoMain(MojoHandle application_request) { | 136 MojoResult MojoMain(MojoHandle application_request) { |
| 137 mojo::ScopedChromiumInit init; | 137 mojo::ScopedChromiumInit init; |
| 138 services::android::JavaHandler java_handler; | 138 services::android::JavaHandler java_handler; |
| 139 return mojo::RunApplication(application_request, &java_handler); | 139 return mojo::RunApplication(application_request, &java_handler); |
| (...skipping 16 matching lines...) Expand all Loading... |
| 156 return JNI_VERSION_1_4; | 156 return JNI_VERSION_1_4; |
| 157 } | 157 } |
| 158 | 158 |
| 159 // This is needed because the application needs to access the application | 159 // This is needed because the application needs to access the application |
| 160 // context. | 160 // context. |
| 161 extern "C" JNI_EXPORT void InitApplicationContext( | 161 extern "C" JNI_EXPORT void InitApplicationContext( |
| 162 const base::android::JavaRef<jobject>& context) { | 162 const base::android::JavaRef<jobject>& context) { |
| 163 JNIEnv* env = base::android::AttachCurrentThread(); | 163 JNIEnv* env = base::android::AttachCurrentThread(); |
| 164 base::android::InitApplicationContext(env, context); | 164 base::android::InitApplicationContext(env, context); |
| 165 } | 165 } |
| OLD | NEW |