| 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 "android_webview/native/aw_message_port_service_impl.h" | 5 #include "android_webview/native/aw_message_port_service_impl.h" |
| 6 | 6 |
| 7 #include "android_webview/browser/aw_browser_context.h" | 7 #include "android_webview/browser/aw_browser_context.h" |
| 8 #include "android_webview/browser/aw_message_port_message_filter.h" | 8 #include "android_webview/browser/aw_message_port_message_filter.h" |
| 9 #include "android_webview/native/aw_contents.h" | 9 #include "android_webview/native/aw_contents.h" |
| 10 #include "base/android/jni_array.h" | 10 #include "base/android/jni_array.h" |
| 11 #include "base/android/jni_string.h" | 11 #include "base/android/jni_string.h" |
| 12 #include "base/bind.h" | 12 #include "base/bind.h" |
| 13 #include "content/public/browser/browser_thread.h" | 13 #include "content/public/browser/browser_thread.h" |
| 14 #include "content/public/browser/message_port_provider.h" | 14 #include "content/public/browser/message_port_provider.h" |
| 15 #include "jni/AwMessagePortService_jni.h" | 15 #include "jni/AwMessagePortService_jni.h" |
| 16 | 16 |
| 17 namespace android_webview { | 17 namespace android_webview { |
| 18 | 18 |
| 19 using base::android::AttachCurrentThread; | 19 using base::android::AttachCurrentThread; |
| 20 using base::android::ConvertJavaStringToUTF16; | 20 using base::android::ConvertJavaStringToUTF16; |
| 21 using base::android::ConvertUTF16ToJavaString; | 21 using base::android::ConvertUTF16ToJavaString; |
| 22 using base::android::JavaParamRef; |
| 22 using base::android::ScopedJavaGlobalRef; | 23 using base::android::ScopedJavaGlobalRef; |
| 23 using base::android::ScopedJavaLocalRef; | 24 using base::android::ScopedJavaLocalRef; |
| 24 using base::android::ToJavaIntArray; | 25 using base::android::ToJavaIntArray; |
| 25 using content::BrowserThread; | 26 using content::BrowserThread; |
| 26 using content::MessagePortProvider; | 27 using content::MessagePortProvider; |
| 27 | 28 |
| 28 // static | 29 // static |
| 29 AwMessagePortServiceImpl* AwMessagePortServiceImpl::GetInstance() { | 30 AwMessagePortServiceImpl* AwMessagePortServiceImpl::GetInstance() { |
| 30 return static_cast<AwMessagePortServiceImpl*>( | 31 return static_cast<AwMessagePortServiceImpl*>( |
| 31 AwBrowserContext::GetDefault()->GetMessagePortService()); | 32 AwBrowserContext::GetDefault()->GetMessagePortService()); |
| (...skipping 205 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 237 } | 238 } |
| 238 | 239 |
| 239 // static | 240 // static |
| 240 jlong InitAwMessagePortService(JNIEnv* env, const JavaParamRef<jobject>& obj) { | 241 jlong InitAwMessagePortService(JNIEnv* env, const JavaParamRef<jobject>& obj) { |
| 241 AwMessagePortServiceImpl* service = AwMessagePortServiceImpl::GetInstance(); | 242 AwMessagePortServiceImpl* service = AwMessagePortServiceImpl::GetInstance(); |
| 242 service->Init(env, obj); | 243 service->Init(env, obj); |
| 243 return reinterpret_cast<intptr_t>(service); | 244 return reinterpret_cast<intptr_t>(service); |
| 244 } | 245 } |
| 245 | 246 |
| 246 } // namespace android_webview | 247 } // namespace android_webview |
| OLD | NEW |