diff options
author | Steve Block <steveblock@google.com> | 2010-08-24 07:50:47 -0700 |
---|---|---|
committer | Android (Google) Code Review <android-gerrit@google.com> | 2010-08-24 07:50:47 -0700 |
commit | c570a147a94b126d4172c30914f53dea17b4c8f5 (patch) | |
tree | 99c11741887d21f65d67c5bbdab58b7ba2a5d4d5 /WebCore/platform/network/HTTPParsers.cpp | |
parent | c952714bc6809a5ad081baaf9fcc04107b92ea3f (diff) | |
parent | 6c65f16005b91786c2b7c0791b9ea1dd684d57f4 (diff) | |
download | external_webkit-c570a147a94b126d4172c30914f53dea17b4c8f5.zip external_webkit-c570a147a94b126d4172c30914f53dea17b4c8f5.tar.gz external_webkit-c570a147a94b126d4172c30914f53dea17b4c8f5.tar.bz2 |
Merge changes I2e7e2317,Ie6ccde3a,I3e89f231,Id06ff339,I268dfe7d,Icaf70d9f,Ie234f1a0,Iff5c7aaa,I69b75bf0,Ifbf384f4
* changes:
Merge WebKit at r65615 : Update WebKit revision number
Merge WebKit at r65615 : Ignore http/tests/appcache/origin-quota.html
Merge WebKit at r65615 : Android-specific results for Geolocation tests.
Merge WebKit at r65615 : Fix GraphicsContext and ImageBuffer.
Merge WebKit at r65615 : processingUserGesture() is now static.
Merge WebKit at r65615 : UTF8String() becomes utf8().
Merge WebKit at r65615 : Fix include paths for string headers.
Merge WebKit at r65615 : Fix Makefiles.
Merge WebKit at r65615 : Fix conflicts.
Merge WebKit at r65615 : Initial merge by git.
Diffstat (limited to 'WebCore/platform/network/HTTPParsers.cpp')
-rw-r--r-- | WebCore/platform/network/HTTPParsers.cpp | 34 |
1 files changed, 17 insertions, 17 deletions
diff --git a/WebCore/platform/network/HTTPParsers.cpp b/WebCore/platform/network/HTTPParsers.cpp index 6252bfc..b3f3d45 100644 --- a/WebCore/platform/network/HTTPParsers.cpp +++ b/WebCore/platform/network/HTTPParsers.cpp @@ -42,9 +42,9 @@ using namespace WTF; namespace WebCore { // true if there is more to parse -static inline bool skipWhiteSpace(const String& str, int& pos, bool fromHttpEquivMeta) +static inline bool skipWhiteSpace(const String& str, unsigned& pos, bool fromHttpEquivMeta) { - int len = str.length(); + unsigned len = str.length(); if (fromHttpEquivMeta) { while (pos != len && str[pos] <= ' ') @@ -59,9 +59,9 @@ static inline bool skipWhiteSpace(const String& str, int& pos, bool fromHttpEqui // Returns true if the function can match the whole token (case insensitive). // Note: Might return pos == str.length() -static inline bool skipToken(const String& str, int& pos, const char* token) +static inline bool skipToken(const String& str, unsigned& pos, const char* token) { - int len = str.length(); + unsigned len = str.length(); while (pos != len && *token) { if (toASCIILower(str[pos]) != *token++) @@ -104,8 +104,8 @@ ContentDispositionType contentDispositionType(const String& contentDisposition) bool parseHTTPRefresh(const String& refresh, bool fromHttpEquivMeta, double& delay, String& url) { - int len = refresh.length(); - int pos = 0; + unsigned len = refresh.length(); + unsigned pos = 0; if (!skipWhiteSpace(refresh, pos, fromHttpEquivMeta)) return false; @@ -126,7 +126,7 @@ bool parseHTTPRefresh(const String& refresh, bool fromHttpEquivMeta, double& del ++pos; skipWhiteSpace(refresh, pos, fromHttpEquivMeta); - int urlStartPos = pos; + unsigned urlStartPos = pos; if (refresh.find("url", urlStartPos, false) == urlStartPos) { urlStartPos += 3; skipWhiteSpace(refresh, urlStartPos, fromHttpEquivMeta); @@ -137,7 +137,7 @@ bool parseHTTPRefresh(const String& refresh, bool fromHttpEquivMeta, double& del urlStartPos = pos; // e.g. "Refresh: 0; url.html" } - int urlEndPos = len; + unsigned urlEndPos = len; if (refresh[urlStartPos] == '"' || refresh[urlStartPos] == '\'') { UChar quotationMark = refresh[urlStartPos]; @@ -173,8 +173,8 @@ String filenameFromHTTPContentDisposition(const String& value) unsigned length = keyValuePairs.size(); for (unsigned i = 0; i < length; i++) { - int valueStartPos = keyValuePairs[i].find('='); - if (valueStartPos < 0) + size_t valueStartPos = keyValuePairs[i].find('='); + if (valueStartPos == notFound) continue; String key = keyValuePairs[i].left(valueStartPos).stripWhiteSpace(); @@ -241,12 +241,12 @@ void findCharsetInMediaType(const String& mediaType, unsigned int& charsetPos, u charsetPos = start; charsetLen = 0; - int pos = start; - int length = (int)mediaType.length(); + size_t pos = start; + unsigned length = mediaType.length(); while (pos < length) { pos = mediaType.find("charset", pos, false); - if (pos <= 0) { + if (pos == notFound || pos == 0) { charsetLen = 0; return; } @@ -270,7 +270,7 @@ void findCharsetInMediaType(const String& mediaType, unsigned int& charsetPos, u ++pos; // we don't handle spaces within quoted parameter values, because charset names cannot have any - int endpos = pos; + unsigned endpos = pos; while (pos != length && mediaType[endpos] > ' ' && mediaType[endpos] != '"' && mediaType[endpos] != '\'' && mediaType[endpos] != ';') ++endpos; @@ -290,8 +290,8 @@ XSSProtectionDisposition parseXSSProtectionHeader(const String& header) if (stippedHeader[0] == '0') return XSSProtectionDisabled; - int length = (int)header.length(); - int pos = 0; + unsigned length = header.length(); + unsigned pos = 0; if (stippedHeader[pos++] == '1' && skipWhiteSpace(stippedHeader, pos, false) && stippedHeader[pos++] == ';' @@ -309,7 +309,7 @@ XSSProtectionDisposition parseXSSProtectionHeader(const String& header) String extractReasonPhraseFromHTTPStatusLine(const String& statusLine) { - int spacePos = statusLine.find(' '); + size_t spacePos = statusLine.find(' '); // Remove status code from the status line. spacePos = statusLine.find(' ', spacePos + 1); return statusLine.substring(spacePos + 1); |