import changes from `dev' branch of rmottola/Arctic-Fox:

- rough apply of Bug 1154275 - Remove ise() in favor of is(); r=Ms2ger (34cf63726)
- Bug 1174954 part 1. Stop throwing DOMErrors from JS-implemented webidBug 1174954 part 1. Stop throwing DOMErrors from JS-implemented webid (ff7b25af0)
- Bug 1173593. Make it possible to throw TypeError (or, in fact, any other Error from the content compartment) from js-implemented webidl. r=bholley (328c181a6)
- Bug 1174954 part 2. Remove the special-casing of DOMError in JS-implemented webidl code. r=bholley (d8784c655)
- Bug 1174954 part 3. Remove ReportJSExceptionFromJSImplementation, since it no longer does anything interesting. r=bholley (e5e6360df)
- Bug 1170716 - Part 1: Add js shell functions to get last warning. r=jandem (391a75cfa)
- Bug 1170716 - Part 2: Report unreachable code after return statement as JSEXN_NONE. r=jandem (5396c950a)
- Bug 1170716 - Part 3: Use getLastWarning in test for warning with JSEXN_NONE. r=jandem (20453ed86)
- Bug 1173787. The column number of an exception populated via PopulateReportBlame should be 1-based. r=fitzgen (ccc3d63f6)
- Bug 1148593 - Create async stack in callback objects. r=bz, r=fitzgen (ec0802480)
- Bug 1170097 - Part 2: Add originAttributesToCookieJar. r=bholley (0358faa1c)
- Bug 1169044 - Patch 2 - Split URLSearchParams parsing logic into non-CCed URLParams. r=baku (2d228a166)
- make qcms support for AltiVec compile-time selected like in TenFourFox and make thus compilation without it work (a343e775a)
This commit is contained in:
2021-04-21 09:28:07 +08:00
parent a101af758e
commit b4028f07d5
130 changed files with 1658 additions and 881 deletions
+20 -16
View File
@@ -21,28 +21,28 @@
namespace mozilla {
using dom::URLSearchParams;
using dom::URLParams;
void
OriginAttributes::CreateSuffix(nsACString& aStr) const
{
MOZ_RELEASE_ASSERT(mAppId != nsIScriptSecurityManager::UNKNOWN_APP_ID);
nsRefPtr<URLSearchParams> usp = new URLSearchParams(nullptr);
UniquePtr<URLParams> params(new URLParams());
nsAutoString value;
if (mAppId != nsIScriptSecurityManager::NO_APP_ID) {
value.AppendInt(mAppId);
usp->Set(NS_LITERAL_STRING("appId"), value);
params->Set(NS_LITERAL_STRING("appId"), value);
}
if (mInBrowser) {
usp->Set(NS_LITERAL_STRING("inBrowser"), NS_LITERAL_STRING("1"));
params->Set(NS_LITERAL_STRING("inBrowser"), NS_LITERAL_STRING("1"));
}
aStr.Truncate();
usp->Serialize(value);
params->Serialize(value);
if (!value.IsEmpty()) {
aStr.AppendLiteral("!");
aStr.Append(NS_ConvertUTF16toUTF8(value));
@@ -52,7 +52,7 @@ OriginAttributes::CreateSuffix(nsACString& aStr) const
namespace {
class MOZ_STACK_CLASS PopulateFromSuffixIterator final
: public URLSearchParams::ForEachIterator
: public URLParams::ForEachIterator
{
public:
explicit PopulateFromSuffixIterator(OriginAttributes* aOriginAttributes)
@@ -61,8 +61,8 @@ public:
MOZ_ASSERT(aOriginAttributes);
}
bool URLSearchParamsIterator(const nsString& aName,
const nsString& aValue) override
bool URLParamsIterator(const nsString& aName,
const nsString& aValue) override
{
if (aName.EqualsLiteral("appId")) {
nsresult rv;
@@ -108,11 +108,17 @@ OriginAttributes::PopulateFromSuffix(const nsACString& aStr)
return false;
}
nsRefPtr<URLSearchParams> usp = new URLSearchParams(nullptr);
usp->ParseInput(Substring(aStr, 1, aStr.Length() - 1));
UniquePtr<URLParams> params(new URLParams());
params->ParseInput(Substring(aStr, 1, aStr.Length() - 1));
PopulateFromSuffixIterator iterator(this);
return usp->ForEach(iterator);
return params->ForEach(iterator);
}
void
OriginAttributes::CookieJar(nsACString& aStr)
{
mozilla::GetJarPrefix(mAppId, mInBrowser, aStr);
}
BasePrincipal::BasePrincipal()
@@ -212,7 +218,7 @@ BasePrincipal::GetJarPrefix(nsACString& aJarPrefix)
{
MOZ_ASSERT(AppId() != nsIScriptSecurityManager::UNKNOWN_APP_ID);
mozilla::GetJarPrefix(AppId(), IsInBrowserElement(), aJarPrefix);
mOriginAttributes.CookieJar(aJarPrefix);
return NS_OK;
}
@@ -235,10 +241,8 @@ BasePrincipal::GetOriginSuffix(nsACString& aOriginAttributes)
NS_IMETHODIMP
BasePrincipal::GetCookieJar(nsACString& aCookieJar)
{
// We just forward to .jarPrefix for now, which is a nice compact
// stringification of the (appId, inBrowser) tuple. This will eventaully be
// swapped out for an origin attribute - see the comment in nsIPrincipal.idl.
return GetJarPrefix(aCookieJar);
mOriginAttributes.CookieJar(aCookieJar);
return NS_OK;
}
NS_IMETHODIMP