Bug 1579213 - Remove unused fields from ChangeRemoteness API, r=farre

This patch changes a few things about how nsFrameLoader is created, specifically
around the ChangeRemoteness API.

1. The private 'nsFrameLoader::nsFrameLoader' constructor has been simplified to
   only have one overload, shared by the different `::Create` static methods.

2. The creation static method used by `ChangeRemoteness` has changed name to
   `::Recreate`, as the signature is becoming more like the old method.

3. The `mNetworkCreated` bit is preserved when doing a `ChangeRemoteness`, as a
   remoteness change shouldn't be affecting that property.

4. Unused fields are removed from the ChangeRemoteness API.

5. The `remoteType` attribute is now mandatory in the ChangeRemoteness API,
   which simplifies the logic and makes it harder to accidentally misuse.

Differential Revision: https://phabricator.services.mozilla.com/D44893
This commit is contained in:
Nika Layzell
2019-09-11 08:09:58 +00:00
parent 89e21d6e79
commit 49231332a9
7 changed files with 100 additions and 122 deletions

View File

@@ -384,7 +384,7 @@ nsresult nsGenericHTMLFrameElement::CopyInnerTo(Element* aDest) {
if (doc->IsStaticDocument() && mFrameLoader) {
nsGenericHTMLFrameElement* dest =
static_cast<nsGenericHTMLFrameElement*>(aDest);
nsFrameLoader* fl = nsFrameLoader::Create(dest, nullptr, false);
RefPtr<nsFrameLoader> fl = nsFrameLoader::Create(dest, nullptr, false);
NS_ENSURE_STATE(fl);
dest->mFrameLoader = fl;
mFrameLoader->CreateStaticClone(fl);