? network/module/nsILoadAttribs.h
New nsIloadAttribs interface that defines the load attributes that are will be associated with a url. ? network/module/nsLoadAttribs.cpp New nsIloadAttribs interface implementation. M network/main/mkconect.c Check for a new local ip address to use. If found PR_Bind() is called to bind the connecting socket to the new address. M network/main/mkgeturl.c Added logic to determine whether or not skip the proxy for the given url. M network/main/mktcp.h api change. Changed NET_BeginConnect() and NET_FinishConnect() function prototypes. M network/module/MANIFEST Added nsILoadAttribs.h to exports list M network/module/Makefile Added nsILoadAttribs.h to exports list and nsILoadAttribs.cpp to compile lists. M network/module/makefile.win Added nsILoadAttribs.h to exports list and nsILoadAttribs.cpp to compile lists. M network/module/nsIURL.h Added accessor methods to the url interface for nsILoadAttribs interface pointer. M network/module/nsNetService.h Added urlSetup method to class definition. M network/module/nsNetService.cpp Condensed url setup (from nsIURL properties to the actual url struct) into a helper routine. URL struct setup now transfers nsILoadAttributes over into the url struct. M network/module/nsURL.cpp Added nsILoadAttribs accessor method implementations to the url implementation. M network/protocol/ftp/mkftp.c api change. NET_*Connect(). M network/protocol/gopher/mkgopher.c api change. NET_*Connect(). M network/protocol/http/mkhttp.c api change. NET_*Connect(). M network/protocol/imap4/mkimap4.cpp api change. NET_*Connect(). M network/protocol/nntp/mknews.c api change. NET_*Connect(). M network/protocol/pop3/mkpop3.c api change. NET_*Connect(). M network/protocol/smtp/mksmtp.c api change. NET_*Connect(). git-svn-id: svn://10.0.0.236/trunk@10102 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
92
mozilla/network/module/nsLoadAttribs.cpp
Normal file
92
mozilla/network/module/nsLoadAttribs.cpp
Normal file
@@ -0,0 +1,92 @@
|
||||
#include "nsString.h"
|
||||
#include "nsILoadAttribs.h"
|
||||
#include "prtypes.h"
|
||||
|
||||
static NS_DEFINE_IID(kILoadAttribs, NS_ILOAD_ATTRIBS_IDD);
|
||||
|
||||
// nsLoadAttribs definition.
|
||||
class nsLoadAttribs : public nsILoadAttribs {
|
||||
public:
|
||||
nsLoadAttribs();
|
||||
virtual ~nsLoadAttribs();
|
||||
|
||||
// nsISupports
|
||||
NS_DECL_ISUPPORTS
|
||||
|
||||
// nsILoadAttribs
|
||||
NS_IMETHOD SetBypassProxy(PRBool aBypass);
|
||||
NS_IMETHOD GetBypassProxy(PRBool *aBypass);
|
||||
NS_IMETHOD SetLocalIP(const PRUint32 aIP);
|
||||
NS_IMETHOD GetLocalIP(PRUint32 *aIP);
|
||||
|
||||
private:
|
||||
PRBool mBypass;
|
||||
PRUint32 mLocalIP;
|
||||
};
|
||||
|
||||
// nsLoadAttribs Implementation
|
||||
|
||||
NS_IMPL_ADDREF(nsLoadAttribs)
|
||||
NS_IMPL_RELEASE(nsLoadAttribs)
|
||||
|
||||
nsresult
|
||||
nsLoadAttribs::QueryInterface(const nsIID &aIID, void** aInstancePtr)
|
||||
{
|
||||
if (NULL == aInstancePtr) {
|
||||
return NS_ERROR_NULL_POINTER;
|
||||
}
|
||||
static NS_DEFINE_IID(kISupportsIID, NS_ISUPPORTS_IID);
|
||||
|
||||
if (aIID.Equals(kILoadAttribs)) {
|
||||
*aInstancePtr = (void*) ((nsILoadAttribs*)this);
|
||||
AddRef();
|
||||
return NS_OK;
|
||||
}
|
||||
if (aIID.Equals(kISupportsIID)) {
|
||||
*aInstancePtr = (void*) ((nsISupports *)this);
|
||||
AddRef();
|
||||
return NS_OK;
|
||||
}
|
||||
return NS_NOINTERFACE;
|
||||
}
|
||||
|
||||
nsLoadAttribs::nsLoadAttribs() {
|
||||
mBypass = PR_FALSE;
|
||||
mLocalIP = 0;
|
||||
}
|
||||
|
||||
nsLoadAttribs::~nsLoadAttribs() {
|
||||
}
|
||||
|
||||
nsresult
|
||||
nsLoadAttribs::SetBypassProxy(PRBool aBypass) {
|
||||
mBypass = aBypass;
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
nsresult
|
||||
nsLoadAttribs::GetBypassProxy(PRBool *aBypass) {
|
||||
*aBypass = mBypass;
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
nsresult
|
||||
nsLoadAttribs::SetLocalIP(const PRUint32 aLocalIP) {
|
||||
mLocalIP = aLocalIP;
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
nsresult
|
||||
nsLoadAttribs::GetLocalIP(PRUint32 *aLocalIP) {
|
||||
*aLocalIP = mLocalIP;
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
// Creation routines
|
||||
NS_NET nsresult NS_NewLoadAttribs(nsILoadAttribs** aInstancePtrResult) {
|
||||
nsILoadAttribs* it = new nsLoadAttribs();
|
||||
if (nsnull == it) {
|
||||
return NS_ERROR_OUT_OF_MEMORY;
|
||||
}
|
||||
return it->QueryInterface(kILoadAttribs, (void **) aInstancePtrResult);
|
||||
}
|
||||
Reference in New Issue
Block a user