OLD | NEW |
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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 #pragma once | 7 #pragma once |
8 | 8 |
9 #include <set> | 9 #include <set> |
| 10 #include <string> |
10 | 11 |
11 #include "base/scoped_ptr.h" | 12 #include "base/scoped_ptr.h" |
| 13 #include "base/string16.h" |
12 #include "net/http/http_util.h" | 14 #include "net/http/http_util.h" |
13 | 15 |
14 template <class T> class scoped_refptr; | 16 template <class T> class scoped_refptr; |
15 | 17 |
16 namespace net { | 18 namespace net { |
17 | 19 |
18 class BoundNetLog; | 20 class BoundNetLog; |
19 class HttpAuthHandler; | 21 class HttpAuthHandler; |
20 class HttpAuthHandlerFactory; | 22 class HttpAuthHandlerFactory; |
21 class HttpResponseHeaders; | 23 class HttpResponseHeaders; |
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
61 IDENT_SRC_DEFAULT_CREDENTIALS, | 63 IDENT_SRC_DEFAULT_CREDENTIALS, |
62 }; | 64 }; |
63 | 65 |
64 // Helper structure used by HttpNetworkTransaction to track | 66 // Helper structure used by HttpNetworkTransaction to track |
65 // the current identity being used for authorization. | 67 // the current identity being used for authorization. |
66 struct Identity { | 68 struct Identity { |
67 Identity() : source(IDENT_SRC_NONE), invalid(true) { } | 69 Identity() : source(IDENT_SRC_NONE), invalid(true) { } |
68 | 70 |
69 IdentitySource source; | 71 IdentitySource source; |
70 bool invalid; | 72 bool invalid; |
71 // TODO(wtc): |username| and |password| should be string16. | 73 string16 username; |
72 std::wstring username; | 74 string16 password; |
73 std::wstring password; | |
74 }; | 75 }; |
75 | 76 |
76 // Get the name of the header containing the auth challenge | 77 // Get the name of the header containing the auth challenge |
77 // (either WWW-Authenticate or Proxy-Authenticate). | 78 // (either WWW-Authenticate or Proxy-Authenticate). |
78 static std::string GetChallengeHeaderName(Target target); | 79 static std::string GetChallengeHeaderName(Target target); |
79 | 80 |
80 // Get the name of the header where the credentials go | 81 // Get the name of the header where the credentials go |
81 // (either Authorization or Proxy-Authorization). | 82 // (either Authorization or Proxy-Authorization). |
82 static std::string GetAuthorizationHeaderName(Target target); | 83 static std::string GetAuthorizationHeaderName(Target target); |
83 | 84 |
(...skipping 113 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
197 std::string::const_iterator value_end_; | 198 std::string::const_iterator value_end_; |
198 | 199 |
199 bool value_is_quoted_; | 200 bool value_is_quoted_; |
200 bool expect_base64_token_; | 201 bool expect_base64_token_; |
201 }; | 202 }; |
202 }; | 203 }; |
203 | 204 |
204 } // namespace net | 205 } // namespace net |
205 | 206 |
206 #endif // NET_HTTP_HTTP_AUTH_H_ | 207 #endif // NET_HTTP_HTTP_AUTH_H_ |
OLD | NEW |