OLD | NEW |
1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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/android/interface_provider_android_impl.h" | 5 #include "content/browser/android/interface_provider_android_impl.h" |
6 | 6 |
7 #include <utility> | 7 #include <utility> |
8 | 8 |
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" |
11 #include "base/callback.h" | 11 #include "base/callback.h" |
12 #include "base/memory/ptr_util.h" | 12 #include "base/memory/ptr_util.h" |
13 #include "jni/InterfaceProvider_jni.h" | 13 #include "jni/InterfaceProvider_jni.h" |
14 #include "mojo/public/cpp/system/message_pipe.h" | 14 #include "mojo/public/cpp/system/message_pipe.h" |
15 #include "services/shell/public/cpp/interface_provider.h" | 15 #include "services/shell/public/cpp/interface_provider.h" |
16 #include "services/shell/public/cpp/interface_registry.h" | 16 #include "services/shell/public/cpp/interface_registry.h" |
17 | 17 |
18 using base::android::AttachCurrentThread; | 18 using base::android::AttachCurrentThread; |
19 using base::android::ConvertJavaStringToUTF8; | 19 using base::android::ConvertJavaStringToUTF8; |
| 20 using base::android::JavaParamRef; |
20 using base::android::ScopedJavaGlobalRef; | 21 using base::android::ScopedJavaGlobalRef; |
21 | 22 |
22 namespace content { | 23 namespace content { |
23 | 24 |
24 // static | 25 // static |
25 std::unique_ptr<InterfaceProviderAndroid> InterfaceProviderAndroid::Create( | 26 std::unique_ptr<InterfaceProviderAndroid> InterfaceProviderAndroid::Create( |
26 shell::InterfaceProvider* remote_interfaces) { | 27 shell::InterfaceProvider* remote_interfaces) { |
27 return base::WrapUnique(new InterfaceProviderAndroidImpl(remote_interfaces)); | 28 return base::WrapUnique(new InterfaceProviderAndroidImpl(remote_interfaces)); |
28 } | 29 } |
29 | 30 |
(...skipping 27 matching lines...) Expand all Loading... |
57 JNIEnv* env, | 58 JNIEnv* env, |
58 const JavaParamRef<jobject>& j_interface_provider, | 59 const JavaParamRef<jobject>& j_interface_provider, |
59 const JavaParamRef<jstring>& j_name, | 60 const JavaParamRef<jstring>& j_name, |
60 jint j_handle) { | 61 jint j_handle) { |
61 std::string name(ConvertJavaStringToUTF8(env, j_name)); | 62 std::string name(ConvertJavaStringToUTF8(env, j_name)); |
62 mojo::ScopedMessagePipeHandle handle((mojo::MessagePipeHandle(j_handle))); | 63 mojo::ScopedMessagePipeHandle handle((mojo::MessagePipeHandle(j_handle))); |
63 remote_interfaces_->GetInterface(name, std::move(handle)); | 64 remote_interfaces_->GetInterface(name, std::move(handle)); |
64 } | 65 } |
65 | 66 |
66 } // namespace content | 67 } // namespace content |
OLD | NEW |