Source code

Revision control

Other Tools

1
/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
2
/* vim: set ts=8 sts=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 file,
5
* You can obtain one at http://mozilla.org/MPL/2.0/. */
6
7
#ifndef mozilla_dom_indexeddb_actorsparent_h__
8
#define mozilla_dom_indexeddb_actorsparent_h__
9
10
#include "nscore.h"
11
12
#include <stdint.h>
13
14
#include "mozilla/dom/indexedDB/PermissionRequestBase.h"
15
#include "mozilla/dom/PBrowserParent.h"
16
17
template <class>
18
struct already_AddRefed;
19
class nsIPrincipal;
20
21
namespace mozilla {
22
namespace dom {
23
24
class Element;
25
class FileHandleThreadPool;
26
27
namespace quota {
28
29
class Client;
30
31
} // namespace quota
32
33
namespace indexedDB {
34
35
class FileManager;
36
class LoggingInfo;
37
class PBackgroundIDBFactoryParent;
38
class PBackgroundIndexedDBUtilsParent;
39
40
PBackgroundIDBFactoryParent* AllocPBackgroundIDBFactoryParent(
41
const LoggingInfo& aLoggingInfo);
42
43
bool RecvPBackgroundIDBFactoryConstructor(PBackgroundIDBFactoryParent* aActor,
44
const LoggingInfo& aLoggingInfo);
45
46
bool DeallocPBackgroundIDBFactoryParent(PBackgroundIDBFactoryParent* aActor);
47
48
PBackgroundIndexedDBUtilsParent* AllocPBackgroundIndexedDBUtilsParent();
49
50
bool DeallocPBackgroundIndexedDBUtilsParent(
51
PBackgroundIndexedDBUtilsParent* aActor);
52
53
bool RecvFlushPendingFileDeletions();
54
55
already_AddRefed<mozilla::dom::quota::Client> CreateQuotaClient();
56
57
FileHandleThreadPool* GetFileHandleThreadPool();
58
59
class PermissionRequestHelper final : public PermissionRequestBase {
60
public:
61
PermissionRequestHelper(
62
Element* aOwnerElement, nsIPrincipal* aPrincipal,
63
PBrowserParent::IndexedDBPermissionRequestResolver& aResolver)
64
: PermissionRequestBase(aOwnerElement, aPrincipal),
65
mResolver(aResolver) {}
66
67
protected:
68
~PermissionRequestHelper() override = default;
69
70
private:
71
PBrowserParent::IndexedDBPermissionRequestResolver mResolver;
72
73
void OnPromptComplete(PermissionValue aPermissionValue) override;
74
};
75
76
nsresult AsyncDeleteFile(FileManager* aFileManager, int64_t aFileId);
77
78
} // namespace indexedDB
79
} // namespace dom
80
} // namespace mozilla
81
82
#endif // mozilla_dom_indexeddb_actorsparent_h__