OLD | NEW |
1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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 "sky/shell/java_service_provider.h" | 5 #include "sky/shell/java_service_provider.h" |
6 | 6 |
7 #include "base/android/jni_android.h" | 7 #include "base/android/jni_android.h" |
8 #include "jni/JavaServiceProvider_jni.h" | 8 #include "jni/JavaServiceProvider_jni.h" |
| 9 #include "mojo/public/cpp/bindings/interface_request.h" |
9 | 10 |
10 namespace sky { | 11 namespace sky { |
11 namespace shell { | 12 namespace shell { |
12 | 13 |
13 bool RegisterJavaServiceProvider(JNIEnv* env) { | 14 bool RegisterJavaServiceProvider(JNIEnv* env) { |
14 return RegisterNativesImpl(env); | 15 return RegisterNativesImpl(env); |
15 } | 16 } |
16 | 17 |
17 mojo::ScopedMessagePipeHandle CreateJavaServiceProvider() { | 18 void CreateJavaServiceProvider( |
18 JNIEnv* env = base::android::AttachCurrentThread(); | 19 mojo::InterfaceRequest<mojo::ServiceProvider> request) { |
19 return mojo::ScopedMessagePipeHandle( | 20 Java_JavaServiceProvider_create( |
20 mojo::MessagePipeHandle(Java_JavaServiceProvider_create( | 21 base::android::AttachCurrentThread(), |
21 env, base::android::GetApplicationContext()))); | 22 base::android::GetApplicationContext(), |
| 23 request.PassMessagePipe().release().value()); |
22 } | 24 } |
23 | 25 |
24 } // namespace shell | 26 } // namespace shell |
25 } // namespace sky | 27 } // namespace sky |
OLD | NEW |