| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2006 Alexey Proskuryakov (ap@webkit.org) | 2 * Copyright (C) 2006 Alexey Proskuryakov (ap@webkit.org) |
| 3 * Copyright (C) 2006, 2007, 2008, 2009 Apple Inc. All rights reserved. | 3 * Copyright (C) 2006, 2007, 2008, 2009 Apple Inc. All rights reserved. |
| 4 * Copyright (C) 2009 Torch Mobile Inc. http://www.torchmobile.com/ | 4 * Copyright (C) 2009 Torch Mobile Inc. http://www.torchmobile.com/ |
| 5 * Copyright (C) 2009 Google Inc. All rights reserved. | 5 * Copyright (C) 2009 Google Inc. All rights reserved. |
| 6 * Copyright (C) 2011 Apple Inc. All Rights Reserved. | 6 * Copyright (C) 2011 Apple Inc. All Rights Reserved. |
| 7 * | 7 * |
| 8 * Redistribution and use in source and binary forms, with or without | 8 * Redistribution and use in source and binary forms, with or without |
| 9 * modification, are permitted provided that the following conditions | 9 * modification, are permitted provided that the following conditions |
| 10 * are met: | 10 * are met: |
| (...skipping 313 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 324 bool ok; | 324 bool ok; |
| 325 delay = refresh.left(pos).stripWhiteSpace().toDouble(&ok); | 325 delay = refresh.left(pos).stripWhiteSpace().toDouble(&ok); |
| 326 if (!ok) | 326 if (!ok) |
| 327 return false; | 327 return false; |
| 328 | 328 |
| 329 skipWhiteSpace(refresh, pos, matcher); | 329 skipWhiteSpace(refresh, pos, matcher); |
| 330 if (pos < len && (refresh[pos] == ',' || refresh[pos] == ';')) | 330 if (pos < len && (refresh[pos] == ',' || refresh[pos] == ';')) |
| 331 ++pos; | 331 ++pos; |
| 332 skipWhiteSpace(refresh, pos, matcher); | 332 skipWhiteSpace(refresh, pos, matcher); |
| 333 unsigned urlStartPos = pos; | 333 unsigned urlStartPos = pos; |
| 334 if (refresh.find("url", urlStartPos, TextCaseInsensitive) == urlStartPos) { | 334 if (refresh.find("url", urlStartPos, TextCaseASCIIInsensitive) == |
| 335 urlStartPos) { |
| 335 urlStartPos += 3; | 336 urlStartPos += 3; |
| 336 skipWhiteSpace(refresh, urlStartPos, matcher); | 337 skipWhiteSpace(refresh, urlStartPos, matcher); |
| 337 if (refresh[urlStartPos] == '=') { | 338 if (refresh[urlStartPos] == '=') { |
| 338 ++urlStartPos; | 339 ++urlStartPos; |
| 339 skipWhiteSpace(refresh, urlStartPos, matcher); | 340 skipWhiteSpace(refresh, urlStartPos, matcher); |
| 340 } else { | 341 } else { |
| 341 urlStartPos = pos; // e.g. "Refresh: 0; url.html" | 342 urlStartPos = pos; // e.g. "Refresh: 0; url.html" |
| 342 } | 343 } |
| 343 } | 344 } |
| 344 | 345 |
| (...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 424 unsigned& charsetPos, | 425 unsigned& charsetPos, |
| 425 unsigned& charsetLen, | 426 unsigned& charsetLen, |
| 426 unsigned start) { | 427 unsigned start) { |
| 427 charsetPos = start; | 428 charsetPos = start; |
| 428 charsetLen = 0; | 429 charsetLen = 0; |
| 429 | 430 |
| 430 size_t pos = start; | 431 size_t pos = start; |
| 431 unsigned length = mediaType.length(); | 432 unsigned length = mediaType.length(); |
| 432 | 433 |
| 433 while (pos < length) { | 434 while (pos < length) { |
| 434 pos = mediaType.find("charset", pos, TextCaseInsensitive); | 435 pos = mediaType.find("charset", pos, TextCaseASCIIInsensitive); |
| 435 if (pos == kNotFound || !pos) { | 436 if (pos == kNotFound || !pos) { |
| 436 charsetLen = 0; | 437 charsetLen = 0; |
| 437 return; | 438 return; |
| 438 } | 439 } |
| 439 | 440 |
| 440 // is what we found a beginning of a word? | 441 // is what we found a beginning of a word? |
| 441 if (mediaType[pos - 1] > ' ' && mediaType[pos - 1] != ';') { | 442 if (mediaType[pos - 1] > ' ' && mediaType[pos - 1] != ';') { |
| 442 pos += 7; | 443 pos += 7; |
| 443 continue; | 444 continue; |
| 444 } | 445 } |
| (...skipping 456 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 901 std::unique_ptr<JSONArray> parseJSONHeader(const String& header) { | 902 std::unique_ptr<JSONArray> parseJSONHeader(const String& header) { |
| 902 StringBuilder sb; | 903 StringBuilder sb; |
| 903 sb.append("["); | 904 sb.append("["); |
| 904 sb.append(header); | 905 sb.append(header); |
| 905 sb.append("]"); | 906 sb.append("]"); |
| 906 std::unique_ptr<JSONValue> headerValue = parseJSON(sb.toString()); | 907 std::unique_ptr<JSONValue> headerValue = parseJSON(sb.toString()); |
| 907 return JSONArray::from(std::move(headerValue)); | 908 return JSONArray::from(std::move(headerValue)); |
| 908 } | 909 } |
| 909 | 910 |
| 910 } // namespace blink | 911 } // namespace blink |
| OLD | NEW |