1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /* vim:set ts=4 sw=4 sts=4 et cin: */
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/. */
7 #include "InputChannelThrottleQueueChild.h"
8 #include "nsThreadUtils.h"
13 NS_IMPL_ISUPPORTS_INHERITED0(InputChannelThrottleQueueChild
, ThrottleQueue
)
16 InputChannelThrottleQueueChild::RecordRead(uint32_t aBytesRead
) {
17 ThrottleQueue::RecordRead(aBytesRead
);
19 RefPtr
<InputChannelThrottleQueueChild
> self
= this;
20 NS_DispatchToMainThread(NS_NewRunnableFunction(
21 "InputChannelThrottleQueueChild::RecordRead", [self
, aBytesRead
]() {
22 if (self
->CanSend()) {
23 Unused
<< self
->SendRecordRead(aBytesRead
);
30 } // namespace mozilla