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