Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(59)

Side by Side Diff: net/http/http_auth_handler_negotiate.h

Issue 1383613002: [net/http auth] Cleanup. Method names, and constness. Base URL: https://chromium.googlesource.com/chromium/src.git@mock-auth-handler-generalization
Patch Set: Created 5 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « net/http/http_auth_handler_mock.cc ('k') | net/http/http_auth_handler_negotiate.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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_NEGOTIATE_H_ 5 #ifndef NET_HTTP_HTTP_AUTH_HANDLER_NEGOTIATE_H_
6 #define NET_HTTP_HTTP_AUTH_HANDLER_NEGOTIATE_H_ 6 #define NET_HTTP_HTTP_AUTH_HANDLER_NEGOTIATE_H_
7 7
8 #include <string> 8 #include <string>
9 9
10 #include "build/build_config.h" 10 #include "build/build_config.h"
(...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after
69 void set_use_port(bool use_port) { use_port_ = use_port; } 69 void set_use_port(bool use_port) { use_port_ = use_port; }
70 70
71 void set_host_resolver(HostResolver* host_resolver); 71 void set_host_resolver(HostResolver* host_resolver);
72 72
73 // Sets the system library to use, thereby assuming ownership of 73 // Sets the system library to use, thereby assuming ownership of
74 // |auth_library|. 74 // |auth_library|.
75 void set_library(AuthLibrary* auth_provider) { 75 void set_library(AuthLibrary* auth_provider) {
76 auth_library_.reset(auth_provider); 76 auth_library_.reset(auth_provider);
77 } 77 }
78 78
79 int CreateAuthHandler(HttpAuthChallengeTokenizer* challenge, 79 int CreateAuthHandler(const HttpAuthChallengeTokenizer& challenge,
80 HttpAuth::Target target, 80 HttpAuth::Target target,
81 const GURL& origin, 81 const GURL& origin,
82 CreateReason reason, 82 CreateReason reason,
83 int digest_nonce_count, 83 int digest_nonce_count,
84 const BoundNetLog& net_log, 84 const BoundNetLog& net_log,
85 scoped_ptr<HttpAuthHandler>* handler) override; 85 scoped_ptr<HttpAuthHandler>* handler) override;
86 86
87 private: 87 private:
88 bool disable_cname_lookup_; 88 bool disable_cname_lookup_;
89 bool use_port_; 89 bool use_port_;
(...skipping 15 matching lines...) Expand all
105 bool use_port); 105 bool use_port);
106 106
107 ~HttpAuthHandlerNegotiate() override; 107 ~HttpAuthHandlerNegotiate() override;
108 108
109 // These are public for unit tests 109 // These are public for unit tests
110 std::string CreateSPN(const AddressList& address_list, const GURL& orign); 110 std::string CreateSPN(const AddressList& address_list, const GURL& orign);
111 const std::string& spn() const { return spn_; } 111 const std::string& spn() const { return spn_; }
112 112
113 // HttpAuthHandler: 113 // HttpAuthHandler:
114 HttpAuth::AuthorizationResult HandleAnotherChallenge( 114 HttpAuth::AuthorizationResult HandleAnotherChallenge(
115 HttpAuthChallengeTokenizer* challenge) override; 115 const HttpAuthChallengeTokenizer& challenge) override;
116 bool NeedsIdentity() override; 116 bool NeedsIdentity() override;
117 bool AllowsDefaultCredentials() override; 117 bool AllowsDefaultCredentials() override;
118 bool AllowsExplicitCredentials() override; 118 bool AllowsExplicitCredentials() override;
119 119
120 protected: 120 protected:
121 bool Init(HttpAuthChallengeTokenizer* challenge) override; 121 int Init(const HttpAuthChallengeTokenizer& challenge) override;
122 122
123 int GenerateAuthTokenImpl(const AuthCredentials* credentials, 123 int GenerateAuthTokenImpl(const AuthCredentials* credentials,
124 const HttpRequestInfo* request, 124 const HttpRequestInfo& request,
125 const CompletionCallback& callback, 125 const CompletionCallback& callback,
126 std::string* auth_token) override; 126 std::string* auth_token) override;
127 127
128 private: 128 private:
129 enum State { 129 enum State {
130 STATE_RESOLVE_CANONICAL_NAME, 130 STATE_RESOLVE_CANONICAL_NAME,
131 STATE_RESOLVE_CANONICAL_NAME_COMPLETE, 131 STATE_RESOLVE_CANONICAL_NAME_COMPLETE,
132 STATE_GENERATE_AUTH_TOKEN, 132 STATE_GENERATE_AUTH_TOKEN,
133 STATE_GENERATE_AUTH_TOKEN_COMPLETE, 133 STATE_GENERATE_AUTH_TOKEN_COMPLETE,
134 STATE_NONE, 134 STATE_NONE,
(...skipping 29 matching lines...) Expand all
164 std::string* auth_token_; 164 std::string* auth_token_;
165 165
166 State next_state_; 166 State next_state_;
167 167
168 const URLSecurityManager* url_security_manager_; 168 const URLSecurityManager* url_security_manager_;
169 }; 169 };
170 170
171 } // namespace net 171 } // namespace net
172 172
173 #endif // NET_HTTP_HTTP_AUTH_HANDLER_NEGOTIATE_H_ 173 #endif // NET_HTTP_HTTP_AUTH_HANDLER_NEGOTIATE_H_
OLDNEW
« no previous file with comments | « net/http/http_auth_handler_mock.cc ('k') | net/http/http_auth_handler_negotiate.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698