| 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_HANDLER_BASIC_H_ | 5 #ifndef NET_HTTP_HTTP_AUTH_HANDLER_BASIC_H_ |
| 6 #define NET_HTTP_HTTP_AUTH_HANDLER_BASIC_H_ | 6 #define NET_HTTP_HTTP_AUTH_HANDLER_BASIC_H_ |
| 7 | 7 |
| 8 #include <string> | 8 #include <string> |
| 9 | 9 |
| 10 #include "net/base/net_export.h" | 10 #include "net/base/net_export.h" |
| 11 #include "net/http/http_auth_handler.h" | 11 #include "net/http/http_auth_handler.h" |
| 12 #include "net/http/http_auth_handler_factory.h" | 12 #include "net/http/http_auth_handler_factory.h" |
| 13 | 13 |
| 14 namespace net { | 14 namespace net { |
| 15 | 15 |
| 16 // Code for handling http basic authentication. | 16 // Code for handling http basic authentication. |
| 17 class NET_EXPORT_PRIVATE HttpAuthHandlerBasic : public HttpAuthHandler { | 17 class NET_EXPORT_PRIVATE HttpAuthHandlerBasic : public HttpAuthHandler { |
| 18 public: | 18 public: |
| 19 class NET_EXPORT_PRIVATE Factory : public HttpAuthHandlerFactory { | 19 class NET_EXPORT_PRIVATE Factory : public HttpAuthHandlerFactory { |
| 20 public: | 20 public: |
| 21 Factory(); | 21 Factory(); |
| 22 ~Factory() override; | 22 ~Factory() override; |
| 23 | 23 |
| 24 int CreateAuthHandler(HttpAuthChallengeTokenizer* challenge, | 24 int CreateAuthHandler(HttpAuthChallengeTokenizer* challenge, |
| 25 HttpAuth::Target target, | 25 HttpAuth::Target target, |
| 26 const SSLInfo& ssl_info, | 26 const SSLInfo& ssl_info, |
| 27 const GURL& origin, | 27 const GURL& origin, |
| 28 CreateReason reason, | 28 CreateReason reason, |
| 29 int digest_nonce_count, | 29 int digest_nonce_count, |
| 30 const BoundNetLog& net_log, | 30 const NetLogWithSource& net_log, |
| 31 std::unique_ptr<HttpAuthHandler>* handler) override; | 31 std::unique_ptr<HttpAuthHandler>* handler) override; |
| 32 }; | 32 }; |
| 33 | 33 |
| 34 HttpAuth::AuthorizationResult HandleAnotherChallenge( | 34 HttpAuth::AuthorizationResult HandleAnotherChallenge( |
| 35 HttpAuthChallengeTokenizer* challenge) override; | 35 HttpAuthChallengeTokenizer* challenge) override; |
| 36 | 36 |
| 37 protected: | 37 protected: |
| 38 bool Init(HttpAuthChallengeTokenizer* challenge, | 38 bool Init(HttpAuthChallengeTokenizer* challenge, |
| 39 const SSLInfo& ssl_info) override; | 39 const SSLInfo& ssl_info) override; |
| 40 | 40 |
| 41 int GenerateAuthTokenImpl(const AuthCredentials* credentials, | 41 int GenerateAuthTokenImpl(const AuthCredentials* credentials, |
| 42 const HttpRequestInfo* request, | 42 const HttpRequestInfo* request, |
| 43 const CompletionCallback& callback, | 43 const CompletionCallback& callback, |
| 44 std::string* auth_token) override; | 44 std::string* auth_token) override; |
| 45 | 45 |
| 46 private: | 46 private: |
| 47 ~HttpAuthHandlerBasic() override {} | 47 ~HttpAuthHandlerBasic() override {} |
| 48 | 48 |
| 49 bool ParseChallenge(HttpAuthChallengeTokenizer* challenge); | 49 bool ParseChallenge(HttpAuthChallengeTokenizer* challenge); |
| 50 }; | 50 }; |
| 51 | 51 |
| 52 } // namespace net | 52 } // namespace net |
| 53 | 53 |
| 54 #endif // NET_HTTP_HTTP_AUTH_HANDLER_BASIC_H_ | 54 #endif // NET_HTTP_HTTP_AUTH_HANDLER_BASIC_H_ |
| OLD | NEW |