gecko-dev/network/module/nsNetService.h

83 строки
2.6 KiB
C
Исходник Обычный вид История

1998-05-23 03:38:40 +04:00
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*-
*
* The contents of this file are subject to the Netscape Public License
* Version 1.0 (the "License"); you may not use this file except in
* compliance with the License. You may obtain a copy of the License at
1998-05-23 03:38:40 +04:00
* http://www.mozilla.org/NPL/
*
* Software distributed under the License is distributed on an "AS IS"
* basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
* the License for the specific language governing rights and limitations
* under the License.
1998-05-23 03:38:40 +04:00
*
* The Original Code is Mozilla Communicator client code.
*
* The Initial Developer of the Original Code is Netscape Communications
* Corporation. Portions created by Netscape are Copyright (C) 1998
* Netscape Communications Corporation. All Rights Reserved.
1998-05-23 03:38:40 +04:00
*/
#ifndef nsNetService_h___
#define nsNetService_h___
1998-05-23 03:38:40 +04:00
#include "nspr.h"
#include "plevent.h"
#include "nsIPref.h"
1998-05-23 03:38:40 +04:00
#include "nsINetService.h"
#include "nsNetThread.h"
? 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().
1998-09-16 04:35:32 +04:00
#include "net.h"
1998-05-23 03:38:40 +04:00
class nsINetContainerApplication;
class nsITimer;
1998-05-23 03:38:40 +04:00
class nsNetlibService : public nsINetService {
public:
NS_DECL_ISUPPORTS
nsNetlibService(nsINetContainerApplication *aContainer);
1998-05-23 03:38:40 +04:00
/* Implementation of the nsINetService interface */
NS_IMETHOD OpenStream(nsIURL *aUrl, nsIStreamListener *aConsumer);
NS_IMETHOD OpenBlockingStream(nsIURL *aUrl,
nsIStreamListener *aConsumer,
nsIInputStream **aNewStream);
NS_IMETHOD GetContainerApplication(nsINetContainerApplication **aContainer);
nsresult SetContainerApplication(nsINetContainerApplication *aContainer);
NS_IMETHOD GetCookieString(nsIURL *aURL, nsString& aCookie);
NS_IMETHOD SetCookieString(nsIURL *aURL, const nsString& aCookie);
NS_IMETHOD GetProxyHTTP(nsString& aProxyHTTP);
NS_IMETHOD SetProxyHTTP(nsString& aProxyHTTP);
1998-05-23 03:38:40 +04:00
protected:
virtual ~nsNetlibService();
nsresult StartNetlibThread(void);
nsresult StopNetlibThread(void);
void SchedulePollingTimer();
void CleanupPollingTimer(nsITimer* aTimer);
static void NetPollSocketsCallback(nsITimer* aTimer, void* aClosure);
#if defined(NETLIB_THREAD)
static void NetlibThreadMain(void *aParam);
#endif /* NETLIB_THREAD */
1998-05-23 03:38:40 +04:00
private:
? 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().
1998-09-16 04:35:32 +04:00
void SetupURLStruct(nsIURL *aURL, URL_Struct *aURL_s);
1998-05-23 03:38:40 +04:00
/* XXX: This is temporary until bamwrap.cpp is removed... */
void *m_stubContext;
nsINetContainerApplication *mContainer;
nsIPref *mPref;
nsITimer* mPollingTimer;
nsNetlibThread* mNetlibThread;
1998-05-23 03:38:40 +04:00
};
#endif /* nsNetService_h___ */