2010-09-09 15:15:40 -07: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 04:12:37 -07: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-09 15:15:40 -07:00
|
|
|
|
2012-12-19 09:45:57 -08:00
|
|
|
#ifndef mozilla_dom_quota_checkquotahelper_h__
|
|
|
|
#define mozilla_dom_quota_checkquotahelper_h__
|
2010-09-09 15:15:40 -07:00
|
|
|
|
2012-12-19 09:45:57 -08:00
|
|
|
#include "QuotaCommon.h"
|
2010-09-09 15:15:40 -07:00
|
|
|
|
|
|
|
#include "nsIInterfaceRequestor.h"
|
|
|
|
#include "nsIObserver.h"
|
|
|
|
#include "nsIRunnable.h"
|
|
|
|
|
|
|
|
#include "mozilla/CondVar.h"
|
2013-09-10 21:18:36 -07:00
|
|
|
#include "mozilla/Mutex.h"
|
2010-09-09 15:15:40 -07:00
|
|
|
|
2013-03-31 17:10:27 -07:00
|
|
|
class nsIPrincipal;
|
2010-09-09 15:15:40 -07:00
|
|
|
class nsPIDOMWindow;
|
|
|
|
|
2012-12-19 09:45:57 -08:00
|
|
|
BEGIN_QUOTA_NAMESPACE
|
2010-09-09 15:15:40 -07:00
|
|
|
|
2012-05-14 21:50:29 -07:00
|
|
|
class CheckQuotaHelper MOZ_FINAL : public nsIRunnable,
|
|
|
|
public nsIInterfaceRequestor,
|
|
|
|
public nsIObserver
|
2010-09-09 15:15:40 -07:00
|
|
|
{
|
|
|
|
public:
|
2013-07-18 19:21:20 -07:00
|
|
|
NS_DECL_THREADSAFE_ISUPPORTS
|
2010-09-09 15:15:40 -07:00
|
|
|
NS_DECL_NSIRUNNABLE
|
|
|
|
NS_DECL_NSIINTERFACEREQUESTOR
|
|
|
|
NS_DECL_NSIOBSERVER
|
|
|
|
|
2011-12-03 09:10:21 -08:00
|
|
|
CheckQuotaHelper(nsPIDOMWindow* aWindow,
|
2010-09-09 15:15:40 -07:00
|
|
|
mozilla::Mutex& aMutex);
|
|
|
|
|
2013-09-10 21:18:36 -07:00
|
|
|
bool
|
|
|
|
PromptAndReturnQuotaIsDisabled();
|
2010-09-09 15:15:40 -07:00
|
|
|
|
2013-09-10 21:18:36 -07:00
|
|
|
void
|
|
|
|
Cancel();
|
2010-10-19 10:58:39 -07:00
|
|
|
|
2013-09-10 21:18:36 -07:00
|
|
|
static uint32_t
|
|
|
|
GetQuotaPermission(nsIPrincipal* aPrincipal);
|
2013-03-31 17:10:27 -07:00
|
|
|
|
2010-09-09 15:15:40 -07:00
|
|
|
private:
|
|
|
|
nsPIDOMWindow* mWindow;
|
|
|
|
|
|
|
|
mozilla::Mutex& mMutex;
|
|
|
|
mozilla::CondVar mCondVar;
|
2012-08-22 08:56:38 -07:00
|
|
|
uint32_t mPromptResult;
|
2010-09-09 15:15:40 -07:00
|
|
|
bool mWaiting;
|
|
|
|
bool mHasPrompted;
|
|
|
|
};
|
|
|
|
|
2012-12-19 09:45:57 -08:00
|
|
|
END_QUOTA_NAMESPACE
|
2010-09-09 15:15:40 -07:00
|
|
|
|
2013-03-26 04:13:17 -07:00
|
|
|
#endif // mozilla_dom_quota_checkquotahelper_h__
|