1 /* This Source Code Form is subject to the terms of the Mozilla Public
2  * License, v. 2.0. If a copy of the MPL was not distributed with this
3  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
4 
5 #ifndef mozilla_net_BackgroundDataBridgeChild_h
6 #define mozilla_net_BackgroundDataBridgeChild_h
7 
8 #include "mozilla/net/PBackgroundDataBridgeChild.h"
9 #include "mozilla/ipc/BackgroundChild.h"
10 
11 namespace mozilla {
12 namespace net {
13 
14 class HttpBackgroundChannelChild;
15 
16 class BackgroundDataBridgeChild final : public PBackgroundDataBridgeChild {
17   NS_INLINE_DECL_THREADSAFE_REFCOUNTING(BackgroundDataBridgeChild, override)
18 
19   explicit BackgroundDataBridgeChild(HttpBackgroundChannelChild* aBgChild);
20   void Destroy();
21 
22  protected:
23   virtual ~BackgroundDataBridgeChild();
24 
25   RefPtr<HttpBackgroundChannelChild> mBgChild;
26   nsCOMPtr<nsIThread> mBackgroundThread;
27 
28  public:
29   mozilla::ipc::IPCResult RecvOnTransportAndData(const uint64_t& offset,
30                                                  const uint32_t& count,
31                                                  const nsCString& data);
32 };
33 
34 }  // namespace net
35 }  // namespace mozilla
36 
37 #endif  // mozilla_net_BackgroundDataBridgeChild_h
38