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

Side by Side Diff: net/http/http_auth_handler_ntlm_portable.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.cc ('k') | net/http/http_auth_handler_ntlm_win.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) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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 #include "net/http/http_auth_handler_ntlm.h" 5 #include "net/http/http_auth_handler_ntlm.h"
6 6
7 #include <stdlib.h> 7 #include <stdlib.h>
8 // For gethostname 8 // For gethostname
9 #if defined(OS_POSIX) 9 #if defined(OS_POSIX)
10 #include <unistd.h> 10 #include <unistd.h>
(...skipping 693 matching lines...) Expand 10 before | Expand all | Expand 10 after
704 rv = GenerateType1Msg(out_token, out_token_len); 704 rv = GenerateType1Msg(out_token, out_token_len);
705 } 705 }
706 706
707 if (rv == OK) 707 if (rv == OK)
708 LogToken("out-token", *out_token, *out_token_len); 708 LogToken("out-token", *out_token, *out_token_len);
709 709
710 return rv; 710 return rv;
711 } 711 }
712 712
713 int HttpAuthHandlerNTLM::Factory::CreateAuthHandler( 713 int HttpAuthHandlerNTLM::Factory::CreateAuthHandler(
714 HttpAuthChallengeTokenizer* challenge, 714 const HttpAuthChallengeTokenizer& challenge,
715 HttpAuth::Target target, 715 HttpAuth::Target target,
716 const GURL& origin, 716 const GURL& origin,
717 CreateReason reason, 717 CreateReason reason,
718 int digest_nonce_count, 718 int digest_nonce_count,
719 const BoundNetLog& net_log, 719 const BoundNetLog& net_log,
720 scoped_ptr<HttpAuthHandler>* handler) { 720 scoped_ptr<HttpAuthHandler>* handler) {
721 if (reason == CREATE_PREEMPTIVE) 721 if (reason == CREATE_PREEMPTIVE)
722 return ERR_UNSUPPORTED_AUTH_SCHEME; 722 return ERR_UNSUPPORTED_AUTH_SCHEME;
723 // TODO(cbentzel): Move towards model of parsing in the factory 723 // TODO(cbentzel): Move towards model of parsing in the factory
724 // method and only constructing when valid. 724 // method and only constructing when valid.
725 // NOTE: Default credentials are not supported for the portable implementation 725 // NOTE: Default credentials are not supported for the portable implementation
726 // of NTLM. 726 // of NTLM.
727 scoped_ptr<HttpAuthHandler> tmp_handler(new HttpAuthHandlerNTLM); 727 scoped_ptr<HttpAuthHandler> tmp_handler(new HttpAuthHandlerNTLM);
728 if (!tmp_handler->InitFromChallenge(challenge, target, origin, net_log)) 728 int result =
729 return ERR_INVALID_RESPONSE; 729 tmp_handler->HandleInitialChallenge(challenge, target, origin, net_log);
730 handler->swap(tmp_handler); 730 if (result == OK)
731 return OK; 731 handler->swap(tmp_handler);
732 return result;
732 } 733 }
733 734
734 } // namespace net 735 } // namespace net
OLDNEW
« no previous file with comments | « net/http/http_auth_handler_ntlm.cc ('k') | net/http/http_auth_handler_ntlm_win.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698