QuotaRequestBase.cpp (1148B)
1 /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ 2 /* vim: set ts=8 sts=2 et sw=2 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 file, 5 * You can obtain one at http://mozilla.org/MPL/2.0/. */ 6 7 #include "QuotaRequestBase.h" 8 9 #include "mozilla/dom/quota/PQuotaUsageRequest.h" 10 #include "mozilla/dom/quota/QuotaManager.h" 11 12 namespace mozilla::dom::quota { 13 14 QuotaRequestBase::~QuotaRequestBase() { 15 AssertIsOnOwningThread(); 16 MOZ_ASSERT(mActorDestroyed); 17 } 18 19 void QuotaRequestBase::SendResults() { 20 AssertIsOnOwningThread(); 21 22 if (IsActorDestroyed()) { 23 if (NS_SUCCEEDED(mResultCode)) { 24 mResultCode = NS_ERROR_FAILURE; 25 } 26 } else { 27 RequestResponse response; 28 29 if (NS_SUCCEEDED(mResultCode)) { 30 GetResponse(response); 31 } else { 32 response = mResultCode; 33 } 34 35 (void)PQuotaRequestParent::Send__delete__(this, response); 36 } 37 } 38 39 void QuotaRequestBase::ActorDestroy(ActorDestroyReason aWhy) { 40 AssertIsOnOwningThread(); 41 42 NoteActorDestroyed(); 43 } 44 45 } // namespace mozilla::dom::quota