2011-05-04 13:36:23 +00:00
|
|
|
/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
|
|
|
|
/* vim: set sw=2 ts=8 et tw=80 : */
|
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/. */
|
2011-05-04 13:36:23 +00:00
|
|
|
|
|
|
|
#ifndef mozilla_net_WebSocketChannelParent_h
|
|
|
|
#define mozilla_net_WebSocketChannelParent_h
|
|
|
|
|
|
|
|
#include "mozilla/net/PWebSocketParent.h"
|
2012-12-29 09:02:16 +00:00
|
|
|
#include "mozilla/net/NeckoParent.h"
|
2012-08-23 19:33:46 +00:00
|
|
|
#include "nsIInterfaceRequestor.h"
|
2011-07-05 04:18:33 +00:00
|
|
|
#include "nsIWebSocketListener.h"
|
|
|
|
#include "nsIWebSocketChannel.h"
|
2012-07-22 22:35:33 +00:00
|
|
|
#include "nsILoadContext.h"
|
2011-05-04 13:36:23 +00:00
|
|
|
#include "nsCOMPtr.h"
|
|
|
|
#include "nsString.h"
|
|
|
|
|
|
|
|
class nsIAuthPromptProvider;
|
|
|
|
|
|
|
|
namespace mozilla {
|
|
|
|
namespace net {
|
|
|
|
|
|
|
|
class WebSocketChannelParent : public PWebSocketParent,
|
|
|
|
public nsIWebSocketListener,
|
2012-08-07 04:47:48 +00:00
|
|
|
public nsIInterfaceRequestor
|
2011-05-04 13:36:23 +00:00
|
|
|
{
|
|
|
|
public:
|
|
|
|
NS_DECL_ISUPPORTS
|
|
|
|
NS_DECL_NSIWEBSOCKETLISTENER
|
|
|
|
NS_DECL_NSIINTERFACEREQUESTOR
|
|
|
|
|
2012-12-29 09:02:16 +00:00
|
|
|
WebSocketChannelParent(nsIAuthPromptProvider* aAuthProvider,
|
|
|
|
nsILoadContext* aLoadContext,
|
|
|
|
PBOverrideStatus aOverrideStatus);
|
2011-05-04 13:36:23 +00:00
|
|
|
|
|
|
|
private:
|
2012-08-23 19:33:46 +00:00
|
|
|
bool RecvAsyncOpen(const URIParams& aURI,
|
2011-05-04 13:36:23 +00:00
|
|
|
const nsCString& aOrigin,
|
|
|
|
const nsCString& aProtocol,
|
2013-03-28 22:52:16 +00:00
|
|
|
const bool& aSecure,
|
|
|
|
const uint32_t& aPingInterval,
|
|
|
|
const bool& aClientSetPingInterval,
|
|
|
|
const uint32_t& aPingTimeout,
|
|
|
|
const bool& aClientSetPingTimeout);
|
2012-08-22 15:56:38 +00:00
|
|
|
bool RecvClose(const uint16_t & code, const nsCString & reason);
|
2011-05-04 13:36:23 +00:00
|
|
|
bool RecvSendMsg(const nsCString& aMsg);
|
|
|
|
bool RecvSendBinaryMsg(const nsCString& aMsg);
|
2012-08-23 02:13:54 +00:00
|
|
|
bool RecvSendBinaryStream(const InputStreamParams& aStream,
|
2012-08-22 15:56:38 +00:00
|
|
|
const uint32_t& aLength);
|
2011-05-04 13:36:23 +00:00
|
|
|
bool RecvDeleteSelf();
|
|
|
|
|
|
|
|
void ActorDestroy(ActorDestroyReason why);
|
|
|
|
|
|
|
|
nsCOMPtr<nsIAuthPromptProvider> mAuthProvider;
|
2011-07-05 04:18:32 +00:00
|
|
|
nsCOMPtr<nsIWebSocketChannel> mChannel;
|
2012-08-07 04:47:48 +00:00
|
|
|
nsCOMPtr<nsILoadContext> mLoadContext;
|
2011-05-04 13:36:23 +00:00
|
|
|
bool mIPCOpen;
|
2012-07-22 22:35:33 +00:00
|
|
|
|
2011-05-04 13:36:23 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
} // namespace net
|
|
|
|
} // namespace mozilla
|
|
|
|
|
|
|
|
#endif // mozilla_net_WebSocketChannelParent_h
|