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

Side by Side Diff: net/http/http_auth_handler_ntlm_win.cc

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_ntlm_portable.cc ('k') | net/http/http_auth_handler_unittest.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 // See "SSPI Sample Application" at 5 // See "SSPI Sample Application" at
6 // http://msdn.microsoft.com/en-us/library/aa918273.aspx 6 // http://msdn.microsoft.com/en-us/library/aa918273.aspx
7 // and "NTLM Security Support Provider" at 7 // and "NTLM Security Support Provider" at
8 // http://msdn.microsoft.com/en-us/library/aa923611.aspx. 8 // http://msdn.microsoft.com/en-us/library/aa923611.aspx.
9 9
10 #include "net/http/http_auth_handler_ntlm.h" 10 #include "net/http/http_auth_handler_ntlm.h"
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after
44 44
45 HttpAuthHandlerNTLM::Factory::Factory() 45 HttpAuthHandlerNTLM::Factory::Factory()
46 : max_token_length_(0), 46 : max_token_length_(0),
47 is_unsupported_(false) { 47 is_unsupported_(false) {
48 } 48 }
49 49
50 HttpAuthHandlerNTLM::Factory::~Factory() { 50 HttpAuthHandlerNTLM::Factory::~Factory() {
51 } 51 }
52 52
53 int HttpAuthHandlerNTLM::Factory::CreateAuthHandler( 53 int HttpAuthHandlerNTLM::Factory::CreateAuthHandler(
54 HttpAuthChallengeTokenizer* challenge, 54 const HttpAuthChallengeTokenizer& challenge,
55 HttpAuth::Target target, 55 HttpAuth::Target target,
56 const GURL& origin, 56 const GURL& origin,
57 CreateReason reason, 57 CreateReason reason,
58 int digest_nonce_count, 58 int digest_nonce_count,
59 const BoundNetLog& net_log, 59 const BoundNetLog& net_log,
60 scoped_ptr<HttpAuthHandler>* handler) { 60 scoped_ptr<HttpAuthHandler>* handler) {
61 if (is_unsupported_ || reason == CREATE_PREEMPTIVE) 61 if (is_unsupported_ || reason == CREATE_PREEMPTIVE)
62 return ERR_UNSUPPORTED_AUTH_SCHEME; 62 return ERR_UNSUPPORTED_AUTH_SCHEME;
63 if (max_token_length_ == 0) { 63 if (max_token_length_ == 0) {
64 int rv = DetermineMaxTokenLength(sspi_library_.get(), NTLMSP_NAME, 64 int rv = DetermineMaxTokenLength(sspi_library_.get(), NTLMSP_NAME,
65 &max_token_length_); 65 &max_token_length_);
66 if (rv == ERR_UNSUPPORTED_AUTH_SCHEME) 66 if (rv == ERR_UNSUPPORTED_AUTH_SCHEME)
67 is_unsupported_ = true; 67 is_unsupported_ = true;
68 if (rv != OK) 68 if (rv != OK)
69 return rv; 69 return rv;
70 } 70 }
71 // TODO(cbentzel): Move towards model of parsing in the factory 71 // TODO(cbentzel): Move towards model of parsing in the factory
72 // method and only constructing when valid. 72 // method and only constructing when valid.
73 scoped_ptr<HttpAuthHandler> tmp_handler( 73 scoped_ptr<HttpAuthHandler> tmp_handler(
74 new HttpAuthHandlerNTLM(sspi_library_.get(), max_token_length_, 74 new HttpAuthHandlerNTLM(sspi_library_.get(), max_token_length_,
75 url_security_manager())); 75 url_security_manager()));
76 if (!tmp_handler->InitFromChallenge(challenge, target, origin, net_log)) 76 int result =
77 return ERR_INVALID_RESPONSE; 77 tmp_handler->HandleInitialChallenge(challenge, target, origin, net_log);
78 handler->swap(tmp_handler); 78 if (result == OK)
79 return OK; 79 handler->swap(tmp_handler);
80 return result;
80 } 81 }
81 82
82 } // namespace net 83 } // namespace net
OLDNEW
« no previous file with comments | « net/http/http_auth_handler_ntlm_portable.cc ('k') | net/http/http_auth_handler_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698