mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-11-24 13:21:05 +00:00
Bug 1540170 - don't use history for windowless browsers, r=farre
Differential Revision: https://phabricator.services.mozilla.com/D25587 --HG-- extra : rebase_source : ec367a840c573caa5eadc8332e4137023d735c35
This commit is contained in:
parent
c6d20be462
commit
750ee88f29
@ -102,7 +102,8 @@ nsIWidget* nsWebBrowser::EnsureWidget() {
|
||||
already_AddRefed<nsWebBrowser> nsWebBrowser::Create(
|
||||
nsIWebBrowserChrome* aContainerWindow, nsIWidget* aParentWidget,
|
||||
const OriginAttributes& aOriginAttributes,
|
||||
dom::BrowsingContext* aBrowsingContext) {
|
||||
dom::BrowsingContext* aBrowsingContext,
|
||||
bool aDisableHistory /* = false */) {
|
||||
RefPtr<nsWebBrowser> browser = new nsWebBrowser(
|
||||
aBrowsingContext->IsContent() ? typeContentWrapper : typeChromeWrapper);
|
||||
|
||||
@ -152,7 +153,7 @@ already_AddRefed<nsWebBrowser> nsWebBrowser::Create(
|
||||
|
||||
docShell->InitSessionHistory();
|
||||
|
||||
if (XRE_IsParentProcess()) {
|
||||
if (XRE_IsParentProcess() && !aDisableHistory) {
|
||||
// Hook up global history. Do not fail if we can't - just warn.
|
||||
DebugOnly<nsresult> rv =
|
||||
browser->EnableGlobalHistory(browser->mShouldEnableHistory);
|
||||
|
@ -108,7 +108,8 @@ class nsWebBrowser final : public nsIWebBrowser,
|
||||
static already_AddRefed<nsWebBrowser> Create(
|
||||
nsIWebBrowserChrome* aContainerWindow, nsIWidget* aParentWidget,
|
||||
const mozilla::OriginAttributes& aOriginAttributes,
|
||||
mozilla::dom::BrowsingContext* aBrowsingContext);
|
||||
mozilla::dom::BrowsingContext* aBrowsingContext,
|
||||
bool aDisableHistory = false);
|
||||
|
||||
protected:
|
||||
virtual ~nsWebBrowser();
|
||||
|
@ -495,7 +495,8 @@ nsAppShellService::CreateWindowlessBrowser(bool aIsChrome,
|
||||
* an associated doc shell, which is what we're interested in.
|
||||
*/
|
||||
nsCOMPtr<nsIWebBrowser> browser =
|
||||
nsWebBrowser::Create(stub, widget, OriginAttributes(), browsingContext);
|
||||
nsWebBrowser::Create(stub, widget, OriginAttributes(), browsingContext,
|
||||
true /* disable history */);
|
||||
|
||||
if (NS_WARN_IF(!browser)) {
|
||||
NS_ERROR("Couldn't create instance of nsWebBrowser!");
|
||||
|
Loading…
Reference in New Issue
Block a user