2013-07-29 21:36:43 +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/. */
|
|
|
|
|
|
|
|
#include "mozilla/net/PNeckoParent.h"
|
|
|
|
#include "mozilla/net/PTCPServerSocketParent.h"
|
|
|
|
#include "nsITCPSocketParent.h"
|
|
|
|
#include "nsITCPServerSocketParent.h"
|
|
|
|
#include "nsCycleCollectionParticipant.h"
|
|
|
|
#include "nsCOMPtr.h"
|
2015-01-18 00:26:10 +03:00
|
|
|
#include "nsIDOMTCPSocket.h"
|
2013-07-29 21:36:43 +04:00
|
|
|
|
|
|
|
namespace mozilla {
|
|
|
|
namespace dom {
|
|
|
|
|
|
|
|
class PBrowserParent;
|
|
|
|
|
|
|
|
class TCPServerSocketParent : public mozilla::net::PTCPServerSocketParent
|
|
|
|
, public nsITCPServerSocketParent
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
NS_DECL_CYCLE_COLLECTION_CLASS(TCPServerSocketParent)
|
|
|
|
NS_DECL_CYCLE_COLLECTING_ISUPPORTS
|
|
|
|
NS_DECL_NSITCPSERVERSOCKETPARENT
|
|
|
|
|
2015-01-18 00:26:10 +03:00
|
|
|
TCPServerSocketParent() : mNeckoParent(nullptr), mIPCOpen(false) {}
|
2013-07-29 21:36:43 +04:00
|
|
|
|
|
|
|
bool Init(PNeckoParent* neckoParent, const uint16_t& aLocalPort, const uint16_t& aBacklog,
|
|
|
|
const nsString& aBinaryType);
|
|
|
|
|
|
|
|
virtual bool RecvClose() MOZ_OVERRIDE;
|
|
|
|
virtual bool RecvRequestDelete() MOZ_OVERRIDE;
|
|
|
|
|
2014-10-30 05:03:54 +03:00
|
|
|
uint32_t GetAppId();
|
2014-12-29 11:12:17 +03:00
|
|
|
bool GetInBrowser();
|
2014-10-30 05:03:54 +03:00
|
|
|
|
2013-07-29 21:36:43 +04:00
|
|
|
void AddIPDLReference();
|
|
|
|
void ReleaseIPDLReference();
|
|
|
|
|
|
|
|
private:
|
2015-01-18 00:26:10 +03:00
|
|
|
~TCPServerSocketParent() {}
|
2014-06-23 23:56:07 +04:00
|
|
|
|
2013-07-29 21:36:43 +04:00
|
|
|
virtual void ActorDestroy(ActorDestroyReason why) MOZ_OVERRIDE;
|
|
|
|
|
|
|
|
PNeckoParent* mNeckoParent;
|
|
|
|
nsCOMPtr<nsITCPSocketIntermediary> mIntermediary;
|
2015-01-18 00:26:10 +03:00
|
|
|
nsCOMPtr<nsIDOMTCPServerSocket> mServerSocket;
|
2013-07-29 21:36:43 +04:00
|
|
|
bool mIPCOpen;
|
|
|
|
};
|
|
|
|
|
|
|
|
} // namespace dom
|
|
|
|
} // namespace mozilla
|