2012-05-21 15:12:37 +04:00
|
|
|
/* This Source Code Form is subject to the terms of the Mozilla Public
|
|
|
|
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
|
|
|
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
2003-01-18 04:27:53 +03:00
|
|
|
|
2016-05-19 05:02:57 +03:00
|
|
|
#ifndef nsStreamTransportService_h__
|
|
|
|
#define nsStreamTransportService_h__
|
|
|
|
|
2003-01-18 04:27:53 +03:00
|
|
|
#include "nsIStreamTransportService.h"
|
2006-05-10 21:30:15 +04:00
|
|
|
#include "nsIEventTarget.h"
|
|
|
|
#include "nsIObserver.h"
|
|
|
|
#include "nsCOMPtr.h"
|
2014-06-21 14:26:43 +04:00
|
|
|
#include "nsThreadUtils.h"
|
2012-06-06 07:18:25 +04:00
|
|
|
#include "mozilla/Attributes.h"
|
2014-06-21 14:26:43 +04:00
|
|
|
#include "mozilla/Mutex.h"
|
2003-01-18 04:27:53 +03:00
|
|
|
|
2013-09-22 07:04:57 +04:00
|
|
|
class nsIThreadPool;
|
|
|
|
|
2016-05-19 05:02:57 +03:00
|
|
|
namespace mozilla {
|
|
|
|
namespace net {
|
|
|
|
|
2015-03-21 19:28:04 +03:00
|
|
|
class nsStreamTransportService final : public nsIStreamTransportService
|
2015-03-27 21:52:19 +03:00
|
|
|
, public nsIEventTarget
|
|
|
|
, public nsIObserver
|
2003-01-18 04:27:53 +03:00
|
|
|
{
|
|
|
|
public:
|
2013-07-19 06:24:13 +04:00
|
|
|
NS_DECL_THREADSAFE_ISUPPORTS
|
2003-01-18 04:27:53 +03:00
|
|
|
NS_DECL_NSISTREAMTRANSPORTSERVICE
|
2017-05-20 06:58:07 +03:00
|
|
|
NS_DECL_NSIEVENTTARGET_FULL
|
2006-05-10 21:30:15 +04:00
|
|
|
NS_DECL_NSIOBSERVER
|
|
|
|
|
|
|
|
nsresult Init();
|
2003-01-18 04:27:53 +03:00
|
|
|
|
2014-06-21 14:26:43 +04:00
|
|
|
nsStreamTransportService() : mShutdownLock("nsStreamTransportService.mShutdownLock"),
|
|
|
|
mIsShutdown(false) {}
|
2006-05-10 21:30:15 +04:00
|
|
|
|
|
|
|
private:
|
|
|
|
~nsStreamTransportService();
|
|
|
|
|
|
|
|
nsCOMPtr<nsIThreadPool> mPool;
|
2014-06-21 14:26:43 +04:00
|
|
|
|
|
|
|
mozilla::Mutex mShutdownLock;
|
|
|
|
bool mIsShutdown;
|
2003-01-18 04:27:53 +03:00
|
|
|
};
|
2016-05-19 05:02:57 +03:00
|
|
|
|
|
|
|
} // namespace net
|
|
|
|
} // namespace mozilla
|
|
|
|
#endif
|