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

Side by Side Diff: net/tools/quic/spdy_utils.cc

Issue 448853002: Move StringToLowerASCII to base namespace (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 4 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
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/tools/quic/spdy_utils.h" 5 #include "net/tools/quic/spdy_utils.h"
6 6
7 #include <string> 7 #include <string>
8 8
9 #include "base/memory/scoped_ptr.h" 9 #include "base/memory/scoped_ptr.h"
10 #include "base/strings/string_number_conversions.h" 10 #include "base/strings/string_number_conversions.h"
(...skipping 28 matching lines...) Expand all
39 ++hi) { 39 ++hi) {
40 if ((hi->second.length() == 0) && !allow_empty_values) { 40 if ((hi->second.length() == 0) && !allow_empty_values) {
41 DVLOG(1) << "Dropping empty header " << hi->first.as_string() 41 DVLOG(1) << "Dropping empty header " << hi->first.as_string()
42 << " from headers"; 42 << " from headers";
43 continue; 43 continue;
44 } 44 }
45 45
46 // This unfortunately involves loads of copying, but its the simplest way 46 // This unfortunately involves loads of copying, but its the simplest way
47 // to sort the headers and leverage the framer. 47 // to sort the headers and leverage the framer.
48 string name = hi->first.as_string(); 48 string name = hi->first.as_string();
49 StringToLowerASCII(&name); 49 base::StringToLowerASCII(&name);
50 SpdyHeaderBlock::iterator it = block->find(name); 50 SpdyHeaderBlock::iterator it = block->find(name);
51 if (it != block->end()) { 51 if (it != block->end()) {
52 it->second.reserve(it->second.size() + 1 + hi->second.size()); 52 it->second.reserve(it->second.size() + 1 + hi->second.size());
53 it->second.append("\0", 1); 53 it->second.append("\0", 1);
54 it->second.append(hi->second.data(), hi->second.size()); 54 it->second.append(hi->second.data(), hi->second.size());
55 } else { 55 } else {
56 block->insert(make_pair(name, hi->second.as_string())); 56 block->insert(make_pair(name, hi->second.as_string()));
57 } 57 }
58 } 58 }
59 } 59 }
(...skipping 197 matching lines...) Expand 10 before | Expand all | Expand 10 after
257 for (BlockIt it = header_block.begin(); it != header_block.end(); ++it) { 257 for (BlockIt it = header_block.begin(); it != header_block.end(); ++it) {
258 if (!IsSpecialSpdyHeader(it, request_headers)) { 258 if (!IsSpecialSpdyHeader(it, request_headers)) {
259 request_headers->AppendHeader(it->first, it->second); 259 request_headers->AppendHeader(it->first, it->second);
260 } 260 }
261 } 261 }
262 return true; 262 return true;
263 } 263 }
264 264
265 } // namespace tools 265 } // namespace tools
266 } // namespace net 266 } // namespace net
OLDNEW
« no previous file with comments | « net/test/embedded_test_server/http_request.cc ('k') | net/url_request/url_request_throttler_manager.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698