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_indexeddb_checkpermissionshelper_h__
8 #define mozilla_dom_indexeddb_checkpermissionshelper_h__
10 // Only meant to be included in IndexedDB source files, not exported.
11 #include "OpenDatabaseHelper.h"
13 #include "nsIInterfaceRequestor.h"
14 #include "nsIObserver.h"
15 #include "nsIRunnable.h"
20 BEGIN_INDEXEDDB_NAMESPACE
22 class CheckPermissionsHelper MOZ_FINAL
: public nsIRunnable
,
23 public nsIInterfaceRequestor
,
27 NS_DECL_THREADSAFE_ISUPPORTS
29 NS_DECL_NSIINTERFACEREQUESTOR
32 CheckPermissionsHelper(OpenDatabaseHelper
* aHelper
,
33 nsIDOMWindow
* aWindow
)
36 // If we're trying to delete the database, we should never prompt the user.
37 // Anything that would prompt is translated to denied.
38 mPromptAllowed(!aHelper
->mForDeletion
),
42 NS_ASSERTION(aHelper
, "Null pointer!");
43 NS_ASSERTION(aHelper
->mPersistenceType
== quota::PERSISTENCE_TYPE_PERSISTENT
,
44 "Checking permission for non persistent databases?!");
48 ~CheckPermissionsHelper() {}
50 nsRefPtr
<OpenDatabaseHelper
> mHelper
;
51 nsCOMPtr
<nsIDOMWindow
> mWindow
;
54 uint32_t mPromptResult
;
57 END_INDEXEDDB_NAMESPACE
59 #endif // mozilla_dom_indexeddb_checkpermissionshelper_h__