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

Unified Diff: sky/engine/platform/network/HTTPParsers.cpp

Issue 708233002: Remove many attributes. (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: Created 6 years, 1 month 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « sky/engine/platform/network/HTTPParsers.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: sky/engine/platform/network/HTTPParsers.cpp
diff --git a/sky/engine/platform/network/HTTPParsers.cpp b/sky/engine/platform/network/HTTPParsers.cpp
index be3302e4181291e64f7e79edc2241bce9710b673..270e54ee286d03d5408db081cd25e26b6676cf59 100644
--- a/sky/engine/platform/network/HTTPParsers.cpp
+++ b/sky/engine/platform/network/HTTPParsers.cpp
@@ -168,66 +168,6 @@ ContentDispositionType contentDispositionType(const String& contentDisposition)
return ContentDispositionAttachment;
}
-bool parseHTTPRefresh(const String& refresh, bool fromHttpEquivMeta, double& delay, String& url)
-{
- unsigned len = refresh.length();
- unsigned pos = 0;
-
- if (!skipWhiteSpace(refresh, pos, fromHttpEquivMeta))
- return false;
-
- while (pos != len && refresh[pos] != ',' && refresh[pos] != ';')
- ++pos;
-
- if (pos == len) { // no URL
- url = String();
- bool ok;
- delay = refresh.stripWhiteSpace().toDouble(&ok);
- return ok;
- } else {
- bool ok;
- delay = refresh.left(pos).stripWhiteSpace().toDouble(&ok);
- if (!ok)
- return false;
-
- ++pos;
- skipWhiteSpace(refresh, pos, fromHttpEquivMeta);
- unsigned urlStartPos = pos;
- if (refresh.find("url", urlStartPos, false) == urlStartPos) {
- urlStartPos += 3;
- skipWhiteSpace(refresh, urlStartPos, fromHttpEquivMeta);
- if (refresh[urlStartPos] == '=') {
- ++urlStartPos;
- skipWhiteSpace(refresh, urlStartPos, fromHttpEquivMeta);
- } else {
- urlStartPos = pos; // e.g. "Refresh: 0; url.html"
- }
- }
-
- unsigned urlEndPos = len;
-
- if (refresh[urlStartPos] == '"' || refresh[urlStartPos] == '\'') {
- UChar quotationMark = refresh[urlStartPos];
- urlStartPos++;
- while (urlEndPos > urlStartPos) {
- urlEndPos--;
- if (refresh[urlEndPos] == quotationMark)
- break;
- }
-
- // https://bugs.webkit.org/show_bug.cgi?id=27868
- // Sometimes there is no closing quote for the end of the URL even though there was an opening quote.
- // If we looped over the entire alleged URL string back to the opening quote, just go ahead and use everything
- // after the opening quote instead.
- if (urlEndPos == urlStartPos)
- urlEndPos = len;
- }
-
- url = refresh.substring(urlStartPos, urlEndPos - urlStartPos).stripWhiteSpace();
- return true;
- }
-}
-
double parseDate(const String& value)
{
return parseDateFromNullTerminatedCharacters(value.utf8().data());
« no previous file with comments | « sky/engine/platform/network/HTTPParsers.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698