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_BASE_AUTH_H__ | 5 #ifndef NET_BASE_AUTH_H__ |
6 #define NET_BASE_AUTH_H__ | 6 #define NET_BASE_AUTH_H__ |
7 | 7 |
8 #include <string> | 8 #include <string> |
9 | 9 |
10 #include "base/memory/ref_counted.h" | 10 #include "base/memory/ref_counted.h" |
(...skipping 12 matching lines...) Expand all Loading... |
23 | 23 |
24 // Determines whether two AuthChallengeInfo's are equivalent. | 24 // Determines whether two AuthChallengeInfo's are equivalent. |
25 bool Equals(const AuthChallengeInfo& other) const; | 25 bool Equals(const AuthChallengeInfo& other) const; |
26 | 26 |
27 // Whether this came from a server or a proxy. | 27 // Whether this came from a server or a proxy. |
28 bool is_proxy; | 28 bool is_proxy; |
29 | 29 |
30 // The service issuing the challenge. | 30 // The service issuing the challenge. |
31 HostPortPair challenger; | 31 HostPortPair challenger; |
32 | 32 |
33 // The authentication scheme used, such as "basic" or "digest". If the | 33 // The authentication scheme used, such as "basic" or "digest". |
34 // |source| is FTP_SERVER, this is an empty string. The encoding is ASCII. | |
35 std::string scheme; | 34 std::string scheme; |
36 | 35 |
37 // The realm of the challenge. May be empty. The encoding is UTF-8. | 36 // The realm of the challenge. May be empty. The encoding is UTF-8. |
38 std::string realm; | 37 std::string realm; |
39 | 38 |
40 private: | 39 private: |
41 friend class base::RefCountedThreadSafe<AuthChallengeInfo>; | 40 friend class base::RefCountedThreadSafe<AuthChallengeInfo>; |
42 ~AuthChallengeInfo(); | 41 ~AuthChallengeInfo(); |
43 }; | 42 }; |
44 | 43 |
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
82 }; | 81 }; |
83 | 82 |
84 // Authentication structures | 83 // Authentication structures |
85 enum AuthState { | 84 enum AuthState { |
86 AUTH_STATE_DONT_NEED_AUTH, | 85 AUTH_STATE_DONT_NEED_AUTH, |
87 AUTH_STATE_NEED_AUTH, | 86 AUTH_STATE_NEED_AUTH, |
88 AUTH_STATE_HAVE_AUTH, | 87 AUTH_STATE_HAVE_AUTH, |
89 AUTH_STATE_CANCELED | 88 AUTH_STATE_CANCELED |
90 }; | 89 }; |
91 | 90 |
| 91 // TODO(asanka): This is only used by URLRequestFtpJob. Get rid of this and move |
| 92 // the functionality to that class. http://crbug.com/529319 |
92 class AuthData : public base::RefCountedThreadSafe<AuthData> { | 93 class AuthData : public base::RefCountedThreadSafe<AuthData> { |
93 public: | 94 public: |
94 AuthState state; // whether we need, have, or gave up on authentication. | 95 AuthState state; // whether we need, have, or gave up on authentication. |
95 AuthCredentials credentials; // The credentials to use for auth. | 96 AuthCredentials credentials; // The credentials to use for auth. |
96 | 97 |
97 // We wouldn't instantiate this class if we didn't need authentication. | 98 // We wouldn't instantiate this class if we didn't need authentication. |
98 AuthData(); | 99 AuthData(); |
99 | 100 |
100 private: | 101 private: |
101 friend class base::RefCountedThreadSafe<AuthData>; | 102 friend class base::RefCountedThreadSafe<AuthData>; |
102 ~AuthData(); | 103 ~AuthData(); |
103 }; | 104 }; |
104 | 105 |
105 } // namespace net | 106 } // namespace net |
106 | 107 |
107 #endif // NET_BASE_AUTH_H__ | 108 #endif // NET_BASE_AUTH_H__ |
OLD | NEW |