From 6cff828c389f08b2a9b91eb92be71d97ef0fa8d0 Mon Sep 17 00:00:00 2001 From: "bryner%brianryner.com" Date: Thu, 20 Apr 2006 03:39:33 +0000 Subject: [PATCH] Add support for caching content viewers in session history to speed up back/forward (bug 274784). This initial landing has the feature disabled by default; set browser.sessionhistory.max_viewers to the maximum number of pages to cache to enable the feature. r=bzbarsky, sr/a=brendan. git-svn-id: svn://10.0.0.236/trunk@194922 18797224-902f-48f8-a5cc-f745e15eee43 --- mozilla/content/base/src/nsDOMParser.cpp | 6 ++++++ mozilla/content/base/src/nsDOMParser.h | 1 + mozilla/content/base/src/nsLoadListenerProxy.cpp | 12 ++++++++++++ mozilla/content/base/src/nsLoadListenerProxy.h | 1 + mozilla/content/base/src/nsXMLHttpRequest.cpp | 6 ++++++ mozilla/content/base/src/nsXMLHttpRequest.h | 1 + 6 files changed, 27 insertions(+) diff --git a/mozilla/content/base/src/nsDOMParser.cpp b/mozilla/content/base/src/nsDOMParser.cpp index f61a94eac5d..a5788dee8f3 100644 --- a/mozilla/content/base/src/nsDOMParser.cpp +++ b/mozilla/content/base/src/nsDOMParser.cpp @@ -333,6 +333,12 @@ nsDOMParser::Error(nsIDOMEvent* aEvent) return NS_OK; } +NS_IMETHODIMP +nsDOMParser::PageRestore(nsIDOMEvent* aEvent) +{ + return NS_OK; +} + nsDOMParser::nsDOMParser() : mLoopingForSyncLoad(PR_FALSE) { diff --git a/mozilla/content/base/src/nsDOMParser.h b/mozilla/content/base/src/nsDOMParser.h index 4fc7059bd8a..4ab15930069 100644 --- a/mozilla/content/base/src/nsDOMParser.h +++ b/mozilla/content/base/src/nsDOMParser.h @@ -67,6 +67,7 @@ public: NS_IMETHOD Unload(nsIDOMEvent* aEvent); NS_IMETHOD Abort(nsIDOMEvent* aEvent); NS_IMETHOD Error(nsIDOMEvent* aEvent); + NS_IMETHOD PageRestore(nsIDOMEvent* aEvent); private: nsCOMPtr mBaseURI; diff --git a/mozilla/content/base/src/nsLoadListenerProxy.cpp b/mozilla/content/base/src/nsLoadListenerProxy.cpp index f1527e8fa4c..e4ecdb2dded 100644 --- a/mozilla/content/base/src/nsLoadListenerProxy.cpp +++ b/mozilla/content/base/src/nsLoadListenerProxy.cpp @@ -121,3 +121,15 @@ nsLoadListenerProxy::Error(nsIDOMEvent* aEvent) return NS_OK; } + +NS_IMETHODIMP +nsLoadListenerProxy::PageRestore(nsIDOMEvent* aEvent) +{ + nsCOMPtr listener(do_QueryReferent(mParent)); + + if (listener) { + return listener->PageRestore(aEvent); + } + + return NS_OK; +} diff --git a/mozilla/content/base/src/nsLoadListenerProxy.h b/mozilla/content/base/src/nsLoadListenerProxy.h index d0582d53107..10584725c87 100644 --- a/mozilla/content/base/src/nsLoadListenerProxy.h +++ b/mozilla/content/base/src/nsLoadListenerProxy.h @@ -69,6 +69,7 @@ public: NS_IMETHOD Unload(nsIDOMEvent* aEvent); NS_IMETHOD Abort(nsIDOMEvent* aEvent); NS_IMETHOD Error(nsIDOMEvent* aEvent); + NS_IMETHOD PageRestore(nsIDOMEvent* aEvent); protected: nsWeakPtr mParent; diff --git a/mozilla/content/base/src/nsXMLHttpRequest.cpp b/mozilla/content/base/src/nsXMLHttpRequest.cpp index a1a394842ac..71c7abde886 100644 --- a/mozilla/content/base/src/nsXMLHttpRequest.cpp +++ b/mozilla/content/base/src/nsXMLHttpRequest.cpp @@ -1743,6 +1743,12 @@ nsXMLHttpRequest::Error(nsIDOMEvent* aEvent) return NS_OK; } +NS_IMETHODIMP +nsXMLHttpRequest::PageRestore(nsIDOMEvent* aEvent) +{ + return NS_OK; +} + nsresult nsXMLHttpRequest::ChangeState(PRUint32 aState, PRBool aBroadcast, PRBool aClearEventListeners) diff --git a/mozilla/content/base/src/nsXMLHttpRequest.h b/mozilla/content/base/src/nsXMLHttpRequest.h index 41857074394..77ba6ddb7e0 100644 --- a/mozilla/content/base/src/nsXMLHttpRequest.h +++ b/mozilla/content/base/src/nsXMLHttpRequest.h @@ -97,6 +97,7 @@ public: NS_IMETHOD Unload(nsIDOMEvent* aEvent); NS_IMETHOD Abort(nsIDOMEvent* aEvent); NS_IMETHOD Error(nsIDOMEvent* aEvent); + NS_IMETHOD PageRestore(nsIDOMEvent* aEvent); // nsIStreamListener NS_DECL_NSISTREAMLISTENER