Bug 1315302 - Remove signedPkg from origin attributes r=baku
MozReview-Commit-ID: L1xvRgeO6De
This commit is contained in:
@@ -106,7 +106,6 @@ const SESSION_DATA_OA = `
|
|||||||
"addonId": "",
|
"addonId": "",
|
||||||
"appId": 0,
|
"appId": 0,
|
||||||
"inIsolatedMozBrowser": false,
|
"inIsolatedMozBrowser": false,
|
||||||
"signedPkg": "",
|
|
||||||
"userContextId": 0
|
"userContextId": 0
|
||||||
}
|
}
|
||||||
}]
|
}]
|
||||||
|
|||||||
@@ -43,11 +43,6 @@ PrincipalOriginAttributes::InheritFromDocShellToDoc(const DocShellOriginAttribut
|
|||||||
// addonId is computed from the principal URI and never propagated
|
// addonId is computed from the principal URI and never propagated
|
||||||
mUserContextId = aAttrs.mUserContextId;
|
mUserContextId = aAttrs.mUserContextId;
|
||||||
|
|
||||||
// TODO:
|
|
||||||
// Bug 1225349 - PrincipalOriginAttributes should inherit mSignedPkg
|
|
||||||
// accordingly by URI
|
|
||||||
mSignedPkg = aAttrs.mSignedPkg;
|
|
||||||
|
|
||||||
mPrivateBrowsingId = aAttrs.mPrivateBrowsingId;
|
mPrivateBrowsingId = aAttrs.mPrivateBrowsingId;
|
||||||
mFirstPartyDomain = aAttrs.mFirstPartyDomain;
|
mFirstPartyDomain = aAttrs.mFirstPartyDomain;
|
||||||
}
|
}
|
||||||
@@ -60,7 +55,6 @@ PrincipalOriginAttributes::InheritFromNecko(const NeckoOriginAttributes& aAttrs)
|
|||||||
|
|
||||||
// addonId is computed from the principal URI and never propagated
|
// addonId is computed from the principal URI and never propagated
|
||||||
mUserContextId = aAttrs.mUserContextId;
|
mUserContextId = aAttrs.mUserContextId;
|
||||||
mSignedPkg = aAttrs.mSignedPkg;
|
|
||||||
|
|
||||||
mPrivateBrowsingId = aAttrs.mPrivateBrowsingId;
|
mPrivateBrowsingId = aAttrs.mPrivateBrowsingId;
|
||||||
mFirstPartyDomain = aAttrs.mFirstPartyDomain;
|
mFirstPartyDomain = aAttrs.mFirstPartyDomain;
|
||||||
@@ -82,11 +76,6 @@ DocShellOriginAttributes::InheritFromDocToChildDocShell(const PrincipalOriginAtt
|
|||||||
// addonId is computed from the principal URI and never propagated
|
// addonId is computed from the principal URI and never propagated
|
||||||
mUserContextId = aAttrs.mUserContextId;
|
mUserContextId = aAttrs.mUserContextId;
|
||||||
|
|
||||||
// TODO:
|
|
||||||
// Bug 1225353 - DocShell/NeckoOriginAttributes should inherit
|
|
||||||
// mSignedPkg accordingly by mSignedPkgInBrowser
|
|
||||||
mSignedPkg = aAttrs.mSignedPkg;
|
|
||||||
|
|
||||||
mPrivateBrowsingId = aAttrs.mPrivateBrowsingId;
|
mPrivateBrowsingId = aAttrs.mPrivateBrowsingId;
|
||||||
mFirstPartyDomain = aAttrs.mFirstPartyDomain;
|
mFirstPartyDomain = aAttrs.mFirstPartyDomain;
|
||||||
}
|
}
|
||||||
@@ -100,10 +89,6 @@ NeckoOriginAttributes::InheritFromDocToNecko(const PrincipalOriginAttributes& aA
|
|||||||
// addonId is computed from the principal URI and never propagated
|
// addonId is computed from the principal URI and never propagated
|
||||||
mUserContextId = aAttrs.mUserContextId;
|
mUserContextId = aAttrs.mUserContextId;
|
||||||
|
|
||||||
// TODO:
|
|
||||||
// Bug 1225353 - DocShell/NeckoOriginAttributes should inherit
|
|
||||||
// mSignedPkg accordingly by mSignedPkgInBrowser
|
|
||||||
|
|
||||||
mPrivateBrowsingId = aAttrs.mPrivateBrowsingId;
|
mPrivateBrowsingId = aAttrs.mPrivateBrowsingId;
|
||||||
mFirstPartyDomain = aAttrs.mFirstPartyDomain;
|
mFirstPartyDomain = aAttrs.mFirstPartyDomain;
|
||||||
}
|
}
|
||||||
@@ -119,10 +104,6 @@ NeckoOriginAttributes::InheritFromDocShellToNecko(const DocShellOriginAttributes
|
|||||||
// addonId is computed from the principal URI and never propagated
|
// addonId is computed from the principal URI and never propagated
|
||||||
mUserContextId = aAttrs.mUserContextId;
|
mUserContextId = aAttrs.mUserContextId;
|
||||||
|
|
||||||
// TODO:
|
|
||||||
// Bug 1225353 - DocShell/NeckoOriginAttributes should inherit
|
|
||||||
// mSignedPkg accordingly by mSignedPkgInBrowser
|
|
||||||
|
|
||||||
mPrivateBrowsingId = aAttrs.mPrivateBrowsingId;
|
mPrivateBrowsingId = aAttrs.mPrivateBrowsingId;
|
||||||
|
|
||||||
bool isFirstPartyEnabled = IsFirstPartyEnabled();
|
bool isFirstPartyEnabled = IsFirstPartyEnabled();
|
||||||
@@ -183,10 +164,6 @@ OriginAttributes::CreateSuffix(nsACString& aStr) const
|
|||||||
params->Set(NS_LITERAL_STRING("userContextId"), value);
|
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) {
|
if (mPrivateBrowsingId) {
|
||||||
value.Truncate();
|
value.Truncate();
|
||||||
@@ -269,12 +246,6 @@ public:
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (aName.EqualsLiteral("signedPkg")) {
|
|
||||||
MOZ_RELEASE_ASSERT(mOriginAttributes->mSignedPkg.IsEmpty());
|
|
||||||
mOriginAttributes->mSignedPkg.Assign(aValue);
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (aName.EqualsLiteral("privateBrowsingId")) {
|
if (aName.EqualsLiteral("privateBrowsingId")) {
|
||||||
nsresult rv;
|
nsresult rv;
|
||||||
int64_t val = aValue.ToInteger64(&rv);
|
int64_t val = aValue.ToInteger64(&rv);
|
||||||
@@ -349,7 +320,6 @@ OriginAttributes::SetFromGenericAttributes(const GenericOriginAttributes& aAttrs
|
|||||||
mInIsolatedMozBrowser = aAttrs.mInIsolatedMozBrowser;
|
mInIsolatedMozBrowser = aAttrs.mInIsolatedMozBrowser;
|
||||||
mAddonId = aAttrs.mAddonId;
|
mAddonId = aAttrs.mAddonId;
|
||||||
mUserContextId = aAttrs.mUserContextId;
|
mUserContextId = aAttrs.mUserContextId;
|
||||||
mSignedPkg = aAttrs.mSignedPkg;
|
|
||||||
mPrivateBrowsingId = aAttrs.mPrivateBrowsingId;
|
mPrivateBrowsingId = aAttrs.mPrivateBrowsingId;
|
||||||
mFirstPartyDomain = aAttrs.mFirstPartyDomain;
|
mFirstPartyDomain = aAttrs.mFirstPartyDomain;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -36,7 +36,6 @@ public:
|
|||||||
mInIsolatedMozBrowser == aOther.mInIsolatedMozBrowser &&
|
mInIsolatedMozBrowser == aOther.mInIsolatedMozBrowser &&
|
||||||
mAddonId == aOther.mAddonId &&
|
mAddonId == aOther.mAddonId &&
|
||||||
mUserContextId == aOther.mUserContextId &&
|
mUserContextId == aOther.mUserContextId &&
|
||||||
mSignedPkg == aOther.mSignedPkg &&
|
|
||||||
mPrivateBrowsingId == aOther.mPrivateBrowsingId &&
|
mPrivateBrowsingId == aOther.mPrivateBrowsingId &&
|
||||||
mFirstPartyDomain == aOther.mFirstPartyDomain;
|
mFirstPartyDomain == aOther.mFirstPartyDomain;
|
||||||
}
|
}
|
||||||
@@ -191,10 +190,6 @@ public:
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (mSignedPkg.WasPassed() && mSignedPkg.Value() != aAttrs.mSignedPkg) {
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (mPrivateBrowsingId.WasPassed() && mPrivateBrowsingId.Value() != aAttrs.mPrivateBrowsingId) {
|
if (mPrivateBrowsingId.WasPassed() && mPrivateBrowsingId.Value() != aAttrs.mPrivateBrowsingId) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
@@ -229,11 +224,6 @@ public:
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (mSignedPkg.WasPassed() && aOther.mSignedPkg.WasPassed() &&
|
|
||||||
mSignedPkg.Value() != aOther.mSignedPkg.Value()) {
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (mPrivateBrowsingId.WasPassed() && aOther.mPrivateBrowsingId.WasPassed() &&
|
if (mPrivateBrowsingId.WasPassed() && aOther.mPrivateBrowsingId.WasPassed() &&
|
||||||
mPrivateBrowsingId.Value() != aOther.mPrivateBrowsingId.Value()) {
|
mPrivateBrowsingId.Value() != aOther.mPrivateBrowsingId.Value()) {
|
||||||
return false;
|
return false;
|
||||||
|
|||||||
@@ -49,7 +49,6 @@ function printAttrs(name, attrs) {
|
|||||||
"\tuserContextId: " + attrs.userContextId + ",\n" +
|
"\tuserContextId: " + attrs.userContextId + ",\n" +
|
||||||
"\tinIsolatedMozBrowser: " + attrs.inIsolatedMozBrowser + ",\n" +
|
"\tinIsolatedMozBrowser: " + attrs.inIsolatedMozBrowser + ",\n" +
|
||||||
"\taddonId: '" + attrs.addonId + "',\n" +
|
"\taddonId: '" + attrs.addonId + "',\n" +
|
||||||
"\tsignedPkg: '" + attrs.signedPkg + "',\n" +
|
|
||||||
"\tprivateBrowsingId: '" + attrs.privateBrowsingId + "',\n" +
|
"\tprivateBrowsingId: '" + attrs.privateBrowsingId + "',\n" +
|
||||||
"\tfirstPartyDomain: '" + attrs.firstPartyDomain + "'\n}");
|
"\tfirstPartyDomain: '" + attrs.firstPartyDomain + "'\n}");
|
||||||
}
|
}
|
||||||
@@ -63,7 +62,6 @@ function checkValues(attrs, values) {
|
|||||||
do_check_eq(attrs.userContextId, values.userContextId || 0);
|
do_check_eq(attrs.userContextId, values.userContextId || 0);
|
||||||
do_check_eq(attrs.inIsolatedMozBrowser, values.inIsolatedMozBrowser || false);
|
do_check_eq(attrs.inIsolatedMozBrowser, values.inIsolatedMozBrowser || false);
|
||||||
do_check_eq(attrs.addonId, values.addonId || '');
|
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.privateBrowsingId, values.privateBrowsingId || '');
|
||||||
do_check_eq(attrs.firstPartyDomain, values.firstPartyDomain || '');
|
do_check_eq(attrs.firstPartyDomain, values.firstPartyDomain || '');
|
||||||
}
|
}
|
||||||
@@ -171,19 +169,6 @@ function run_test() {
|
|||||||
checkOriginAttributes(nullPrin_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');
|
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(null, {});
|
||||||
checkSandboxOriginAttributes('http://example.org', {});
|
checkSandboxOriginAttributes('http://example.org', {});
|
||||||
checkSandboxOriginAttributes('http://example.org', {}, {originAttributes: {}});
|
checkSandboxOriginAttributes('http://example.org', {}, {originAttributes: {}});
|
||||||
@@ -191,22 +176,6 @@ function run_test() {
|
|||||||
checkSandboxOriginAttributes(['http://example.org'], {});
|
checkSandboxOriginAttributes(['http://example.org'], {});
|
||||||
checkSandboxOriginAttributes(['http://example.org'], {}, {originAttributes: {}});
|
checkSandboxOriginAttributes(['http://example.org'], {}, {originAttributes: {}});
|
||||||
checkSandboxOriginAttributes(['http://example.org'], {appId: 42}, {originAttributes: {appId: 42}});
|
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.
|
// Check that all of the above are cross-origin.
|
||||||
checkCrossOrigin(exampleOrg_app, exampleOrg);
|
checkCrossOrigin(exampleOrg_app, exampleOrg);
|
||||||
@@ -222,9 +191,6 @@ function run_test() {
|
|||||||
checkCrossOrigin(exampleOrg_userContextAddon, exampleOrg);
|
checkCrossOrigin(exampleOrg_userContextAddon, exampleOrg);
|
||||||
checkCrossOrigin(exampleOrg_userContext, exampleOrg_userContextAddon);
|
checkCrossOrigin(exampleOrg_userContext, exampleOrg_userContextAddon);
|
||||||
checkCrossOrigin(exampleOrg_userContext, exampleOrg_userContextApp);
|
checkCrossOrigin(exampleOrg_userContext, exampleOrg_userContextApp);
|
||||||
checkCrossOrigin(exampleOrg_signedPkg, exampleOrg);
|
|
||||||
checkCrossOrigin(exampleOrg_signedPkg, exampleOrg_signedPkg_browser);
|
|
||||||
checkCrossOrigin(exampleOrg_signedPkg, exampleOrg_signedPkg_another);
|
|
||||||
|
|
||||||
// Check Principal kinds.
|
// Check Principal kinds.
|
||||||
function checkKind(prin, kind) {
|
function checkKind(prin, kind) {
|
||||||
@@ -255,7 +221,6 @@ function run_test() {
|
|||||||
[ "^addonId=fooBar", {addonId: "fooBar"} ],
|
[ "^addonId=fooBar", {addonId: "fooBar"} ],
|
||||||
[ "^inBrowser=1", {inIsolatedMozBrowser: true} ],
|
[ "^inBrowser=1", {inIsolatedMozBrowser: true} ],
|
||||||
[ "^firstPartyDomain=example.org", {firstPartyDomain: "example.org"} ],
|
[ "^firstPartyDomain=example.org", {firstPartyDomain: "example.org"} ],
|
||||||
[ "^signedPkg=bazQux", {signedPkg: "bazQux"} ],
|
|
||||||
[ "^appId=3&inBrowser=1&userContextId=6",
|
[ "^appId=3&inBrowser=1&userContextId=6",
|
||||||
{appId: 3, userContextId: 6, inIsolatedMozBrowser: true} ] ];
|
{appId: 3, userContextId: 6, inIsolatedMozBrowser: true} ] ];
|
||||||
|
|
||||||
|
|||||||
@@ -658,7 +658,6 @@ stubPackets.set("console.log('foobar', 'test')", {
|
|||||||
"firstPartyDomain": "",
|
"firstPartyDomain": "",
|
||||||
"inIsolatedMozBrowser": false,
|
"inIsolatedMozBrowser": false,
|
||||||
"privateBrowsingId": 0,
|
"privateBrowsingId": 0,
|
||||||
"signedPkg": "",
|
|
||||||
"userContextId": 0
|
"userContextId": 0
|
||||||
},
|
},
|
||||||
"private": false,
|
"private": false,
|
||||||
@@ -692,7 +691,6 @@ stubPackets.set("console.log(undefined)", {
|
|||||||
"firstPartyDomain": "",
|
"firstPartyDomain": "",
|
||||||
"inIsolatedMozBrowser": false,
|
"inIsolatedMozBrowser": false,
|
||||||
"privateBrowsingId": 0,
|
"privateBrowsingId": 0,
|
||||||
"signedPkg": "",
|
|
||||||
"userContextId": 0
|
"userContextId": 0
|
||||||
},
|
},
|
||||||
"private": false,
|
"private": false,
|
||||||
@@ -724,7 +722,6 @@ stubPackets.set("console.warn('danger, will robinson!')", {
|
|||||||
"firstPartyDomain": "",
|
"firstPartyDomain": "",
|
||||||
"inIsolatedMozBrowser": false,
|
"inIsolatedMozBrowser": false,
|
||||||
"privateBrowsingId": 0,
|
"privateBrowsingId": 0,
|
||||||
"signedPkg": "",
|
|
||||||
"userContextId": 0
|
"userContextId": 0
|
||||||
},
|
},
|
||||||
"private": false,
|
"private": false,
|
||||||
@@ -758,7 +755,6 @@ stubPackets.set("console.log(NaN)", {
|
|||||||
"firstPartyDomain": "",
|
"firstPartyDomain": "",
|
||||||
"inIsolatedMozBrowser": false,
|
"inIsolatedMozBrowser": false,
|
||||||
"privateBrowsingId": 0,
|
"privateBrowsingId": 0,
|
||||||
"signedPkg": "",
|
|
||||||
"userContextId": 0
|
"userContextId": 0
|
||||||
},
|
},
|
||||||
"private": false,
|
"private": false,
|
||||||
@@ -792,7 +788,6 @@ stubPackets.set("console.log(null)", {
|
|||||||
"firstPartyDomain": "",
|
"firstPartyDomain": "",
|
||||||
"inIsolatedMozBrowser": false,
|
"inIsolatedMozBrowser": false,
|
||||||
"privateBrowsingId": 0,
|
"privateBrowsingId": 0,
|
||||||
"signedPkg": "",
|
|
||||||
"userContextId": 0
|
"userContextId": 0
|
||||||
},
|
},
|
||||||
"private": false,
|
"private": false,
|
||||||
@@ -824,7 +819,6 @@ stubPackets.set("console.log('鼬')", {
|
|||||||
"firstPartyDomain": "",
|
"firstPartyDomain": "",
|
||||||
"inIsolatedMozBrowser": false,
|
"inIsolatedMozBrowser": false,
|
||||||
"privateBrowsingId": 0,
|
"privateBrowsingId": 0,
|
||||||
"signedPkg": "",
|
|
||||||
"userContextId": 0
|
"userContextId": 0
|
||||||
},
|
},
|
||||||
"private": false,
|
"private": false,
|
||||||
@@ -854,7 +848,6 @@ stubPackets.set("console.clear()", {
|
|||||||
"firstPartyDomain": "",
|
"firstPartyDomain": "",
|
||||||
"inIsolatedMozBrowser": false,
|
"inIsolatedMozBrowser": false,
|
||||||
"privateBrowsingId": 0,
|
"privateBrowsingId": 0,
|
||||||
"signedPkg": "",
|
|
||||||
"userContextId": 0
|
"userContextId": 0
|
||||||
},
|
},
|
||||||
"private": false,
|
"private": false,
|
||||||
@@ -889,7 +882,6 @@ stubPackets.set("console.count('bar')", {
|
|||||||
"firstPartyDomain": "",
|
"firstPartyDomain": "",
|
||||||
"inIsolatedMozBrowser": false,
|
"inIsolatedMozBrowser": false,
|
||||||
"privateBrowsingId": 0,
|
"privateBrowsingId": 0,
|
||||||
"signedPkg": "",
|
|
||||||
"userContextId": 0
|
"userContextId": 0
|
||||||
},
|
},
|
||||||
"private": false,
|
"private": false,
|
||||||
@@ -942,7 +934,6 @@ stubPackets.set("console.assert(false, {message: 'foobar'})", {
|
|||||||
"firstPartyDomain": "",
|
"firstPartyDomain": "",
|
||||||
"inIsolatedMozBrowser": false,
|
"inIsolatedMozBrowser": false,
|
||||||
"privateBrowsingId": 0,
|
"privateBrowsingId": 0,
|
||||||
"signedPkg": "",
|
|
||||||
"userContextId": 0
|
"userContextId": 0
|
||||||
},
|
},
|
||||||
"private": false,
|
"private": false,
|
||||||
@@ -983,7 +974,6 @@ stubPackets.set("console.log('hello \nfrom \rthe \"string world!')", {
|
|||||||
"firstPartyDomain": "",
|
"firstPartyDomain": "",
|
||||||
"inIsolatedMozBrowser": false,
|
"inIsolatedMozBrowser": false,
|
||||||
"privateBrowsingId": 0,
|
"privateBrowsingId": 0,
|
||||||
"signedPkg": "",
|
|
||||||
"userContextId": 0
|
"userContextId": 0
|
||||||
},
|
},
|
||||||
"private": false,
|
"private": false,
|
||||||
@@ -1015,7 +1005,6 @@ stubPackets.set("console.log('úṇĩçödê țĕșť')", {
|
|||||||
"firstPartyDomain": "",
|
"firstPartyDomain": "",
|
||||||
"inIsolatedMozBrowser": false,
|
"inIsolatedMozBrowser": false,
|
||||||
"privateBrowsingId": 0,
|
"privateBrowsingId": 0,
|
||||||
"signedPkg": "",
|
|
||||||
"userContextId": 0
|
"userContextId": 0
|
||||||
},
|
},
|
||||||
"private": false,
|
"private": false,
|
||||||
@@ -1059,7 +1048,6 @@ stubPackets.set("console.dirxml(window)", {
|
|||||||
"firstPartyDomain": "",
|
"firstPartyDomain": "",
|
||||||
"inIsolatedMozBrowser": false,
|
"inIsolatedMozBrowser": false,
|
||||||
"privateBrowsingId": 0,
|
"privateBrowsingId": 0,
|
||||||
"signedPkg": "",
|
|
||||||
"userContextId": 0
|
"userContextId": 0
|
||||||
},
|
},
|
||||||
"private": false,
|
"private": false,
|
||||||
@@ -1089,7 +1077,6 @@ stubPackets.set("console.trace()", {
|
|||||||
"firstPartyDomain": "",
|
"firstPartyDomain": "",
|
||||||
"inIsolatedMozBrowser": false,
|
"inIsolatedMozBrowser": false,
|
||||||
"privateBrowsingId": 0,
|
"privateBrowsingId": 0,
|
||||||
"signedPkg": "",
|
|
||||||
"userContextId": 0
|
"userContextId": 0
|
||||||
},
|
},
|
||||||
"private": false,
|
"private": false,
|
||||||
@@ -1144,7 +1131,6 @@ stubPackets.set("console.time('bar')", {
|
|||||||
"firstPartyDomain": "",
|
"firstPartyDomain": "",
|
||||||
"inIsolatedMozBrowser": false,
|
"inIsolatedMozBrowser": false,
|
||||||
"privateBrowsingId": 0,
|
"privateBrowsingId": 0,
|
||||||
"signedPkg": "",
|
|
||||||
"userContextId": 0
|
"userContextId": 0
|
||||||
},
|
},
|
||||||
"private": false,
|
"private": false,
|
||||||
@@ -1179,7 +1165,6 @@ stubPackets.set("console.timeEnd('bar')", {
|
|||||||
"firstPartyDomain": "",
|
"firstPartyDomain": "",
|
||||||
"inIsolatedMozBrowser": false,
|
"inIsolatedMozBrowser": false,
|
||||||
"privateBrowsingId": 0,
|
"privateBrowsingId": 0,
|
||||||
"signedPkg": "",
|
|
||||||
"userContextId": 0
|
"userContextId": 0
|
||||||
},
|
},
|
||||||
"private": false,
|
"private": false,
|
||||||
@@ -1214,7 +1199,6 @@ stubPackets.set("console.table('bar')", {
|
|||||||
"firstPartyDomain": "",
|
"firstPartyDomain": "",
|
||||||
"inIsolatedMozBrowser": false,
|
"inIsolatedMozBrowser": false,
|
||||||
"privateBrowsingId": 0,
|
"privateBrowsingId": 0,
|
||||||
"signedPkg": "",
|
|
||||||
"userContextId": 0
|
"userContextId": 0
|
||||||
},
|
},
|
||||||
"private": false,
|
"private": false,
|
||||||
@@ -1263,7 +1247,6 @@ stubPackets.set("console.table(['a', 'b', 'c'])", {
|
|||||||
"firstPartyDomain": "",
|
"firstPartyDomain": "",
|
||||||
"inIsolatedMozBrowser": false,
|
"inIsolatedMozBrowser": false,
|
||||||
"privateBrowsingId": 0,
|
"privateBrowsingId": 0,
|
||||||
"signedPkg": "",
|
|
||||||
"userContextId": 0
|
"userContextId": 0
|
||||||
},
|
},
|
||||||
"private": false,
|
"private": false,
|
||||||
@@ -1295,7 +1278,6 @@ stubPackets.set("console.group('bar')", {
|
|||||||
"firstPartyDomain": "",
|
"firstPartyDomain": "",
|
||||||
"inIsolatedMozBrowser": false,
|
"inIsolatedMozBrowser": false,
|
||||||
"privateBrowsingId": 0,
|
"privateBrowsingId": 0,
|
||||||
"signedPkg": "",
|
|
||||||
"userContextId": 0
|
"userContextId": 0
|
||||||
},
|
},
|
||||||
"private": false,
|
"private": false,
|
||||||
@@ -1327,7 +1309,6 @@ stubPackets.set("console.groupEnd('bar')", {
|
|||||||
"firstPartyDomain": "",
|
"firstPartyDomain": "",
|
||||||
"inIsolatedMozBrowser": false,
|
"inIsolatedMozBrowser": false,
|
||||||
"privateBrowsingId": 0,
|
"privateBrowsingId": 0,
|
||||||
"signedPkg": "",
|
|
||||||
"userContextId": 0
|
"userContextId": 0
|
||||||
},
|
},
|
||||||
"private": false,
|
"private": false,
|
||||||
@@ -1359,7 +1340,6 @@ stubPackets.set("console.groupCollapsed('foo')", {
|
|||||||
"firstPartyDomain": "",
|
"firstPartyDomain": "",
|
||||||
"inIsolatedMozBrowser": false,
|
"inIsolatedMozBrowser": false,
|
||||||
"privateBrowsingId": 0,
|
"privateBrowsingId": 0,
|
||||||
"signedPkg": "",
|
|
||||||
"userContextId": 0
|
"userContextId": 0
|
||||||
},
|
},
|
||||||
"private": false,
|
"private": false,
|
||||||
@@ -1391,7 +1371,6 @@ stubPackets.set("console.groupEnd('foo')", {
|
|||||||
"firstPartyDomain": "",
|
"firstPartyDomain": "",
|
||||||
"inIsolatedMozBrowser": false,
|
"inIsolatedMozBrowser": false,
|
||||||
"privateBrowsingId": 0,
|
"privateBrowsingId": 0,
|
||||||
"signedPkg": "",
|
|
||||||
"userContextId": 0
|
"userContextId": 0
|
||||||
},
|
},
|
||||||
"private": false,
|
"private": false,
|
||||||
@@ -1421,7 +1400,6 @@ stubPackets.set("console.group()", {
|
|||||||
"firstPartyDomain": "",
|
"firstPartyDomain": "",
|
||||||
"inIsolatedMozBrowser": false,
|
"inIsolatedMozBrowser": false,
|
||||||
"privateBrowsingId": 0,
|
"privateBrowsingId": 0,
|
||||||
"signedPkg": "",
|
|
||||||
"userContextId": 0
|
"userContextId": 0
|
||||||
},
|
},
|
||||||
"private": false,
|
"private": false,
|
||||||
@@ -1451,7 +1429,6 @@ stubPackets.set("console.groupEnd()", {
|
|||||||
"firstPartyDomain": "",
|
"firstPartyDomain": "",
|
||||||
"inIsolatedMozBrowser": false,
|
"inIsolatedMozBrowser": false,
|
||||||
"privateBrowsingId": 0,
|
"privateBrowsingId": 0,
|
||||||
"signedPkg": "",
|
|
||||||
"userContextId": 0
|
"userContextId": 0
|
||||||
},
|
},
|
||||||
"private": false,
|
"private": false,
|
||||||
@@ -1484,7 +1461,6 @@ stubPackets.set("console.log(%cfoobar)", {
|
|||||||
"firstPartyDomain": "",
|
"firstPartyDomain": "",
|
||||||
"inIsolatedMozBrowser": false,
|
"inIsolatedMozBrowser": false,
|
||||||
"privateBrowsingId": 0,
|
"privateBrowsingId": 0,
|
||||||
"signedPkg": "",
|
|
||||||
"userContextId": 0
|
"userContextId": 0
|
||||||
},
|
},
|
||||||
"private": false,
|
"private": false,
|
||||||
|
|||||||
@@ -178,7 +178,6 @@ ChromeUtils::IsOriginAttributesEqual(dom::GlobalObject& aGlobal,
|
|||||||
return aA.mAddonId == aB.mAddonId &&
|
return aA.mAddonId == aB.mAddonId &&
|
||||||
aA.mAppId == aB.mAppId &&
|
aA.mAppId == aB.mAppId &&
|
||||||
aA.mInIsolatedMozBrowser == aB.mInIsolatedMozBrowser &&
|
aA.mInIsolatedMozBrowser == aB.mInIsolatedMozBrowser &&
|
||||||
aA.mSignedPkg == aB.mSignedPkg &&
|
|
||||||
aA.mUserContextId == aB.mUserContextId &&
|
aA.mUserContextId == aB.mUserContextId &&
|
||||||
aA.mPrivateBrowsingId == aB.mPrivateBrowsingId;
|
aA.mPrivateBrowsingId == aB.mPrivateBrowsingId;
|
||||||
}
|
}
|
||||||
@@ -189,7 +188,6 @@ ChromeUtils::IsOriginAttributesEqualIgnoringAddonId(const dom::OriginAttributesD
|
|||||||
{
|
{
|
||||||
return aA.mAppId == aB.mAppId &&
|
return aA.mAppId == aB.mAppId &&
|
||||||
aA.mInIsolatedMozBrowser == aB.mInIsolatedMozBrowser &&
|
aA.mInIsolatedMozBrowser == aB.mInIsolatedMozBrowser &&
|
||||||
aA.mSignedPkg == aB.mSignedPkg &&
|
|
||||||
aA.mUserContextId == aB.mUserContextId &&
|
aA.mUserContextId == aB.mUserContextId &&
|
||||||
aA.mPrivateBrowsingId == aB.mPrivateBrowsingId;
|
aA.mPrivateBrowsingId == aB.mPrivateBrowsingId;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -328,30 +328,6 @@ nsFrameLoader::LoadURI(nsIURI* aURI)
|
|||||||
return rv;
|
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
|
NS_IMETHODIMP
|
||||||
nsFrameLoader::SetIsPrerendered()
|
nsFrameLoader::SetIsPrerendered()
|
||||||
{
|
{
|
||||||
@@ -3093,52 +3069,6 @@ nsFrameLoader::SetRemoteBrowser(nsITabParent* aTabParent)
|
|||||||
ShowRemoteFrame(ScreenIntSize(0, 0));
|
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
|
void
|
||||||
nsFrameLoader::SetDetachedSubdocFrame(nsIFrame* aDetachedFrame,
|
nsFrameLoader::SetDetachedSubdocFrame(nsIFrame* aDetachedFrame,
|
||||||
nsIDocument* aContainerDoc)
|
nsIDocument* aContainerDoc)
|
||||||
@@ -3462,8 +3392,7 @@ nsFrameLoader::MaybeUpdatePrimaryTabParent(TabParentChange aChange)
|
|||||||
|
|
||||||
nsresult
|
nsresult
|
||||||
nsFrameLoader::GetNewTabContext(MutableTabContext* aTabContext,
|
nsFrameLoader::GetNewTabContext(MutableTabContext* aTabContext,
|
||||||
nsIURI* aURI,
|
nsIURI* aURI)
|
||||||
const nsACString& aPackageId)
|
|
||||||
{
|
{
|
||||||
nsCOMPtr<mozIApplication> ownApp = GetOwnApp();
|
nsCOMPtr<mozIApplication> ownApp = GetOwnApp();
|
||||||
nsCOMPtr<mozIApplication> containingApp = GetContainingApp();
|
nsCOMPtr<mozIApplication> containingApp = GetContainingApp();
|
||||||
@@ -3471,13 +3400,6 @@ nsFrameLoader::GetNewTabContext(MutableTabContext* aTabContext,
|
|||||||
attrs.mInIsolatedMozBrowser = OwnerIsIsolatedMozBrowserFrame();
|
attrs.mInIsolatedMozBrowser = OwnerIsIsolatedMozBrowserFrame();
|
||||||
nsresult rv;
|
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
|
// Get the AppId from ownApp
|
||||||
uint32_t appId = nsIScriptSecurityManager::NO_APP_ID;
|
uint32_t appId = nsIScriptSecurityManager::NO_APP_ID;
|
||||||
if (ownApp) {
|
if (ownApp) {
|
||||||
@@ -3491,9 +3413,6 @@ nsFrameLoader::GetNewTabContext(MutableTabContext* aTabContext,
|
|||||||
}
|
}
|
||||||
attrs.mAppId = appId;
|
attrs.mAppId = appId;
|
||||||
|
|
||||||
// Populate packageId to signedPkg.
|
|
||||||
attrs.mSignedPkg = NS_ConvertUTF8toUTF16(aPackageId);
|
|
||||||
|
|
||||||
// set the userContextId on the attrs before we pass them into
|
// set the userContextId on the attrs before we pass them into
|
||||||
// the tab context
|
// the tab context
|
||||||
rv = PopulateUserContextIdFromAttribute(attrs);
|
rv = PopulateUserContextIdFromAttribute(attrs);
|
||||||
@@ -3532,7 +3451,6 @@ nsFrameLoader::GetNewTabContext(MutableTabContext* aTabContext,
|
|||||||
showAccelerators,
|
showAccelerators,
|
||||||
showFocusRings,
|
showFocusRings,
|
||||||
attrs,
|
attrs,
|
||||||
signedPkgOrigin,
|
|
||||||
presentationURLStr);
|
presentationURLStr);
|
||||||
NS_ENSURE_STATE(tabContextUpdated);
|
NS_ENSURE_STATE(tabContextUpdated);
|
||||||
|
|
||||||
|
|||||||
@@ -190,8 +190,6 @@ public:
|
|||||||
*/
|
*/
|
||||||
void SetRemoteBrowser(nsITabParent* aTabParent);
|
void SetRemoteBrowser(nsITabParent* aTabParent);
|
||||||
|
|
||||||
nsresult SwapRemoteBrowser(nsITabParent* aTabParent);
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Stashes a detached nsIFrame on the frame loader. We do this when we're
|
* Stashes a detached nsIFrame on the frame loader. We do this when we're
|
||||||
* destroying the nsSubDocumentFrame. If the nsSubdocumentFrame is
|
* destroying the nsSubDocumentFrame. If the nsSubdocumentFrame is
|
||||||
@@ -327,8 +325,7 @@ private:
|
|||||||
void DestroyBrowserFrameScripts();
|
void DestroyBrowserFrameScripts();
|
||||||
|
|
||||||
nsresult GetNewTabContext(mozilla::dom::MutableTabContext* aTabContext,
|
nsresult GetNewTabContext(mozilla::dom::MutableTabContext* aTabContext,
|
||||||
nsIURI* aURI = nullptr,
|
nsIURI* aURI = nullptr);
|
||||||
const nsACString& aPackageId = EmptyCString());
|
|
||||||
|
|
||||||
enum TabParentChange {
|
enum TabParentChange {
|
||||||
eTabParentRemoved,
|
eTabParentRemoved,
|
||||||
|
|||||||
@@ -54,15 +54,6 @@ interface nsIFrameLoader : nsISupports
|
|||||||
*/
|
*/
|
||||||
void loadURI(in nsIURI aURI);
|
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.
|
* Puts the frameloader in prerendering mode.
|
||||||
*/
|
*/
|
||||||
|
|||||||
@@ -651,8 +651,6 @@ skip-if = toolkit == 'android' || e10s # showmodaldialog
|
|||||||
[test_fileapi.html]
|
[test_fileapi.html]
|
||||||
[test_fileapi_slice.html]
|
[test_fileapi_slice.html]
|
||||||
skip-if = (toolkit == 'android') # Android: Bug 775227
|
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_getAttribute_after_createAttribute.html]
|
||||||
[test_getElementById.html]
|
[test_getElementById.html]
|
||||||
[test_getTranslationNodes.html]
|
[test_getTranslationNodes.html]
|
||||||
|
|||||||
@@ -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>
|
|
||||||
@@ -42,11 +42,6 @@ struct FrameIPCTabContext
|
|||||||
// The ID of the app containing this app/browser frame, if applicable.
|
// The ID of the app containing this app/browser frame, if applicable.
|
||||||
uint32_t frameOwnerAppId;
|
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
|
// Whether this is a mozbrowser frame. <iframe mozbrowser mozapp> and
|
||||||
// <xul:browser> are not considered to be mozbrowser frames.
|
// <xul:browser> are not considered to be mozbrowser frames.
|
||||||
bool isMozBrowserElement;
|
bool isMozBrowserElement;
|
||||||
|
|||||||
@@ -177,8 +177,7 @@ TabContext::UpdateTabContextAfterSwap(const TabContext& aContext)
|
|||||||
// must match for the change to be accepted.
|
// must match for the change to be accepted.
|
||||||
if (aContext.OwnAppId() != OwnAppId() ||
|
if (aContext.OwnAppId() != OwnAppId() ||
|
||||||
aContext.mContainingAppId != mContainingAppId ||
|
aContext.mContainingAppId != mContainingAppId ||
|
||||||
aContext.mOriginAttributes != mOriginAttributes ||
|
aContext.mOriginAttributes != mOriginAttributes) {
|
||||||
aContext.mSignedPkgOriginNoSuffix != mSignedPkgOriginNoSuffix) {
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -192,12 +191,6 @@ TabContext::OriginAttributesRef() const
|
|||||||
return mOriginAttributes;
|
return mOriginAttributes;
|
||||||
}
|
}
|
||||||
|
|
||||||
const nsACString&
|
|
||||||
TabContext::SignedPkgOriginNoSuffix() const
|
|
||||||
{
|
|
||||||
return mSignedPkgOriginNoSuffix;
|
|
||||||
}
|
|
||||||
|
|
||||||
const nsAString&
|
const nsAString&
|
||||||
TabContext::PresentationURL() const
|
TabContext::PresentationURL() const
|
||||||
{
|
{
|
||||||
@@ -224,7 +217,6 @@ TabContext::SetTabContext(bool aIsMozBrowserElement,
|
|||||||
UIStateChangeType aShowAccelerators,
|
UIStateChangeType aShowAccelerators,
|
||||||
UIStateChangeType aShowFocusRings,
|
UIStateChangeType aShowFocusRings,
|
||||||
const DocShellOriginAttributes& aOriginAttributes,
|
const DocShellOriginAttributes& aOriginAttributes,
|
||||||
const nsACString& aSignedPkgOriginNoSuffix,
|
|
||||||
const nsAString& aPresentationURL)
|
const nsAString& aPresentationURL)
|
||||||
{
|
{
|
||||||
NS_ENSURE_FALSE(mInitialized, false);
|
NS_ENSURE_FALSE(mInitialized, false);
|
||||||
@@ -257,7 +249,6 @@ TabContext::SetTabContext(bool aIsMozBrowserElement,
|
|||||||
mContainingAppId = containingAppId;
|
mContainingAppId = containingAppId;
|
||||||
mOwnApp = aOwnApp;
|
mOwnApp = aOwnApp;
|
||||||
mContainingApp = aAppFrameOwnerApp;
|
mContainingApp = aAppFrameOwnerApp;
|
||||||
mSignedPkgOriginNoSuffix = aSignedPkgOriginNoSuffix;
|
|
||||||
mPresentationURL = aPresentationURL;
|
mPresentationURL = aPresentationURL;
|
||||||
mShowAccelerators = aShowAccelerators;
|
mShowAccelerators = aShowAccelerators;
|
||||||
mShowFocusRings = aShowFocusRings;
|
mShowFocusRings = aShowFocusRings;
|
||||||
@@ -269,7 +260,6 @@ TabContext::AsIPCTabContext() const
|
|||||||
{
|
{
|
||||||
return IPCTabContext(FrameIPCTabContext(mOriginAttributes,
|
return IPCTabContext(FrameIPCTabContext(mOriginAttributes,
|
||||||
mContainingAppId,
|
mContainingAppId,
|
||||||
mSignedPkgOriginNoSuffix,
|
|
||||||
mIsMozBrowserElement,
|
mIsMozBrowserElement,
|
||||||
mIsPrerendered,
|
mIsPrerendered,
|
||||||
mPresentationURL,
|
mPresentationURL,
|
||||||
@@ -296,7 +286,6 @@ MaybeInvalidTabContext::MaybeInvalidTabContext(const IPCTabContext& aParams)
|
|||||||
bool isPrerendered = false;
|
bool isPrerendered = false;
|
||||||
uint32_t containingAppId = NO_APP_ID;
|
uint32_t containingAppId = NO_APP_ID;
|
||||||
DocShellOriginAttributes originAttributes;
|
DocShellOriginAttributes originAttributes;
|
||||||
nsAutoCString signedPkgOriginNoSuffix;
|
|
||||||
nsAutoString presentationURL;
|
nsAutoString presentationURL;
|
||||||
UIStateChangeType showAccelerators = UIStateChangeType_NoChange;
|
UIStateChangeType showAccelerators = UIStateChangeType_NoChange;
|
||||||
UIStateChangeType showFocusRings = UIStateChangeType_NoChange;
|
UIStateChangeType showFocusRings = UIStateChangeType_NoChange;
|
||||||
@@ -360,7 +349,6 @@ MaybeInvalidTabContext::MaybeInvalidTabContext(const IPCTabContext& aParams)
|
|||||||
isMozBrowserElement = ipcContext.isMozBrowserElement();
|
isMozBrowserElement = ipcContext.isMozBrowserElement();
|
||||||
isPrerendered = ipcContext.isPrerendered();
|
isPrerendered = ipcContext.isPrerendered();
|
||||||
containingAppId = ipcContext.frameOwnerAppId();
|
containingAppId = ipcContext.frameOwnerAppId();
|
||||||
signedPkgOriginNoSuffix = ipcContext.signedPkgOriginNoSuffix();
|
|
||||||
presentationURL = ipcContext.presentationURL();
|
presentationURL = ipcContext.presentationURL();
|
||||||
showAccelerators = ipcContext.showAccelerators();
|
showAccelerators = ipcContext.showAccelerators();
|
||||||
showFocusRings = ipcContext.showFocusRings();
|
showFocusRings = ipcContext.showFocusRings();
|
||||||
@@ -414,7 +402,6 @@ MaybeInvalidTabContext::MaybeInvalidTabContext(const IPCTabContext& aParams)
|
|||||||
showAccelerators,
|
showAccelerators,
|
||||||
showFocusRings,
|
showFocusRings,
|
||||||
originAttributes,
|
originAttributes,
|
||||||
signedPkgOriginNoSuffix,
|
|
||||||
presentationURL);
|
presentationURL);
|
||||||
if (!rv) {
|
if (!rv) {
|
||||||
mInvalidReason = "Couldn't initialize TabContext.";
|
mInvalidReason = "Couldn't initialize TabContext.";
|
||||||
|
|||||||
@@ -126,12 +126,6 @@ public:
|
|||||||
*/
|
*/
|
||||||
const DocShellOriginAttributes& OriginAttributesRef() const;
|
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
|
* Returns the presentation URL associated with the tab if this tab is
|
||||||
* created for presented content
|
* created for presented content
|
||||||
@@ -177,7 +171,6 @@ protected:
|
|||||||
UIStateChangeType aShowAccelerators,
|
UIStateChangeType aShowAccelerators,
|
||||||
UIStateChangeType aShowFocusRings,
|
UIStateChangeType aShowFocusRings,
|
||||||
const DocShellOriginAttributes& aOriginAttributes,
|
const DocShellOriginAttributes& aOriginAttributes,
|
||||||
const nsACString& aSignedPkgOriginNoSuffix,
|
|
||||||
const nsAString& aPresentationURL);
|
const nsAString& aPresentationURL);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -233,14 +226,6 @@ private:
|
|||||||
*/
|
*/
|
||||||
DocShellOriginAttributes mOriginAttributes;
|
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.
|
* The requested presentation URL.
|
||||||
*/
|
*/
|
||||||
@@ -274,7 +259,6 @@ public:
|
|||||||
UIStateChangeType aShowAccelerators,
|
UIStateChangeType aShowAccelerators,
|
||||||
UIStateChangeType aShowFocusRings,
|
UIStateChangeType aShowFocusRings,
|
||||||
const DocShellOriginAttributes& aOriginAttributes,
|
const DocShellOriginAttributes& aOriginAttributes,
|
||||||
const nsACString& aSignedPkgOriginNoSuffix = EmptyCString(),
|
|
||||||
const nsAString& aPresentationURL = EmptyString())
|
const nsAString& aPresentationURL = EmptyString())
|
||||||
{
|
{
|
||||||
return TabContext::SetTabContext(aIsMozBrowserElement,
|
return TabContext::SetTabContext(aIsMozBrowserElement,
|
||||||
@@ -284,7 +268,6 @@ public:
|
|||||||
aShowAccelerators,
|
aShowAccelerators,
|
||||||
aShowFocusRings,
|
aShowFocusRings,
|
||||||
aOriginAttributes,
|
aOriginAttributes,
|
||||||
aSignedPkgOriginNoSuffix,
|
|
||||||
aPresentationURL);
|
aPresentationURL);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -151,7 +151,6 @@ TabParent::TabParent(nsIContentParent* aManager,
|
|||||||
, mDocShellIsActive(false)
|
, mDocShellIsActive(false)
|
||||||
, mMarkedDestroying(false)
|
, mMarkedDestroying(false)
|
||||||
, mIsDestroyed(false)
|
, mIsDestroyed(false)
|
||||||
, mIsDetached(true)
|
|
||||||
, mChromeFlags(aChromeFlags)
|
, mChromeFlags(aChromeFlags)
|
||||||
, mDragValid(false)
|
, mDragValid(false)
|
||||||
, mInitedByParent(false)
|
, mInitedByParent(false)
|
||||||
@@ -408,35 +407,6 @@ TabParent::Destroy()
|
|||||||
mMarkedDestroying = true;
|
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
|
bool
|
||||||
TabParent::RecvEnsureLayersConnected()
|
TabParent::RecvEnsureLayersConnected()
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -152,10 +152,6 @@ public:
|
|||||||
|
|
||||||
void Destroy();
|
void Destroy();
|
||||||
|
|
||||||
void Detach();
|
|
||||||
|
|
||||||
void Attach(nsFrameLoader* aFrameLoader);
|
|
||||||
|
|
||||||
void RemoveWindowListeners();
|
void RemoveWindowListeners();
|
||||||
|
|
||||||
void AddWindowListeners();
|
void AddWindowListeners();
|
||||||
@@ -681,8 +677,6 @@ private:
|
|||||||
bool mMarkedDestroying;
|
bool mMarkedDestroying;
|
||||||
// When true, the TabParent is invalid and we should not send IPC messages anymore.
|
// When true, the TabParent is invalid and we should not send IPC messages anymore.
|
||||||
bool mIsDestroyed;
|
bool mIsDestroyed;
|
||||||
// When true, the TabParent is detached from the frame loader.
|
|
||||||
bool mIsDetached;
|
|
||||||
|
|
||||||
uint32_t mChromeFlags;
|
uint32_t mChromeFlags;
|
||||||
|
|
||||||
|
|||||||
@@ -79,7 +79,6 @@ dictionary OriginAttributesDictionary {
|
|||||||
unsigned long userContextId = 0;
|
unsigned long userContextId = 0;
|
||||||
boolean inIsolatedMozBrowser = false;
|
boolean inIsolatedMozBrowser = false;
|
||||||
DOMString addonId = "";
|
DOMString addonId = "";
|
||||||
DOMString signedPkg = "";
|
|
||||||
unsigned long privateBrowsingId = 0;
|
unsigned long privateBrowsingId = 0;
|
||||||
DOMString firstPartyDomain = "";
|
DOMString firstPartyDomain = "";
|
||||||
};
|
};
|
||||||
@@ -88,7 +87,6 @@ dictionary OriginAttributesPatternDictionary {
|
|||||||
unsigned long userContextId;
|
unsigned long userContextId;
|
||||||
boolean inIsolatedMozBrowser;
|
boolean inIsolatedMozBrowser;
|
||||||
DOMString addonId;
|
DOMString addonId;
|
||||||
DOMString signedPkg;
|
|
||||||
unsigned long privateBrowsingId;
|
unsigned long privateBrowsingId;
|
||||||
DOMString firstPartyDomain;
|
DOMString firstPartyDomain;
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -191,11 +191,6 @@ NeckoParent::GetValidatedAppInfo(const SerializedLoadContext& aSerialized,
|
|||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!aSerialized.mOriginAttributes.mSignedPkg.IsEmpty() &&
|
|
||||||
aSerialized.mOriginAttributes.mSignedPkg != tabContext.OriginAttributesRef().mSignedPkg) {
|
|
||||||
debugString.Append("s,");
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
if (aSerialized.mOriginAttributes.mUserContextId != tabContext.OriginAttributesRef().mUserContextId) {
|
if (aSerialized.mOriginAttributes.mUserContextId != tabContext.OriginAttributesRef().mUserContextId) {
|
||||||
debugString.Append("(");
|
debugString.Append("(");
|
||||||
debugString.AppendInt(aSerialized.mOriginAttributes.mUserContextId);
|
debugString.AppendInt(aSerialized.mOriginAttributes.mUserContextId);
|
||||||
@@ -207,7 +202,6 @@ NeckoParent::GetValidatedAppInfo(const SerializedLoadContext& aSerialized,
|
|||||||
aAttrs = DocShellOriginAttributes();
|
aAttrs = DocShellOriginAttributes();
|
||||||
aAttrs.mAppId = appId;
|
aAttrs.mAppId = appId;
|
||||||
aAttrs.mInIsolatedMozBrowser = inBrowserElement;
|
aAttrs.mInIsolatedMozBrowser = inBrowserElement;
|
||||||
aAttrs.mSignedPkg = aSerialized.mOriginAttributes.mSignedPkg;
|
|
||||||
aAttrs.mUserContextId = aSerialized.mOriginAttributes.mUserContextId;
|
aAttrs.mUserContextId = aSerialized.mOriginAttributes.mUserContextId;
|
||||||
aAttrs.mPrivateBrowsingId = aSerialized.mOriginAttributes.mPrivateBrowsingId;
|
aAttrs.mPrivateBrowsingId = aSerialized.mOriginAttributes.mPrivateBrowsingId;
|
||||||
aAttrs.mFirstPartyDomain = aSerialized.mOriginAttributes.mFirstPartyDomain;
|
aAttrs.mFirstPartyDomain = aSerialized.mOriginAttributes.mFirstPartyDomain;
|
||||||
|
|||||||
Reference in New Issue
Block a user