Skip to content

Commit

Permalink
Backed out 4 changesets (bug 1358297) for hazard build failures a=bac…
Browse files Browse the repository at this point in the history
…kout

Backed out changeset 95211a496191 (bug 1358297)
Backed out changeset 3c1b426a5cce (bug 1358297)
Backed out changeset 9201d345a1d5 (bug 1358297)
Backed out changeset c926817dea60 (bug 1358297)

MozReview-Commit-ID: 874DF43K7Dp
  • Loading branch information
KWierso committed May 5, 2017
1 parent 051a3cf commit 9ff5a8b
Show file tree
Hide file tree
Showing 17 changed files with 61 additions and 605 deletions.
2 changes: 1 addition & 1 deletion docshell/base/nsDefaultURIFixup.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,7 @@ nsDefaultURIFixup::GetFixupURIInfo(const nsACString& aStringURI,
nsAutoCString uriString(aStringURI);

// Eliminate embedded newlines, which single-line text fields now allow:
uriString.StripCRLF();
uriString.StripChars("\r\n");
// Cleanup the empty spaces that might be on each end:
uriString.Trim(" ");

Expand Down
2 changes: 1 addition & 1 deletion docshell/base/nsDocShell.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4780,7 +4780,7 @@ nsDocShell::LoadURIWithOptions(const char16_t* aURI,
// Cleanup the empty spaces that might be on each end.
uriString.Trim(" ");
// Eliminate embedded newlines, which single-line text fields now allow:
uriString.StripCRLF();
uriString.StripChars("\r\n");
NS_ENSURE_TRUE(!uriString.IsEmpty(), NS_ERROR_FAILURE);

rv = NS_NewURI(getter_AddRefs(uri), uriString);
Expand Down
4 changes: 3 additions & 1 deletion dom/base/nsContentUtils.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -6684,7 +6684,9 @@ nsContentUtils::FlushLayoutForTree(nsPIDOMWindowOuter* aWindow)

void nsContentUtils::RemoveNewlines(nsString &aString)
{
aString.StripCRLF();
// strip CR/LF and null
static const char badChars[] = {'\r', '\n', 0};
aString.StripChars(badChars);
}

void
Expand Down
5 changes: 2 additions & 3 deletions dom/base/nsFrameMessageManager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@
#include "nsFrameMessageManager.h"

#include "ContentChild.h"
#include "nsASCIIMask.h"
#include "nsContentUtils.h"
#include "nsDOMClassInfoID.h"
#include "nsError.h"
Expand Down Expand Up @@ -592,7 +591,7 @@ AllowMessage(size_t aDataLength, const nsAString& aMessageName)
}

NS_ConvertUTF16toUTF8 messageName(aMessageName);
messageName.StripTaggedASCII(ASCIIMask::Mask0to9());
messageName.StripChars("0123456789");

Telemetry::Accumulate(Telemetry::MESSAGE_MANAGER_MESSAGE_SIZE2, messageName,
aDataLength);
Expand Down Expand Up @@ -678,7 +677,7 @@ nsFrameMessageManager::SendMessage(const nsAString& aMessageName,
// NOTE: We need to strip digit characters from the message name in order to
// avoid a large number of buckets due to generated names from addons (such
// as "ublock:sb:{N}"). See bug 1348113 comment 10.
messageName.StripTaggedASCII(ASCIIMask::Mask0to9());
messageName.StripChars("0123456789");
Telemetry::Accumulate(Telemetry::IPC_SYNC_MESSAGE_MANAGER_LATENCY_MS,
messageName, latencyMs);
}
Expand Down
6 changes: 4 additions & 2 deletions dom/html/HTMLInputElement.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5345,13 +5345,15 @@ HTMLInputElement::SanitizeValue(nsAString& aValue)
case NS_FORM_INPUT_TEL:
case NS_FORM_INPUT_PASSWORD:
{
aValue.StripCRLF();
char16_t crlf[] = { char16_t('\r'), char16_t('\n'), 0 };
aValue.StripChars(crlf);
}
break;
case NS_FORM_INPUT_EMAIL:
case NS_FORM_INPUT_URL:
{
aValue.StripCRLF();
char16_t crlf[] = { char16_t('\r'), char16_t('\n'), 0 };
aValue.StripChars(crlf);

aValue = nsContentUtils::TrimWhitespace<nsContentUtils::IsHTMLWhitespace>(aValue);
}
Expand Down
2 changes: 1 addition & 1 deletion editor/libeditor/TextEditRules.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -533,7 +533,7 @@ TextEditRules::HandleNewLines(nsString& aString,
aString.ReplaceChar(CRLF, ' ');
break;
case nsIPlaintextEditor::eNewlinesStrip:
aString.StripCRLF();
aString.StripChars(CRLF);
break;
case nsIPlaintextEditor::eNewlinesPasteToFirst:
default: {
Expand Down
18 changes: 7 additions & 11 deletions netwerk/base/nsURLHelper.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@
#include <algorithm>
#include <iterator>

#include "nsASCIIMask.h"
#include "nsURLHelper.h"
#include "nsIFile.h"
#include "nsIURLParser.h"
Expand Down Expand Up @@ -523,7 +522,7 @@ net_ExtractURLScheme(const nsACString &inURI,
}

p.Claim(scheme);
scheme.StripTaggedASCII(ASCIIMask::MaskCRLFTab());
scheme.StripChars("\r\n\t");
return NS_OK;
}

Expand Down Expand Up @@ -592,6 +591,8 @@ net_IsAbsoluteURL(const nsACString& uri)
void
net_FilterURIString(const nsACString& input, nsACString& result)
{
const char kCharsToStrip[] = "\r\n\t";

result.Truncate();

auto start = input.BeginReading();
Expand All @@ -606,14 +607,9 @@ net_FilterURIString(const nsACString& input, nsACString& result)
charFilter).base();

// Check if chars need to be stripped.
bool needsStrip = false;
const ASCIIMaskArray& mask = ASCIIMask::MaskCRLFTab();
for (auto itr = start; itr != end; ++itr) {
if (ASCIIMask::IsMasked(mask, *itr)) {
needsStrip = true;
break;
}
}
auto itr = std::find_first_of(
newStart, newEnd, std::begin(kCharsToStrip), std::end(kCharsToStrip));
const bool needsStrip = itr != newEnd;

// Just use the passed in string rather than creating new copies if no
// changes are necessary.
Expand All @@ -624,7 +620,7 @@ net_FilterURIString(const nsACString& input, nsACString& result)

result.Assign(Substring(newStart, newEnd));
if (needsStrip) {
result.StripTaggedASCII(mask);
result.StripChars(kCharsToStrip);
}
}

Expand Down
4 changes: 2 additions & 2 deletions netwerk/mime/nsMIMEHeaderParamImpl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -518,7 +518,7 @@ nsMIMEHeaderParamImpl::DoParameterInternal(const char *aHeaderValue,
// if the parameter spans across multiple lines we have to strip out the
// line continuation -- jht 4/29/98
nsAutoCString tempStr(valueStart, valueEnd - valueStart);
tempStr.StripCRLF();
tempStr.StripChars("\r\n");
char *res = ToNewCString(tempStr);
NS_ENSURE_TRUE(res, NS_ERROR_OUT_OF_MEMORY);

Expand Down Expand Up @@ -761,7 +761,7 @@ internalDecodeRFC2047Header(const char* aHeaderVal, const char* aDefaultCharset,
nsAutoCString temp(aResult);
temp.ReplaceSubstring("\n\t", " ");
temp.ReplaceSubstring("\r\t", " ");
temp.StripCRLF();
temp.StripChars("\r\n");
aResult = temp;
}

Expand Down
2 changes: 0 additions & 2 deletions xpcom/string/moz.build
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ with Files('**'):
BUG_COMPONENT = ('Core', 'String')

EXPORTS += [
'nsASCIIMask.h',
'nsAString.h',
'nsCharTraits.h',
'nsDependentString.h',
Expand Down Expand Up @@ -39,7 +38,6 @@ EXPORTS += [
]

UNIFIED_SOURCES += [
'nsASCIIMask.cpp',
'nsDependentString.cpp',
'nsDependentSubstring.cpp',
'nsPromiseFlatString.cpp',
Expand Down
55 changes: 0 additions & 55 deletions xpcom/string/nsASCIIMask.cpp

This file was deleted.

70 changes: 0 additions & 70 deletions xpcom/string/nsASCIIMask.h

This file was deleted.

2 changes: 2 additions & 0 deletions xpcom/string/nsStringObsolete.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -540,6 +540,8 @@ StripChars2(char16_t* aString,uint32_t aLength,const char* aSet) {

/* ***** END RICKG BLOCK ***** */

static const char* kWhitespace="\f\t\r\n ";

// This function is used to implement FindCharInSet and friends
template <class CharT>
#ifndef __SUNPRO_CC
Expand Down
Loading

0 comments on commit 9ff5a8b

Please sign in to comment.