dom/quota/CheckQuotaHelper.h

Wed, 31 Dec 2014 06:09:35 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Wed, 31 Dec 2014 06:09:35 +0100
changeset 0
6474c204b198
permissions
-rw-r--r--

Cloned upstream origin tor-browser at tor-browser-31.3.0esr-4.5-1-build1
revision ID fc1c9ff7c1b2defdbc039f12214767608f46423f for hacking purpose.

     1 /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
     2 /* vim: set ts=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
     5  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
     7 #ifndef mozilla_dom_quota_checkquotahelper_h__
     8 #define mozilla_dom_quota_checkquotahelper_h__
    10 #include "QuotaCommon.h"
    12 #include "nsIInterfaceRequestor.h"
    13 #include "nsIObserver.h"
    14 #include "nsIRunnable.h"
    16 #include "mozilla/CondVar.h"
    17 #include "mozilla/Mutex.h"
    19 class nsIPrincipal;
    20 class nsPIDOMWindow;
    22 BEGIN_QUOTA_NAMESPACE
    24 class CheckQuotaHelper MOZ_FINAL : public nsIRunnable,
    25                                    public nsIInterfaceRequestor,
    26                                    public nsIObserver
    27 {
    28 public:
    29   NS_DECL_THREADSAFE_ISUPPORTS
    30   NS_DECL_NSIRUNNABLE
    31   NS_DECL_NSIINTERFACEREQUESTOR
    32   NS_DECL_NSIOBSERVER
    34   CheckQuotaHelper(nsPIDOMWindow* aWindow,
    35                    mozilla::Mutex& aMutex);
    37   bool
    38   PromptAndReturnQuotaIsDisabled();
    40   void
    41   Cancel();
    43   static uint32_t
    44   GetQuotaPermission(nsIPrincipal* aPrincipal);
    46 private:
    47   nsPIDOMWindow* mWindow;
    49   mozilla::Mutex& mMutex;
    50   mozilla::CondVar mCondVar;
    51   uint32_t mPromptResult;
    52   bool mWaiting;
    53   bool mHasPrompted;
    54 };
    56 END_QUOTA_NAMESPACE
    58 #endif // mozilla_dom_quota_checkquotahelper_h__

mercurial