| OLD | NEW |
| 1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2006-2008 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_H_ | 5 #ifndef NET_HTTP_HTTP_AUTH_H_ |
| 6 #define NET_HTTP_HTTP_AUTH_H_ | 6 #define NET_HTTP_HTTP_AUTH_H_ |
| 7 | 7 |
| 8 #include "net/http/http_util.h" | 8 #include "net/http/http_util.h" |
| 9 | 9 |
| 10 template <class T> class scoped_refptr; | 10 template <class T> class scoped_refptr; |
| 11 | 11 |
| 12 namespace net { | 12 namespace net { |
| 13 | 13 |
| 14 class HttpAuthHandler; | 14 class HttpAuthHandler; |
| 15 class HttpResponseHeaders; | 15 class HttpResponseHeaders; |
| 16 | 16 |
| 17 // Utility class for http authentication. | 17 // Utility class for http authentication. |
| 18 class HttpAuth { | 18 class HttpAuth { |
| 19 public: | 19 public: |
| 20 | 20 |
| 21 // Http authentication can be done the the proxy server, origin server, | 21 // Http authentication can be done the the proxy server, origin server, |
| 22 // or both. This enum tracks who the target is. | 22 // or both. This enum tracks who the target is. |
| 23 enum Target { | 23 enum Target { |
| 24 AUTH_NONE = -1, |
| 25 // We depend on the valid targets (!= AUTH_NONE) being usable as indexes |
| 26 // in an array, so start from 0. |
| 24 AUTH_PROXY = 0, | 27 AUTH_PROXY = 0, |
| 25 AUTH_SERVER = 1, | 28 AUTH_SERVER = 1, |
| 26 }; | 29 }; |
| 27 | 30 |
| 28 // Describes where the identity used for authentication came from. | 31 // Describes where the identity used for authentication came from. |
| 29 enum IdentitySource { | 32 enum IdentitySource { |
| 30 // Came from nowhere -- the identity is not initialized. | 33 // Came from nowhere -- the identity is not initialized. |
| 31 IDENT_SRC_NONE, | 34 IDENT_SRC_NONE, |
| 32 | 35 |
| 33 // The identity came from the auth cache, by doing a path-based | 36 // The identity came from the auth cache, by doing a path-based |
| (...skipping 121 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 155 std::string::const_iterator value_begin_; | 158 std::string::const_iterator value_begin_; |
| 156 std::string::const_iterator value_end_; | 159 std::string::const_iterator value_end_; |
| 157 | 160 |
| 158 bool value_is_quoted_; | 161 bool value_is_quoted_; |
| 159 }; | 162 }; |
| 160 }; | 163 }; |
| 161 | 164 |
| 162 } // namespace net | 165 } // namespace net |
| 163 | 166 |
| 164 #endif // NET_HTTP_HTTP_AUTH_H_ | 167 #endif // NET_HTTP_HTTP_AUTH_H_ |
| OLD | NEW |