mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-11-26 22:32:46 +00:00
Bug 1931496. Some missed contentViewer to documentViewer renames. r=baku DONTBUILD
Differential Revision: https://phabricator.services.mozilla.com/D229104
This commit is contained in:
parent
5850652da0
commit
94330c8368
@ -7308,7 +7308,7 @@ nsresult nsDocShell::RestoreFromHistory() {
|
||||
mIsRestoringDocument = false;
|
||||
|
||||
// Hack to keep nsDocShellEditorData alive across the
|
||||
// SetContentViewer(nullptr) call below.
|
||||
// SetDocumentViewer(nullptr) call below.
|
||||
UniquePtr<nsDocShellEditorData> data(mLSHE->ForgetEditorData());
|
||||
|
||||
// Now remove it from the cached presentation.
|
||||
@ -7841,7 +7841,7 @@ nsresult nsDocShell::SetupNewViewer(nsIDocumentViewer* aNewViewer,
|
||||
//
|
||||
// In this block of code, if we get an error result, we return it
|
||||
// but if we get a null pointer, that's perfectly legal for parent
|
||||
// and parentContentViewer.
|
||||
// and parentDocumentViewer.
|
||||
//
|
||||
|
||||
int32_t x = 0;
|
||||
@ -7940,7 +7940,7 @@ nsresult nsDocShell::SetupNewViewer(nsIDocumentViewer* aNewViewer,
|
||||
viewer->Destroy();
|
||||
mDocumentViewer = nullptr;
|
||||
SetCurrentURIInternal(nullptr);
|
||||
NS_WARNING("ContentViewer Initialization failed");
|
||||
NS_WARNING("DocumentViewer Initialization failed");
|
||||
return NS_ERROR_FAILURE;
|
||||
}
|
||||
|
||||
|
@ -398,7 +398,7 @@ interface nsIDocShell : nsIDocShellTreeItem
|
||||
/**
|
||||
* Keeps track of the previous nsISHEntry index and the current
|
||||
* nsISHEntry index at the time that the doc shell begins to load.
|
||||
* Used for ContentViewer eviction.
|
||||
* Used for DocumentViewer eviction.
|
||||
*/
|
||||
readonly attribute long previousEntryIndex;
|
||||
readonly attribute long loadedEntryIndex;
|
||||
|
@ -134,7 +134,7 @@ interface nsIDocumentViewer : nsISupports
|
||||
* If it is non-null, the document will not be destroyed, and the following
|
||||
* actions will happen when destroy() is called (*):
|
||||
* - Sanitize() will be called on the viewer's document
|
||||
* - The content viewer will set the contentViewer property on the
|
||||
* - The content viewer will set the documentViewer property on the
|
||||
* history entry, and release its reference (ownership reversal).
|
||||
* - hide() will be called, and no further destruction will happen.
|
||||
*
|
||||
|
@ -240,7 +240,7 @@ nsresult nsSHEntryShared::SetDocumentViewer(nsIDocumentViewer* aViewer) {
|
||||
}
|
||||
|
||||
// Store observed document in strong pointer in case it is removed from
|
||||
// the contentviewer
|
||||
// the documentviewer
|
||||
mDocument = mDocumentViewer->GetDocument();
|
||||
if (mDocument) {
|
||||
mDocument->SetBFCacheEntry(this);
|
||||
|
@ -303,14 +303,14 @@ uint32_t nsSHistory::CalcMaxTotalViewers() {
|
||||
# define MAX_TOTAL_VIEWERS_BIAS 14
|
||||
#endif
|
||||
|
||||
// Calculate an estimate of how many ContentViewers we should cache based
|
||||
// on RAM. This assumes that the average ContentViewer is 4MB (conservative)
|
||||
// and caps the max at 8 ContentViewers
|
||||
// Calculate an estimate of how many DocumentViewers we should cache based
|
||||
// on RAM. This assumes that the average DocumentViewer is 4MB (conservative)
|
||||
// and caps the max at 8 DocumentViewers
|
||||
//
|
||||
// TODO: Should we split the cache memory betw. ContentViewer caching and
|
||||
// TODO: Should we split the cache memory betw. DocumentViewer caching and
|
||||
// nsCacheService?
|
||||
//
|
||||
// RAM | ContentViewers | on Android
|
||||
// RAM | DocumentViewers | on Android
|
||||
// -------------------------------------
|
||||
// 32 Mb 0 0
|
||||
// 64 Mb 1 0
|
||||
@ -339,7 +339,7 @@ uint32_t nsSHistory::CalcMaxTotalViewers() {
|
||||
|
||||
// This is essentially the same calculation as for nsCacheService,
|
||||
// except that we divide the final memory calculation by 4, since
|
||||
// we assume each ContentViewer takes on average 4MB
|
||||
// we assume each DocumentViewer takes on average 4MB
|
||||
uint32_t viewers = 0;
|
||||
double x = std::log(kBytesD) / std::log(2.0) - MAX_TOTAL_VIEWERS_BIAS;
|
||||
if (x > 0) {
|
||||
|
@ -11862,7 +11862,7 @@ bool Document::CanSavePresentation(nsIRequest* aNewRequest,
|
||||
}
|
||||
|
||||
void Document::Destroy() {
|
||||
// The ContentViewer wants to release the document now. So, tell our content
|
||||
// The DocumentViewer 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;
|
||||
|
@ -2338,14 +2338,14 @@ class Document : public nsINode,
|
||||
nsIPrincipal* aPartitionedPrincipal);
|
||||
|
||||
/**
|
||||
* Notify the document that its associated ContentViewer is being destroyed.
|
||||
* Notify the document that its associated DocumentViewer 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();
|
||||
|
||||
/**
|
||||
* Notify the document that its associated ContentViewer is no longer
|
||||
* Notify the document that its associated DocumentViewer is no longer
|
||||
* the current viewer for the docshell. The document might still
|
||||
* be rendered in "zombie state" until the next document is ready.
|
||||
* The document should save form control state.
|
||||
|
@ -2190,7 +2190,7 @@ Element* nsFocusManager::FlushAndCheckIfFocusable(Element* aElement,
|
||||
// called during reflow, calling GetBrowsingContext() could cause frame
|
||||
// loader initialization at a time when it isn't safe.
|
||||
if (BrowsingContext* bc = flo->GetExtantBrowsingContext()) {
|
||||
// This call may create a contentViewer-created about:blank.
|
||||
// This call may create a documentViewer-created about:blank.
|
||||
// That's intentional, so we can move focus there.
|
||||
Unused << bc->GetDocument();
|
||||
}
|
||||
|
@ -834,7 +834,7 @@ mozilla::ipc::IPCResult BrowserChild::RecvCreateAboutBlankDocumentViewer(
|
||||
MOZ_ALWAYS_SUCCEEDS(
|
||||
WebNavigation()->GetCurrentURI(getter_AddRefs(currentURI)));
|
||||
if (!currentURI || !NS_IsAboutBlank(currentURI)) {
|
||||
NS_WARNING("Can't create a ContentViewer unless on about:blank");
|
||||
NS_WARNING("Can't create a DocumentViewer unless on about:blank");
|
||||
return IPC_OK();
|
||||
}
|
||||
|
||||
|
@ -877,7 +877,7 @@ class CheckPermitUnloadRequest final : public PromiseNativeHandler,
|
||||
}
|
||||
|
||||
// Handle any failure in prompting by aborting the navigation. See comment
|
||||
// in nsContentViewer::PermitUnload for reasoning.
|
||||
// in nsDocumentViewer::PermitUnload for reasoning.
|
||||
auto cleanup = MakeScopeExit([&]() { SendReply(false); });
|
||||
|
||||
if (nsCOMPtr<nsIPromptCollection> prompt =
|
||||
|
@ -340,7 +340,7 @@ nsresult nsXMLContentSink::OnDocumentCreated(Document* aSourceDocument,
|
||||
|
||||
nsCOMPtr<nsIDocumentViewer> viewer;
|
||||
mDocShell->GetDocViewer(getter_AddRefs(viewer));
|
||||
// Make sure that we haven't loaded a new document into the contentviewer
|
||||
// Make sure that we haven't loaded a new document into the documentviewer
|
||||
// after starting the XSLT transform.
|
||||
if (viewer && viewer->GetDocument() == aSourceDocument) {
|
||||
return viewer->SetDocumentInternal(aResultDocument, true);
|
||||
@ -362,7 +362,7 @@ nsresult nsXMLContentSink::OnTransformDone(Document* aSourceDocument,
|
||||
RefPtr<Document> originalDocument = mDocument;
|
||||
bool blockingOnload = mIsBlockingOnload;
|
||||
|
||||
// Make sure that we haven't loaded a new document into the contentviewer
|
||||
// Make sure that we haven't loaded a new document into the documentviewer
|
||||
// after starting the XSLT transform.
|
||||
if (viewer && (viewer->GetDocument() == aSourceDocument ||
|
||||
viewer->GetDocument() == aResultDocument)) {
|
||||
|
@ -2020,7 +2020,7 @@ nsDocumentViewer::Show() {
|
||||
mPreviousViewer = nullptr;
|
||||
prevViewer->Destroy();
|
||||
|
||||
// Make sure we don't have too many cached ContentViewers
|
||||
// Make sure we don't have too many cached DocumentViewers
|
||||
nsCOMPtr<nsIDocShellTreeItem> treeItem(mContainer);
|
||||
if (treeItem) {
|
||||
// We need to find the root DocShell since only that object has an
|
||||
@ -2933,7 +2933,7 @@ nsDocumentViewer::PrintPreview(nsIPrintSettings* aPrintSettings,
|
||||
}
|
||||
|
||||
NS_ENSURE_STATE(!GetIsPrinting());
|
||||
// beforeprint event may have caused ContentViewer to be shutdown.
|
||||
// beforeprint event may have caused DocumentViewer to be shutdown.
|
||||
NS_ENSURE_STATE(mContainer);
|
||||
NS_ENSURE_STATE(mDeviceContext);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user