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 "net/android/http_auth_negotiate_android.h" | 5 #include "net/android/http_auth_negotiate_android.h" |
6 | 6 |
7 #include "base/android/jni_string.h" | 7 #include "base/android/jni_string.h" |
8 #include "base/android/scoped_java_ref.h" | 8 #include "base/android/scoped_java_ref.h" |
9 #include "base/bind.h" | 9 #include "base/bind.h" |
10 #include "base/callback_helpers.h" | 10 #include "base/callback_helpers.h" |
11 #include "base/location.h" | 11 #include "base/location.h" |
12 #include "base/threading/thread_task_runner_handle.h" | 12 #include "base/threading/thread_task_runner_handle.h" |
13 #include "jni/HttpNegotiateAuthenticator_jni.h" | 13 #include "jni/HttpNegotiateAuthenticator_jni.h" |
14 #include "net/base/auth.h" | 14 #include "net/base/auth.h" |
15 #include "net/base/net_errors.h" | 15 #include "net/base/net_errors.h" |
16 #include "net/http/http_auth_challenge_tokenizer.h" | 16 #include "net/http/http_auth_challenge_tokenizer.h" |
17 #include "net/http/http_auth_multi_round_parse.h" | 17 #include "net/http/http_auth_multi_round_parse.h" |
18 #include "net/http/http_auth_preferences.h" | 18 #include "net/http/http_auth_preferences.h" |
19 | 19 |
20 using base::android::AttachCurrentThread; | 20 using base::android::AttachCurrentThread; |
21 using base::android::ConvertUTF8ToJavaString; | 21 using base::android::ConvertUTF8ToJavaString; |
22 using base::android::ConvertJavaStringToUTF8; | 22 using base::android::ConvertJavaStringToUTF8; |
| 23 using base::android::JavaParamRef; |
23 using base::android::ScopedJavaLocalRef; | 24 using base::android::ScopedJavaLocalRef; |
24 | 25 |
25 namespace net { | 26 namespace net { |
26 namespace android { | 27 namespace android { |
27 | 28 |
28 JavaNegotiateResultWrapper::JavaNegotiateResultWrapper( | 29 JavaNegotiateResultWrapper::JavaNegotiateResultWrapper( |
29 const scoped_refptr<base::TaskRunner>& callback_task_runner, | 30 const scoped_refptr<base::TaskRunner>& callback_task_runner, |
30 const base::Callback<void(int, const std::string&)>& thread_safe_callback) | 31 const base::Callback<void(int, const std::string&)>& thread_safe_callback) |
31 : callback_task_runner_(callback_task_runner), | 32 : callback_task_runner_(callback_task_runner), |
32 thread_safe_callback_(thread_safe_callback) { | 33 thread_safe_callback_(thread_safe_callback) { |
(...skipping 120 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
153 const std::string& raw_token) { | 154 const std::string& raw_token) { |
154 DCHECK(auth_token_); | 155 DCHECK(auth_token_); |
155 DCHECK(!completion_callback_.is_null()); | 156 DCHECK(!completion_callback_.is_null()); |
156 if (result == OK) | 157 if (result == OK) |
157 *auth_token_ = "Negotiate " + raw_token; | 158 *auth_token_ = "Negotiate " + raw_token; |
158 base::ResetAndReturn(&completion_callback_).Run(result); | 159 base::ResetAndReturn(&completion_callback_).Run(result); |
159 } | 160 } |
160 | 161 |
161 } // namespace android | 162 } // namespace android |
162 } // namespace net | 163 } // namespace net |
OLD | NEW |