зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1516366 - Move Init, Destroy and RemovedFromDocShell to nsIDocument. r=smaug
Differential Revision: https://phabricator.services.mozilla.com/D15362
This commit is contained in:
Родитель
6d77395190
Коммит
f7401d4d89
|
@ -1949,7 +1949,7 @@ NS_IMPL_CYCLE_COLLECTION_UNLINK_BEGIN(nsDocument)
|
|||
tmp->mInUnlinkOrDeletion = false;
|
||||
NS_IMPL_CYCLE_COLLECTION_UNLINK_END
|
||||
|
||||
nsresult nsDocument::Init() {
|
||||
nsresult nsIDocument::Init() {
|
||||
if (mCSSLoader || mStyleImageLoader || mNodeInfoManager || mScriptLoader) {
|
||||
return NS_ERROR_ALREADY_INITIALIZED;
|
||||
}
|
||||
|
@ -7519,7 +7519,7 @@ bool nsIDocument::CanSavePresentation(nsIRequest* aNewRequest) {
|
|||
return true;
|
||||
}
|
||||
|
||||
void nsDocument::Destroy() {
|
||||
void nsIDocument::Destroy() {
|
||||
// The ContentViewer wants to release the document now. So, tell our content
|
||||
// to drop any references to the document so that it can be destroyed.
|
||||
if (mIsGoingAway) return;
|
||||
|
@ -7554,7 +7554,7 @@ void nsDocument::Destroy() {
|
|||
mExternalResourceMap.Shutdown();
|
||||
}
|
||||
|
||||
void nsDocument::RemovedFromDocShell() {
|
||||
void nsIDocument::RemovedFromDocShell() {
|
||||
if (mRemovedFromDocShell) return;
|
||||
|
||||
mRemovedFromDocShell = true;
|
||||
|
|
|
@ -107,11 +107,6 @@ class nsDocument : public nsIDocument {
|
|||
using mozilla::dom::DocumentOrShadowRoot::GetElementsByTagName;
|
||||
using mozilla::dom::DocumentOrShadowRoot::GetElementsByTagNameNS;
|
||||
|
||||
virtual nsresult Init();
|
||||
|
||||
virtual void Destroy() override;
|
||||
virtual void RemovedFromDocShell() override;
|
||||
|
||||
NS_DECL_CYCLE_COLLECTION_SKIPPABLE_SCRIPT_HOLDER_CLASS_AMBIGUOUS(nsDocument,
|
||||
nsINode)
|
||||
|
||||
|
|
|
@ -2118,12 +2118,14 @@ class nsIDocument : public nsINode,
|
|||
*/
|
||||
virtual bool CanSavePresentation(nsIRequest* aNewRequest);
|
||||
|
||||
virtual nsresult Init();
|
||||
|
||||
/**
|
||||
* Notify the document that its associated ContentViewer is being destroyed.
|
||||
* This releases circular references so that the document can go away.
|
||||
* Destroy() is only called on documents that have a content viewer.
|
||||
*/
|
||||
virtual void Destroy() = 0;
|
||||
virtual void Destroy();
|
||||
|
||||
/**
|
||||
* Notify the document that its associated ContentViewer is no longer
|
||||
|
@ -2131,7 +2133,7 @@ class nsIDocument : public nsINode,
|
|||
* be rendered in "zombie state" until the next document is ready.
|
||||
* The document should save form control state.
|
||||
*/
|
||||
virtual void RemovedFromDocShell() = 0;
|
||||
virtual void RemovedFromDocShell();
|
||||
|
||||
/**
|
||||
* Get the layout history state that should be used to save and restore state
|
||||
|
|
Загрузка…
Ссылка в новой задаче