Backed out changeset 6d39aab86966 (bug 1633710) for failure at test_disabled_hosts.js. CLOSED TREE

This commit is contained in:
Butkovits Atila 2020-08-05 22:19:30 +03:00
Родитель 93a956852c
Коммит a24ad1c55b
9 изменённых файлов: 9 добавлений и 66 удалений

Просмотреть файл

@ -51,7 +51,7 @@ export default class CompletionErrorPage extends HandleEventMixin(
}
let { request } = this.requestStore.getState();
let { displayHost } = request.topLevelPrincipal;
let { displayHost } = request.topLevelPrincipal.URI;
for (let key of [
"pageTitle",
"suggestion-heading",

Просмотреть файл

@ -514,7 +514,7 @@ export default class PaymentDialog extends HandleEventMixin(
render(state) {
let request = state.request;
let paymentDetails = request.paymentDetails;
this._hostNameEl.textContent = request.topLevelPrincipal.displayHost;
this._hostNameEl.textContent = request.topLevelPrincipal.URI.displayHost;
let displayItems = request.paymentDetails.displayItems || [];
let additionalItems = this._getAdditionalDisplayItems(state);

Просмотреть файл

@ -62,7 +62,7 @@ add_task(async function test_no_values() {
});
await asyncElementRendered();
is(page.requestStore.getState().request.topLevelPrincipal.displayHost, displayHost,
is(page.requestStore.getState().request.topLevelPrincipal.URI.displayHost, displayHost,
"State should have the displayHost set properly");
is(page.querySelector("h2").textContent,
`Oh noes! ${displayHost} is having an issue`,

Просмотреть файл

@ -801,38 +801,6 @@ BasePrincipal::GetExposableSpec(nsACString& aSpec) {
return clone->GetAsciiSpec(aSpec);
}
NS_IMETHODIMP
BasePrincipal::GetDisplaySpec(nsACString& aSpec) {
aSpec.Truncate();
nsCOMPtr<nsIURI> prinURI;
nsresult rv = GetURI(getter_AddRefs(prinURI));
if (NS_FAILED(rv) || !prinURI) {
return NS_OK;
}
return prinURI->GetDisplaySpec(aSpec);
}
NS_IMETHODIMP
BasePrincipal::GetDisplayHost(nsACString& aHost) {
aHost.Truncate();
nsCOMPtr<nsIURI> prinURI;
nsresult rv = GetURI(getter_AddRefs(prinURI));
if (NS_FAILED(rv) || !prinURI) {
return NS_OK;
}
return prinURI->GetDisplayHost(aHost);
}
NS_IMETHODIMP
BasePrincipal::GetDisplayPrePath(nsACString& aPrepath) {
aPrepath.Truncate();
nsCOMPtr<nsIURI> prinURI;
nsresult rv = GetURI(getter_AddRefs(prinURI));
if (NS_FAILED(rv) || !prinURI) {
return NS_OK;
}
return prinURI->GetDisplayPrePath(aPrepath);
}
NS_IMETHODIMP
BasePrincipal::GetPrepath(nsACString& aPath) {
aPath.Truncate();

Просмотреть файл

@ -134,9 +134,6 @@ class BasePrincipal : public nsJSPrincipals {
NS_IMETHOD GetSpec(nsACString& aSpec) override;
NS_IMETHOD GetExposablePrePath(nsACString& aResult) override;
NS_IMETHOD GetExposableSpec(nsACString& aSpec) override;
NS_IMETHOD GetDisplaySpec(nsACString& aSpec) override;
NS_IMETHOD GetDisplayHost(nsACString& aSpec) override;
NS_IMETHOD GetDisplayPrePath(nsACString& aSpec) override;
NS_IMETHOD GetHostPort(nsACString& aRes) override;
NS_IMETHOD GetHost(nsACString& aRes) override;
NS_IMETHOD GetPrepath(nsACString& aResult) override;

Просмотреть файл

@ -298,28 +298,6 @@ interface nsIPrincipal : nsISerializable
*/
readonly attribute ACString exposableSpec;
/**
* Returns the same as calling .spec, only with a UTF8 encoded hostname
* if that hostname doesn't contain blacklisted characters, and
* the network.IDN_show_punycode pref is false
*/
readonly attribute ACString displaySpec;
/**
* Returns the same as calling .host, only with a UTF8 encoded hostname
* if that hostname doesn't contain blacklisted characters, and
* the network.IDN_show_punycode pref is false
*/
readonly attribute ACString displayHost;
/**
* Returns the same as calling .prepath, only with a UTF8 encoded hostname
* if that hostname doesn't contain blacklisted characters, and
* the network.IDN_show_punycode pref is false
*/
readonly attribute ACString displayPrePath;
/**
* Return the scheme of the principals URI
*/

Просмотреть файл

@ -253,7 +253,7 @@ class GeckoViewPermission {
dispatcher
.sendRequestForResult({
type: "GeckoView:ContentPermission",
uri: aRequest.principal.displaySpec,
uri: aRequest.principal.URI.displaySpec,
perm: perm.type,
})
.then(granted => {

Просмотреть файл

@ -27,16 +27,16 @@ const LoadURIDelegate = {
return false;
}
const triggerUri = aTriggeringPrincipal.isNullPrincipal
? null
: aTriggeringPrincipal.displaySpec;
const triggerUri =
aTriggeringPrincipal &&
(aTriggeringPrincipal.isNullPrincipal ? null : aTriggeringPrincipal.URI);
const message = {
type: "GeckoView:OnLoadRequest",
uri: aUri ? aUri.displaySpec : "",
where: aWhere,
flags: aFlags,
triggerUri,
triggerUri: triggerUri && triggerUri.displaySpec,
hasUserGesture: aWindow.document.hasValidTransientUserGestureActivation,
};

Просмотреть файл

@ -460,7 +460,7 @@ LoginManager.prototype = {
perm.type == PERMISSION_SAVE_LOGINS &&
perm.capability == Services.perms.DENY_ACTION
) {
disabledHosts.push(perm.principal.displayPrePath);
disabledHosts.push(perm.principal.URI.displayPrePath);
}
}