| 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 "content/browser/mojo/service_registry_android.h" | 5 #include "content/browser/mojo/service_registry_android.h" |
| 6 | 6 |
| 7 #include <utility> |
| 8 |
| 7 #include "base/android/jni_android.h" | 9 #include "base/android/jni_android.h" |
| 8 #include "base/android/jni_string.h" | 10 #include "base/android/jni_string.h" |
| 9 #include "base/callback.h" | 11 #include "base/callback.h" |
| 10 #include "content/common/mojo/service_registry_impl.h" | 12 #include "content/common/mojo/service_registry_impl.h" |
| 11 #include "jni/ServiceRegistry_jni.h" | 13 #include "jni/ServiceRegistry_jni.h" |
| 12 | 14 |
| 13 using base::android::AttachCurrentThread; | 15 using base::android::AttachCurrentThread; |
| 14 using base::android::ConvertJavaStringToUTF8; | 16 using base::android::ConvertJavaStringToUTF8; |
| 15 using base::android::ScopedJavaGlobalRef; | 17 using base::android::ScopedJavaGlobalRef; |
| 16 | 18 |
| (...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 87 service_registry_->RemoveService(name); | 89 service_registry_->RemoveService(name); |
| 88 } | 90 } |
| 89 | 91 |
| 90 void ServiceRegistryAndroid::ConnectToRemoteService( | 92 void ServiceRegistryAndroid::ConnectToRemoteService( |
| 91 JNIEnv* env, | 93 JNIEnv* env, |
| 92 const JavaParamRef<jobject>& j_service_registry, | 94 const JavaParamRef<jobject>& j_service_registry, |
| 93 const JavaParamRef<jstring>& j_name, | 95 const JavaParamRef<jstring>& j_name, |
| 94 jint j_handle) { | 96 jint j_handle) { |
| 95 std::string name(ConvertJavaStringToUTF8(env, j_name)); | 97 std::string name(ConvertJavaStringToUTF8(env, j_name)); |
| 96 mojo::ScopedMessagePipeHandle handle((mojo::MessagePipeHandle(j_handle))); | 98 mojo::ScopedMessagePipeHandle handle((mojo::MessagePipeHandle(j_handle))); |
| 97 service_registry_->ConnectToRemoteService(name, handle.Pass()); | 99 service_registry_->ConnectToRemoteService(name, std::move(handle)); |
| 98 } | 100 } |
| 99 | 101 |
| 100 } // namespace content | 102 } // namespace content |
| OLD | NEW |