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

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

Issue 7466003: MD5Update function uses StringPiece instead of raw buffer. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Remove line from license. Created 9 years, 5 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 | Annotate | Revision Log
« no previous file with comments | « media/tools/media_bench/media_bench.cc ('k') | no next file » | 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_vary_data.h" 5 #include "net/http/http_vary_data.h"
6 6
7 #include <stdlib.h> 7 #include <stdlib.h>
8 8
9 #include "base/pickle.h" 9 #include "base/pickle.h"
10 #include "base/string_util.h" 10 #include "base/string_util.h"
(...skipping 102 matching lines...) Expand 10 before | Expand all | Expand 10 after
113 const std::string& request_header, 113 const std::string& request_header,
114 base::MD5Context* ctx) { 114 base::MD5Context* ctx) {
115 std::string request_value = GetRequestValue(request_info, request_header); 115 std::string request_value = GetRequestValue(request_info, request_header);
116 116
117 // Append a character that cannot appear in the request header line so that we 117 // Append a character that cannot appear in the request header line so that we
118 // protect against case where the concatenation of two request headers could 118 // protect against case where the concatenation of two request headers could
119 // look the same for a variety of values for the individual request headers. 119 // look the same for a variety of values for the individual request headers.
120 // For example, "foo: 12\nbar: 3" looks like "foo: 1\nbar: 23" otherwise. 120 // For example, "foo: 12\nbar: 3" looks like "foo: 1\nbar: 23" otherwise.
121 request_value.append(1, '\n'); 121 request_value.append(1, '\n');
122 122
123 base::MD5Update(ctx, request_value.data(), request_value.size()); 123 base::MD5Update(ctx, request_value);
124 } 124 }
125 125
126 } // namespace net 126 } // namespace net
OLDNEW
« no previous file with comments | « media/tools/media_bench/media_bench.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698