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

Side by Side Diff: third_party/WebKit/Source/core/loader/LinkHeader.cpp

Issue 1779253002: More minor cleanups for LinkHeaderTest. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@cleanup-linkheader-tests
Patch Set: Created 4 years, 9 months 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 | « no previous file | third_party/WebKit/Source/core/loader/LinkHeaderTest.cpp » ('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 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
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
OLDNEW
« no previous file with comments | « no previous file | third_party/WebKit/Source/core/loader/LinkHeaderTest.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698