forked from mirrors/gecko-dev
Bug 869836 - Part 4: Use EqualsLiteral instead of Equals(NS_LITERAL_STRING(...)). r=ehsan
This commit is contained in:
parent
0e6f3a6562
commit
189593520f
28 changed files with 60 additions and 60 deletions
|
|
@ -745,7 +745,7 @@ HTMLCanvasElement::MozGetIPCContext(const nsAString& aContextId,
|
||||||
}
|
}
|
||||||
|
|
||||||
// We only support 2d shmem contexts for now.
|
// We only support 2d shmem contexts for now.
|
||||||
if (!aContextId.Equals(NS_LITERAL_STRING("2d")))
|
if (!aContextId.EqualsLiteral("2d"))
|
||||||
return NS_ERROR_INVALID_ARG;
|
return NS_ERROR_INVALID_ARG;
|
||||||
|
|
||||||
if (mCurrentContextId.IsEmpty()) {
|
if (mCurrentContextId.IsEmpty()) {
|
||||||
|
|
|
||||||
|
|
@ -592,7 +592,7 @@ public:
|
||||||
void SetType(const nsAString& aValue, ErrorResult& aRv)
|
void SetType(const nsAString& aValue, ErrorResult& aRv)
|
||||||
{
|
{
|
||||||
SetHTMLAttr(nsGkAtoms::type, aValue, aRv);
|
SetHTMLAttr(nsGkAtoms::type, aValue, aRv);
|
||||||
if (aValue.Equals(NS_LITERAL_STRING("number"))) {
|
if (aValue.EqualsLiteral("number")) {
|
||||||
// For NS_FORM_INPUT_NUMBER we rely on having frames to process key
|
// For NS_FORM_INPUT_NUMBER we rely on having frames to process key
|
||||||
// events. Make sure we have them in case someone changes the type of
|
// events. Make sure we have them in case someone changes the type of
|
||||||
// this element to "number" and then expects to be able to send key
|
// this element to "number" and then expects to be able to send key
|
||||||
|
|
|
||||||
|
|
@ -955,7 +955,7 @@ SpeechRecognition::GetUserMediaErrorCallback::OnError(const nsAString& aError)
|
||||||
{
|
{
|
||||||
SpeechRecognitionErrorCode errorCode;
|
SpeechRecognitionErrorCode errorCode;
|
||||||
|
|
||||||
if (aError.Equals(NS_LITERAL_STRING("PERMISSION_DENIED"))) {
|
if (aError.EqualsLiteral("PERMISSION_DENIED")) {
|
||||||
errorCode = SpeechRecognitionErrorCode::Not_allowed;
|
errorCode = SpeechRecognitionErrorCode::Not_allowed;
|
||||||
} else {
|
} else {
|
||||||
errorCode = SpeechRecognitionErrorCode::Audio_capture;
|
errorCode = SpeechRecognitionErrorCode::Audio_capture;
|
||||||
|
|
|
||||||
|
|
@ -1201,7 +1201,7 @@ BluetoothHfpManager::HandleCallStateChanged(uint32_t aCallIndex,
|
||||||
GetNumberOfCalls(nsITelephonyProvider::CALL_STATE_DISCONNECTED)) {
|
GetNumberOfCalls(nsITelephonyProvider::CALL_STATE_DISCONNECTED)) {
|
||||||
// In order to let user hear busy tone via connected Bluetooth headset,
|
// In order to let user hear busy tone via connected Bluetooth headset,
|
||||||
// we postpone the timing of dropping SCO.
|
// we postpone the timing of dropping SCO.
|
||||||
if (aError.Equals(NS_LITERAL_STRING("BusyError"))) {
|
if (aError.EqualsLiteral("BusyError")) {
|
||||||
// FIXME: UpdatePhoneCIND later since it causes SCO close but
|
// FIXME: UpdatePhoneCIND later since it causes SCO close but
|
||||||
// Dialer is still playing busy tone via HF.
|
// Dialer is still playing busy tone via HF.
|
||||||
BT_HF_DISPATCH_MAIN(MainThreadTaskCmd::POST_TASK_CLOSE_SCO);
|
BT_HF_DISPATCH_MAIN(MainThreadTaskCmd::POST_TASK_CLOSE_SCO);
|
||||||
|
|
|
||||||
|
|
@ -1639,7 +1639,7 @@ BluetoothHfpManager::HandleCallStateChanged(uint32_t aCallIndex,
|
||||||
GetNumberOfCalls(nsITelephonyProvider::CALL_STATE_DISCONNECTED)) {
|
GetNumberOfCalls(nsITelephonyProvider::CALL_STATE_DISCONNECTED)) {
|
||||||
// In order to let user hear busy tone via connected Bluetooth headset,
|
// In order to let user hear busy tone via connected Bluetooth headset,
|
||||||
// we postpone the timing of dropping SCO.
|
// we postpone the timing of dropping SCO.
|
||||||
if (!(aError.Equals(NS_LITERAL_STRING("BusyError")))) {
|
if (!(aError.EqualsLiteral("BusyError"))) {
|
||||||
DisconnectSco();
|
DisconnectSco();
|
||||||
} else {
|
} else {
|
||||||
// Close Sco later since Dialer is still playing busy tone via HF.
|
// Close Sco later since Dialer is still playing busy tone via HF.
|
||||||
|
|
|
||||||
|
|
@ -356,7 +356,7 @@ DOMStorageManager::GetStorageInternal(bool aCreate,
|
||||||
return NS_OK;
|
return NS_OK;
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
if (scope.Equals(NS_LITERAL_CSTRING("knalb.:about"))) {
|
if (scope.EqualsLiteral("knalb.:about")) {
|
||||||
return NS_OK;
|
return NS_OK;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1251,7 +1251,7 @@ mozInlineSpellChecker::SkipSpellCheckForNode(nsIEditor* aEditor,
|
||||||
{
|
{
|
||||||
nsAutoString classname;
|
nsAutoString classname;
|
||||||
parentElement->GetAttribute(NS_LITERAL_STRING("class"),classname);
|
parentElement->GetAttribute(NS_LITERAL_STRING("class"),classname);
|
||||||
if (classname.Equals(NS_LITERAL_STRING("moz-signature")))
|
if (classname.EqualsLiteral("moz-signature"))
|
||||||
*checkSpelling = false;
|
*checkSpelling = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -138,7 +138,7 @@ nsTextBoxFrame::AlwaysAppendAccessKey()
|
||||||
|
|
||||||
const char* prefName = "intl.menuitems.alwaysappendaccesskeys";
|
const char* prefName = "intl.menuitems.alwaysappendaccesskeys";
|
||||||
nsAdoptingString val = Preferences::GetLocalizedString(prefName);
|
nsAdoptingString val = Preferences::GetLocalizedString(prefName);
|
||||||
gAlwaysAppendAccessKey = val.Equals(NS_LITERAL_STRING("true"));
|
gAlwaysAppendAccessKey = val.EqualsLiteral("true");
|
||||||
}
|
}
|
||||||
return gAlwaysAppendAccessKey;
|
return gAlwaysAppendAccessKey;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1161,7 +1161,7 @@ static nsresult pref_LoadPrefsInDirList(const char *listId)
|
||||||
path->GetNativeLeafName(leaf);
|
path->GetNativeLeafName(leaf);
|
||||||
|
|
||||||
// Do we care if a file provided by this process fails to load?
|
// Do we care if a file provided by this process fails to load?
|
||||||
if (Substring(leaf, leaf.Length() - 4).Equals(NS_LITERAL_CSTRING(".xpi")))
|
if (Substring(leaf, leaf.Length() - 4).EqualsLiteral(".xpi"))
|
||||||
ReadExtensionPrefs(path);
|
ReadExtensionPrefs(path);
|
||||||
else
|
else
|
||||||
pref_LoadPrefsInDir(path, nullptr, 0);
|
pref_LoadPrefsInDir(path, nullptr, 0);
|
||||||
|
|
|
||||||
|
|
@ -522,8 +522,8 @@ GetCacheSessionNameForStoragePolicy(
|
||||||
MOZ_ASSERT(!isPrivate || storagePolicy == nsICache::STORE_IN_MEMORY);
|
MOZ_ASSERT(!isPrivate || storagePolicy == nsICache::STORE_IN_MEMORY);
|
||||||
|
|
||||||
// HTTP
|
// HTTP
|
||||||
if (scheme.Equals(NS_LITERAL_CSTRING("http")) ||
|
if (scheme.EqualsLiteral("http") ||
|
||||||
scheme.Equals(NS_LITERAL_CSTRING("https"))) {
|
scheme.EqualsLiteral("https")) {
|
||||||
switch (storagePolicy) {
|
switch (storagePolicy) {
|
||||||
case nsICache::STORE_IN_MEMORY:
|
case nsICache::STORE_IN_MEMORY:
|
||||||
if (isPrivate)
|
if (isPrivate)
|
||||||
|
|
@ -542,14 +542,14 @@ GetCacheSessionNameForStoragePolicy(
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
// WYCIWYG
|
// WYCIWYG
|
||||||
else if (scheme.Equals(NS_LITERAL_CSTRING("wyciwyg"))) {
|
else if (scheme.EqualsLiteral("wyciwyg")) {
|
||||||
if (isPrivate)
|
if (isPrivate)
|
||||||
sessionName.Assign(NS_LITERAL_CSTRING("wyciwyg-private"));
|
sessionName.Assign(NS_LITERAL_CSTRING("wyciwyg-private"));
|
||||||
else
|
else
|
||||||
sessionName.Assign(NS_LITERAL_CSTRING("wyciwyg"));
|
sessionName.Assign(NS_LITERAL_CSTRING("wyciwyg"));
|
||||||
}
|
}
|
||||||
// FTP
|
// FTP
|
||||||
else if (scheme.Equals(NS_LITERAL_CSTRING("ftp"))) {
|
else if (scheme.EqualsLiteral("ftp")) {
|
||||||
if (isPrivate)
|
if (isPrivate)
|
||||||
sessionName.Assign(NS_LITERAL_CSTRING("FTP-private"));
|
sessionName.Assign(NS_LITERAL_CSTRING("FTP-private"));
|
||||||
else
|
else
|
||||||
|
|
@ -1096,8 +1096,8 @@ nsresult _OldStorage::AssembleCacheKey(nsIURI *aURI,
|
||||||
NS_ENSURE_SUCCESS(rv, rv);
|
NS_ENSURE_SUCCESS(rv, rv);
|
||||||
|
|
||||||
nsAutoCString uriSpec;
|
nsAutoCString uriSpec;
|
||||||
if (aScheme.Equals(NS_LITERAL_CSTRING("http")) ||
|
if (aScheme.EqualsLiteral("http") ||
|
||||||
aScheme.Equals(NS_LITERAL_CSTRING("https"))) {
|
aScheme.EqualsLiteral("https")) {
|
||||||
if (mLoadInfo->IsAnonymous()) {
|
if (mLoadInfo->IsAnonymous()) {
|
||||||
aCacheKey.AssignLiteral("anon&");
|
aCacheKey.AssignLiteral("anon&");
|
||||||
}
|
}
|
||||||
|
|
@ -1117,7 +1117,7 @@ nsresult _OldStorage::AssembleCacheKey(nsIURI *aURI,
|
||||||
aCacheKey.AppendLiteral("uri=");
|
aCacheKey.AppendLiteral("uri=");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if (aScheme.Equals(NS_LITERAL_CSTRING("wyciwyg"))) {
|
else if (aScheme.EqualsLiteral("wyciwyg")) {
|
||||||
rv = aURI->GetSpec(uriSpec);
|
rv = aURI->GetSpec(uriSpec);
|
||||||
NS_ENSURE_SUCCESS(rv, rv);
|
NS_ENSURE_SUCCESS(rv, rv);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -123,9 +123,9 @@ void nsIDNService::prefsChanged(nsIPrefBranch *prefBranch, const char16_t *pref)
|
||||||
getter_Copies(profile)))) {
|
getter_Copies(profile)))) {
|
||||||
profile.Truncate();
|
profile.Truncate();
|
||||||
}
|
}
|
||||||
if (profile.Equals(NS_LITERAL_CSTRING("moderate"))) {
|
if (profile.EqualsLiteral("moderate")) {
|
||||||
mRestrictionProfile = eModeratelyRestrictiveProfile;
|
mRestrictionProfile = eModeratelyRestrictiveProfile;
|
||||||
} else if (profile.Equals(NS_LITERAL_CSTRING("high"))) {
|
} else if (profile.EqualsLiteral("high")) {
|
||||||
mRestrictionProfile = eHighlyRestrictiveProfile;
|
mRestrictionProfile = eHighlyRestrictiveProfile;
|
||||||
} else {
|
} else {
|
||||||
mRestrictionProfile = eASCIIOnlyProfile;
|
mRestrictionProfile = eASCIIOnlyProfile;
|
||||||
|
|
|
||||||
|
|
@ -383,13 +383,13 @@ nsresult
|
||||||
Http2Decompressor::OutputHeader(const nsACString &name, const nsACString &value)
|
Http2Decompressor::OutputHeader(const nsACString &name, const nsACString &value)
|
||||||
{
|
{
|
||||||
// exclusions
|
// exclusions
|
||||||
if (name.Equals(NS_LITERAL_CSTRING("connection")) ||
|
if (name.EqualsLiteral("connection") ||
|
||||||
name.Equals(NS_LITERAL_CSTRING("host")) ||
|
name.EqualsLiteral("host") ||
|
||||||
name.Equals(NS_LITERAL_CSTRING("keep-alive")) ||
|
name.EqualsLiteral("keep-alive") ||
|
||||||
name.Equals(NS_LITERAL_CSTRING("proxy-connection")) ||
|
name.EqualsLiteral("proxy-connection") ||
|
||||||
name.Equals(NS_LITERAL_CSTRING("te")) ||
|
name.EqualsLiteral("te") ||
|
||||||
name.Equals(NS_LITERAL_CSTRING("transfer-encoding")) ||
|
name.EqualsLiteral("transfer-encoding") ||
|
||||||
name.Equals(NS_LITERAL_CSTRING("upgrade")) ||
|
name.EqualsLiteral("upgrade") ||
|
||||||
name.Equals(("accept-encoding"))) {
|
name.Equals(("accept-encoding"))) {
|
||||||
nsCString toLog(name);
|
nsCString toLog(name);
|
||||||
LOG3(("HTTP Decompressor illegal response header found : %s",
|
LOG3(("HTTP Decompressor illegal response header found : %s",
|
||||||
|
|
@ -421,19 +421,19 @@ Http2Decompressor::OutputHeader(const nsACString &name, const nsACString &value)
|
||||||
}
|
}
|
||||||
|
|
||||||
// Status comes first
|
// Status comes first
|
||||||
if (name.Equals(NS_LITERAL_CSTRING(":status"))) {
|
if (name.EqualsLiteral(":status")) {
|
||||||
nsAutoCString status(NS_LITERAL_CSTRING("HTTP/2.0 "));
|
nsAutoCString status(NS_LITERAL_CSTRING("HTTP/2.0 "));
|
||||||
status.Append(value);
|
status.Append(value);
|
||||||
status.AppendLiteral("\r\n");
|
status.AppendLiteral("\r\n");
|
||||||
mOutput->Insert(status, 0);
|
mOutput->Insert(status, 0);
|
||||||
mHeaderStatus = value;
|
mHeaderStatus = value;
|
||||||
} else if (name.Equals(NS_LITERAL_CSTRING(":authority"))) {
|
} else if (name.EqualsLiteral(":authority")) {
|
||||||
mHeaderHost = value;
|
mHeaderHost = value;
|
||||||
} else if (name.Equals(NS_LITERAL_CSTRING(":scheme"))) {
|
} else if (name.EqualsLiteral(":scheme")) {
|
||||||
mHeaderScheme = value;
|
mHeaderScheme = value;
|
||||||
} else if (name.Equals(NS_LITERAL_CSTRING(":path"))) {
|
} else if (name.EqualsLiteral(":path")) {
|
||||||
mHeaderPath = value;
|
mHeaderPath = value;
|
||||||
} else if (name.Equals(NS_LITERAL_CSTRING(":method"))) {
|
} else if (name.EqualsLiteral(":method")) {
|
||||||
mHeaderMethod = value;
|
mHeaderMethod = value;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -447,7 +447,7 @@ Http2Decompressor::OutputHeader(const nsACString &name, const nsACString &value)
|
||||||
mOutput->Append(name);
|
mOutput->Append(name);
|
||||||
mOutput->AppendLiteral(": ");
|
mOutput->AppendLiteral(": ");
|
||||||
// Special handling for set-cookie according to the spec
|
// Special handling for set-cookie according to the spec
|
||||||
bool isSetCookie = name.Equals(NS_LITERAL_CSTRING("set-cookie"));
|
bool isSetCookie = name.EqualsLiteral("set-cookie");
|
||||||
int32_t valueLen = value.Length();
|
int32_t valueLen = value.Length();
|
||||||
for (int32_t i = 0; i < valueLen; ++i) {
|
for (int32_t i = 0; i < valueLen; ++i) {
|
||||||
if (value[i] == '\0') {
|
if (value[i] == '\0') {
|
||||||
|
|
|
||||||
|
|
@ -916,7 +916,7 @@ Http2Stream::ConvertPushHeaders(Http2Decompressor *decompressor,
|
||||||
}
|
}
|
||||||
|
|
||||||
decompressor->GetMethod(method);
|
decompressor->GetMethod(method);
|
||||||
if (!method.Equals(NS_LITERAL_CSTRING("GET"))) {
|
if (!method.EqualsLiteral("GET")) {
|
||||||
LOG3(("Http2Stream::ConvertPushHeaders %p Error - method not supported: %s\n",
|
LOG3(("Http2Stream::ConvertPushHeaders %p Error - method not supported: %s\n",
|
||||||
this, method.get()));
|
this, method.get()));
|
||||||
return NS_ERROR_NOT_IMPLEMENTED;
|
return NS_ERROR_NOT_IMPLEMENTED;
|
||||||
|
|
|
||||||
|
|
@ -1219,7 +1219,7 @@ SpdyStream3::ConvertHeaders(nsACString &aHeadersOut)
|
||||||
// to look for chunked specifically because it is the only HTTP
|
// to look for chunked specifically because it is the only HTTP
|
||||||
// allowed default encoding and we did not negotiate further encodings
|
// allowed default encoding and we did not negotiate further encodings
|
||||||
// via TE
|
// via TE
|
||||||
if (nameString.Equals(NS_LITERAL_CSTRING("transfer-encoding"))) {
|
if (nameString.EqualsLiteral("transfer-encoding")) {
|
||||||
LOG3(("SpdyStream3::ConvertHeaders session=%p stream=%p "
|
LOG3(("SpdyStream3::ConvertHeaders session=%p stream=%p "
|
||||||
"transfer-encoding found. Chunked is invalid and no TE sent.",
|
"transfer-encoding found. Chunked is invalid and no TE sent.",
|
||||||
mSession, this));
|
mSession, this));
|
||||||
|
|
@ -1236,8 +1236,8 @@ SpdyStream3::ConvertHeaders(nsACString &aHeadersOut)
|
||||||
|
|
||||||
// spdy transport level headers shouldn't be gatewayed into http/1
|
// spdy transport level headers shouldn't be gatewayed into http/1
|
||||||
if (!nameString.IsEmpty() && nameString[0] != ':' &&
|
if (!nameString.IsEmpty() && nameString[0] != ':' &&
|
||||||
!nameString.Equals(NS_LITERAL_CSTRING("connection")) &&
|
!nameString.EqualsLiteral("connection") &&
|
||||||
!nameString.Equals(NS_LITERAL_CSTRING("keep-alive"))) {
|
!nameString.EqualsLiteral("keep-alive")) {
|
||||||
nsDependentCSubstring valueString =
|
nsDependentCSubstring valueString =
|
||||||
Substring(reinterpret_cast<const char *>(nvpair) + 8 + nameLen,
|
Substring(reinterpret_cast<const char *>(nvpair) + 8 + nameLen,
|
||||||
reinterpret_cast<const char *>(nvpair) + 8 + nameLen +
|
reinterpret_cast<const char *>(nvpair) + 8 + nameLen +
|
||||||
|
|
|
||||||
|
|
@ -1235,7 +1235,7 @@ SpdyStream31::ConvertHeaders(nsACString &aHeadersOut)
|
||||||
// to look for chunked specifically because it is the only HTTP
|
// to look for chunked specifically because it is the only HTTP
|
||||||
// allowed default encoding and we did not negotiate further encodings
|
// allowed default encoding and we did not negotiate further encodings
|
||||||
// via TE
|
// via TE
|
||||||
if (nameString.Equals(NS_LITERAL_CSTRING("transfer-encoding"))) {
|
if (nameString.EqualsLiteral("transfer-encoding")) {
|
||||||
LOG3(("SpdyStream31::ConvertHeaders session=%p stream=%p "
|
LOG3(("SpdyStream31::ConvertHeaders session=%p stream=%p "
|
||||||
"transfer-encoding found. Chunked is invalid and no TE sent.",
|
"transfer-encoding found. Chunked is invalid and no TE sent.",
|
||||||
mSession, this));
|
mSession, this));
|
||||||
|
|
@ -1252,8 +1252,8 @@ SpdyStream31::ConvertHeaders(nsACString &aHeadersOut)
|
||||||
|
|
||||||
// spdy transport level headers shouldn't be gatewayed into http/1
|
// spdy transport level headers shouldn't be gatewayed into http/1
|
||||||
if (!nameString.IsEmpty() && nameString[0] != ':' &&
|
if (!nameString.IsEmpty() && nameString[0] != ':' &&
|
||||||
!nameString.Equals(NS_LITERAL_CSTRING("connection")) &&
|
!nameString.EqualsLiteral("connection") &&
|
||||||
!nameString.Equals(NS_LITERAL_CSTRING("keep-alive"))) {
|
!nameString.EqualsLiteral("keep-alive")) {
|
||||||
nsDependentCSubstring valueString =
|
nsDependentCSubstring valueString =
|
||||||
Substring(reinterpret_cast<const char *>(nvpair) + 8 + nameLen,
|
Substring(reinterpret_cast<const char *>(nvpair) + 8 + nameLen,
|
||||||
reinterpret_cast<const char *>(nvpair) + 8 + nameLen +
|
reinterpret_cast<const char *>(nvpair) + 8 + nameLen +
|
||||||
|
|
|
||||||
|
|
@ -61,7 +61,7 @@ nsResURL::EnsureFile()
|
||||||
// In most cases, the scheme is jar if it's not file.
|
// In most cases, the scheme is jar if it's not file.
|
||||||
// Regardless, net_GetFileFromURLSpec should be avoided
|
// Regardless, net_GetFileFromURLSpec should be avoided
|
||||||
// when the scheme isn't file.
|
// when the scheme isn't file.
|
||||||
if (!scheme.Equals(NS_LITERAL_CSTRING("file")))
|
if (!scheme.EqualsLiteral("file"))
|
||||||
return NS_ERROR_NO_INTERFACE;
|
return NS_ERROR_NO_INTERFACE;
|
||||||
|
|
||||||
rv = net_GetFileFromURLSpec(spec, getter_AddRefs(mFile));
|
rv = net_GetFileFromURLSpec(spec, getter_AddRefs(mFile));
|
||||||
|
|
@ -316,7 +316,7 @@ nsResProtocolHandler::SetSubstitution(const nsACString& root, nsIURI *baseURI)
|
||||||
nsAutoCString scheme;
|
nsAutoCString scheme;
|
||||||
nsresult rv = baseURI->GetScheme(scheme);
|
nsresult rv = baseURI->GetScheme(scheme);
|
||||||
NS_ENSURE_SUCCESS(rv, rv);
|
NS_ENSURE_SUCCESS(rv, rv);
|
||||||
if (!scheme.Equals(NS_LITERAL_CSTRING("resource"))) {
|
if (!scheme.EqualsLiteral("resource")) {
|
||||||
mSubstitutions.Put(root, baseURI);
|
mSubstitutions.Put(root, baseURI);
|
||||||
return NS_OK;
|
return NS_OK;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -2116,7 +2116,7 @@ WebSocketChannel::HandleExtensions()
|
||||||
NS_LITERAL_CSTRING("Sec-WebSocket-Extensions"), extensions);
|
NS_LITERAL_CSTRING("Sec-WebSocket-Extensions"), extensions);
|
||||||
if (NS_SUCCEEDED(rv)) {
|
if (NS_SUCCEEDED(rv)) {
|
||||||
if (!extensions.IsEmpty()) {
|
if (!extensions.IsEmpty()) {
|
||||||
if (!extensions.Equals(NS_LITERAL_CSTRING("deflate-stream"))) {
|
if (!extensions.EqualsLiteral("deflate-stream")) {
|
||||||
LOG(("WebSocketChannel::OnStartRequest: "
|
LOG(("WebSocketChannel::OnStartRequest: "
|
||||||
"HTTP Sec-WebSocket-Exensions negotiated unknown value %s\n",
|
"HTTP Sec-WebSocket-Exensions negotiated unknown value %s\n",
|
||||||
extensions.get()));
|
extensions.get()));
|
||||||
|
|
@ -2354,7 +2354,7 @@ WebSocketChannel::ReportConnectionTelemetry()
|
||||||
nsAutoCString proxyType;
|
nsAutoCString proxyType;
|
||||||
pi->GetType(proxyType);
|
pi->GetType(proxyType);
|
||||||
if (!proxyType.IsEmpty() &&
|
if (!proxyType.IsEmpty() &&
|
||||||
!proxyType.Equals(NS_LITERAL_CSTRING("direct")))
|
!proxyType.EqualsLiteral("direct"))
|
||||||
didProxy = true;
|
didProxy = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -461,7 +461,7 @@ nsSiteSecurityService::IsSecureURI(uint32_t aType, nsIURI* aURI,
|
||||||
}
|
}
|
||||||
|
|
||||||
// Holepunch chart.apis.google.com and subdomains.
|
// Holepunch chart.apis.google.com and subdomains.
|
||||||
if (host.Equals(NS_LITERAL_CSTRING("chart.apis.google.com")) ||
|
if (host.EqualsLiteral("chart.apis.google.com") ||
|
||||||
StringEndsWith(host, NS_LITERAL_CSTRING(".chart.apis.google.com"))) {
|
StringEndsWith(host, NS_LITERAL_CSTRING(".chart.apis.google.com"))) {
|
||||||
return NS_OK;
|
return NS_OK;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -997,7 +997,7 @@ nsTypeAheadFind::Find(const nsAString& aSearchString, bool aLinksOnly,
|
||||||
// by waiting for the first keystroke, we still get the startup time benefits.
|
// by waiting for the first keystroke, we still get the startup time benefits.
|
||||||
mIsSoundInitialized = true;
|
mIsSoundInitialized = true;
|
||||||
mSoundInterface = do_CreateInstance("@mozilla.org/sound;1");
|
mSoundInterface = do_CreateInstance("@mozilla.org/sound;1");
|
||||||
if (mSoundInterface && !mNotFoundSoundURL.Equals(NS_LITERAL_CSTRING("beep"))) {
|
if (mSoundInterface && !mNotFoundSoundURL.EqualsLiteral("beep")) {
|
||||||
mSoundInterface->Init();
|
mSoundInterface->Init();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -491,7 +491,7 @@ LoadDirsIntoArray(nsCOMArray<nsIFile>& aSourceDirs,
|
||||||
|
|
||||||
nsAutoCString leaf;
|
nsAutoCString leaf;
|
||||||
appended->GetNativeLeafName(leaf);
|
appended->GetNativeLeafName(leaf);
|
||||||
if (!Substring(leaf, leaf.Length() - 4).Equals(NS_LITERAL_CSTRING(".xpi"))) {
|
if (!Substring(leaf, leaf.Length() - 4).EqualsLiteral(".xpi")) {
|
||||||
LoadDirIntoArray(appended,
|
LoadDirIntoArray(appended,
|
||||||
aAppendList,
|
aAppendList,
|
||||||
aDirectories);
|
aDirectories);
|
||||||
|
|
@ -564,7 +564,7 @@ LoadExtensionDirectories(nsINIParser &parser,
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
aDirectories.AppendObject(dir);
|
aDirectories.AppendObject(dir);
|
||||||
if (Substring(path, path.Length() - 4).Equals(NS_LITERAL_CSTRING(".xpi"))) {
|
if (Substring(path, path.Length() - 4).EqualsLiteral(".xpi")) {
|
||||||
XRE_AddJarManifestLocation(aType, dir);
|
XRE_AddJarManifestLocation(aType, dir);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
|
|
|
||||||
|
|
@ -398,7 +398,7 @@ GfxInfo::GetFeatureStatusImpl(int32_t aFeature,
|
||||||
return NS_OK;
|
return NS_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (mHardware.Equals(NS_LITERAL_STRING("ville"))) {
|
if (mHardware.EqualsLiteral("ville")) {
|
||||||
*aStatus = nsIGfxInfo::FEATURE_BLOCKED_DEVICE;
|
*aStatus = nsIGfxInfo::FEATURE_BLOCKED_DEVICE;
|
||||||
return NS_OK;
|
return NS_OK;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -36,7 +36,7 @@ public:
|
||||||
private:
|
private:
|
||||||
NS_IMETHOD Callback(const nsAString& aTopic, const nsAString& aState) {
|
NS_IMETHOD Callback(const nsAString& aTopic, const nsAString& aState) {
|
||||||
bool isLocked = mLockedTopics.Contains(aTopic);
|
bool isLocked = mLockedTopics.Contains(aTopic);
|
||||||
bool shouldLock = aState.Equals(NS_LITERAL_STRING("locked-foreground"));
|
bool shouldLock = aState.EqualsLiteral("locked-foreground");
|
||||||
if (isLocked == shouldLock) {
|
if (isLocked == shouldLock) {
|
||||||
return NS_OK;
|
return NS_OK;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -78,7 +78,7 @@ nsresult CheckValidTEXT(STGMEDIUM* pSTG)
|
||||||
nsCString string;
|
nsCString string;
|
||||||
string = pText;
|
string = pText;
|
||||||
|
|
||||||
if (!string.Equals(NS_LITERAL_CSTRING("Mozilla can drag and drop"))) {
|
if (!string.EqualsLiteral("Mozilla can drag and drop")) {
|
||||||
fail("Text passed through drop object wrong");
|
fail("Text passed through drop object wrong");
|
||||||
return NS_ERROR_UNEXPECTED;
|
return NS_ERROR_UNEXPECTED;
|
||||||
}
|
}
|
||||||
|
|
@ -103,7 +103,7 @@ nsresult CheckValidTEXTTwo(STGMEDIUM* pSTG)
|
||||||
nsCString string;
|
nsCString string;
|
||||||
string = pText;
|
string = pText;
|
||||||
|
|
||||||
if (!string.Equals(NS_LITERAL_CSTRING("Mozilla can drag and drop twice over"))) {
|
if (!string.EqualsLiteral("Mozilla can drag and drop twice over")) {
|
||||||
fail("Text passed through drop object wrong");
|
fail("Text passed through drop object wrong");
|
||||||
return NS_ERROR_UNEXPECTED;
|
return NS_ERROR_UNEXPECTED;
|
||||||
}
|
}
|
||||||
|
|
@ -128,7 +128,7 @@ nsresult CheckValidUNICODE(STGMEDIUM* pSTG)
|
||||||
nsString string;
|
nsString string;
|
||||||
string = pText;
|
string = pText;
|
||||||
|
|
||||||
if (!string.Equals(NS_LITERAL_STRING("Mozilla can drag and drop"))) {
|
if (!string.EqualsLiteral("Mozilla can drag and drop")) {
|
||||||
fail("Text passed through drop object wrong");
|
fail("Text passed through drop object wrong");
|
||||||
return NS_ERROR_UNEXPECTED;
|
return NS_ERROR_UNEXPECTED;
|
||||||
}
|
}
|
||||||
|
|
@ -153,7 +153,7 @@ nsresult CheckValidUNICODETwo(STGMEDIUM* pSTG)
|
||||||
nsString string;
|
nsString string;
|
||||||
string = pText;
|
string = pText;
|
||||||
|
|
||||||
if (!string.Equals(NS_LITERAL_STRING("Mozilla can drag and drop twice over"))) {
|
if (!string.EqualsLiteral("Mozilla can drag and drop twice over")) {
|
||||||
fail("Text passed through drop object wrong");
|
fail("Text passed through drop object wrong");
|
||||||
return NS_ERROR_UNEXPECTED;
|
return NS_ERROR_UNEXPECTED;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -19,7 +19,7 @@ WakeLockListener::Callback(const nsAString& aTopic, const nsAString& aState)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (aState.Equals(NS_LITERAL_STRING("locked-foreground"))) {
|
if (aState.EqualsLiteral("locked-foreground")) {
|
||||||
mDisplayRequest->RequestActive();
|
mDisplayRequest->RequestActive();
|
||||||
} else {
|
} else {
|
||||||
mDisplayRequest->RequestRelease();
|
mDisplayRequest->RequestRelease();
|
||||||
|
|
|
||||||
|
|
@ -1872,7 +1872,7 @@ nsComponentManagerImpl::AddBootstrappedManifestLocation(nsIFile* aLocation)
|
||||||
if (NS_FAILED(rv))
|
if (NS_FAILED(rv))
|
||||||
return rv;
|
return rv;
|
||||||
|
|
||||||
if (Substring(path, path.Length() - 4).Equals(NS_LITERAL_STRING(".xpi"))) {
|
if (Substring(path, path.Length() - 4).EqualsLiteral(".xpi")) {
|
||||||
return XRE_AddJarManifestLocation(NS_BOOTSTRAPPED_LOCATION, aLocation);
|
return XRE_AddJarManifestLocation(NS_BOOTSTRAPPED_LOCATION, aLocation);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -1897,7 +1897,7 @@ nsComponentManagerImpl::RemoveBootstrappedManifestLocation(nsIFile* aLocation)
|
||||||
nsComponentManagerImpl::ComponentLocation elem;
|
nsComponentManagerImpl::ComponentLocation elem;
|
||||||
elem.type = NS_BOOTSTRAPPED_LOCATION;
|
elem.type = NS_BOOTSTRAPPED_LOCATION;
|
||||||
|
|
||||||
if (Substring(path, path.Length() - 4).Equals(NS_LITERAL_STRING(".xpi"))) {
|
if (Substring(path, path.Length() - 4).EqualsLiteral(".xpi")) {
|
||||||
elem.location.Init(aLocation, "chrome.manifest");
|
elem.location.Init(aLocation, "chrome.manifest");
|
||||||
} else {
|
} else {
|
||||||
nsCOMPtr<nsIFile> lf = CloneAndAppend(aLocation, NS_LITERAL_CSTRING("chrome.manifest"));
|
nsCOMPtr<nsIFile> lf = CloneAndAppend(aLocation, NS_LITERAL_CSTRING("chrome.manifest"));
|
||||||
|
|
|
||||||
|
|
@ -55,11 +55,11 @@ int testWrite() {
|
||||||
CHECK(begin == s.BeginWriting()) +
|
CHECK(begin == s.BeginWriting()) +
|
||||||
CHECK(end == s.EndWriting());
|
CHECK(end == s.EndWriting());
|
||||||
begin[4] = char16_t('y');
|
begin[4] = char16_t('y');
|
||||||
res += CHECK(s.Equals(NS_LITERAL_STRING("xyzzy")));
|
res += CHECK(s.EqualsLiteral("xyzzy"));
|
||||||
s.SetLength(4);
|
s.SetLength(4);
|
||||||
res += CHECK(4 == s.Length()) +
|
res += CHECK(4 == s.Length()) +
|
||||||
CHECK(s.Equals(NS_LITERAL_STRING("xyzz"))) +
|
CHECK(s.EqualsLiteral("xyzz")) +
|
||||||
CHECK(!s.Equals(NS_LITERAL_STRING("xyzzy"))) +
|
CHECK(!s.EqualsLiteral("xyzzy")) +
|
||||||
CHECK(!s.IsEmpty());
|
CHECK(!s.IsEmpty());
|
||||||
s.Truncate();
|
s.Truncate();
|
||||||
res += CHECK(0 == s.Length()) +
|
res += CHECK(0 == s.Length()) +
|
||||||
|
|
|
||||||
|
|
@ -104,7 +104,7 @@ test_malformed8()
|
||||||
|
|
||||||
nsString tmp16(NS_LITERAL_STRING("string"));
|
nsString tmp16(NS_LITERAL_STRING("string"));
|
||||||
AppendUTF8toUTF16(str8, tmp16);
|
AppendUTF8toUTF16(str8, tmp16);
|
||||||
if (!tmp16.Equals(NS_LITERAL_STRING("string")))
|
if (!tmp16.EqualsLiteral("string"))
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
if (CompareUTF8toUTF16(str8, EmptyString()) == 0)
|
if (CompareUTF8toUTF16(str8, EmptyString()) == 0)
|
||||||
|
|
|
||||||
2
xpcom/tests/external/TestMinStringAPI.cpp
vendored
2
xpcom/tests/external/TestMinStringAPI.cpp
vendored
|
|
@ -557,7 +557,7 @@ static bool test_compressws()
|
||||||
{
|
{
|
||||||
nsString check(NS_LITERAL_STRING(" \tTesting \n\t1\n 2 3\n "));
|
nsString check(NS_LITERAL_STRING(" \tTesting \n\t1\n 2 3\n "));
|
||||||
CompressWhitespace(check);
|
CompressWhitespace(check);
|
||||||
return check.Equals(NS_LITERAL_STRING("Testing 1 2 3"));
|
return check.EqualsLiteral("Testing 1 2 3");
|
||||||
}
|
}
|
||||||
|
|
||||||
static bool test_comparisons()
|
static bool test_comparisons()
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue