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 "config.h" | 5 #include "config.h" |
6 #include "core/loader/LinkHeader.h" | 6 #include "core/loader/LinkHeader.h" |
7 | 7 |
8 #include "platform/ParsingUtilities.h" | 8 #include "platform/ParsingUtilities.h" |
9 | 9 |
10 namespace blink { | 10 namespace blink { |
(...skipping 228 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
239 if (hasQuotes) | 239 if (hasQuotes) |
240 ++valueStart; | 240 ++valueStart; |
241 if (completeQuotes) | 241 if (completeQuotes) |
242 --valueEnd; | 242 --valueEnd; |
243 value = String(valueStart, valueEnd - valueStart); | 243 value = String(valueStart, valueEnd - valueStart); |
244 return !hasQuotes || completeQuotes; | 244 return !hasQuotes || completeQuotes; |
245 } | 245 } |
246 | 246 |
247 void LinkHeader::setValue(LinkParameterName name, String value) | 247 void LinkHeader::setValue(LinkParameterName name, String value) |
248 { | 248 { |
249 // FIXME: Add support for more header parameters as neccessary. | 249 // FIXME: Add support for more header parameters as necessary. |
250 if (name == LinkParameterRel && !m_rel) | 250 if (name == LinkParameterRel && !m_rel) |
251 m_rel = value.lower(); | 251 m_rel = value.lower(); |
252 else if (name == LinkParameterAnchor) | 252 else if (name == LinkParameterAnchor) |
253 m_isValid = false; | 253 m_isValid = false; |
254 else if (name == LinkParameterCrossOrigin) | 254 else if (name == LinkParameterCrossOrigin) |
255 m_crossOrigin = crossOriginAttributeValue(value); | 255 m_crossOrigin = crossOriginAttributeValue(value); |
256 } | 256 } |
257 | 257 |
258 template <typename CharType> | 258 template <typename CharType> |
259 static void findNextHeader(CharType*& position, CharType* end) | 259 static void findNextHeader(CharType*& position, CharType* end) |
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
311 template <typename CharType> | 311 template <typename CharType> |
312 void LinkHeaderSet::init(CharType* headerValue, unsigned len) | 312 void LinkHeaderSet::init(CharType* headerValue, unsigned len) |
313 { | 313 { |
314 CharType* position = headerValue; | 314 CharType* position = headerValue; |
315 CharType* end = headerValue + len; | 315 CharType* end = headerValue + len; |
316 while (position < end) | 316 while (position < end) |
317 m_headerSet.append(LinkHeader(position, end)); | 317 m_headerSet.append(LinkHeader(position, end)); |
318 } | 318 } |
319 | 319 |
320 } | 320 } |
OLD | NEW |