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

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

Issue 8487001: Remove 13 exit time constructors and 3 static initializers (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: comments Created 9 years, 1 month 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 | Annotate | Revision Log
« no previous file with comments | « net/base/net_util.cc ('k') | net/spdy/spdy_settings_storage.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 #include "net/http/http_mac_signature.h" 5 #include "net/http/http_mac_signature.h"
6 6
7 #include "base/base64.h" 7 #include "base/base64.h"
8 #include "base/rand_util.h" 8 #include "base/rand_util.h"
9 #include "base/string_number_conversions.h" 9 #include "base/string_number_conversions.h"
10 #include "base/string_util.h" 10 #include "base/string_util.h"
(...skipping 114 matching lines...) Expand 10 before | Expand all | Expand 10 after
125 125
126 *header = "MAC id=\"" + id_ + 126 *header = "MAC id=\"" + id_ +
127 "\", nonce=\"" + age + ":" + nonce + 127 "\", nonce=\"" + age + ":" + nonce +
128 "\", mac=\"" + mac + "\""; 128 "\", mac=\"" + mac + "\"";
129 return true; 129 return true;
130 } 130 }
131 131
132 std::string HttpMacSignature::GenerateNormalizedRequest( 132 std::string HttpMacSignature::GenerateNormalizedRequest(
133 const std::string& age, 133 const std::string& age,
134 const std::string& nonce) { 134 const std::string& nonce) {
135 static const std::string kNewLine = "\n"; 135 const std::string kNewLine = "\n";
136 136
137 std::string normalized_request = age + ":" + nonce + kNewLine; 137 std::string normalized_request = age + ":" + nonce + kNewLine;
138 normalized_request += method_ + kNewLine; 138 normalized_request += method_ + kNewLine;
139 normalized_request += request_uri_ + kNewLine; 139 normalized_request += request_uri_ + kNewLine;
140 normalized_request += host_ + kNewLine; 140 normalized_request += host_ + kNewLine;
141 normalized_request += port_ + kNewLine; 141 normalized_request += port_ + kNewLine;
142 normalized_request += kNewLine; 142 normalized_request += kNewLine;
143 normalized_request += kNewLine; 143 normalized_request += kNewLine;
144 144
145 return normalized_request; 145 return normalized_request;
(...skipping 23 matching lines...) Expand all
169 if (!base::Base64Encode(signature, &encoded_signature)) { 169 if (!base::Base64Encode(signature, &encoded_signature)) {
170 NOTREACHED(); 170 NOTREACHED();
171 return false; 171 return false;
172 } 172 }
173 173
174 mac->swap(encoded_signature); 174 mac->swap(encoded_signature);
175 return true; 175 return true;
176 } 176 }
177 177
178 } // namespace net 178 } // namespace net
OLDNEW
« no previous file with comments | « net/base/net_util.cc ('k') | net/spdy/spdy_settings_storage.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698