Bug 1918268 - updated libwebrtc patch stack
[gecko.git] / netwerk / ipc / InputChannelThrottleQueueParent.h
blob74d1a00bd70ed356ff3f5abc778b136e8baa5edd
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /* This Source Code Form is subject to the terms of the Mozilla Public
3 * License, v. 2.0. If a copy of the MPL was not distributed with this
4 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
6 #ifndef InputChannelThrottleQueueParent_h__
7 #define InputChannelThrottleQueueParent_h__
9 #include "nsISupportsImpl.h"
10 #include "nsIThrottledInputChannel.h"
11 #include "mozilla/net/PInputChannelThrottleQueueParent.h"
13 namespace mozilla {
14 namespace net {
16 #define INPUT_CHANNEL_THROTTLE_QUEUE_PARENT_IID \
17 { \
18 0x4f151655, 0x70b3, 0x4350, { \
19 0x9b, 0xd9, 0xe3, 0x2b, 0xe5, 0xeb, 0xb2, 0x9e \
20 } \
23 class InputChannelThrottleQueueParent final
24 : public PInputChannelThrottleQueueParent,
25 public nsIInputChannelThrottleQueue {
26 public:
27 NS_DECL_ISUPPORTS
28 NS_DECL_NSIINPUTCHANNELTHROTTLEQUEUE
29 NS_DECLARE_STATIC_IID_ACCESSOR(INPUT_CHANNEL_THROTTLE_QUEUE_PARENT_IID)
31 friend class PInputChannelThrottleQueueParent;
33 explicit InputChannelThrottleQueueParent() = default;
34 mozilla::ipc::IPCResult RecvRecordRead(const uint32_t& aBytesRead);
35 void ActorDestroy(ActorDestroyReason aWhy) override {}
37 private:
38 virtual ~InputChannelThrottleQueueParent() = default;
40 uint64_t mBytesProcessed{0};
41 uint32_t mMeanBytesPerSecond{0};
42 uint32_t mMaxBytesPerSecond{0};
45 NS_DEFINE_STATIC_IID_ACCESSOR(InputChannelThrottleQueueParent,
46 INPUT_CHANNEL_THROTTLE_QUEUE_PARENT_IID)
48 } // namespace net
49 } // namespace mozilla
51 #endif // InputChannelThrottleQueueParent_h__