2015-05-03 22:32:37 +03:00
|
|
|
/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
|
|
|
|
/* vim: set ts=8 sts=2 et sw=2 tw=80: */
|
2014-09-27 03:21:57 +04: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/. */
|
|
|
|
|
|
|
|
#ifndef mozilla_dom_indexeddb_actorsparent_h__
|
|
|
|
#define mozilla_dom_indexeddb_actorsparent_h__
|
|
|
|
|
2019-02-23 19:25:48 +03:00
|
|
|
#include "nscore.h"
|
|
|
|
|
|
|
|
#include <stdint.h>
|
|
|
|
|
2019-03-22 22:14:01 +03:00
|
|
|
#include "mozilla/dom/indexedDB/PermissionRequestBase.h"
|
|
|
|
#include "mozilla/dom/PBrowserParent.h"
|
|
|
|
|
2014-09-27 03:21:57 +04:00
|
|
|
template <class>
|
|
|
|
struct already_AddRefed;
|
|
|
|
class nsIPrincipal;
|
|
|
|
|
|
|
|
namespace mozilla {
|
|
|
|
namespace dom {
|
|
|
|
|
2015-04-10 19:10:00 +03:00
|
|
|
class Element;
|
2015-09-09 14:15:05 +03:00
|
|
|
class FileHandleThreadPool;
|
2014-09-27 03:21:57 +04:00
|
|
|
|
|
|
|
namespace quota {
|
|
|
|
|
|
|
|
class Client;
|
|
|
|
|
|
|
|
} // namespace quota
|
|
|
|
|
|
|
|
namespace indexedDB {
|
|
|
|
|
2019-02-23 19:25:48 +03:00
|
|
|
class FileManager;
|
2014-10-16 08:56:52 +04:00
|
|
|
class LoggingInfo;
|
2014-09-27 03:21:57 +04:00
|
|
|
class PBackgroundIDBFactoryParent;
|
2015-11-22 12:44:33 +03:00
|
|
|
class PBackgroundIndexedDBUtilsParent;
|
2014-09-27 03:21:57 +04:00
|
|
|
|
2014-10-16 08:56:52 +04:00
|
|
|
PBackgroundIDBFactoryParent* AllocPBackgroundIDBFactoryParent(
|
|
|
|
const LoggingInfo& aLoggingInfo);
|
2014-09-27 03:21:57 +04:00
|
|
|
|
2014-10-16 08:56:52 +04:00
|
|
|
bool RecvPBackgroundIDBFactoryConstructor(PBackgroundIDBFactoryParent* aActor,
|
|
|
|
const LoggingInfo& aLoggingInfo);
|
2014-09-27 03:21:57 +04:00
|
|
|
|
|
|
|
bool DeallocPBackgroundIDBFactoryParent(PBackgroundIDBFactoryParent* aActor);
|
|
|
|
|
2015-11-22 12:44:33 +03:00
|
|
|
PBackgroundIndexedDBUtilsParent* AllocPBackgroundIndexedDBUtilsParent();
|
|
|
|
|
|
|
|
bool DeallocPBackgroundIndexedDBUtilsParent(
|
|
|
|
PBackgroundIndexedDBUtilsParent* aActor);
|
|
|
|
|
2016-02-10 18:11:25 +03:00
|
|
|
bool RecvFlushPendingFileDeletions();
|
|
|
|
|
2019-03-22 22:14:01 +03:00
|
|
|
already_AddRefed<mozilla::dom::quota::Client> CreateQuotaClient();
|
|
|
|
|
|
|
|
FileHandleThreadPool* GetFileHandleThreadPool();
|
2014-09-27 03:21:57 +04:00
|
|
|
|
2019-03-22 22:14:01 +03:00
|
|
|
class PermissionRequestHelper final : public PermissionRequestBase {
|
|
|
|
public:
|
|
|
|
PermissionRequestHelper(
|
|
|
|
Element* aOwnerElement, nsIPrincipal* aPrincipal,
|
|
|
|
PBrowserParent::IndexedDBPermissionRequestResolver& aResolver)
|
|
|
|
: PermissionRequestBase(aOwnerElement, aPrincipal),
|
|
|
|
mResolver(aResolver) {}
|
2014-09-27 03:21:57 +04:00
|
|
|
|
2019-03-22 22:14:01 +03:00
|
|
|
protected:
|
|
|
|
~PermissionRequestHelper() override = default;
|
2014-09-27 03:21:57 +04:00
|
|
|
|
2019-03-22 22:14:01 +03:00
|
|
|
private:
|
|
|
|
PBrowserParent::IndexedDBPermissionRequestResolver mResolver;
|
2014-09-27 03:21:57 +04:00
|
|
|
|
2019-03-22 22:14:01 +03:00
|
|
|
void OnPromptComplete(PermissionValue aPermissionValue) override;
|
|
|
|
};
|
2015-09-09 14:15:05 +03:00
|
|
|
|
2019-02-23 19:25:48 +03:00
|
|
|
nsresult AsyncDeleteFile(FileManager* aFileManager, int64_t aFileId);
|
|
|
|
|
2014-09-27 03:21:57 +04:00
|
|
|
} // namespace indexedDB
|
|
|
|
} // namespace dom
|
|
|
|
} // namespace mozilla
|
|
|
|
|
|
|
|
#endif // mozilla_dom_indexeddb_actorsparent_h__
|