2012-05-21 11:12:37 +00: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 01:27:53 +00:00
|
|
|
|
2016-05-19 02:02:57 +00:00
|
|
|
#ifndef nsStreamTransportService_h__
|
|
|
|
#define nsStreamTransportService_h__
|
|
|
|
|
2003-01-18 01:27:53 +00:00
|
|
|
#include "nsIStreamTransportService.h"
|
2006-05-10 17:30:15 +00:00
|
|
|
#include "nsIEventTarget.h"
|
|
|
|
#include "nsIObserver.h"
|
|
|
|
#include "nsCOMPtr.h"
|
2014-06-21 10:26:43 +00:00
|
|
|
#include "nsThreadUtils.h"
|
2012-06-06 03:18:25 +00:00
|
|
|
#include "mozilla/Attributes.h"
|
2014-06-21 10:26:43 +00:00
|
|
|
#include "mozilla/Mutex.h"
|
2003-01-18 01:27:53 +00:00
|
|
|
|
2013-09-22 03:04:57 +00:00
|
|
|
class nsIThreadPool;
|
|
|
|
|
2016-05-19 02:02:57 +00:00
|
|
|
namespace mozilla {
|
|
|
|
namespace net {
|
|
|
|
|
2015-03-21 16:28:04 +00:00
|
|
|
class nsStreamTransportService final : public nsIStreamTransportService
|
2015-03-27 18:52:19 +00:00
|
|
|
, public nsIEventTarget
|
|
|
|
, public nsIObserver
|
2003-01-18 01:27:53 +00:00
|
|
|
{
|
|
|
|
public:
|
2013-07-19 02:24:13 +00:00
|
|
|
NS_DECL_THREADSAFE_ISUPPORTS
|
2003-01-18 01:27:53 +00:00
|
|
|
NS_DECL_NSISTREAMTRANSPORTSERVICE
|
2017-05-20 03:58:07 +00:00
|
|
|
NS_DECL_NSIEVENTTARGET_FULL
|
2006-05-10 17:30:15 +00:00
|
|
|
NS_DECL_NSIOBSERVER
|
|
|
|
|
|
|
|
nsresult Init();
|
2003-01-18 01:27:53 +00:00
|
|
|
|
2014-06-21 10:26:43 +00:00
|
|
|
nsStreamTransportService() : mShutdownLock("nsStreamTransportService.mShutdownLock"),
|
|
|
|
mIsShutdown(false) {}
|
2006-05-10 17:30:15 +00:00
|
|
|
|
|
|
|
private:
|
|
|
|
~nsStreamTransportService();
|
|
|
|
|
|
|
|
nsCOMPtr<nsIThreadPool> mPool;
|
2014-06-21 10:26:43 +00:00
|
|
|
|
|
|
|
mozilla::Mutex mShutdownLock;
|
|
|
|
bool mIsShutdown;
|
2003-01-18 01:27:53 +00:00
|
|
|
};
|
2016-05-19 02:02:57 +00:00
|
|
|
|
|
|
|
} // namespace net
|
|
|
|
} // namespace mozilla
|
|
|
|
#endif
|