netwerk/protocol/websocket/WebSocketChannelParent.h

changeset 0
6474c204b198
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/netwerk/protocol/websocket/WebSocketChannelParent.h	Wed Dec 31 06:09:35 2014 +0100
     1.3 @@ -0,0 +1,65 @@
     1.4 +/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
     1.5 +/* vim: set sw=2 ts=8 et tw=80 : */
     1.6 +/* This Source Code Form is subject to the terms of the Mozilla Public
     1.7 + * License, v. 2.0. If a copy of the MPL was not distributed with this
     1.8 + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
     1.9 +
    1.10 +#ifndef mozilla_net_WebSocketChannelParent_h
    1.11 +#define mozilla_net_WebSocketChannelParent_h
    1.12 +
    1.13 +#include "mozilla/net/PWebSocketParent.h"
    1.14 +#include "mozilla/net/NeckoParent.h"
    1.15 +#include "nsIInterfaceRequestor.h"
    1.16 +#include "nsIWebSocketListener.h"
    1.17 +#include "nsIWebSocketChannel.h"
    1.18 +#include "nsILoadContext.h"
    1.19 +#include "nsCOMPtr.h"
    1.20 +#include "nsString.h"
    1.21 +
    1.22 +class nsIAuthPromptProvider;
    1.23 +
    1.24 +namespace mozilla {
    1.25 +namespace net {
    1.26 +
    1.27 +class WebSocketChannelParent : public PWebSocketParent,
    1.28 +                               public nsIWebSocketListener,
    1.29 +                               public nsIInterfaceRequestor
    1.30 +{
    1.31 + public:
    1.32 +  NS_DECL_THREADSAFE_ISUPPORTS
    1.33 +  NS_DECL_NSIWEBSOCKETLISTENER
    1.34 +  NS_DECL_NSIINTERFACEREQUESTOR
    1.35 +
    1.36 +  WebSocketChannelParent(nsIAuthPromptProvider* aAuthProvider,
    1.37 +                         nsILoadContext* aLoadContext,
    1.38 +                         PBOverrideStatus aOverrideStatus);
    1.39 +
    1.40 + private:
    1.41 +  bool RecvAsyncOpen(const URIParams& aURI,
    1.42 +                     const nsCString& aOrigin,
    1.43 +                     const nsCString& aProtocol,
    1.44 +                     const bool& aSecure,
    1.45 +                     const uint32_t& aPingInterval,
    1.46 +                     const bool& aClientSetPingInterval,
    1.47 +                     const uint32_t& aPingTimeout,
    1.48 +                     const bool& aClientSetPingTimeout) MOZ_OVERRIDE;
    1.49 +  bool RecvClose(const uint16_t & code, const nsCString & reason) MOZ_OVERRIDE;
    1.50 +  bool RecvSendMsg(const nsCString& aMsg) MOZ_OVERRIDE;
    1.51 +  bool RecvSendBinaryMsg(const nsCString& aMsg) MOZ_OVERRIDE;
    1.52 +  bool RecvSendBinaryStream(const InputStreamParams& aStream,
    1.53 +                            const uint32_t& aLength) MOZ_OVERRIDE;
    1.54 +  bool RecvDeleteSelf() MOZ_OVERRIDE;
    1.55 +
    1.56 +  void ActorDestroy(ActorDestroyReason why) MOZ_OVERRIDE;
    1.57 +
    1.58 +  nsCOMPtr<nsIAuthPromptProvider> mAuthProvider;
    1.59 +  nsCOMPtr<nsIWebSocketChannel> mChannel;
    1.60 +  nsCOMPtr<nsILoadContext> mLoadContext;
    1.61 +  bool mIPCOpen;
    1.62 +
    1.63 +};
    1.64 +
    1.65 +} // namespace net
    1.66 +} // namespace mozilla
    1.67 +
    1.68 +#endif // mozilla_net_WebSocketChannelParent_h

mercurial