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

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

Issue 2464683002: adds std:: to stl types (#049) (Closed)
Patch Set: remove dead using std::foo declarations. Created 4 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
« no previous file with comments | « net/quic/core/quic_stream_sequencer_test.cc ('k') | net/tools/quic/end_to_end_test.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) 2013 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2013 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/quic/core/spdy_utils.h" 5 #include "net/quic/core/spdy_utils.h"
6 6
7 #include <memory> 7 #include <memory>
8 #include <vector> 8 #include <vector>
9 9
10 #include "base/stl_util.h" 10 #include "base/stl_util.h"
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after
56 } 56 }
57 57
58 // static 58 // static
59 bool SpdyUtils::ExtractContentLengthFromHeaders(int64_t* content_length, 59 bool SpdyUtils::ExtractContentLengthFromHeaders(int64_t* content_length,
60 SpdyHeaderBlock* headers) { 60 SpdyHeaderBlock* headers) {
61 auto it = headers->find("content-length"); 61 auto it = headers->find("content-length");
62 if (it == headers->end()) { 62 if (it == headers->end()) {
63 return false; 63 return false;
64 } else { 64 } else {
65 // Check whether multiple values are consistent. 65 // Check whether multiple values are consistent.
66 base::StringPiece content_length_header = it->second; 66 StringPiece content_length_header = it->second;
67 vector<string> values = 67 std::vector<string> values =
68 base::SplitString(content_length_header, base::StringPiece("\0", 1), 68 base::SplitString(content_length_header, base::StringPiece("\0", 1),
69 base::TRIM_WHITESPACE, base::SPLIT_WANT_ALL); 69 base::TRIM_WHITESPACE, base::SPLIT_WANT_ALL);
70 for (const string& value : values) { 70 for (const string& value : values) {
71 int64_t new_value; 71 int64_t new_value;
72 if (!base::StringToInt64(value, &new_value) || new_value < 0) { 72 if (!base::StringToInt64(value, &new_value) || new_value < 0) {
73 DLOG(ERROR) << "Content length was either unparseable or negative."; 73 DLOG(ERROR) << "Content length was either unparseable or negative.";
74 return false; 74 return false;
75 } 75 }
76 if (*content_length < 0) { 76 if (*content_length < 0) {
77 *content_length = new_value; 77 *content_length = new_value;
(...skipping 174 matching lines...) Expand 10 before | Expand all | Expand 10 after
252 pos = url.find("/", start); 252 pos = url.find("/", start);
253 if (pos == string::npos) { 253 if (pos == string::npos) {
254 return false; 254 return false;
255 } 255 }
256 (*headers)[":authority"] = url.substr(start, pos - start); 256 (*headers)[":authority"] = url.substr(start, pos - start);
257 (*headers)[":path"] = url.substr(pos); 257 (*headers)[":path"] = url.substr(pos);
258 return true; 258 return true;
259 } 259 }
260 260
261 } // namespace net 261 } // namespace net
OLDNEW
« no previous file with comments | « net/quic/core/quic_stream_sequencer_test.cc ('k') | net/tools/quic/end_to_end_test.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698