| OLD | NEW |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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 "core/loader/LinkHeader.h" | 5 #include "core/loader/LinkHeader.h" |
| 6 | 6 |
| 7 #include "platform/ParsingUtilities.h" | 7 #include "platform/ParsingUtilities.h" |
| 8 | 8 |
| 9 namespace blink { | 9 namespace blink { |
| 10 | 10 |
| (...skipping 282 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 293 | 293 |
| 294 String parameterValue; | 294 String parameterValue; |
| 295 if (!parseParameterValue(position, end, parameterValue) && !isExtensionP
arameter(parameterName)) { | 295 if (!parseParameterValue(position, end, parameterValue) && !isExtensionP
arameter(parameterName)) { |
| 296 findNextHeader(position, end); | 296 findNextHeader(position, end); |
| 297 m_isValid = false; | 297 m_isValid = false; |
| 298 return; | 298 return; |
| 299 } | 299 } |
| 300 | 300 |
| 301 setValue(parameterName, parameterValue); | 301 setValue(parameterName, parameterValue); |
| 302 } | 302 } |
| 303 findNextHeader(position, end); |
| 303 } | 304 } |
| 304 | 305 |
| 305 LinkHeaderSet::LinkHeaderSet(const String& header) | 306 LinkHeaderSet::LinkHeaderSet(const String& header) |
| 306 { | 307 { |
| 307 if (header.isNull()) | 308 if (header.isNull()) |
| 308 return; | 309 return; |
| 309 | 310 |
| 310 if (header.is8Bit()) | 311 if (header.is8Bit()) |
| 311 init(header.characters8(), header.length()); | 312 init(header.characters8(), header.length()); |
| 312 else | 313 else |
| 313 init(header.characters16(), header.length()); | 314 init(header.characters16(), header.length()); |
| 314 } | 315 } |
| 315 | 316 |
| 316 template <typename CharType> | 317 template <typename CharType> |
| 317 void LinkHeaderSet::init(CharType* headerValue, unsigned len) | 318 void LinkHeaderSet::init(CharType* headerValue, unsigned len) |
| 318 { | 319 { |
| 319 CharType* position = headerValue; | 320 CharType* position = headerValue; |
| 320 CharType* end = headerValue + len; | 321 CharType* end = headerValue + len; |
| 321 while (position < end) | 322 while (position < end) |
| 322 m_headerSet.append(LinkHeader(position, end)); | 323 m_headerSet.append(LinkHeader(position, end)); |
| 323 } | 324 } |
| 324 | 325 |
| 325 } // namespace blink | 326 } // namespace blink |
| OLD | NEW |