Wed, 31 Dec 2014 06:09:35 +0100
Cloned upstream origin tor-browser at tor-browser-31.3.0esr-4.5-1-build1
revision ID fc1c9ff7c1b2defdbc039f12214767608f46423f for hacking purpose.
michael@0 | 1 | /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ |
michael@0 | 2 | /* vim: set ts=2 et sw=2 tw=80: */ |
michael@0 | 3 | /* This Source Code Form is subject to the terms of the Mozilla Public |
michael@0 | 4 | * License, v. 2.0. If a copy of the MPL was not distributed with this |
michael@0 | 5 | * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ |
michael@0 | 6 | |
michael@0 | 7 | #ifndef mozilla_dom_quota_checkquotahelper_h__ |
michael@0 | 8 | #define mozilla_dom_quota_checkquotahelper_h__ |
michael@0 | 9 | |
michael@0 | 10 | #include "QuotaCommon.h" |
michael@0 | 11 | |
michael@0 | 12 | #include "nsIInterfaceRequestor.h" |
michael@0 | 13 | #include "nsIObserver.h" |
michael@0 | 14 | #include "nsIRunnable.h" |
michael@0 | 15 | |
michael@0 | 16 | #include "mozilla/CondVar.h" |
michael@0 | 17 | #include "mozilla/Mutex.h" |
michael@0 | 18 | |
michael@0 | 19 | class nsIPrincipal; |
michael@0 | 20 | class nsPIDOMWindow; |
michael@0 | 21 | |
michael@0 | 22 | BEGIN_QUOTA_NAMESPACE |
michael@0 | 23 | |
michael@0 | 24 | class CheckQuotaHelper MOZ_FINAL : public nsIRunnable, |
michael@0 | 25 | public nsIInterfaceRequestor, |
michael@0 | 26 | public nsIObserver |
michael@0 | 27 | { |
michael@0 | 28 | public: |
michael@0 | 29 | NS_DECL_THREADSAFE_ISUPPORTS |
michael@0 | 30 | NS_DECL_NSIRUNNABLE |
michael@0 | 31 | NS_DECL_NSIINTERFACEREQUESTOR |
michael@0 | 32 | NS_DECL_NSIOBSERVER |
michael@0 | 33 | |
michael@0 | 34 | CheckQuotaHelper(nsPIDOMWindow* aWindow, |
michael@0 | 35 | mozilla::Mutex& aMutex); |
michael@0 | 36 | |
michael@0 | 37 | bool |
michael@0 | 38 | PromptAndReturnQuotaIsDisabled(); |
michael@0 | 39 | |
michael@0 | 40 | void |
michael@0 | 41 | Cancel(); |
michael@0 | 42 | |
michael@0 | 43 | static uint32_t |
michael@0 | 44 | GetQuotaPermission(nsIPrincipal* aPrincipal); |
michael@0 | 45 | |
michael@0 | 46 | private: |
michael@0 | 47 | nsPIDOMWindow* mWindow; |
michael@0 | 48 | |
michael@0 | 49 | mozilla::Mutex& mMutex; |
michael@0 | 50 | mozilla::CondVar mCondVar; |
michael@0 | 51 | uint32_t mPromptResult; |
michael@0 | 52 | bool mWaiting; |
michael@0 | 53 | bool mHasPrompted; |
michael@0 | 54 | }; |
michael@0 | 55 | |
michael@0 | 56 | END_QUOTA_NAMESPACE |
michael@0 | 57 | |
michael@0 | 58 | #endif // mozilla_dom_quota_checkquotahelper_h__ |