| OLD | NEW |
| 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" |
| 11 #include "base/strings/string_piece.h" | 11 #include "base/strings/string_piece.h" |
| 12 #include "base/strings/string_util.h" | 12 #include "base/strings/string_util.h" |
| 13 #include "net/spdy/spdy_frame_builder.h" | 13 #include "net/spdy/spdy_frame_builder.h" |
| 14 #include "net/spdy/spdy_framer.h" | 14 #include "net/spdy/spdy_framer.h" |
| 15 #include "net/spdy/spdy_protocol.h" | 15 #include "net/spdy/spdy_protocol.h" |
| 16 #include "net/tools/balsa/balsa_headers.h" | 16 #include "net/tools/balsa/balsa_headers.h" |
| 17 #include "url/gurl.h" | 17 #include "url/gurl.h" |
| 18 | 18 |
| 19 using base::StringPiece; | 19 using base::StringPiece; |
| 20 using std::make_pair; | 20 using std::make_pair; |
| 21 using std::pair; | 21 using std::pair; |
| 22 using std::string; | 22 using std::string; |
| 23 | 23 |
| 24 namespace net { | 24 namespace net { |
| 25 namespace tools { | 25 namespace tools { |
| 26 | 26 |
| 27 const char* const kV4Host = ":authority"; | 27 const char kV4Host[] = ":authority"; |
| 28 | 28 |
| 29 const char* const kV3Host = ":host"; | 29 const char kV3Host[] = ":host"; |
| 30 const char* const kV3Path = ":path"; | 30 const char kV3Path[] = ":path"; |
| 31 const char* const kV3Scheme = ":scheme"; | 31 const char kV3Scheme[] = ":scheme"; |
| 32 const char* const kV3Status = ":status"; | 32 const char kV3Status[] = ":status"; |
| 33 const char* const kV3Method = ":method"; | 33 const char kV3Method[] = ":method"; |
| 34 const char* const kV3Version = ":version"; | 34 const char kV3Version[] = ":version"; |
| 35 | 35 |
| 36 void PopulateSpdyHeaderBlock(const BalsaHeaders& headers, | 36 void PopulateSpdyHeaderBlock(const BalsaHeaders& headers, |
| 37 SpdyHeaderBlock* block, | 37 SpdyHeaderBlock* block, |
| 38 bool allow_empty_values) { | 38 bool allow_empty_values) { |
| 39 for (BalsaHeaders::const_header_lines_iterator hi = | 39 for (BalsaHeaders::const_header_lines_iterator hi = |
| 40 headers.header_lines_begin(); | 40 headers.header_lines_begin(); |
| 41 hi != headers.header_lines_end(); | 41 hi != headers.header_lines_end(); |
| 42 ++hi) { | 42 ++hi) { |
| 43 if ((hi->second.length() == 0) && !allow_empty_values) { | 43 if ((hi->second.length() == 0) && !allow_empty_values) { |
| 44 DVLOG(1) << "Dropping empty header " << hi->first.as_string() | 44 DVLOG(1) << "Dropping empty header " << hi->first.as_string() |
| (...skipping 276 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 321 for (BlockIt it = header_block.begin(); it != header_block.end(); ++it) { | 321 for (BlockIt it = header_block.begin(); it != header_block.end(); ++it) { |
| 322 if (!IsSpecialSpdyHeader(it, request_headers)) { | 322 if (!IsSpecialSpdyHeader(it, request_headers)) { |
| 323 request_headers->AppendHeader(it->first, it->second); | 323 request_headers->AppendHeader(it->first, it->second); |
| 324 } | 324 } |
| 325 } | 325 } |
| 326 return true; | 326 return true; |
| 327 } | 327 } |
| 328 | 328 |
| 329 } // namespace tools | 329 } // namespace tools |
| 330 } // namespace net | 330 } // namespace net |
| OLD | NEW |