/src/mozilla-central/netwerk/protocol/websocket/WebSocketChannelParent.h
Line | Count | Source (jump to first uncovered line) |
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/. */ |
6 | | |
7 | | #ifndef mozilla_net_WebSocketChannelParent_h |
8 | | #define mozilla_net_WebSocketChannelParent_h |
9 | | |
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" |
18 | | |
19 | | class nsIAuthPromptProvider; |
20 | | |
21 | | namespace mozilla { |
22 | | namespace net { |
23 | | |
24 | | class WebSocketChannelParent : public PWebSocketParent, |
25 | | public nsIWebSocketListener, |
26 | | public nsIInterfaceRequestor |
27 | | { |
28 | 0 | ~WebSocketChannelParent() = default; |
29 | | public: |
30 | | NS_DECL_THREADSAFE_ISUPPORTS |
31 | | NS_DECL_NSIWEBSOCKETLISTENER |
32 | | NS_DECL_NSIINTERFACEREQUESTOR |
33 | | |
34 | | WebSocketChannelParent(nsIAuthPromptProvider* aAuthProvider, |
35 | | nsILoadContext* aLoadContext, |
36 | | PBOverrideStatus aOverrideStatus, |
37 | | uint32_t aSerial); |
38 | | |
39 | | private: |
40 | | mozilla::ipc::IPCResult RecvAsyncOpen(const OptionalURIParams& aURI, |
41 | | const nsCString& aOrigin, |
42 | | const uint64_t& aInnerWindowID, |
43 | | const nsCString& aProtocol, |
44 | | const bool& aSecure, |
45 | | const uint32_t& aPingInterval, |
46 | | const bool& aClientSetPingInterval, |
47 | | const uint32_t& aPingTimeout, |
48 | | const bool& aClientSetPingTimeout, |
49 | | const OptionalLoadInfoArgs& aLoadInfoArgs, |
50 | | const OptionalTransportProvider& aTransportProvider, |
51 | | const nsCString& aNegotiatedExtensions) override; |
52 | | mozilla::ipc::IPCResult RecvClose(const uint16_t & code, const nsCString & reason) override; |
53 | | mozilla::ipc::IPCResult RecvSendMsg(const nsCString& aMsg) override; |
54 | | mozilla::ipc::IPCResult RecvSendBinaryMsg(const nsCString& aMsg) override; |
55 | | mozilla::ipc::IPCResult RecvSendBinaryStream(const IPCStream& aStream, |
56 | | const uint32_t& aLength) override; |
57 | | mozilla::ipc::IPCResult RecvDeleteSelf() override; |
58 | | |
59 | | void ActorDestroy(ActorDestroyReason why) override; |
60 | | |
61 | | nsCOMPtr<nsIAuthPromptProvider> mAuthProvider; |
62 | | nsCOMPtr<nsIWebSocketChannel> mChannel; |
63 | | nsCOMPtr<nsILoadContext> mLoadContext; |
64 | | bool mIPCOpen; |
65 | | |
66 | | uint32_t mSerial; |
67 | | }; |
68 | | |
69 | | } // namespace net |
70 | | } // namespace mozilla |
71 | | |
72 | | #endif // mozilla_net_WebSocketChannelParent_h |