OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 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/tools/balsa/balsa_headers_token_utils.h" | 5 #include "net/tools/balsa/balsa_headers_token_utils.h" |
6 | 6 |
7 namespace net { | 7 namespace net { |
8 | 8 |
9 inline void BalsaHeadersTokenUtils::TokenizeHeaderLine( | 9 inline void BalsaHeadersTokenUtils::TokenizeHeaderLine( |
10 const BalsaHeaders& headers, | 10 const BalsaHeaders& headers, |
(...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
89 base::CompareCase::INSENSITIVE_ASCII); | 89 base::CompareCase::INSENSITIVE_ASCII); |
90 } | 90 } |
91 | 91 |
92 void BalsaHeadersTokenUtils::TokenizeHeaderValue( | 92 void BalsaHeadersTokenUtils::TokenizeHeaderValue( |
93 const BalsaHeaders& headers, | 93 const BalsaHeaders& headers, |
94 const base::StringPiece& key, | 94 const base::StringPiece& key, |
95 BalsaHeaders::HeaderTokenList* tokens) { | 95 BalsaHeaders::HeaderTokenList* tokens) { |
96 CHECK(tokens); | 96 CHECK(tokens); |
97 tokens->clear(); | 97 tokens->clear(); |
98 | 98 |
99 // We may have more then 1 line with the same header key. Tokenize them all | 99 // We may have more than 1 line with the same header key. Tokenize them all |
100 // and stick all the tokens into the same list. | 100 // and stick all the tokens into the same list. |
101 for (BalsaHeaders::const_header_lines_key_iterator header_line = | 101 for (BalsaHeaders::const_header_lines_key_iterator header_line = |
102 headers.GetIteratorForKey(key); | 102 headers.GetIteratorForKey(key); |
103 header_line != headers.header_lines_key_end(); ++header_line) { | 103 header_line != headers.header_lines_key_end(); ++header_line) { |
104 ParseTokenList(header_line->second.begin(), header_line->second.end(), | 104 ParseTokenList(header_line->second.begin(), header_line->second.end(), |
105 tokens); | 105 tokens); |
106 } | 106 } |
107 } | 107 } |
108 | 108 |
109 void BalsaHeadersTokenUtils::ParseTokenList( | 109 void BalsaHeadersTokenUtils::ParseTokenList( |
(...skipping 23 matching lines...) Expand all Loading... |
133 } | 133 } |
134 return; | 134 return; |
135 } | 135 } |
136 } | 136 } |
137 tokens->push_back(base::StringPiece(nws, start - nws)); | 137 tokens->push_back(base::StringPiece(nws, start - nws)); |
138 } | 138 } |
139 } | 139 } |
140 | 140 |
141 } // namespace net | 141 } // namespace net |
142 | 142 |
OLD | NEW |