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
|
|
|
|
|
|
|
#ifndef mozilla_dom_indexeddb_checkquotahelper_h__
|
|
|
|
#define mozilla_dom_indexeddb_checkquotahelper_h__
|
|
|
|
|
|
|
|
// Only meant to be included in IndexedDB source files, not exported.
|
|
|
|
#include "IndexedDatabase.h"
|
|
|
|
#include "IDBDatabase.h"
|
|
|
|
|
|
|
|
#include "nsIInterfaceRequestor.h"
|
|
|
|
#include "nsIObserver.h"
|
|
|
|
#include "nsIRunnable.h"
|
|
|
|
|
|
|
|
#include "mozilla/Mutex.h"
|
|
|
|
#include "mozilla/CondVar.h"
|
|
|
|
|
|
|
|
class nsPIDOMWindow;
|
|
|
|
|
|
|
|
BEGIN_INDEXEDDB_NAMESPACE
|
|
|
|
|
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:
|
|
|
|
NS_DECL_ISUPPORTS
|
|
|
|
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);
|
|
|
|
|
|
|
|
bool PromptAndReturnQuotaIsDisabled();
|
|
|
|
|
2010-10-19 10:58:39 -07:00
|
|
|
void Cancel();
|
|
|
|
|
2010-09-09 15:15:40 -07:00
|
|
|
private:
|
|
|
|
nsPIDOMWindow* mWindow;
|
|
|
|
|
|
|
|
mozilla::Mutex& mMutex;
|
|
|
|
mozilla::CondVar mCondVar;
|
|
|
|
PRUint32 mPromptResult;
|
|
|
|
bool mWaiting;
|
|
|
|
bool mHasPrompted;
|
|
|
|
};
|
|
|
|
|
|
|
|
END_INDEXEDDB_NAMESPACE
|
|
|
|
|
|
|
|
#endif // mozilla_dom_indexeddb_checkquotahelper_h__
|