Remove SpdySessionTest pre-SPDY/3.1 conditionals.
[chromium-blink-merge.git] / net / http / http_auth_handler_basic.h
blob186caf68304c01da616c1d20a37b7c6edeb5023e
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
3 // found in the LICENSE file.
5 #ifndef NET_HTTP_HTTP_AUTH_HANDLER_BASIC_H_
6 #define NET_HTTP_HTTP_AUTH_HANDLER_BASIC_H_
8 #include <string>
10 #include "net/base/net_export.h"
11 #include "net/http/http_auth_handler.h"
12 #include "net/http/http_auth_handler_factory.h"
14 namespace net {
16 // Code for handling http basic authentication.
17 class NET_EXPORT_PRIVATE HttpAuthHandlerBasic : public HttpAuthHandler {
18 public:
19 class NET_EXPORT_PRIVATE Factory : public HttpAuthHandlerFactory {
20 public:
21 Factory();
22 ~Factory() override;
24 int CreateAuthHandler(HttpAuthChallengeTokenizer* challenge,
25 HttpAuth::Target target,
26 const GURL& origin,
27 CreateReason reason,
28 int digest_nonce_count,
29 const BoundNetLog& net_log,
30 scoped_ptr<HttpAuthHandler>* handler) override;
33 HttpAuth::AuthorizationResult HandleAnotherChallenge(
34 HttpAuthChallengeTokenizer* challenge) override;
36 protected:
37 bool Init(HttpAuthChallengeTokenizer* challenge) override;
39 int GenerateAuthTokenImpl(const AuthCredentials* credentials,
40 const HttpRequestInfo* request,
41 const CompletionCallback& callback,
42 std::string* auth_token) override;
44 private:
45 ~HttpAuthHandlerBasic() override {}
47 bool ParseChallenge(HttpAuthChallengeTokenizer* challenge);
50 } // namespace net
52 #endif // NET_HTTP_HTTP_AUTH_HANDLER_BASIC_H_