bug #40867 (r=bzarsky@mit.edu, sr=jst@netscape.com, a=asa@mozilla.org) Add new caching API to allow view-source to load from the cache and not the network.

This commit is contained in:
rpotts%netscape.com 2005-08-18 11:16:36 +00:00
Родитель cfd6677aaa
Коммит 0e044cb465
2 изменённых файлов: 34 добавлений и 1 удалений

Просмотреть файл

@ -100,6 +100,8 @@ void create(in nsIURI aURI, in wstring aTitle, in nsIDOMDocument aDocument,
in nsIInputStream aInputStream, in nsILayoutHistoryState aHistoryLayoutState,
in nsISupports aCacheKey);
nsISHEntry clone();
/** Attribute that indicates if this entry is for a subframe navigation */
void SetIsSubFrame(in boolean aFlag);

Просмотреть файл

@ -253,7 +253,7 @@ NS_IMETHODIMP nsSHEntry::SetExpirationStatus(PRBool aFlag)
return NS_OK;
}
nsresult
NS_IMETHODIMP
nsSHEntry::Create(nsIURI * aURI, const PRUnichar * aTitle, nsIDOMDocument * aDOMDocument,
nsIInputStream * aInputStream, nsILayoutHistoryState * aHistoryLayoutState,
nsISupports * aCacheKey)
@ -283,6 +283,37 @@ nsSHEntry::Create(nsIURI * aURI, const PRUnichar * aTitle, nsIDOMDocument * aDOM
}
NS_IMETHODIMP
nsSHEntry::Clone(nsISHEntry ** aResult)
{
nsresult rv;
nsSHEntry *dest;
dest = new nsSHEntry();
if (!dest) {
return NS_ERROR_OUT_OF_MEMORY;
}
NS_ADDREF(dest);
dest->SetURI(mURI);
dest->SetReferrerURI(mReferrerURI);
dest->SetPostData(mPostData);
dest->SetLayoutHistoryState(mLayoutHistoryState);
dest->SetTitle(mTitle.get());
dest->SetParent(mParent);
dest->SetID(mID);
dest->SetIsSubFrame(mIsFrameNavigation);
dest->SetExpirationStatus(mExpired);
dest->SetSaveLayoutStateFlag(mSaveLayoutState);
dest->SetCacheKey(mCacheKey);
rv = dest->QueryInterface(NS_GET_IID(nsISHEntry), (void**) aResult);
NS_RELEASE(dest);
return rv;
}
NS_IMETHODIMP
nsSHEntry::GetParent(nsISHEntry ** aResult)
{