|
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 public: |
|
29 NS_DECL_THREADSAFE_ISUPPORTS |
|
30 NS_DECL_NSIWEBSOCKETLISTENER |
|
31 NS_DECL_NSIINTERFACEREQUESTOR |
|
32 |
|
33 WebSocketChannelParent(nsIAuthPromptProvider* aAuthProvider, |
|
34 nsILoadContext* aLoadContext, |
|
35 PBOverrideStatus aOverrideStatus); |
|
36 |
|
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; |
|
52 |
|
53 void ActorDestroy(ActorDestroyReason why) MOZ_OVERRIDE; |
|
54 |
|
55 nsCOMPtr<nsIAuthPromptProvider> mAuthProvider; |
|
56 nsCOMPtr<nsIWebSocketChannel> mChannel; |
|
57 nsCOMPtr<nsILoadContext> mLoadContext; |
|
58 bool mIPCOpen; |
|
59 |
|
60 }; |
|
61 |
|
62 } // namespace net |
|
63 } // namespace mozilla |
|
64 |
|
65 #endif // mozilla_net_WebSocketChannelParent_h |