| 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 102 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 113 extracted_path.size())); | 113 extracted_path.size())); |
| 114 *cache_dir = base::FilePath(std::string( | 114 *cache_dir = base::FilePath(std::string( |
| 115 reinterpret_cast<char*>(&cache_path.front()), cache_path.size())); | 115 reinterpret_cast<char*>(&cache_path.front()), cache_path.size())); |
| 116 } | 116 } |
| 117 callback.Run(); | 117 callback.Run(); |
| 118 }); | 118 }); |
| 119 } | 119 } |
| 120 | 120 |
| 121 bool JavaHandler::ConfigureIncomingConnection( | 121 bool JavaHandler::ConfigureIncomingConnection( |
| 122 mojo::ApplicationConnection* connection) { | 122 mojo::ApplicationConnection* connection) { |
| 123 connection->AddService(&content_handler_factory_); | 123 connection->GetServiceProviderImpl().AddService<mojo::ContentHandler>( |
| 124 content_handler_factory_.GetInterfaceRequestHandler()); |
| 124 return true; | 125 return true; |
| 125 } | 126 } |
| 126 | 127 |
| 127 void PreInvokeEvent(JNIEnv* env, jclass jcaller) { | 128 void PreInvokeEvent(JNIEnv* env, jclass jcaller) { |
| 128 TRACE_EVENT_END0("java_handler", "JavaHandler::RunApplication"); | 129 TRACE_EVENT_END0("java_handler", "JavaHandler::RunApplication"); |
| 129 } | 130 } |
| 130 | 131 |
| 131 } // namespace android | 132 } // namespace android |
| 132 } // namespace services | 133 } // namespace services |
| 133 | 134 |
| (...skipping 18 matching lines...) Expand all Loading... |
| 152 return JNI_VERSION_1_4; | 153 return JNI_VERSION_1_4; |
| 153 } | 154 } |
| 154 | 155 |
| 155 // This is needed because the application needs to access the application | 156 // This is needed because the application needs to access the application |
| 156 // context. | 157 // context. |
| 157 extern "C" JNI_EXPORT void InitApplicationContext( | 158 extern "C" JNI_EXPORT void InitApplicationContext( |
| 158 const base::android::JavaRef<jobject>& context) { | 159 const base::android::JavaRef<jobject>& context) { |
| 159 JNIEnv* env = base::android::AttachCurrentThread(); | 160 JNIEnv* env = base::android::AttachCurrentThread(); |
| 160 base::android::InitApplicationContext(env, context); | 161 base::android::InitApplicationContext(env, context); |
| 161 } | 162 } |
| OLD | NEW |