| 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_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/ref_counted.h" | 10 #include "base/ref_counted.h" |
| 11 | 11 |
| 12 namespace net { | 12 namespace net { |
| 13 | 13 |
| 14 // Holds info about an authentication challenge that we may want to display | 14 // Holds info about an authentication challenge that we may want to display |
| 15 // to the user. | 15 // to the user. |
| 16 class AuthChallengeInfo : | 16 class AuthChallengeInfo : |
| 17 public base::RefCountedThreadSafe<AuthChallengeInfo> { | 17 public base::RefCountedThreadSafe<AuthChallengeInfo> { |
| 18 public: | 18 public: |
| 19 bool operator==(const AuthChallengeInfo& that) const { |
| 20 return (this->is_proxy == that.is_proxy && |
| 21 this->host_and_port == that.host_and_port && |
| 22 this->scheme == that.scheme && |
| 23 this->realm == that.realm); |
| 24 } |
| 25 |
| 26 bool operator!=(const AuthChallengeInfo& that) const { |
| 27 return !(*this == that); |
| 28 } |
| 29 |
| 19 bool is_proxy; // true for Proxy-Authenticate, false for WWW-Authenticate. | 30 bool is_proxy; // true for Proxy-Authenticate, false for WWW-Authenticate. |
| 20 std::wstring host_and_port; // <host>:<port> of the server asking for auth | 31 std::wstring host_and_port; // <host>:<port> of the server asking for auth |
| 21 // (could be the proxy). | 32 // (could be the proxy). |
| 22 std::wstring scheme; // "Basic", "Digest", or whatever other method is used. | 33 std::wstring scheme; // "Basic", "Digest", or whatever other method is used. |
| 23 std::wstring realm; // the realm provided by the server, if there is one. | 34 std::wstring realm; // the realm provided by the server, if there is one. |
| 24 | 35 |
| 25 private: | 36 private: |
| 26 friend class base::RefCountedThreadSafe<AuthChallengeInfo>; | 37 friend class base::RefCountedThreadSafe<AuthChallengeInfo>; |
| 27 ~AuthChallengeInfo() {} | 38 ~AuthChallengeInfo() {} |
| 28 }; | 39 }; |
| (...skipping 17 matching lines...) Expand all Loading... |
| 46 AuthData() : state(AUTH_STATE_NEED_AUTH) {} | 57 AuthData() : state(AUTH_STATE_NEED_AUTH) {} |
| 47 | 58 |
| 48 private: | 59 private: |
| 49 friend class base::RefCountedThreadSafe<AuthData>; | 60 friend class base::RefCountedThreadSafe<AuthData>; |
| 50 ~AuthData() {} | 61 ~AuthData() {} |
| 51 }; | 62 }; |
| 52 | 63 |
| 53 } // namespace net | 64 } // namespace net |
| 54 | 65 |
| 55 #endif // NET_BASE_AUTH_H__ | 66 #endif // NET_BASE_AUTH_H__ |
| OLD | NEW |