Bug 1633459 - Marshal customUserAgent setting via nsDocShell. r=geckoview-reviewers,esawin,nika
Reinstate customUserAgent interface for nsIDocShell. This is so it can be used as a choke-point to catch setting values on docshells which are in the process of changing process. We don't want to send changes which will be rejected on the parent side. This code should be removed once callers setting customUserAgent are refactored to only occur from parent process. Differential Revision: https://phabricator.services.mozilla.com/D75006
This commit is contained in:
@@ -2267,6 +2267,23 @@ nsDocShell::NameEquals(const nsAString& aName, bool* aResult) {
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsDocShell::GetCustomUserAgent(nsAString& aCustomUserAgent) {
|
||||
mBrowsingContext->GetCustomUserAgent(aCustomUserAgent);
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsDocShell::SetCustomUserAgent(const nsAString& aCustomUserAgent) {
|
||||
if (mWillChangeProcess) {
|
||||
NS_WARNING("SetCustomUserAgent: Process is changing. Ignoring set");
|
||||
return NS_ERROR_FAILURE;
|
||||
}
|
||||
|
||||
mBrowsingContext->SetCustomUserAgent(aCustomUserAgent);
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsDocShell::ClearCachedUserAgent() {
|
||||
RefPtr<nsGlobalWindowInner> win =
|
||||
|
||||
Reference in New Issue
Block a user