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/java_interfaces_impl.h" | 5 #include "content/browser/android/java_interfaces_impl.h" |
6 | 6 |
7 #include <jni.h> | 7 #include <jni.h> |
8 | 8 |
9 #include <utility> | 9 #include <utility> |
10 | 10 |
11 #include "base/android/context_utils.h" | 11 #include "base/android/context_utils.h" |
12 #include "base/android/jni_android.h" | 12 #include "base/android/jni_android.h" |
13 #include "base/memory/singleton.h" | 13 #include "base/memory/singleton.h" |
14 #include "content/public/browser/browser_thread.h" | 14 #include "content/public/browser/browser_thread.h" |
15 #include "content/public/browser/web_contents.h" | 15 #include "content/public/browser/web_contents.h" |
16 #include "jni/InterfaceRegistrarImpl_jni.h" | 16 #include "jni/InterfaceRegistrarImpl_jni.h" |
17 #include "mojo/public/cpp/system/message_pipe.h" | 17 #include "mojo/public/cpp/system/message_pipe.h" |
18 #include "services/shell/public/cpp/interface_provider.h" | 18 #include "services/service_manager/public/cpp/interface_provider.h" |
19 | 19 |
20 namespace content { | 20 namespace content { |
21 | 21 |
22 namespace { | 22 namespace { |
23 | 23 |
24 class JavaInterfaceProviderHolder { | 24 class JavaInterfaceProviderHolder { |
25 public: | 25 public: |
26 JavaInterfaceProviderHolder() { | 26 JavaInterfaceProviderHolder() { |
27 shell::mojom::InterfaceProviderPtr provider; | 27 shell::mojom::InterfaceProviderPtr provider; |
28 JNIEnv* env = base::android::AttachCurrentThread(); | 28 JNIEnv* env = base::android::AttachCurrentThread(); |
(...skipping 23 matching lines...) Expand all Loading... |
52 void BindInterfaceRegistryForWebContents( | 52 void BindInterfaceRegistryForWebContents( |
53 shell::mojom::InterfaceProviderRequest request, | 53 shell::mojom::InterfaceProviderRequest request, |
54 WebContents* web_contents) { | 54 WebContents* web_contents) { |
55 JNIEnv* env = base::android::AttachCurrentThread(); | 55 JNIEnv* env = base::android::AttachCurrentThread(); |
56 Java_InterfaceRegistrarImpl_createInterfaceRegistryForWebContents( | 56 Java_InterfaceRegistrarImpl_createInterfaceRegistryForWebContents( |
57 env, request.PassMessagePipe().release().value(), | 57 env, request.PassMessagePipe().release().value(), |
58 web_contents->GetJavaWebContents().obj()); | 58 web_contents->GetJavaWebContents().obj()); |
59 } | 59 } |
60 | 60 |
61 } // namespace content | 61 } // namespace content |
OLD | NEW |