diff options
author | erg@google.com <erg@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-01-20 00:12:13 +0000 |
---|---|---|
committer | erg@google.com <erg@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-01-20 00:12:13 +0000 |
commit | be1a48bcd64ea75939f38a9ab264ee99214313bb (patch) | |
tree | c9aa66838177a6e10757ae4547e731a490420bfa /net/http/http_auth.cc | |
parent | f1e99b1b03848eb939fd3f51b56de1b23dfab057 (diff) | |
download | chromium_src-be1a48bcd64ea75939f38a9ab264ee99214313bb.zip chromium_src-be1a48bcd64ea75939f38a9ab264ee99214313bb.tar.gz chromium_src-be1a48bcd64ea75939f38a9ab264ee99214313bb.tar.bz2 |
Even more reordering the methods in headers and implementation in net/.
BUG=68682
TEST=compiles
Review URL: http://codereview.chromium.org/6314010
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@71880 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'net/http/http_auth.cc')
-rw-r--r-- | net/http/http_auth.cc | 36 |
1 files changed, 18 insertions, 18 deletions
diff --git a/net/http/http_auth.cc b/net/http/http_auth.cc index 552d245..d5d6e0c 100644 --- a/net/http/http_auth.cc +++ b/net/http/http_auth.cc @@ -87,6 +87,24 @@ HttpAuth::AuthorizationResult HttpAuth::HandleChallengeResponse( return HttpAuth::AUTHORIZATION_RESULT_REJECT; } +HttpUtil::NameValuePairsIterator HttpAuth::ChallengeTokenizer::param_pairs() + const { + return HttpUtil::NameValuePairsIterator(params_begin_, params_end_, ','); +} + +std::string HttpAuth::ChallengeTokenizer::base64_param() const { + // Strip off any padding. + // (See https://bugzilla.mozilla.org/show_bug.cgi?id=230351.) + // + // Our base64 decoder requires that the length be a multiple of 4. + int encoded_length = params_end_ - params_begin_; + while (encoded_length > 0 && encoded_length % 4 != 0 && + params_begin_[encoded_length - 1] == '=') { + --encoded_length; + } + return std::string(params_begin_, params_begin_ + encoded_length); +} + void HttpAuth::ChallengeTokenizer::Init(std::string::const_iterator begin, std::string::const_iterator end) { // The first space-separated token is the auth-scheme. @@ -107,24 +125,6 @@ void HttpAuth::ChallengeTokenizer::Init(std::string::const_iterator begin, HttpUtil::TrimLWS(¶ms_begin_, ¶ms_end_); } -HttpUtil::NameValuePairsIterator HttpAuth::ChallengeTokenizer::param_pairs() - const { - return HttpUtil::NameValuePairsIterator(params_begin_, params_end_, ','); -} - -std::string HttpAuth::ChallengeTokenizer::base64_param() const { - // Strip off any padding. - // (See https://bugzilla.mozilla.org/show_bug.cgi?id=230351.) - // - // Our base64 decoder requires that the length be a multiple of 4. - int encoded_length = params_end_ - params_begin_; - while (encoded_length > 0 && encoded_length % 4 != 0 && - params_begin_[encoded_length - 1] == '=') { - --encoded_length; - } - return std::string(params_begin_, params_begin_ + encoded_length); -} - // static std::string HttpAuth::GetChallengeHeaderName(Target target) { switch (target) { |