| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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/intercepted_request_data.h" | 5 #include "android_webview/native/intercepted_request_data.h" |
| 6 | 6 |
| 7 #include "base/android/jni_android.h" | 7 #include "base/android/jni_android.h" |
| 8 #include "base/android/jni_string.h" | 8 #include "base/android/jni_string.h" |
| 9 #include "jni/InterceptedRequestData_jni.h" | 9 #include "jni/InterceptedRequestData_jni.h" |
| 10 | 10 |
| 11 using std::string; | 11 using std::string; |
| 12 using base::android::ScopedJavaLocalRef; | 12 using base::android::ScopedJavaLocalRef; |
| 13 | 13 |
| 14 InterceptedRequestData::InterceptedRequestData( | 14 InterceptedRequestData::InterceptedRequestData( |
| 15 JNIEnv* env, base::android::JavaRef<jobject> obj) { | 15 const base::android::JavaRef<jobject>& obj) |
| 16 java_object_.Reset(env, obj.obj()); | 16 : java_object_(obj) { |
| 17 } | 17 } |
| 18 | 18 |
| 19 InterceptedRequestData::~InterceptedRequestData() { | 19 InterceptedRequestData::~InterceptedRequestData() { |
| 20 } | 20 } |
| 21 | 21 |
| 22 ScopedJavaLocalRef<jobject> | 22 ScopedJavaLocalRef<jobject> |
| 23 InterceptedRequestData::GetInputStream(JNIEnv* env) const { | 23 InterceptedRequestData::GetInputStream(JNIEnv* env) const { |
| 24 return Java_InterceptedRequestData_getData(env, java_object_.obj()); | 24 return Java_InterceptedRequestData_getData(env, java_object_.obj()); |
| 25 } | 25 } |
| 26 | 26 |
| (...skipping 19 matching lines...) Expand all Loading... |
| 46 | 46 |
| 47 bool RegisterInterceptedRequestData(JNIEnv* env) { | 47 bool RegisterInterceptedRequestData(JNIEnv* env) { |
| 48 if (g_InterceptedRequestData_clazz) | 48 if (g_InterceptedRequestData_clazz) |
| 49 return true; | 49 return true; |
| 50 if (!base::android::HasClass(env, kInterceptedRequestDataClassPath)) { | 50 if (!base::android::HasClass(env, kInterceptedRequestDataClassPath)) { |
| 51 DLOG(ERROR) << "Unable to find class InterceptedRequestData!"; | 51 DLOG(ERROR) << "Unable to find class InterceptedRequestData!"; |
| 52 return false; | 52 return false; |
| 53 } | 53 } |
| 54 return RegisterNativesImpl(env); | 54 return RegisterNativesImpl(env); |
| 55 } | 55 } |
| OLD | NEW |