netwerk/protocol/websocket/WebSocketChannelParent.h

Thu, 15 Jan 2015 21:03:48 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Thu, 15 Jan 2015 21:03:48 +0100
branch
TOR_BUG_9701
changeset 11
deefc01c0e14
permissions
-rw-r--r--

Integrate friendly tips from Tor colleagues to make (or not) 4.5 alpha 3;
This includes removal of overloaded (but unused) methods, and addition of
a overlooked call to DataStruct::SetData(nsISupports, uint32_t, bool.)

     1 /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
     2 /* vim: set sw=2 ts=8 et tw=80 : */
     3 /* This Source Code Form is subject to the terms of the Mozilla Public
     4  * License, v. 2.0. If a copy of the MPL was not distributed with this
     5  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
     7 #ifndef mozilla_net_WebSocketChannelParent_h
     8 #define mozilla_net_WebSocketChannelParent_h
    10 #include "mozilla/net/PWebSocketParent.h"
    11 #include "mozilla/net/NeckoParent.h"
    12 #include "nsIInterfaceRequestor.h"
    13 #include "nsIWebSocketListener.h"
    14 #include "nsIWebSocketChannel.h"
    15 #include "nsILoadContext.h"
    16 #include "nsCOMPtr.h"
    17 #include "nsString.h"
    19 class nsIAuthPromptProvider;
    21 namespace mozilla {
    22 namespace net {
    24 class WebSocketChannelParent : public PWebSocketParent,
    25                                public nsIWebSocketListener,
    26                                public nsIInterfaceRequestor
    27 {
    28  public:
    29   NS_DECL_THREADSAFE_ISUPPORTS
    30   NS_DECL_NSIWEBSOCKETLISTENER
    31   NS_DECL_NSIINTERFACEREQUESTOR
    33   WebSocketChannelParent(nsIAuthPromptProvider* aAuthProvider,
    34                          nsILoadContext* aLoadContext,
    35                          PBOverrideStatus aOverrideStatus);
    37  private:
    38   bool RecvAsyncOpen(const URIParams& aURI,
    39                      const nsCString& aOrigin,
    40                      const nsCString& aProtocol,
    41                      const bool& aSecure,
    42                      const uint32_t& aPingInterval,
    43                      const bool& aClientSetPingInterval,
    44                      const uint32_t& aPingTimeout,
    45                      const bool& aClientSetPingTimeout) MOZ_OVERRIDE;
    46   bool RecvClose(const uint16_t & code, const nsCString & reason) MOZ_OVERRIDE;
    47   bool RecvSendMsg(const nsCString& aMsg) MOZ_OVERRIDE;
    48   bool RecvSendBinaryMsg(const nsCString& aMsg) MOZ_OVERRIDE;
    49   bool RecvSendBinaryStream(const InputStreamParams& aStream,
    50                             const uint32_t& aLength) MOZ_OVERRIDE;
    51   bool RecvDeleteSelf() MOZ_OVERRIDE;
    53   void ActorDestroy(ActorDestroyReason why) MOZ_OVERRIDE;
    55   nsCOMPtr<nsIAuthPromptProvider> mAuthProvider;
    56   nsCOMPtr<nsIWebSocketChannel> mChannel;
    57   nsCOMPtr<nsILoadContext> mLoadContext;
    58   bool mIPCOpen;
    60 };
    62 } // namespace net
    63 } // namespace mozilla
    65 #endif // mozilla_net_WebSocketChannelParent_h

mercurial