--- a/browser/components/sessionstore/test/browser_restore_cookies_noOriginAttributes.js
+++ b/browser/components/sessionstore/test/browser_restore_cookies_noOriginAttributes.js
@@ -101,17 +101,16 @@ const SESSION_DATA_OA = `
"host": "www.example.com",
"value": "yes1",
"path": "/browser/browser/components/sessionstore/test/",
"name": "test1",
"originAttributes": {
"addonId": "",
"appId": 0,
"inIsolatedMozBrowser": false,
- "signedPkg": "",
"userContextId": 0
}
}]
}],
"selectedWindow": 1,
"_closedWindows": [],
"session": {
"lastUpdate": 1463893009801,
--- a/caps/BasePrincipal.cpp
+++ b/caps/BasePrincipal.cpp
@@ -38,34 +38,28 @@ PrincipalOriginAttributes::InheritFromDo
const nsIURI* aURI)
{
mAppId = aAttrs.mAppId;
mInIsolatedMozBrowser = aAttrs.mInIsolatedMozBrowser;
// addonId is computed from the principal URI and never propagated
mUserContextId = aAttrs.mUserContextId;
- // TODO:
- // Bug 1225349 - PrincipalOriginAttributes should inherit mSignedPkg
- // accordingly by URI
- mSignedPkg = aAttrs.mSignedPkg;
-
mPrivateBrowsingId = aAttrs.mPrivateBrowsingId;
mFirstPartyDomain = aAttrs.mFirstPartyDomain;
}
void
PrincipalOriginAttributes::InheritFromNecko(const NeckoOriginAttributes& aAttrs)
{
mAppId = aAttrs.mAppId;
mInIsolatedMozBrowser = aAttrs.mInIsolatedMozBrowser;
// addonId is computed from the principal URI and never propagated
mUserContextId = aAttrs.mUserContextId;
- mSignedPkg = aAttrs.mSignedPkg;
mPrivateBrowsingId = aAttrs.mPrivateBrowsingId;
mFirstPartyDomain = aAttrs.mFirstPartyDomain;
}
void
PrincipalOriginAttributes::StripUserContextIdAndFirstPartyDomain()
{
@@ -77,57 +71,44 @@ void
DocShellOriginAttributes::InheritFromDocToChildDocShell(const PrincipalOriginAttributes& aAttrs)
{
mAppId = aAttrs.mAppId;
mInIsolatedMozBrowser = aAttrs.mInIsolatedMozBrowser;
// addonId is computed from the principal URI and never propagated
mUserContextId = aAttrs.mUserContextId;
- // TODO:
- // Bug 1225353 - DocShell/NeckoOriginAttributes should inherit
- // mSignedPkg accordingly by mSignedPkgInBrowser
- mSignedPkg = aAttrs.mSignedPkg;
-
mPrivateBrowsingId = aAttrs.mPrivateBrowsingId;
mFirstPartyDomain = aAttrs.mFirstPartyDomain;
}
void
NeckoOriginAttributes::InheritFromDocToNecko(const PrincipalOriginAttributes& aAttrs)
{
mAppId = aAttrs.mAppId;
mInIsolatedMozBrowser = aAttrs.mInIsolatedMozBrowser;
// addonId is computed from the principal URI and never propagated
mUserContextId = aAttrs.mUserContextId;
- // TODO:
- // Bug 1225353 - DocShell/NeckoOriginAttributes should inherit
- // mSignedPkg accordingly by mSignedPkgInBrowser
-
mPrivateBrowsingId = aAttrs.mPrivateBrowsingId;
mFirstPartyDomain = aAttrs.mFirstPartyDomain;
}
void
NeckoOriginAttributes::InheritFromDocShellToNecko(const DocShellOriginAttributes& aAttrs,
const bool aIsTopLevelDocument,
nsIURI* aURI)
{
mAppId = aAttrs.mAppId;
mInIsolatedMozBrowser = aAttrs.mInIsolatedMozBrowser;
// addonId is computed from the principal URI and never propagated
mUserContextId = aAttrs.mUserContextId;
- // TODO:
- // Bug 1225353 - DocShell/NeckoOriginAttributes should inherit
- // mSignedPkg accordingly by mSignedPkgInBrowser
-
mPrivateBrowsingId = aAttrs.mPrivateBrowsingId;
bool isFirstPartyEnabled = IsFirstPartyEnabled();
// When the pref is on, we also compute the firstPartyDomain attribute
// if this is for top-level document.
if (isFirstPartyEnabled && aIsTopLevelDocument) {
nsCOMPtr<nsIEffectiveTLDService> tldService = do_GetService(NS_EFFECTIVETLDSERVICE_CONTRACTID);
@@ -178,20 +159,16 @@ OriginAttributes::CreateSuffix(nsACStrin
}
if (mUserContextId != nsIScriptSecurityManager::DEFAULT_USER_CONTEXT_ID) {
value.Truncate();
value.AppendInt(mUserContextId);
params->Set(NS_LITERAL_STRING("userContextId"), value);
}
- if (!mSignedPkg.IsEmpty()) {
- MOZ_RELEASE_ASSERT(mSignedPkg.FindCharInSet(dom::quota::QuotaManager::kReplaceChars) == kNotFound);
- params->Set(NS_LITERAL_STRING("signedPkg"), mSignedPkg);
- }
if (mPrivateBrowsingId) {
value.Truncate();
value.AppendInt(mPrivateBrowsingId);
params->Set(NS_LITERAL_STRING("privateBrowsingId"), value);
}
if (!mFirstPartyDomain.IsEmpty()) {
@@ -264,22 +241,16 @@ public:
int64_t val = aValue.ToInteger64(&rv);
NS_ENSURE_SUCCESS(rv, false);
NS_ENSURE_TRUE(val <= UINT32_MAX, false);
mOriginAttributes->mUserContextId = static_cast<uint32_t>(val);
return true;
}
- if (aName.EqualsLiteral("signedPkg")) {
- MOZ_RELEASE_ASSERT(mOriginAttributes->mSignedPkg.IsEmpty());
- mOriginAttributes->mSignedPkg.Assign(aValue);
- return true;
- }
-
if (aName.EqualsLiteral("privateBrowsingId")) {
nsresult rv;
int64_t val = aValue.ToInteger64(&rv);
NS_ENSURE_SUCCESS(rv, false);
NS_ENSURE_TRUE(val >= 0 && val <= UINT32_MAX, false);
mOriginAttributes->mPrivateBrowsingId = static_cast<uint32_t>(val);
return true;
@@ -344,17 +315,16 @@ OriginAttributes::SyncAttributesWithPriv
void
OriginAttributes::SetFromGenericAttributes(const GenericOriginAttributes& aAttrs)
{
mAppId = aAttrs.mAppId;
mInIsolatedMozBrowser = aAttrs.mInIsolatedMozBrowser;
mAddonId = aAttrs.mAddonId;
mUserContextId = aAttrs.mUserContextId;
- mSignedPkg = aAttrs.mSignedPkg;
mPrivateBrowsingId = aAttrs.mPrivateBrowsingId;
mFirstPartyDomain = aAttrs.mFirstPartyDomain;
}
bool
OriginAttributes::IsFirstPartyEnabled()
{
// Cache the privacy.firstparty.isolate pref.
--- a/caps/BasePrincipal.h
+++ b/caps/BasePrincipal.h
@@ -31,17 +31,16 @@ class OriginAttributes : public dom::Ori
{
public:
bool operator==(const OriginAttributes& aOther) const
{
return mAppId == aOther.mAppId &&
mInIsolatedMozBrowser == aOther.mInIsolatedMozBrowser &&
mAddonId == aOther.mAddonId &&
mUserContextId == aOther.mUserContextId &&
- mSignedPkg == aOther.mSignedPkg &&
mPrivateBrowsingId == aOther.mPrivateBrowsingId &&
mFirstPartyDomain == aOther.mFirstPartyDomain;
}
bool operator!=(const OriginAttributes& aOther) const
{
return !(*this == aOther);
}
@@ -186,20 +185,16 @@ public:
if (mAddonId.WasPassed() && mAddonId.Value() != aAttrs.mAddonId) {
return false;
}
if (mUserContextId.WasPassed() && mUserContextId.Value() != aAttrs.mUserContextId) {
return false;
}
- if (mSignedPkg.WasPassed() && mSignedPkg.Value() != aAttrs.mSignedPkg) {
- return false;
- }
-
if (mPrivateBrowsingId.WasPassed() && mPrivateBrowsingId.Value() != aAttrs.mPrivateBrowsingId) {
return false;
}
if (mFirstPartyDomain.WasPassed() && mFirstPartyDomain.Value() != aAttrs.mFirstPartyDomain) {
return false;
}
@@ -224,21 +219,16 @@ public:
return false;
}
if (mUserContextId.WasPassed() && aOther.mUserContextId.WasPassed() &&
mUserContextId.Value() != aOther.mUserContextId.Value()) {
return false;
}
- if (mSignedPkg.WasPassed() && aOther.mSignedPkg.WasPassed() &&
- mSignedPkg.Value() != aOther.mSignedPkg.Value()) {
- return false;
- }
-
if (mPrivateBrowsingId.WasPassed() && aOther.mPrivateBrowsingId.WasPassed() &&
mPrivateBrowsingId.Value() != aOther.mPrivateBrowsingId.Value()) {
return false;
}
if (mFirstPartyDomain.WasPassed() && aOther.mFirstPartyDomain.WasPassed() &&
mFirstPartyDomain.Value() != aOther.mFirstPartyDomain.Value()) {
return false;
--- a/caps/tests/unit/test_origin.js
+++ b/caps/tests/unit/test_origin.js
@@ -44,31 +44,29 @@ function checkSandboxOriginAttributes(ar
// utility function useful for debugging
function printAttrs(name, attrs) {
do_print(name + " {\n" +
"\tappId: " + attrs.appId + ",\n" +
"\tuserContextId: " + attrs.userContextId + ",\n" +
"\tinIsolatedMozBrowser: " + attrs.inIsolatedMozBrowser + ",\n" +
"\taddonId: '" + attrs.addonId + "',\n" +
- "\tsignedPkg: '" + attrs.signedPkg + "',\n" +
"\tprivateBrowsingId: '" + attrs.privateBrowsingId + "',\n" +
"\tfirstPartyDomain: '" + attrs.firstPartyDomain + "'\n}");
}
function checkValues(attrs, values) {
values = values || {};
//printAttrs("attrs", attrs);
//printAttrs("values", values);
do_check_eq(attrs.appId, values.appId || 0);
do_check_eq(attrs.userContextId, values.userContextId || 0);
do_check_eq(attrs.inIsolatedMozBrowser, values.inIsolatedMozBrowser || false);
do_check_eq(attrs.addonId, values.addonId || '');
- do_check_eq(attrs.signedPkg, values.signedPkg || '');
do_check_eq(attrs.privateBrowsingId, values.privateBrowsingId || '');
do_check_eq(attrs.firstPartyDomain, values.firstPartyDomain || '');
}
function run_test() {
// Attributeless origins.
do_check_eq(ssm.getSystemPrincipal().origin, '[System Principal]');
checkOriginAttributes(ssm.getSystemPrincipal());
@@ -166,70 +164,38 @@ function run_test() {
// UserContext and App.
var exampleOrg_userContextApp = ssm.createCodebasePrincipal(makeURI('http://example.org'), {appId: 24, userContextId: 42});
var nullPrin_userContextApp = ssm.createNullPrincipal({appId: 24, userContextId: 42});
checkOriginAttributes(exampleOrg_userContextApp, {appId: 24, userContextId: 42}, '^appId=24&userContextId=42');
checkOriginAttributes(nullPrin_userContextApp, {appId: 24, userContextId: 42}, '^appId=24&userContextId=42');
do_check_eq(exampleOrg_userContextApp.origin, 'http://example.org^appId=24&userContextId=42');
- // Just signedPkg
- var exampleOrg_signedPkg = ssm.createCodebasePrincipal(makeURI('http://example.org'), {signedPkg: 'whatever'});
- checkOriginAttributes(exampleOrg_signedPkg, { signedPkg: 'whatever' }, '^signedPkg=whatever');
- do_check_eq(exampleOrg_signedPkg.origin, 'http://example.org^signedPkg=whatever');
-
- // signedPkg and browser
- var exampleOrg_signedPkg_browser = ssm.createCodebasePrincipal(makeURI('http://example.org'), {signedPkg: 'whatever', inIsolatedMozBrowser: true});
- checkOriginAttributes(exampleOrg_signedPkg_browser, { signedPkg: 'whatever', inIsolatedMozBrowser: true }, '^inBrowser=1&signedPkg=whatever');
- do_check_eq(exampleOrg_signedPkg_browser.origin, 'http://example.org^inBrowser=1&signedPkg=whatever');
-
- // Just signedPkg (but different value from 'exampleOrg_signedPkg_app')
- var exampleOrg_signedPkg_another = ssm.createCodebasePrincipal(makeURI('http://example.org'), {signedPkg: 'whatup'});
-
checkSandboxOriginAttributes(null, {});
checkSandboxOriginAttributes('http://example.org', {});
checkSandboxOriginAttributes('http://example.org', {}, {originAttributes: {}});
checkSandboxOriginAttributes('http://example.org', {appId: 42}, {originAttributes: {appId: 42}});
checkSandboxOriginAttributes(['http://example.org'], {});
checkSandboxOriginAttributes(['http://example.org'], {}, {originAttributes: {}});
checkSandboxOriginAttributes(['http://example.org'], {appId: 42}, {originAttributes: {appId: 42}});
- checkSandboxOriginAttributes([exampleOrg_signedPkg, 'http://example.org'], {signedPkg: 'whatever'});
- checkSandboxOriginAttributes(['http://example.org', exampleOrg_signedPkg], {signedPkg: 'whatever'});
- checkSandboxOriginAttributes(['http://example.org', exampleOrg_app, exampleOrg_signedPkg], {signedPkg: 'whatever'}, {originAttributes: {signedPkg: 'whatever'}});
- checkSandboxOriginAttributes(['http://example.org', exampleOrg_signedPkg, exampleOrg_app], {signedPkg: 'whatever'}, {originAttributes: {signedPkg: 'whatever'}});
- checkSandboxOriginAttributes([exampleOrg_app, exampleOrg_signedPkg, 'http://example.org'], {signedPkg: 'whatever'}, {originAttributes: {signedPkg: 'whatever'}});
- checkSandboxOriginAttributes([exampleOrg_app, 'http://example.org', exampleOrg_signedPkg], {signedPkg: 'whatever'}, {originAttributes: {signedPkg: 'whatever'}});
- checkSandboxOriginAttributes([exampleOrg_signedPkg, exampleOrg_app, 'http://example.org'], {signedPkg: 'whatever'}, {originAttributes: {signedPkg: 'whatever'}});
- checkSandboxOriginAttributes([exampleOrg_signedPkg, 'http://example.org', exampleOrg_app], {signedPkg: 'whatever'}, {originAttributes: {signedPkg: 'whatever'}});
- checkThrows(() => Cu.Sandbox([exampleOrg_app, exampleOrg_signedPkg]));
- checkThrows(() => Cu.Sandbox([exampleOrg_signedPkg, exampleOrg_app]));
- checkThrows(() => Cu.Sandbox(['http://example.org', exampleOrg_app, exampleOrg_signedPkg]));
- checkThrows(() => Cu.Sandbox(['http://example.org', exampleOrg_signedPkg, exampleOrg_app]));
- checkThrows(() => Cu.Sandbox([exampleOrg_app, exampleOrg_signedPkg, 'http://example.org']));
- checkThrows(() => Cu.Sandbox([exampleOrg_app, 'http://example.org', exampleOrg_signedPkg]));
- checkThrows(() => Cu.Sandbox([exampleOrg_signedPkg, exampleOrg_app, 'http://example.org']));
- checkThrows(() => Cu.Sandbox([exampleOrg_signedPkg, 'http://example.org', exampleOrg_app]));
// Check that all of the above are cross-origin.
checkCrossOrigin(exampleOrg_app, exampleOrg);
checkCrossOrigin(exampleOrg_app, nullPrin_app);
checkCrossOrigin(exampleOrg_browser, exampleOrg_app);
checkCrossOrigin(exampleOrg_browser, nullPrin_browser);
checkCrossOrigin(exampleOrg_appBrowser, exampleOrg_app);
checkCrossOrigin(exampleOrg_appBrowser, nullPrin_appBrowser);
checkCrossOrigin(exampleOrg_appBrowser, exampleCom_appBrowser);
checkCrossOrigin(exampleOrg_addon, exampleOrg);
checkCrossOrigin(exampleOrg_firstPartyDomain, exampleOrg);
checkCrossOrigin(exampleOrg_userContext, exampleOrg);
checkCrossOrigin(exampleOrg_userContextAddon, exampleOrg);
checkCrossOrigin(exampleOrg_userContext, exampleOrg_userContextAddon);
checkCrossOrigin(exampleOrg_userContext, exampleOrg_userContextApp);
- checkCrossOrigin(exampleOrg_signedPkg, exampleOrg);
- checkCrossOrigin(exampleOrg_signedPkg, exampleOrg_signedPkg_browser);
- checkCrossOrigin(exampleOrg_signedPkg, exampleOrg_signedPkg_another);
// Check Principal kinds.
function checkKind(prin, kind) {
do_check_eq(prin.isNullPrincipal, kind == 'nullPrincipal');
do_check_eq(prin.isCodebasePrincipal, kind == 'codebasePrincipal');
do_check_eq(prin.isExpandedPrincipal, kind == 'expandedPrincipal');
do_check_eq(prin.isSystemPrincipal, kind == 'systemPrincipal');
}
@@ -250,17 +216,16 @@ function run_test() {
var uri = "http://example.org";
var tests = [
[ "", {} ],
[ "^appId=5", {appId: 5} ],
[ "^userContextId=3", {userContextId: 3} ],
[ "^addonId=fooBar", {addonId: "fooBar"} ],
[ "^inBrowser=1", {inIsolatedMozBrowser: true} ],
[ "^firstPartyDomain=example.org", {firstPartyDomain: "example.org"} ],
- [ "^signedPkg=bazQux", {signedPkg: "bazQux"} ],
[ "^appId=3&inBrowser=1&userContextId=6",
{appId: 3, userContextId: 6, inIsolatedMozBrowser: true} ] ];
// check that we can create an origin attributes from an origin properly
tests.forEach(t => {
let attrs = ChromeUtils.createOriginAttributesFromOrigin(uri + t[0]);
checkValues(attrs, t[1]);
do_check_eq(ChromeUtils.originAttributesToSuffix(attrs), t[0]);
--- a/devtools/client/webconsole/new-console-output/test/fixtures/stubs/consoleApi.js
+++ b/devtools/client/webconsole/new-console-output/test/fixtures/stubs/consoleApi.js
@@ -653,17 +653,16 @@ stubPackets.set("console.log('foobar', '
"level": "log",
"lineNumber": 1,
"originAttributes": {
"addonId": "",
"appId": 0,
"firstPartyDomain": "",
"inIsolatedMozBrowser": false,
"privateBrowsingId": 0,
- "signedPkg": "",
"userContextId": 0
},
"private": false,
"styles": [],
"timeStamp": 1477086261590,
"timer": null,
"workerType": "none",
"category": "webdev"
@@ -687,17 +686,16 @@ stubPackets.set("console.log(undefined)"
"level": "log",
"lineNumber": 1,
"originAttributes": {
"addonId": "",
"appId": 0,
"firstPartyDomain": "",
"inIsolatedMozBrowser": false,
"privateBrowsingId": 0,
- "signedPkg": "",
"userContextId": 0
},
"private": false,
"styles": [],
"timeStamp": 1477086264886,
"timer": null,
"workerType": "none",
"category": "webdev"
@@ -719,17 +717,16 @@ stubPackets.set("console.warn('danger, w
"level": "warn",
"lineNumber": 1,
"originAttributes": {
"addonId": "",
"appId": 0,
"firstPartyDomain": "",
"inIsolatedMozBrowser": false,
"privateBrowsingId": 0,
- "signedPkg": "",
"userContextId": 0
},
"private": false,
"styles": [],
"timeStamp": 1477086267284,
"timer": null,
"workerType": "none",
"category": "webdev"
@@ -753,17 +750,16 @@ stubPackets.set("console.log(NaN)", {
"level": "log",
"lineNumber": 1,
"originAttributes": {
"addonId": "",
"appId": 0,
"firstPartyDomain": "",
"inIsolatedMozBrowser": false,
"privateBrowsingId": 0,
- "signedPkg": "",
"userContextId": 0
},
"private": false,
"styles": [],
"timeStamp": 1477086269484,
"timer": null,
"workerType": "none",
"category": "webdev"
@@ -787,17 +783,16 @@ stubPackets.set("console.log(null)", {
"level": "log",
"lineNumber": 1,
"originAttributes": {
"addonId": "",
"appId": 0,
"firstPartyDomain": "",
"inIsolatedMozBrowser": false,
"privateBrowsingId": 0,
- "signedPkg": "",
"userContextId": 0
},
"private": false,
"styles": [],
"timeStamp": 1477086271418,
"timer": null,
"workerType": "none",
"category": "webdev"
@@ -819,17 +814,16 @@ stubPackets.set("console.log('ιΌ¬')", {
"level": "log",
"lineNumber": 1,
"originAttributes": {
"addonId": "",
"appId": 0,
"firstPartyDomain": "",
"inIsolatedMozBrowser": false,
"privateBrowsingId": 0,
- "signedPkg": "",
"userContextId": 0
},
"private": false,
"styles": [],
"timeStamp": 1477086273549,
"timer": null,
"workerType": "none",
"category": "webdev"
@@ -849,17 +843,16 @@ stubPackets.set("console.clear()", {
"level": "clear",
"lineNumber": 1,
"originAttributes": {
"addonId": "",
"appId": 0,
"firstPartyDomain": "",
"inIsolatedMozBrowser": false,
"privateBrowsingId": 0,
- "signedPkg": "",
"userContextId": 0
},
"private": false,
"timeStamp": 1477086275587,
"timer": null,
"workerType": "none",
"styles": [],
"category": "webdev"
@@ -884,17 +877,16 @@ stubPackets.set("console.count('bar')",
"level": "count",
"lineNumber": 1,
"originAttributes": {
"addonId": "",
"appId": 0,
"firstPartyDomain": "",
"inIsolatedMozBrowser": false,
"privateBrowsingId": 0,
- "signedPkg": "",
"userContextId": 0
},
"private": false,
"timeStamp": 1477086277812,
"timer": null,
"workerType": "none",
"styles": [],
"category": "webdev"
@@ -937,17 +929,16 @@ stubPackets.set("console.assert(false, {
"level": "assert",
"lineNumber": 1,
"originAttributes": {
"addonId": "",
"appId": 0,
"firstPartyDomain": "",
"inIsolatedMozBrowser": false,
"privateBrowsingId": 0,
- "signedPkg": "",
"userContextId": 0
},
"private": false,
"styles": [],
"timeStamp": 1477086280131,
"timer": null,
"stacktrace": [
{
@@ -978,17 +969,16 @@ stubPackets.set("console.log('hello \nfr
"level": "log",
"lineNumber": 1,
"originAttributes": {
"addonId": "",
"appId": 0,
"firstPartyDomain": "",
"inIsolatedMozBrowser": false,
"privateBrowsingId": 0,
- "signedPkg": "",
"userContextId": 0
},
"private": false,
"styles": [],
"timeStamp": 1477086281936,
"timer": null,
"workerType": "none",
"category": "webdev"
@@ -1010,17 +1000,16 @@ stubPackets.set("console.log('ΓΊαΉΔ©Γ§ΓΆdΓͺ ΘΔΘΕ₯')", {
"level": "log",
"lineNumber": 1,
"originAttributes": {
"addonId": "",
"appId": 0,
"firstPartyDomain": "",
"inIsolatedMozBrowser": false,
"privateBrowsingId": 0,
- "signedPkg": "",
"userContextId": 0
},
"private": false,
"styles": [],
"timeStamp": 1477086283713,
"timer": null,
"workerType": "none",
"category": "webdev"
@@ -1054,17 +1043,16 @@ stubPackets.set("console.dirxml(window)"
"level": "dirxml",
"lineNumber": 1,
"originAttributes": {
"addonId": "",
"appId": 0,
"firstPartyDomain": "",
"inIsolatedMozBrowser": false,
"privateBrowsingId": 0,
- "signedPkg": "",
"userContextId": 0
},
"private": false,
"timeStamp": 1477086285483,
"timer": null,
"workerType": "none",
"styles": [],
"category": "webdev"
@@ -1084,17 +1072,16 @@ stubPackets.set("console.trace()", {
"level": "trace",
"lineNumber": 3,
"originAttributes": {
"addonId": "",
"appId": 0,
"firstPartyDomain": "",
"inIsolatedMozBrowser": false,
"privateBrowsingId": 0,
- "signedPkg": "",
"userContextId": 0
},
"private": false,
"timeStamp": 1477086287286,
"timer": null,
"stacktrace": [
{
"columnNumber": 3,
@@ -1139,17 +1126,16 @@ stubPackets.set("console.time('bar')", {
"level": "time",
"lineNumber": 2,
"originAttributes": {
"addonId": "",
"appId": 0,
"firstPartyDomain": "",
"inIsolatedMozBrowser": false,
"privateBrowsingId": 0,
- "signedPkg": "",
"userContextId": 0
},
"private": false,
"timeStamp": 1477086289137,
"timer": {
"name": "bar",
"started": 1166.305
},
@@ -1174,17 +1160,16 @@ stubPackets.set("console.timeEnd('bar')"
"level": "timeEnd",
"lineNumber": 3,
"originAttributes": {
"addonId": "",
"appId": 0,
"firstPartyDomain": "",
"inIsolatedMozBrowser": false,
"privateBrowsingId": 0,
- "signedPkg": "",
"userContextId": 0
},
"private": false,
"timeStamp": 1477086289138,
"timer": {
"duration": 1.3550000000000182,
"name": "bar"
},
@@ -1209,17 +1194,16 @@ stubPackets.set("console.table('bar')",
"level": "table",
"lineNumber": 2,
"originAttributes": {
"addonId": "",
"appId": 0,
"firstPartyDomain": "",
"inIsolatedMozBrowser": false,
"privateBrowsingId": 0,
- "signedPkg": "",
"userContextId": 0
},
"private": false,
"timeStamp": 1477086290984,
"timer": null,
"workerType": "none",
"styles": [],
"category": "webdev"
@@ -1258,17 +1242,16 @@ stubPackets.set("console.table(['a', 'b'
"level": "table",
"lineNumber": 2,
"originAttributes": {
"addonId": "",
"appId": 0,
"firstPartyDomain": "",
"inIsolatedMozBrowser": false,
"privateBrowsingId": 0,
- "signedPkg": "",
"userContextId": 0
},
"private": false,
"timeStamp": 1477086292762,
"timer": null,
"workerType": "none",
"styles": [],
"category": "webdev"
@@ -1290,17 +1273,16 @@ stubPackets.set("console.group('bar')",
"level": "group",
"lineNumber": 2,
"originAttributes": {
"addonId": "",
"appId": 0,
"firstPartyDomain": "",
"inIsolatedMozBrowser": false,
"privateBrowsingId": 0,
- "signedPkg": "",
"userContextId": 0
},
"private": false,
"timeStamp": 1477086294628,
"timer": null,
"workerType": "none",
"styles": [],
"category": "webdev"
@@ -1322,17 +1304,16 @@ stubPackets.set("console.groupEnd('bar')
"level": "groupEnd",
"lineNumber": 3,
"originAttributes": {
"addonId": "",
"appId": 0,
"firstPartyDomain": "",
"inIsolatedMozBrowser": false,
"privateBrowsingId": 0,
- "signedPkg": "",
"userContextId": 0
},
"private": false,
"timeStamp": 1477086294630,
"timer": null,
"workerType": "none",
"styles": [],
"category": "webdev"
@@ -1354,17 +1335,16 @@ stubPackets.set("console.groupCollapsed(
"level": "groupCollapsed",
"lineNumber": 2,
"originAttributes": {
"addonId": "",
"appId": 0,
"firstPartyDomain": "",
"inIsolatedMozBrowser": false,
"privateBrowsingId": 0,
- "signedPkg": "",
"userContextId": 0
},
"private": false,
"timeStamp": 1477086296567,
"timer": null,
"workerType": "none",
"styles": [],
"category": "webdev"
@@ -1386,17 +1366,16 @@ stubPackets.set("console.groupEnd('foo')
"level": "groupEnd",
"lineNumber": 3,
"originAttributes": {
"addonId": "",
"appId": 0,
"firstPartyDomain": "",
"inIsolatedMozBrowser": false,
"privateBrowsingId": 0,
- "signedPkg": "",
"userContextId": 0
},
"private": false,
"timeStamp": 1477086296570,
"timer": null,
"workerType": "none",
"styles": [],
"category": "webdev"
@@ -1416,17 +1395,16 @@ stubPackets.set("console.group()", {
"level": "group",
"lineNumber": 2,
"originAttributes": {
"addonId": "",
"appId": 0,
"firstPartyDomain": "",
"inIsolatedMozBrowser": false,
"privateBrowsingId": 0,
- "signedPkg": "",
"userContextId": 0
},
"private": false,
"timeStamp": 1477086298462,
"timer": null,
"workerType": "none",
"styles": [],
"category": "webdev"
@@ -1446,17 +1424,16 @@ stubPackets.set("console.groupEnd()", {
"level": "groupEnd",
"lineNumber": 3,
"originAttributes": {
"addonId": "",
"appId": 0,
"firstPartyDomain": "",
"inIsolatedMozBrowser": false,
"privateBrowsingId": 0,
- "signedPkg": "",
"userContextId": 0
},
"private": false,
"timeStamp": 1477086298464,
"timer": null,
"workerType": "none",
"styles": [],
"category": "webdev"
@@ -1479,17 +1456,16 @@ stubPackets.set("console.log(%cfoobar)",
"level": "log",
"lineNumber": 2,
"originAttributes": {
"addonId": "",
"appId": 0,
"firstPartyDomain": "",
"inIsolatedMozBrowser": false,
"privateBrowsingId": 0,
- "signedPkg": "",
"userContextId": 0
},
"private": false,
"styles": [
"color:blue;font-size:1.3em;background:url('http://example.com/test');position:absolute;top:10px",
"color:red;background:url('http://example.com/test')"
],
"timeStamp": 1477086300265,
--- a/dom/base/ChromeUtils.cpp
+++ b/dom/base/ChromeUtils.cpp
@@ -173,26 +173,24 @@ ChromeUtils::FillNonDefaultOriginAttribu
/* static */ bool
ChromeUtils::IsOriginAttributesEqual(dom::GlobalObject& aGlobal,
const dom::OriginAttributesDictionary& aA,
const dom::OriginAttributesDictionary& aB)
{
return aA.mAddonId == aB.mAddonId &&
aA.mAppId == aB.mAppId &&
aA.mInIsolatedMozBrowser == aB.mInIsolatedMozBrowser &&
- aA.mSignedPkg == aB.mSignedPkg &&
aA.mUserContextId == aB.mUserContextId &&
aA.mPrivateBrowsingId == aB.mPrivateBrowsingId;
}
/* static */ bool
ChromeUtils::IsOriginAttributesEqualIgnoringAddonId(const dom::OriginAttributesDictionary& aA,
const dom::OriginAttributesDictionary& aB)
{
return aA.mAppId == aB.mAppId &&
aA.mInIsolatedMozBrowser == aB.mInIsolatedMozBrowser &&
- aA.mSignedPkg == aB.mSignedPkg &&
aA.mUserContextId == aB.mUserContextId &&
aA.mPrivateBrowsingId == aB.mPrivateBrowsingId;
}
} // namespace dom
} // namespace mozilla
--- a/dom/base/nsFrameLoader.cpp
+++ b/dom/base/nsFrameLoader.cpp
@@ -324,40 +324,16 @@ nsFrameLoader::LoadURI(nsIURI* aURI)
rv = doc->InitializeFrameLoader(this);
if (NS_FAILED(rv)) {
mURIToLoad = nullptr;
}
return rv;
}
NS_IMETHODIMP
-nsFrameLoader::SwitchProcessAndLoadURI(nsIURI* aURI, const nsACString& aPackageId)
-{
- RefPtr<TabParent> tp = nullptr;
-
- MutableTabContext context;
- nsresult rv = GetNewTabContext(&context, aURI, aPackageId);
- NS_ENSURE_SUCCESS(rv, rv);
-
- nsCOMPtr<Element> ownerElement = mOwnerContent;
- tp = ContentParent::CreateBrowserOrApp(context, ownerElement, nullptr);
- if (!tp) {
- return NS_ERROR_FAILURE;
- }
- mRemoteBrowserShown = false;
-
- rv = SwapRemoteBrowser(tp);
- if (NS_WARN_IF(NS_FAILED(rv))) {
- return rv;
- }
- LoadURI(aURI);
- return NS_OK;
-}
-
-NS_IMETHODIMP
nsFrameLoader::SetIsPrerendered()
{
MOZ_ASSERT(!mDocShell, "Please call SetIsPrerendered before docShell is created");
mIsPrerendered = true;
return NS_OK;
}
@@ -3088,62 +3064,16 @@ nsFrameLoader::SetRemoteBrowser(nsITabPa
mRemoteBrowser = TabParent::GetFrom(aTabParent);
mChildID = mRemoteBrowser ? mRemoteBrowser->Manager()->ChildID() : 0;
MaybeUpdatePrimaryTabParent(eTabParentChanged);
ReallyLoadFrameScripts();
InitializeBrowserAPI();
ShowRemoteFrame(ScreenIntSize(0, 0));
}
-nsresult
-nsFrameLoader::SwapRemoteBrowser(nsITabParent* aTabParent)
-{
- RefPtr<TabParent> newParent = TabParent::GetFrom(aTabParent);
- if (!newParent || !mRemoteBrowser) {
- return NS_ERROR_DOM_INVALID_STATE_ERR;
- }
- if (!IsRemoteFrame()) {
- NS_WARNING("Switching from in-process to out-of-process is not supported.");
- return NS_ERROR_NOT_IMPLEMENTED;
- }
- if (!OwnerIsMozBrowserOrAppFrame()) {
- NS_WARNING("Switching process for non-mozbrowser/app frame is not supported.");
- return NS_ERROR_NOT_IMPLEMENTED;
- }
- if (newParent == mRemoteBrowser) {
- return NS_OK;
- }
-
- MaybeUpdatePrimaryTabParent(eTabParentRemoved);
- mRemoteBrowser->CacheFrameLoader(nullptr);
- mRemoteBrowser->SetOwnerElement(nullptr);
- mRemoteBrowser->Detach();
- mRemoteBrowser->Destroy();
-
- mRemoteBrowser = newParent;
- mRemoteBrowser->Attach(this);
- mChildID = mRemoteBrowser->Manager()->ChildID();
-
- MaybeUpdatePrimaryTabParent(eTabParentChanged);
-
- // Force the new remote frame manager to load pending scripts
- mMessageManager->LoadPendingScripts();
-
- nsCOMPtr<nsIObserverService> os = services::GetObserverService();
- if (os) {
- os->NotifyObservers(NS_ISUPPORTS_CAST(nsIFrameLoader*, this),
- "remote-browser-swapped", nullptr);
- }
- if (!mRemoteBrowserShown) {
- ShowRemoteFrame(ScreenIntSize(0, 0));
- }
-
- return NS_OK;
-}
-
void
nsFrameLoader::SetDetachedSubdocFrame(nsIFrame* aDetachedFrame,
nsIDocument* aContainerDoc)
{
mDetachedSubdocFrame = aDetachedFrame;
mContainerDocWhileDetached = aContainerDoc;
}
@@ -3457,48 +3387,37 @@ nsFrameLoader::MaybeUpdatePrimaryTabPare
eIgnoreCase);
parentTreeOwner->TabParentAdded(mRemoteBrowser, isPrimary);
}
}
}
nsresult
nsFrameLoader::GetNewTabContext(MutableTabContext* aTabContext,
- nsIURI* aURI,
- const nsACString& aPackageId)
+ nsIURI* aURI)
{
nsCOMPtr<mozIApplication> ownApp = GetOwnApp();
nsCOMPtr<mozIApplication> containingApp = GetContainingApp();
DocShellOriginAttributes attrs;
attrs.mInIsolatedMozBrowser = OwnerIsIsolatedMozBrowserFrame();
nsresult rv;
- nsCString signedPkgOrigin;
- if (!aPackageId.IsEmpty()) {
- // Only when aPackageId is not empty would signed package origin
- // be meaningful.
- nsPrincipal::GetOriginForURI(aURI, signedPkgOrigin);
- }
-
// Get the AppId from ownApp
uint32_t appId = nsIScriptSecurityManager::NO_APP_ID;
if (ownApp) {
rv = ownApp->GetLocalId(&appId);
NS_ENSURE_SUCCESS(rv, rv);
NS_ENSURE_STATE(appId != nsIScriptSecurityManager::NO_APP_ID);
} else if (containingApp) {
rv = containingApp->GetLocalId(&appId);
NS_ENSURE_SUCCESS(rv, rv);
NS_ENSURE_STATE(appId != nsIScriptSecurityManager::NO_APP_ID);
}
attrs.mAppId = appId;
- // Populate packageId to signedPkg.
- attrs.mSignedPkg = NS_ConvertUTF8toUTF16(aPackageId);
-
// set the userContextId on the attrs before we pass them into
// the tab context
rv = PopulateUserContextIdFromAttribute(attrs);
NS_ENSURE_SUCCESS(rv, rv);
nsAutoString presentationURLStr;
mOwnerContent->GetAttr(kNameSpaceID_None,
nsGkAtoms::mozpresentation,
@@ -3527,17 +3446,16 @@ nsFrameLoader::GetNewTabContext(MutableT
bool tabContextUpdated =
aTabContext->SetTabContext(OwnerIsMozBrowserFrame(),
mIsPrerendered,
ownApp,
containingApp,
showAccelerators,
showFocusRings,
attrs,
- signedPkgOrigin,
presentationURLStr);
NS_ENSURE_STATE(tabContextUpdated);
return NS_OK;
}
nsresult
nsFrameLoader::PopulateUserContextIdFromAttribute(DocShellOriginAttributes& aAttr)
--- a/dom/base/nsFrameLoader.h
+++ b/dom/base/nsFrameLoader.h
@@ -185,18 +185,16 @@ public:
*
* This will assert if mRemoteBrowser is non-null. In practice,
* this means you can't have successfully run TryRemoteBrowser() on
* this object, which means you can't have called ShowRemoteFrame()
* or ReallyStartLoading().
*/
void SetRemoteBrowser(nsITabParent* aTabParent);
- nsresult SwapRemoteBrowser(nsITabParent* aTabParent);
-
/**
* Stashes a detached nsIFrame on the frame loader. We do this when we're
* destroying the nsSubDocumentFrame. If the nsSubdocumentFrame is
* being reframed we'll restore the detached nsIFrame when it's recreated,
* otherwise we'll discard the old presentation and set the detached
* subdoc nsIFrame to null. aContainerDoc is the document containing the
* the subdoc frame. This enables us to detect when the containing
* document has changed during reframe, so we can discard the presentation
@@ -322,18 +320,17 @@ private:
return mOwnerContent->IsXULElement()
? nsGkAtoms::type : nsGkAtoms::mozframetype;
}
void InitializeBrowserAPI();
void DestroyBrowserFrameScripts();
nsresult GetNewTabContext(mozilla::dom::MutableTabContext* aTabContext,
- nsIURI* aURI = nullptr,
- const nsACString& aPackageId = EmptyCString());
+ nsIURI* aURI = nullptr);
enum TabParentChange {
eTabParentRemoved,
eTabParentChanged
};
void MaybeUpdatePrimaryTabParent(TabParentChange aChange);
nsresult
--- a/dom/base/nsIFrameLoader.idl
+++ b/dom/base/nsIFrameLoader.idl
@@ -50,25 +50,16 @@ interface nsIFrameLoader : nsISupports
/**
* Loads the specified URI in this frame. Behaves identically to loadFrame,
* except that this method allows specifying the URI to load.
*/
void loadURI(in nsIURI aURI);
/**
- * Loads the specified URI in this frame but using a different process.
- * Behaves identically to loadURI, except that this method only works
- * with remote frame. For a signed package, we need to specifiy the
- * package identifier.
- * Throws an exception with non-remote frames.
- */
- void switchProcessAndLoadURI(in nsIURI aURI, in ACString aPackageId);
-
- /**
* Puts the frameloader in prerendering mode.
*/
void setIsPrerendered();
/**
* Make the prerendered frameloader being active (and clear isPrerendered flag).
*/
void makePrerenderedLoaderActive();
--- a/dom/base/test/mochitest.ini
+++ b/dom/base/test/mochitest.ini
@@ -673,18 +673,16 @@ skip-if = buildapp == 'mulet' || buildap
[test_error.html]
[test_EventSource_redirects.html]
[test_explicit_user_agent.html]
[test_file_from_blob.html]
[test_file_negative_date.html]
[test_fileapi.html]
[test_fileapi_slice.html]
skip-if = (toolkit == 'android') # Android: Bug 775227
-[test_frameLoader_switchProcess.html]
-skip-if = e10s || os != 'linux' || buildapp != 'browser' # Already tests multiprocess
[test_getAttribute_after_createAttribute.html]
[test_getElementById.html]
[test_getTranslationNodes.html]
[test_getTranslationNodes_limit.html]
[test_gsp-qualified.html]
[test_gsp-quirks.html]
[test_gsp-standards.html]
[test_history_document_open.html]
deleted file mode 100644
--- a/dom/base/test/test_frameLoader_switchProcess.html
+++ /dev/null
@@ -1,75 +0,0 @@
-<!DOCTYPE HTML>
-<html>
-<head>
- <title>Test frameLoader SwitchProcessAndLoadURI</title>
- <script type="text/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
- <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css" />
-</head>
-
-<body>
-<script type="application/javascript;version=1.7">
- SimpleTest.waitForExplicitFinish();
-
- var Ci = SpecialPowers.Ci;
- var Cc = SpecialPowers.Cc;
-
- function expectProcessCreated() {
- return new Promise((resolve, reject) => {
- var topic = "process-priority-manager:TEST-ONLY:process-created";
- function observer() {
- SpecialPowers.removeObserver(observer, topic);
- ok(true, "Expect process created");
- resolve();
- }
- SpecialPowers.addObserver(observer, topic, /* weak = */ false);
- });
- }
-
- function switchProcessAndLoadURI(iframe, url) {
- var fl = SpecialPowers.wrap(iframe)
- .QueryInterface(Ci.nsIFrameLoaderOwner)
- .frameLoader;
- var uri = SpecialPowers.Services.io.newURI(url, null, null);
- fl.switchProcessAndLoadURI(uri, "");
- }
-
- function runTest() {
- ok(true, "Run Test");
- var iframe = document.createElement("iframe");
- iframe.setAttribute("mozbrowser", "true");
- iframe.setAttribute("remote", "true");
- iframe.setAttribute("src", "http://example.org");
-
- expectProcessCreated()
- .then(() => new Promise(next => {
- iframe.addEventListener("mozbrowserloadend", function loadend(e) {
- iframe.removeEventListener("mozbrowserloadend", loadend);
- ok(true, "Got mozbrowserloadend");
- expectProcessCreated().then(next);
- switchProcessAndLoadURI(iframe, "data:text/html,%3Cscript%3Ealert(true)%3C/script%3E");
- });
- }))
- .then(() => new Promise(next => {
- iframe.addEventListener("mozbrowsershowmodalprompt", function prompt(e) {
- iframe.removeEventListener("mozbrowsershowmodalprompt", prompt);
- ok(true, "Browser API still works after process switch");
- next();
- });
- }))
- .then(SimpleTest.finish);
-
- document.body.appendChild(iframe);
- }
-
- SpecialPowers.pushPrefEnv(
- { "set": [["dom.ipc.processPriorityManager.testMode", true],
- ["dom.ipc.processPriorityManager.enabled", true],
- ["dom.ipc.tabs.disabled", false],
- ["dom.ipc.processCount", 3],
- ["dom.mozBrowserFramesEnabled", true]] },
- () => SpecialPowers.pushPermissions([
- { "type": "browser", "allow": 1, "context": document }
- ], runTest));
-</script>
-</body>
-</html>
--- a/dom/ipc/PTabContext.ipdlh
+++ b/dom/ipc/PTabContext.ipdlh
@@ -37,21 +37,16 @@ struct PopupIPCTabContext
struct FrameIPCTabContext
{
// The originAttributes dictionary.
DocShellOriginAttributes originAttributes;
// The ID of the app containing this app/browser frame, if applicable.
uint32_t frameOwnerAppId;
- // The origin without originAttribute suffix for a signed package.
- // This value would be empty if the TabContext doesn't own a signed
- // package.
- nsCString signedPkgOriginNoSuffix;
-
// Whether this is a mozbrowser frame. <iframe mozbrowser mozapp> and
// <xul:browser> are not considered to be mozbrowser frames.
bool isMozBrowserElement;
// Whether this TabContext should work in prerender mode.
bool isPrerendered;
// The requested presentation URL.
--- a/dom/ipc/TabContext.cpp
+++ b/dom/ipc/TabContext.cpp
@@ -172,37 +172,30 @@ TabContext::UpdateTabContextAfterSwap(co
{
// This is only used after already initialized.
MOZ_ASSERT(mInitialized);
// The only permissable change is to `mIsMozBrowserElement`. All other fields
// must match for the change to be accepted.
if (aContext.OwnAppId() != OwnAppId() ||
aContext.mContainingAppId != mContainingAppId ||
- aContext.mOriginAttributes != mOriginAttributes ||
- aContext.mSignedPkgOriginNoSuffix != mSignedPkgOriginNoSuffix) {
+ aContext.mOriginAttributes != mOriginAttributes) {
return false;
}
mIsMozBrowserElement = aContext.mIsMozBrowserElement;
return true;
}
const DocShellOriginAttributes&
TabContext::OriginAttributesRef() const
{
return mOriginAttributes;
}
-const nsACString&
-TabContext::SignedPkgOriginNoSuffix() const
-{
- return mSignedPkgOriginNoSuffix;
-}
-
const nsAString&
TabContext::PresentationURL() const
{
return mPresentationURL;
}
UIStateChangeType
TabContext::ShowAccelerators() const
@@ -219,17 +212,16 @@ TabContext::ShowFocusRings() const
bool
TabContext::SetTabContext(bool aIsMozBrowserElement,
bool aIsPrerendered,
mozIApplication* aOwnApp,
mozIApplication* aAppFrameOwnerApp,
UIStateChangeType aShowAccelerators,
UIStateChangeType aShowFocusRings,
const DocShellOriginAttributes& aOriginAttributes,
- const nsACString& aSignedPkgOriginNoSuffix,
const nsAString& aPresentationURL)
{
NS_ENSURE_FALSE(mInitialized, false);
// Get ids for both apps and only write to our member variables after we've
// verified that this worked.
uint32_t ownAppId = NO_APP_ID;
if (aOwnApp) {
@@ -252,29 +244,27 @@ TabContext::SetTabContext(bool aIsMozBro
mInitialized = true;
mIsMozBrowserElement = aIsMozBrowserElement;
mIsPrerendered = aIsPrerendered;
mOriginAttributes = aOriginAttributes;
mContainingAppId = containingAppId;
mOwnApp = aOwnApp;
mContainingApp = aAppFrameOwnerApp;
- mSignedPkgOriginNoSuffix = aSignedPkgOriginNoSuffix;
mPresentationURL = aPresentationURL;
mShowAccelerators = aShowAccelerators;
mShowFocusRings = aShowFocusRings;
return true;
}
IPCTabContext
TabContext::AsIPCTabContext() const
{
return IPCTabContext(FrameIPCTabContext(mOriginAttributes,
mContainingAppId,
- mSignedPkgOriginNoSuffix,
mIsMozBrowserElement,
mIsPrerendered,
mPresentationURL,
mShowAccelerators,
mShowFocusRings));
}
static already_AddRefed<mozIApplication>
@@ -291,17 +281,16 @@ GetAppForId(uint32_t aAppId)
MaybeInvalidTabContext::MaybeInvalidTabContext(const IPCTabContext& aParams)
: mInvalidReason(nullptr)
{
bool isMozBrowserElement = false;
bool isPrerendered = false;
uint32_t containingAppId = NO_APP_ID;
DocShellOriginAttributes originAttributes;
- nsAutoCString signedPkgOriginNoSuffix;
nsAutoString presentationURL;
UIStateChangeType showAccelerators = UIStateChangeType_NoChange;
UIStateChangeType showFocusRings = UIStateChangeType_NoChange;
switch(aParams.type()) {
case IPCTabContext::TPopupIPCTabContext: {
const PopupIPCTabContext &ipcContext = aParams.get_PopupIPCTabContext();
@@ -355,17 +344,16 @@ MaybeInvalidTabContext::MaybeInvalidTabC
}
case IPCTabContext::TFrameIPCTabContext: {
const FrameIPCTabContext &ipcContext =
aParams.get_FrameIPCTabContext();
isMozBrowserElement = ipcContext.isMozBrowserElement();
isPrerendered = ipcContext.isPrerendered();
containingAppId = ipcContext.frameOwnerAppId();
- signedPkgOriginNoSuffix = ipcContext.signedPkgOriginNoSuffix();
presentationURL = ipcContext.presentationURL();
showAccelerators = ipcContext.showAccelerators();
showFocusRings = ipcContext.showFocusRings();
originAttributes = ipcContext.originAttributes();
break;
}
case IPCTabContext::TUnsafeIPCTabContext: {
// XXXcatalinb: This used *only* by ServiceWorkerClients::OpenWindow.
@@ -409,17 +397,16 @@ MaybeInvalidTabContext::MaybeInvalidTabC
bool rv;
rv = mTabContext.SetTabContext(isMozBrowserElement,
isPrerendered,
ownApp,
containingApp,
showAccelerators,
showFocusRings,
originAttributes,
- signedPkgOriginNoSuffix,
presentationURL);
if (!rv) {
mInvalidReason = "Couldn't initialize TabContext.";
}
}
bool
MaybeInvalidTabContext::IsValid()
--- a/dom/ipc/TabContext.h
+++ b/dom/ipc/TabContext.h
@@ -122,22 +122,16 @@ public:
/**
* OriginAttributesRef() returns the DocShellOriginAttributes of this frame to
* the caller. This is used to store any attribute associated with the frame's
* docshell, such as the AppId.
*/
const DocShellOriginAttributes& OriginAttributesRef() const;
/**
- * Returns the origin associated with the tab (w/o suffix) if this tab owns
- * a signed packaged content.
- */
- const nsACString& SignedPkgOriginNoSuffix() const;
-
- /**
* Returns the presentation URL associated with the tab if this tab is
* created for presented content
*/
const nsAString& PresentationURL() const;
UIStateChangeType ShowAccelerators() const;
UIStateChangeType ShowFocusRings() const;
@@ -172,17 +166,16 @@ protected:
*/
bool SetTabContext(bool aIsMozBrowserElement,
bool aIsPrerendered,
mozIApplication* aOwnApp,
mozIApplication* aAppFrameOwnerApp,
UIStateChangeType aShowAccelerators,
UIStateChangeType aShowFocusRings,
const DocShellOriginAttributes& aOriginAttributes,
- const nsACString& aSignedPkgOriginNoSuffix,
const nsAString& aPresentationURL);
/**
* Modify this TabContext to match the given TabContext. This is a special
* case triggered by nsFrameLoader::SwapWithOtherRemoteLoader which may have
* caused the owner content to change.
*
* This special case only allows the field `mIsMozBrowserElement` to be
@@ -229,24 +222,16 @@ private:
uint32_t mContainingAppId;
/**
* DocShellOriginAttributes of the top level tab docShell
*/
DocShellOriginAttributes mOriginAttributes;
/**
- * The signed package origin without suffix. Since the signed packaged
- * web content is always loaded in a separate process, it makes sense
- * that we store this immutable value in TabContext. If the TabContext
- * doesn't own a signed package, this value would be empty.
- */
- nsCString mSignedPkgOriginNoSuffix;
-
- /**
* The requested presentation URL.
*/
nsString mPresentationURL;
/**
* Keyboard indicator state (focus rings, accelerators).
*/
UIStateChangeType mShowAccelerators;
@@ -269,27 +254,25 @@ public:
bool
SetTabContext(bool aIsMozBrowserElement,
bool aIsPrerendered,
mozIApplication* aOwnApp,
mozIApplication* aAppFrameOwnerApp,
UIStateChangeType aShowAccelerators,
UIStateChangeType aShowFocusRings,
const DocShellOriginAttributes& aOriginAttributes,
- const nsACString& aSignedPkgOriginNoSuffix = EmptyCString(),
const nsAString& aPresentationURL = EmptyString())
{
return TabContext::SetTabContext(aIsMozBrowserElement,
aIsPrerendered,
aOwnApp,
aAppFrameOwnerApp,
aShowAccelerators,
aShowFocusRings,
aOriginAttributes,
- aSignedPkgOriginNoSuffix,
aPresentationURL);
}
};
/**
* MaybeInvalidTabContext is a simple class that lets you transform an
* IPCTabContext into a TabContext.
*
--- a/dom/ipc/TabParent.cpp
+++ b/dom/ipc/TabParent.cpp
@@ -146,17 +146,16 @@ TabParent::TabParent(nsIContentParent* a
, mRounding(0)
, mDefaultScale(0)
, mUpdatedDimensions(false)
, mSizeMode(nsSizeMode_Normal)
, mManager(aManager)
, mDocShellIsActive(false)
, mMarkedDestroying(false)
, mIsDestroyed(false)
- , mIsDetached(true)
, mChromeFlags(aChromeFlags)
, mDragValid(false)
, mInitedByParent(false)
, mTabId(aTabId)
, mCreatingWindow(false)
, mCursor(nsCursor(-1))
, mTabSetsCursor(false)
, mHasContentOpener(false)
@@ -403,45 +402,16 @@ TabParent::Destroy()
ContentParent::NotifyTabDestroying(this->GetTabId(), Manager()->AsContentParent()->ChildID());
} else {
ContentParent::NotifyTabDestroying(this->GetTabId(), Manager()->ChildID());
}
mMarkedDestroying = true;
}
-void
-TabParent::Detach()
-{
- if (mIsDetached) {
- return;
- }
- RemoveWindowListeners();
- if (RenderFrameParent* frame = GetRenderFrame()) {
- RemoveTabParentFromTable(frame->GetLayersId());
- }
- mIsDetached = true;
-}
-
-void
-TabParent::Attach(nsFrameLoader* aFrameLoader)
-{
- MOZ_ASSERT(mIsDetached);
- if (!mIsDetached) {
- return;
- }
- Element* ownerElement = aFrameLoader->GetOwnerContent();
- SetOwnerElement(ownerElement);
- if (RenderFrameParent* frame = GetRenderFrame()) {
- AddTabParentToTable(frame->GetLayersId(), this);
- frame->OwnerContentChanged(ownerElement);
- }
- mIsDetached = false;
-}
-
bool
TabParent::RecvEnsureLayersConnected()
{
if (RenderFrameParent* frame = GetRenderFrame()) {
frame->EnsureLayersConnected();
}
return true;
}
--- a/dom/ipc/TabParent.h
+++ b/dom/ipc/TabParent.h
@@ -147,20 +147,16 @@ public:
already_AddRefed<nsILoadContext> GetLoadContext();
already_AddRefed<nsIWidget> GetTopLevelWidget();
nsIXULBrowserWindow* GetXULBrowserWindow();
void Destroy();
- void Detach();
-
- void Attach(nsFrameLoader* aFrameLoader);
-
void RemoveWindowListeners();
void AddWindowListeners();
void DidRefresh() override;
virtual bool RecvMoveFocus(const bool& aForward,
const bool& aForDocumentNavigation) override;
@@ -676,18 +672,16 @@ private:
void ApzAwareEventRoutingToChild(ScrollableLayerGuid* aOutTargetGuid,
uint64_t* aOutInputBlockId,
nsEventStatus* aOutApzResponse);
// When true, we've initiated normal shutdown and notified our managing PContent.
bool mMarkedDestroying;
// When true, the TabParent is invalid and we should not send IPC messages anymore.
bool mIsDestroyed;
- // When true, the TabParent is detached from the frame loader.
- bool mIsDetached;
uint32_t mChromeFlags;
nsTArray<nsTArray<IPCDataTransferItem>> mInitialDataTransferItems;
RefPtr<gfx::DataSourceSurface> mDnDVisualization;
bool mDragValid;
LayoutDeviceIntRect mDragRect;
--- a/dom/webidl/ChromeUtils.webidl
+++ b/dom/webidl/ChromeUtils.webidl
@@ -74,21 +74,19 @@ interface ChromeUtils : ThreadSafeChrome
* serialization, deserialization, and inheritance.
* (3) Update the methods on mozilla::OriginAttributesPattern, including matching.
*/
dictionary OriginAttributesDictionary {
unsigned long appId = 0;
unsigned long userContextId = 0;
boolean inIsolatedMozBrowser = false;
DOMString addonId = "";
- DOMString signedPkg = "";
unsigned long privateBrowsingId = 0;
DOMString firstPartyDomain = "";
};
dictionary OriginAttributesPatternDictionary {
unsigned long appId;
unsigned long userContextId;
boolean inIsolatedMozBrowser;
DOMString addonId;
- DOMString signedPkg;
unsigned long privateBrowsingId;
DOMString firstPartyDomain;
};
--- a/netwerk/ipc/NeckoParent.cpp
+++ b/netwerk/ipc/NeckoParent.cpp
@@ -186,33 +186,27 @@ NeckoParent::GetValidatedAppInfo(const S
}
// We may get appID=NO_APP if child frame is neither a browser nor an app
if (appId == NECKO_NO_APP_ID && tabContext.HasOwnApp()) {
// NECKO_NO_APP_ID but also is an app? Weird, skip.
debugString.Append("h,");
continue;
}
- if (!aSerialized.mOriginAttributes.mSignedPkg.IsEmpty() &&
- aSerialized.mOriginAttributes.mSignedPkg != tabContext.OriginAttributesRef().mSignedPkg) {
- debugString.Append("s,");
- continue;
- }
if (aSerialized.mOriginAttributes.mUserContextId != tabContext.OriginAttributesRef().mUserContextId) {
debugString.Append("(");
debugString.AppendInt(aSerialized.mOriginAttributes.mUserContextId);
debugString.Append(",");
debugString.AppendInt(tabContext.OriginAttributesRef().mUserContextId);
debugString.Append(")");
continue;
}
aAttrs = DocShellOriginAttributes();
aAttrs.mAppId = appId;
aAttrs.mInIsolatedMozBrowser = inBrowserElement;
- aAttrs.mSignedPkg = aSerialized.mOriginAttributes.mSignedPkg;
aAttrs.mUserContextId = aSerialized.mOriginAttributes.mUserContextId;
aAttrs.mPrivateBrowsingId = aSerialized.mOriginAttributes.mPrivateBrowsingId;
aAttrs.mFirstPartyDomain = aSerialized.mOriginAttributes.mFirstPartyDomain;
return nullptr;
}
// This may be a ServiceWorker: when a push notification is received, FF wakes