Implement headers arg on nsIWebNavigation::loadURI b=181903 r=bryner@netscape.com sr=rpotts@netscape.com

This commit is contained in:
locka%iol.ie 2002-12-12 23:10:59 +00:00
Родитель ee4e706b3a
Коммит d75f173614
4 изменённых файлов: 49 добавлений и 36 удалений

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

@ -546,6 +546,7 @@ nsDocShell::LoadURI(nsIURI * aURI,
nsresult rv;
nsCOMPtr<nsIURI> referrer;
nsCOMPtr<nsIInputStream> postStream;
nsCOMPtr<nsIInputStream> headersStream;
nsCOMPtr<nsISupports> owner;
PRBool inheritOwner = PR_FALSE;
nsCOMPtr<nsISHEntry> shEntry;
@ -568,6 +569,7 @@ nsDocShell::LoadURI(nsIURI * aURI,
aLoadInfo->GetSHEntry(getter_AddRefs(shEntry));
aLoadInfo->GetTarget(getter_Copies(target));
aLoadInfo->GetPostDataStream(getter_AddRefs(postStream));
aLoadInfo->GetHeadersStream(getter_AddRefs(headersStream));
}
#ifdef PR_LOGGING
@ -717,7 +719,7 @@ nsDocShell::LoadURI(nsIURI * aURI,
inheritOwner,
target.get(),
postStream,
nsnull, // No headers stream
headersStream,
loadType,
nsnull, // No SHEntry
firstParty,
@ -2444,8 +2446,7 @@ nsDocShell::LoadURI(const PRUnichar * aURI,
loadInfo->SetLoadType(ConvertLoadTypeToDocShellLoadInfo(loadType));
loadInfo->SetPostDataStream(aPostStream);
loadInfo->SetReferrer(aReferingURI);
// XXX: Need to pass in the extra headers stream too...
loadInfo->SetHeadersStream(aHeaderStream);
rv = LoadURI(uri, loadInfo, 0, PR_TRUE);
@ -5336,7 +5337,7 @@ AHTC_WriteFunc(nsIInputStream * in,
// pointer to where we should start copying bytes from rawSegment
char *pHeadersBuf = nsnull;
PRUint32 headersBufLen;
PRUint32 rawSegmentLen = strlen(fromRawSegment);
PRUint32 rawSegmentLen = count;
// if the buffer has no data yet
if (!headersBuf) {

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

@ -148,9 +148,7 @@ NS_IMETHODIMP nsDocShellLoadInfo::SetTarget(const PRUnichar* aTarget)
NS_IMETHODIMP
nsDocShellLoadInfo::GetPostDataStream(nsIInputStream **aResult)
{
if (!aResult) {
return NS_ERROR_NULL_POINTER;
}
NS_ENSURE_ARG_POINTER(aResult);
*aResult = mPostDataStream;
@ -166,6 +164,19 @@ nsDocShellLoadInfo::SetPostDataStream(nsIInputStream *aStream)
return NS_OK;
}
/* attribute nsIInputStream headersStream; */
NS_IMETHODIMP nsDocShellLoadInfo::GetHeadersStream(nsIInputStream * *aHeadersStream)
{
NS_ENSURE_ARG_POINTER(aHeadersStream);
*aHeadersStream = mHeadersStream;
NS_IF_ADDREF(*aHeadersStream);
return NS_OK;
}
NS_IMETHODIMP nsDocShellLoadInfo::SetHeadersStream(nsIInputStream * aHeadersStream)
{
mHeadersStream = aHeadersStream;
return NS_OK;
}
//*****************************************************************************
// nsDocShellLoadInfo: Helpers

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

@ -53,6 +53,7 @@ protected:
nsCOMPtr<nsISHEntry> mSHEntry;
nsString mTarget;
nsCOMPtr<nsIInputStream> mPostDataStream;
nsCOMPtr<nsIInputStream> mHeadersStream;
};
#endif /* nsDocShellLoadInfo_h__ */

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

@ -37,44 +37,44 @@ typedef long nsDocShellInfoLoadType;
[scriptable, uuid(33636F98-0635-11d4-9877-00C04FA0D27A)]
interface nsIDocShellLoadInfo : nsISupports
{
/*
This is the referrer for the load.
*/
attribute nsIURI referrer;
/** This is the referrer for the load. */
attribute nsIURI referrer;
/*
The owner of the load, that is, the entity responsible for
causing the load to occur. This should be a nsIPrincipal typically.
*/
/** The owner of the load, that is, the entity responsible for
* causing the load to occur. This should be a nsIPrincipal typically.
*/
attribute nsISupports owner;
/*
If this attribute is true and no owner is specified, copy the owner from
the referring document.
*/
/** If this attribute is true and no owner is specified, copy
* the owner from the referring document.
*/
attribute boolean inheritOwner;
/* these are load type enums... */
const long loadNormal = 0; // Normal Load
const long loadNormalReplace = 1; // Normal Load but replaces current history slot
const long loadHistory = 2; // Load from history
const long loadReloadNormal = 3; // Reload
const long loadReloadBypassCache = 4;
const long loadReloadBypassProxy = 5;
const long loadReloadBypassProxyAndCache = 6;
const long loadLink = 7;
const long loadRefresh = 8;
const long loadReloadCharsetChange = 9;
const long loadBypassHistory = 10;
const long loadNormal = 0; // Normal Load
const long loadNormalReplace = 1; // Normal Load but replaces current history slot
const long loadHistory = 2; // Load from history
const long loadReloadNormal = 3; // Reload
const long loadReloadBypassCache = 4;
const long loadReloadBypassProxy = 5;
const long loadReloadBypassProxyAndCache = 6;
const long loadLink = 7;
const long loadRefresh = 8;
const long loadReloadCharsetChange = 9;
const long loadBypassHistory = 10;
attribute nsDocShellInfoLoadType loadType;
/** Contains a load type as specified by the load* constants */
attribute nsDocShellInfoLoadType loadType;
/*
SHEntry for this page
*/
attribute nsISHEntry SHEntry;
/** SHEntry for this page */
attribute nsISHEntry SHEntry;
attribute wstring target; // like _content, _blank etc
/** Target for load, like _content, _blank etc. */
attribute wstring target;
/** Post data */
attribute nsIInputStream postDataStream;
/** Additional headers */
attribute nsIInputStream headersStream;
};