Bug 1631405 - Make sure we initialize all fields of WindowGlobalParent in the constructor. r=nika

Previously we only set some fields as part of WindowGlobalInit, but WindowGlobalParent sets itself as the current window global on the CanonicalBrowsingContext.

This exposes a period of time where only part of the document state was set, and this was observable to consumers.

This makes OnNewDocument only run when there is a new Document for the same WindowGlobal.

Differential Revision: https://phabricator.services.mozilla.com/D75446
This commit is contained in:
Matt Woodrow
2020-05-26 21:15:42 +00:00
parent c350d6b06e
commit 7af12cd372
14 changed files with 102 additions and 14 deletions

View File

@@ -16,6 +16,7 @@
#include "mozilla/dom/Promise.h"
#include "mozilla/dom/URL.h"
#include "mozilla/dom/WorkerPrivate.h"
#include "mozilla/dom/WindowContext.h"
#include "mozilla/Unused.h"
namespace mozilla {