| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 #ifndef NET_HTTP_HTTP_AUTH_CONTROLLER_H_ | 5 #ifndef NET_HTTP_HTTP_AUTH_CONTROLLER_H_ |
| 6 #define NET_HTTP_HTTP_AUTH_CONTROLLER_H_ | 6 #define NET_HTTP_HTTP_AUTH_CONTROLLER_H_ |
| 7 #pragma once | 7 #pragma once |
| 8 | 8 |
| 9 #include <set> | 9 #include <set> |
| 10 #include <string> | 10 #include <string> |
| (...skipping 27 matching lines...) Expand all Loading... |
| 38 HttpAuthController(HttpAuth::Target target, | 38 HttpAuthController(HttpAuth::Target target, |
| 39 const GURL& auth_url, | 39 const GURL& auth_url, |
| 40 HttpAuthCache* http_auth_cache, | 40 HttpAuthCache* http_auth_cache, |
| 41 HttpAuthHandlerFactory* http_auth_handler_factory); | 41 HttpAuthHandlerFactory* http_auth_handler_factory); |
| 42 | 42 |
| 43 // Generate an authentication token for |target| if necessary. The return | 43 // Generate an authentication token for |target| if necessary. The return |
| 44 // value is a net error code. |OK| will be returned both in the case that | 44 // value is a net error code. |OK| will be returned both in the case that |
| 45 // a token is correctly generated synchronously, as well as when no tokens | 45 // a token is correctly generated synchronously, as well as when no tokens |
| 46 // were necessary. | 46 // were necessary. |
| 47 virtual int MaybeGenerateAuthToken(const HttpRequestInfo* request, | 47 virtual int MaybeGenerateAuthToken(const HttpRequestInfo* request, |
| 48 OldCompletionCallback* callback, | 48 const CompletionCallback& callback, |
| 49 const BoundNetLog& net_log); | 49 const BoundNetLog& net_log); |
| 50 | 50 |
| 51 // Adds either the proxy auth header, or the origin server auth header, | 51 // Adds either the proxy auth header, or the origin server auth header, |
| 52 // as specified by |target_|. | 52 // as specified by |target_|. |
| 53 virtual void AddAuthorizationHeader( | 53 virtual void AddAuthorizationHeader( |
| 54 HttpRequestHeaders* authorization_headers); | 54 HttpRequestHeaders* authorization_headers); |
| 55 | 55 |
| 56 // Checks for and handles HTTP status code 401 or 407. | 56 // Checks for and handles HTTP status code 401 or 407. |
| 57 // |HandleAuthChallenge()| returns OK on success, or a network error code | 57 // |HandleAuthChallenge()| returns OK on success, or a network error code |
| 58 // otherwise. It may also populate |auth_info_|. | 58 // otherwise. It may also populate |auth_info_|. |
| (...skipping 97 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 156 bool default_credentials_used_; | 156 bool default_credentials_used_; |
| 157 | 157 |
| 158 // These two are owned by the HttpNetworkSession/IOThread, which own the | 158 // These two are owned by the HttpNetworkSession/IOThread, which own the |
| 159 // objects which reference |this|. Therefore, these raw pointers are valid | 159 // objects which reference |this|. Therefore, these raw pointers are valid |
| 160 // for the lifetime of this object. | 160 // for the lifetime of this object. |
| 161 HttpAuthCache* const http_auth_cache_; | 161 HttpAuthCache* const http_auth_cache_; |
| 162 HttpAuthHandlerFactory* const http_auth_handler_factory_; | 162 HttpAuthHandlerFactory* const http_auth_handler_factory_; |
| 163 | 163 |
| 164 std::set<HttpAuth::Scheme> disabled_schemes_; | 164 std::set<HttpAuth::Scheme> disabled_schemes_; |
| 165 | 165 |
| 166 OldCompletionCallbackImpl<HttpAuthController> io_callback_; | 166 CompletionCallback callback_; |
| 167 OldCompletionCallback* user_callback_; | |
| 168 }; | 167 }; |
| 169 | 168 |
| 170 } // namespace net | 169 } // namespace net |
| 171 | 170 |
| 172 #endif // NET_HTTP_HTTP_AUTH_CONTROLLER_H_ | 171 #endif // NET_HTTP_HTTP_AUTH_CONTROLLER_H_ |
| OLD | NEW |