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