2010-09-10 02:15:40 +04:00
|
|
|
/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
|
|
|
|
/* vim: set ts=2 et sw=2 tw=80: */
|
2012-05-21 15:12:37 +04:00
|
|
|
/* This Source Code Form is subject to the terms of the Mozilla Public
|
|
|
|
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
|
|
|
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
2010-09-10 02:15:40 +04:00
|
|
|
|
2012-12-19 21:45:57 +04:00
|
|
|
#ifndef mozilla_dom_quota_checkquotahelper_h__
|
|
|
|
#define mozilla_dom_quota_checkquotahelper_h__
|
2010-09-10 02:15:40 +04:00
|
|
|
|
2012-12-19 21:45:57 +04:00
|
|
|
#include "QuotaCommon.h"
|
2010-09-10 02:15:40 +04:00
|
|
|
|
|
|
|
#include "nsIInterfaceRequestor.h"
|
|
|
|
#include "nsIObserver.h"
|
|
|
|
#include "nsIRunnable.h"
|
|
|
|
|
|
|
|
#include "mozilla/Mutex.h"
|
|
|
|
#include "mozilla/CondVar.h"
|
|
|
|
|
2013-04-01 04:10:27 +04:00
|
|
|
class nsIPrincipal;
|
2010-09-10 02:15:40 +04:00
|
|
|
class nsPIDOMWindow;
|
|
|
|
|
2012-12-19 21:45:57 +04:00
|
|
|
BEGIN_QUOTA_NAMESPACE
|
2010-09-10 02:15:40 +04:00
|
|
|
|
2012-05-15 08:50:29 +04:00
|
|
|
class CheckQuotaHelper MOZ_FINAL : public nsIRunnable,
|
|
|
|
public nsIInterfaceRequestor,
|
|
|
|
public nsIObserver
|
2010-09-10 02:15:40 +04:00
|
|
|
{
|
|
|
|
public:
|
|
|
|
NS_DECL_ISUPPORTS
|
|
|
|
NS_DECL_NSIRUNNABLE
|
|
|
|
NS_DECL_NSIINTERFACEREQUESTOR
|
|
|
|
NS_DECL_NSIOBSERVER
|
|
|
|
|
2011-12-03 21:10:21 +04:00
|
|
|
CheckQuotaHelper(nsPIDOMWindow* aWindow,
|
2010-09-10 02:15:40 +04:00
|
|
|
mozilla::Mutex& aMutex);
|
|
|
|
|
|
|
|
bool PromptAndReturnQuotaIsDisabled();
|
|
|
|
|
2010-10-19 21:58:39 +04:00
|
|
|
void Cancel();
|
|
|
|
|
2013-04-01 04:10:27 +04:00
|
|
|
static uint32_t GetQuotaPermission(nsIPrincipal* aPrincipal);
|
|
|
|
|
2010-09-10 02:15:40 +04:00
|
|
|
private:
|
|
|
|
nsPIDOMWindow* mWindow;
|
|
|
|
|
|
|
|
mozilla::Mutex& mMutex;
|
|
|
|
mozilla::CondVar mCondVar;
|
2012-08-22 19:56:38 +04:00
|
|
|
uint32_t mPromptResult;
|
2010-09-10 02:15:40 +04:00
|
|
|
bool mWaiting;
|
|
|
|
bool mHasPrompted;
|
|
|
|
};
|
|
|
|
|
2012-12-19 21:45:57 +04:00
|
|
|
END_QUOTA_NAMESPACE
|
2010-09-10 02:15:40 +04:00
|
|
|
|
2013-03-26 15:13:17 +04:00
|
|
|
#endif // mozilla_dom_quota_checkquotahelper_h__
|