Chromium Code Reviews| 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> |
| 11 | 11 |
| 12 #include "base/basictypes.h" | 12 #include "base/basictypes.h" |
| 13 #include "base/memory/ref_counted.h" | 13 #include "base/memory/ref_counted.h" |
| 14 #include "base/memory/scoped_ptr.h" | 14 #include "base/memory/scoped_ptr.h" |
| 15 #include "base/string16.h" | 15 #include "base/string16.h" |
|
asanka
2011/10/28 14:39:40
Not needed?
| |
| 16 #include "base/threading/non_thread_safe.h" | 16 #include "base/threading/non_thread_safe.h" |
| 17 #include "googleurl/src/gurl.h" | 17 #include "googleurl/src/gurl.h" |
| 18 #include "net/base/completion_callback.h" | 18 #include "net/base/completion_callback.h" |
| 19 #include "net/base/net_export.h" | 19 #include "net/base/net_export.h" |
| 20 #include "net/base/net_log.h" | 20 #include "net/base/net_log.h" |
| 21 #include "net/http/http_auth.h" | 21 #include "net/http/http_auth.h" |
| 22 | 22 |
| 23 namespace net { | 23 namespace net { |
| 24 | 24 |
| 25 class AuthChallengeInfo; | 25 class AuthChallengeInfo; |
| 26 class AuthCredentials; | |
| 26 class HttpAuthHandler; | 27 class HttpAuthHandler; |
| 27 class HttpAuthHandlerFactory; | 28 class HttpAuthHandlerFactory; |
| 28 class HttpAuthCache; | 29 class HttpAuthCache; |
| 29 class HttpRequestHeaders; | 30 class HttpRequestHeaders; |
| 30 struct HttpRequestInfo; | 31 struct HttpRequestInfo; |
| 31 | 32 |
| 32 class NET_EXPORT_PRIVATE HttpAuthController | 33 class NET_EXPORT_PRIVATE HttpAuthController |
| 33 : public base::RefCounted<HttpAuthController>, | 34 : public base::RefCounted<HttpAuthController>, |
| 34 NON_EXPORTED_BASE(public base::NonThreadSafe) { | 35 NON_EXPORTED_BASE(public base::NonThreadSafe) { |
| 35 public: | 36 public: |
| (...skipping 19 matching lines...) Expand all Loading... | |
| 55 | 56 |
| 56 // Checks for and handles HTTP status code 401 or 407. | 57 // Checks for and handles HTTP status code 401 or 407. |
| 57 // |HandleAuthChallenge()| returns OK on success, or a network error code | 58 // |HandleAuthChallenge()| returns OK on success, or a network error code |
| 58 // otherwise. It may also populate |auth_info_|. | 59 // otherwise. It may also populate |auth_info_|. |
| 59 virtual int HandleAuthChallenge(scoped_refptr<HttpResponseHeaders> headers, | 60 virtual int HandleAuthChallenge(scoped_refptr<HttpResponseHeaders> headers, |
| 60 bool do_not_send_server_auth, | 61 bool do_not_send_server_auth, |
| 61 bool establishing_tunnel, | 62 bool establishing_tunnel, |
| 62 const BoundNetLog& net_log); | 63 const BoundNetLog& net_log); |
| 63 | 64 |
| 64 // Store the supplied credentials and prepare to restart the auth. | 65 // Store the supplied credentials and prepare to restart the auth. |
| 65 virtual void ResetAuth(const string16& username, | 66 virtual void ResetAuth(const AuthCredentials& credentials); |
| 66 const string16& password); | |
| 67 | 67 |
| 68 virtual bool HaveAuthHandler() const; | 68 virtual bool HaveAuthHandler() const; |
| 69 | 69 |
| 70 virtual bool HaveAuth() const; | 70 virtual bool HaveAuth() const; |
| 71 | 71 |
| 72 virtual scoped_refptr<AuthChallengeInfo> auth_info(); | 72 virtual scoped_refptr<AuthChallengeInfo> auth_info(); |
| 73 | 73 |
| 74 virtual bool IsAuthSchemeDisabled(HttpAuth::Scheme scheme) const; | 74 virtual bool IsAuthSchemeDisabled(HttpAuth::Scheme scheme) const; |
| 75 virtual void DisableAuthScheme(HttpAuth::Scheme scheme); | 75 virtual void DisableAuthScheme(HttpAuth::Scheme scheme); |
| 76 | 76 |
| (...skipping 87 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 164 | 164 |
| 165 std::set<HttpAuth::Scheme> disabled_schemes_; | 165 std::set<HttpAuth::Scheme> disabled_schemes_; |
| 166 | 166 |
| 167 OldCompletionCallbackImpl<HttpAuthController> io_callback_; | 167 OldCompletionCallbackImpl<HttpAuthController> io_callback_; |
| 168 OldCompletionCallback* user_callback_; | 168 OldCompletionCallback* user_callback_; |
| 169 }; | 169 }; |
| 170 | 170 |
| 171 } // namespace net | 171 } // namespace net |
| 172 | 172 |
| 173 #endif // NET_HTTP_HTTP_AUTH_CONTROLLER_H_ | 173 #endif // NET_HTTP_HTTP_AUTH_CONTROLLER_H_ |
| OLD | NEW |