| Index: third_party/WebKit/Source/platform/network/HTTPParsers.cpp
|
| diff --git a/third_party/WebKit/Source/platform/network/HTTPParsers.cpp b/third_party/WebKit/Source/platform/network/HTTPParsers.cpp
|
| index 6ee9c75a617beabf0f3c67f545f78b63cf2b633a..456db9c35bb382ad0bd598edd816cd371a786100 100644
|
| --- a/third_party/WebKit/Source/platform/network/HTTPParsers.cpp
|
| +++ b/third_party/WebKit/Source/platform/network/HTTPParsers.cpp
|
| @@ -161,23 +161,23 @@ const UChar* parseSuboriginName(const UChar* begin,
|
| WTF::Vector<String>& messages) {
|
| // Parse the name of the suborigin (no spaces, single string)
|
| if (begin == end) {
|
| - messages.append(String("No Suborigin name specified."));
|
| + messages.push_back(String("No Suborigin name specified."));
|
| return nullptr;
|
| }
|
|
|
| const UChar* position = begin;
|
|
|
| if (!skipExactly<UChar, isASCIILower>(position, end)) {
|
| - messages.append("Invalid character \'" + String(position, 1) +
|
| - "\' in suborigin. First character must be a lower case "
|
| - "alphabetic character.");
|
| + messages.push_back("Invalid character \'" + String(position, 1) +
|
| + "\' in suborigin. First character must be a lower case "
|
| + "alphabetic character.");
|
| return nullptr;
|
| }
|
|
|
| skipWhile<UChar, isASCIILowerAlphaOrDigit>(position, end);
|
| if (position != end && !isASCIISpace(*position)) {
|
| - messages.append("Invalid character \'" + String(position, 1) +
|
| - "\' in suborigin.");
|
| + messages.push_back("Invalid character \'" + String(position, 1) +
|
| + "\' in suborigin.");
|
| return nullptr;
|
| }
|
|
|
| @@ -193,22 +193,22 @@ const UChar* parseSuboriginPolicyOption(const UChar* begin,
|
| const UChar* position = begin;
|
|
|
| if (*position != '\'') {
|
| - messages.append("Invalid character \'" + String(position, 1) +
|
| - "\' in suborigin policy. Suborigin policy options must "
|
| - "start and end with a single quote.");
|
| + messages.push_back("Invalid character \'" + String(position, 1) +
|
| + "\' in suborigin policy. Suborigin policy options must "
|
| + "start and end with a single quote.");
|
| return nullptr;
|
| }
|
| position = position + 1;
|
|
|
| skipWhile<UChar, isASCIILowerAlphaOrDigitOrHyphen>(position, end);
|
| if (position == end || isASCIISpace(*position)) {
|
| - messages.append(String("Expected \' to end policy option."));
|
| + messages.push_back(String("Expected \' to end policy option."));
|
| return nullptr;
|
| }
|
|
|
| if (*position != '\'') {
|
| - messages.append("Invalid character \'" + String(position, 1) +
|
| - "\' in suborigin policy.");
|
| + messages.push_back("Invalid character \'" + String(position, 1) +
|
| + "\' in suborigin policy.");
|
| return nullptr;
|
| }
|
|
|
| @@ -638,7 +638,7 @@ static void parseCacheHeader(const String& header,
|
| size_t nextDoubleQuotePosition = value.find('"', 1);
|
| if (nextDoubleQuotePosition != kNotFound) {
|
| // Store the value as a quoted string without quotes
|
| - result.append(std::pair<String, String>(
|
| + result.push_back(std::pair<String, String>(
|
| directive, value.substring(1, nextDoubleQuotePosition - 1)
|
| .stripWhiteSpace()));
|
| pos +=
|
| @@ -651,7 +651,7 @@ static void parseCacheHeader(const String& header,
|
| return; // Parse error if there is anything left with no comma
|
| } else {
|
| // Parse error; just use the rest as the value
|
| - result.append(std::pair<String, String>(
|
| + result.push_back(std::pair<String, String>(
|
| directive,
|
| trimToNextSeparator(
|
| value.substring(1, value.length() - 1).stripWhiteSpace())));
|
| @@ -662,14 +662,14 @@ static void parseCacheHeader(const String& header,
|
| size_t nextCommaPosition2 = value.find(',');
|
| if (nextCommaPosition2 != kNotFound) {
|
| // The value is delimited by the next comma
|
| - result.append(std::pair<String, String>(
|
| + result.push_back(std::pair<String, String>(
|
| directive,
|
| trimToNextSeparator(
|
| value.substring(0, nextCommaPosition2).stripWhiteSpace())));
|
| pos += (safeHeader.find(',', pos) - pos) + 1;
|
| } else {
|
| // The rest is the value; no change to value needed
|
| - result.append(
|
| + result.push_back(
|
| std::pair<String, String>(directive, trimToNextSeparator(value)));
|
| return;
|
| }
|
| @@ -678,14 +678,14 @@ static void parseCacheHeader(const String& header,
|
| (nextCommaPosition < nextEqualSignPosition ||
|
| nextEqualSignPosition == kNotFound)) {
|
| // Add directive to map with empty string as value
|
| - result.append(std::pair<String, String>(
|
| + result.push_back(std::pair<String, String>(
|
| trimToNextSeparator(safeHeader.substring(pos, nextCommaPosition - pos)
|
| .stripWhiteSpace()),
|
| ""));
|
| pos += nextCommaPosition - pos + 1;
|
| } else {
|
| // Add last directive to map with empty string as value
|
| - result.append(std::pair<String, String>(
|
| + result.push_back(std::pair<String, String>(
|
| trimToNextSeparator(
|
| safeHeader.substring(pos, max - pos).stripWhiteSpace()),
|
| ""));
|
| @@ -776,7 +776,7 @@ bool parseSuboriginHeader(const String& header,
|
| header.split(',', true, headers);
|
|
|
| if (headers.size() > 1)
|
| - messages.append(
|
| + messages.push_back(
|
| "Multiple Suborigin headers found. Ignoring all but the first.");
|
|
|
| Vector<UChar> characters;
|
| @@ -813,8 +813,8 @@ bool parseSuboriginHeader(const String& header,
|
| Suborigin::SuboriginPolicyOptions option =
|
| getSuboriginPolicyOptionFromString(optionName);
|
| if (option == Suborigin::SuboriginPolicyOptions::None)
|
| - messages.append("Ignoring unknown suborigin policy option " + optionName +
|
| - ".");
|
| + messages.push_back("Ignoring unknown suborigin policy option " +
|
| + optionName + ".");
|
| else
|
| suborigin->addPolicyOption(option);
|
| }
|
|
|