mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-11-26 22:32:46 +00:00
Added stuff needed for landing -- LoadQuiet, BypassCache, BypassProxy
This commit is contained in:
parent
bd51df11d6
commit
89f98a47db
@ -30,6 +30,7 @@ DIRS= \
|
||||
dns \
|
||||
build \
|
||||
protocol \
|
||||
util \
|
||||
test \
|
||||
$(NULL)
|
||||
|
||||
|
@ -87,5 +87,18 @@ interface nsIChannel : nsIRequest
|
||||
in nsIEventQueue eventQueue,
|
||||
in nsIStreamObserver observer);
|
||||
|
||||
/**
|
||||
* Setting this attribute causes the loading process to not deliver status
|
||||
* notifications to the program performing the load.
|
||||
*/
|
||||
attribute boolean LoadQuiet;
|
||||
|
||||
/**
|
||||
* Returns the content MIME type of the channel if available. Note that the
|
||||
* content type can often be wrongly specified (wrong file extension, wrong
|
||||
* MIME type, wrong document type stored on a server, etc.) and the caller
|
||||
* most likely wants to verify with the actual data.
|
||||
*/
|
||||
readonly attribute string ContentType;
|
||||
};
|
||||
|
||||
|
@ -1240,4 +1240,23 @@ nsSocketTransport::OpenOutputStream(PRUint32 startPosition, nsIOutputStream* *re
|
||||
return rv;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsSocketTransport::GetLoadQuiet(PRBool *aLoadQuiet)
|
||||
{
|
||||
*aLoadQuiet = mLoadQuiet;
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsSocketTransport::SetLoadQuiet(PRBool aLoadQuiet)
|
||||
{
|
||||
mLoadQuiet = aLoadQuiet;
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsSocketTransport::GetContentType(char * *aContentType)
|
||||
{
|
||||
return NS_ERROR_FAILURE; // XXX doesn't make sense for transports
|
||||
}
|
||||
|
||||
|
@ -91,6 +91,9 @@ public:
|
||||
nsISupports *ctxt,
|
||||
nsIEventQueue *eventQueue,
|
||||
nsIStreamObserver *observer);
|
||||
NS_IMETHOD GetLoadQuiet(PRBool *aLoadQuiet);
|
||||
NS_IMETHOD SetLoadQuiet(PRBool aLoadQuiet);
|
||||
NS_IMETHOD GetContentType(char * *aContentType);
|
||||
|
||||
// nsIBufferObserver methods:
|
||||
NS_IMETHOD OnFull(nsIBuffer* buffer);
|
||||
@ -150,6 +153,7 @@ protected:
|
||||
PRUint32 mSourceOffset;
|
||||
|
||||
nsSocketTransportService* mService;
|
||||
PRBool mLoadQuiet;
|
||||
};
|
||||
|
||||
|
||||
|
@ -24,6 +24,7 @@ DIRS= \
|
||||
dns \
|
||||
build \
|
||||
protocol \
|
||||
util \
|
||||
test \
|
||||
$(NULL)
|
||||
|
||||
|
@ -417,6 +417,26 @@ nsFileChannel::AsyncWrite(nsIInputStream *fromStream,
|
||||
return NS_ERROR_NOT_IMPLEMENTED;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsFileChannel::GetLoadQuiet(PRBool *aLoadQuiet)
|
||||
{
|
||||
*aLoadQuiet = mLoadQuiet;
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsFileChannel::SetLoadQuiet(PRBool aLoadQuiet)
|
||||
{
|
||||
mLoadQuiet = aLoadQuiet;
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsFileChannel::GetContentType(char * *aContentType)
|
||||
{
|
||||
return NS_ERROR_NOT_IMPLEMENTED;
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
// nsIRunnable methods:
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
@ -67,6 +67,13 @@ public:
|
||||
/* void AsyncWrite (in nsIInputStream fromStream, in unsigned long startPosition, in long writeCount, in nsISupports ctxt, in nsIEventQueue eventQueue, in nsIStreamObserver observer); */
|
||||
NS_IMETHOD AsyncWrite(nsIInputStream *fromStream, PRUint32 startPosition, PRInt32 writeCount, nsISupports *ctxt, nsIEventQueue *eventQueue, nsIStreamObserver *observer);
|
||||
|
||||
/* attribute boolean LoadQuiet; */
|
||||
NS_IMETHOD GetLoadQuiet(PRBool *aLoadQuiet);
|
||||
NS_IMETHOD SetLoadQuiet(PRBool aLoadQuiet);
|
||||
|
||||
/* readonly attribute string ContentType; */
|
||||
NS_IMETHOD GetContentType(char * *aContentType);
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////
|
||||
// from nsIFileChannel:
|
||||
|
||||
@ -173,8 +180,8 @@ protected:
|
||||
PRUint32 mSourceOffset;
|
||||
PRInt32 mAmount;
|
||||
|
||||
private:
|
||||
PRLock* mLock;
|
||||
PRBool mLoadQuiet;
|
||||
};
|
||||
|
||||
#define NS_FILE_TRANSPORT_SEGMENT_SIZE (4*1024)
|
||||
|
@ -186,6 +186,20 @@ nsFTPChannel::AsyncWrite(nsIInputStream *fromStream,
|
||||
return NS_ERROR_NOT_IMPLEMENTED;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsFTPChannel::GetLoadQuiet(PRBool *aLoadQuiet)
|
||||
{
|
||||
*aLoadQuiet = mLoadQuiet;
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsFTPChannel::SetLoadQuiet(PRBool aLoadQuiet)
|
||||
{
|
||||
mLoadQuiet = aLoadQuiet;
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsFTPChannel::GetContentType(char* *contentType) {
|
||||
|
||||
|
@ -55,6 +55,9 @@ public:
|
||||
nsISupports *ctxt,
|
||||
nsIEventQueue *eventQueue,
|
||||
nsIStreamObserver *observer);
|
||||
NS_IMETHOD GetLoadQuiet(PRBool *aLoadQuiet);
|
||||
NS_IMETHOD SetLoadQuiet(PRBool aLoadQuiet);
|
||||
NS_IMETHOD GetContentType(char * *aContentType);
|
||||
|
||||
// nsIFTPChannel methods:
|
||||
NS_IMETHOD Get(void);
|
||||
@ -88,8 +91,6 @@ public:
|
||||
nsresult Init(const char* verb, nsIURI* uri, nsIEventSinkGetter* getter,
|
||||
nsIEventQueue* queue);
|
||||
|
||||
NS_IMETHOD GetContentType(char* *contentType);
|
||||
|
||||
protected:
|
||||
nsIURI* mUrl;
|
||||
nsIEventQueue* mEventQueue;
|
||||
@ -97,6 +98,7 @@ protected:
|
||||
|
||||
PRBool mConnected;
|
||||
nsIStreamListener* mListener;
|
||||
PRBool mLoadQuiet;
|
||||
};
|
||||
|
||||
#endif /* nsFTPChannel_h___ */
|
||||
|
@ -49,6 +49,10 @@ interface nsIHTTPChannel : nsIChannel
|
||||
readonly attribute nsIHTTPEventSink EventSink;
|
||||
|
||||
readonly attribute nsIStreamListener ResponseDataListener;
|
||||
|
||||
attribute boolean BypassCache;
|
||||
|
||||
attribute boolean BypassProxy;
|
||||
};
|
||||
|
||||
|
||||
|
@ -211,6 +211,26 @@ nsHTTPChannel::AsyncWrite(nsIInputStream *fromStream,
|
||||
return NS_ERROR_NOT_IMPLEMENTED;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsHTTPChannel::GetLoadQuiet(PRBool *aLoadQuiet)
|
||||
{
|
||||
*aLoadQuiet = mLoadQuiet;
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsHTTPChannel::SetLoadQuiet(PRBool aLoadQuiet)
|
||||
{
|
||||
mLoadQuiet = aLoadQuiet;
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsHTTPChannel::GetContentType(char * *aContentType)
|
||||
{
|
||||
return NS_ERROR_NOT_IMPLEMENTED;
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
// nsIHTTPChannel methods:
|
||||
|
||||
@ -297,6 +317,33 @@ nsHTTPChannel::GetResponseDataListener(nsIStreamListener* *aListener)
|
||||
return rv;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsHTTPChannel::GetBypassCache(PRBool *aBypassCache)
|
||||
{
|
||||
*aBypassCache = mBypassCache;
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsHTTPChannel::SetBypassCache(PRBool aBypassCache)
|
||||
{
|
||||
mBypassCache = aBypassCache;
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsHTTPChannel::GetBypassProxy(PRBool *aBypassProxy)
|
||||
{
|
||||
*aBypassProxy = mBypassProxy;
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsHTTPChannel::SetBypassProxy(PRBool aBypassProxy)
|
||||
{
|
||||
mBypassProxy = aBypassProxy;
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
static NS_DEFINE_IID(kProxyObjectManagerIID, NS_IPROXYEVENT_MANAGER_IID);
|
||||
static NS_DEFINE_CID(kEventQueueService, NS_EVENTQUEUESERVICE_CID);
|
||||
|
@ -74,7 +74,10 @@ public:
|
||||
nsISupports *ctxt,
|
||||
nsIEventQueue *eventQueue,
|
||||
nsIStreamObserver *observer);
|
||||
NS_IMETHOD Open();
|
||||
NS_IMETHOD GetLoadQuiet(PRBool *aLoadQuiet);
|
||||
NS_IMETHOD SetLoadQuiet(PRBool aLoadQuiet);
|
||||
NS_IMETHOD GetContentType(char * *aContentType);
|
||||
NS_IMETHOD Open();
|
||||
|
||||
// nsIHTTPChannel methods:
|
||||
NS_IMETHOD GetRequestHeader(const char *headerName, char **_retval);
|
||||
@ -85,6 +88,10 @@ public:
|
||||
NS_IMETHOD GetResponseString(char * *aResponseString);
|
||||
NS_IMETHOD GetEventSink(nsIHTTPEventSink* *eventSink);
|
||||
NS_IMETHOD GetResponseDataListener(nsIStreamListener* *aListener);
|
||||
NS_IMETHOD GetBypassCache(PRBool *aBypassCache);
|
||||
NS_IMETHOD SetBypassCache(PRBool aBypassCache);
|
||||
NS_IMETHOD GetBypassProxy(PRBool *aBypassProxy);
|
||||
NS_IMETHOD SetBypassProxy(PRBool aBypassProxy);
|
||||
|
||||
// nsHTTPChannel methods:
|
||||
nsresult Init();
|
||||
@ -101,6 +108,9 @@ protected:
|
||||
nsHTTPRequest* m_pRequest;
|
||||
nsHTTPResponse* m_pResponse;
|
||||
nsIStreamListener* m_pResponseDataListener;
|
||||
PRBool mLoadQuiet;
|
||||
PRBool mBypassCache;
|
||||
PRBool mBypassProxy;
|
||||
};
|
||||
|
||||
#endif /* _nsHTTPChannel_h_ */
|
||||
|
Loading…
Reference in New Issue
Block a user