Bug 1920487 - QM: Rename helpers for resolving nsresult type; r=dom-storage-reviewers...
[gecko.git] / netwerk / ipc / InputChannelThrottleQueueChild.cpp
blobef7a916b79f45f0d83314db6bd728b74591867b5
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"
10 namespace mozilla {
11 namespace net {
13 NS_IMPL_ISUPPORTS_INHERITED0(InputChannelThrottleQueueChild, ThrottleQueue)
15 NS_IMETHODIMP
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);
25 }));
26 return NS_OK;
29 } // namespace net
30 } // namespace mozilla