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_actorschild_h__
|
|
|
|
#define mozilla_dom_indexeddb_actorschild_h__
|
|
|
|
|
2014-10-16 08:56:52 +04:00
|
|
|
#include "IDBTransaction.h"
|
2014-09-27 03:21:57 +04:00
|
|
|
#include "js/RootingAPI.h"
|
|
|
|
#include "mozilla/Attributes.h"
|
|
|
|
#include "mozilla/dom/indexedDB/PBackgroundIDBCursorChild.h"
|
|
|
|
#include "mozilla/dom/indexedDB/PBackgroundIDBDatabaseChild.h"
|
2015-09-09 14:15:05 +03:00
|
|
|
#include "mozilla/dom/indexedDB/PBackgroundIDBDatabaseRequestChild.h"
|
2014-09-27 03:21:57 +04:00
|
|
|
#include "mozilla/dom/indexedDB/PBackgroundIDBFactoryChild.h"
|
|
|
|
#include "mozilla/dom/indexedDB/PBackgroundIDBFactoryRequestChild.h"
|
|
|
|
#include "mozilla/dom/indexedDB/PBackgroundIDBRequestChild.h"
|
2014-10-16 08:56:52 +04:00
|
|
|
#include "mozilla/dom/indexedDB/PBackgroundIDBSharedTypes.h"
|
2014-09-27 03:21:57 +04:00
|
|
|
#include "mozilla/dom/indexedDB/PBackgroundIDBTransactionChild.h"
|
|
|
|
#include "mozilla/dom/indexedDB/PBackgroundIDBVersionChangeTransactionChild.h"
|
2015-11-22 12:44:33 +03:00
|
|
|
#include "mozilla/dom/indexedDB/PBackgroundIndexedDBUtilsChild.h"
|
2017-06-07 13:36:42 +03:00
|
|
|
#include "mozilla/dom/PBackgroundFileHandleChild.h"
|
|
|
|
#include "mozilla/dom/PBackgroundFileRequestChild.h"
|
|
|
|
#include "mozilla/dom/PBackgroundMutableFileChild.h"
|
2014-09-27 03:21:57 +04:00
|
|
|
#include "nsAutoPtr.h"
|
|
|
|
#include "nsCOMPtr.h"
|
|
|
|
#include "nsTArray.h"
|
|
|
|
|
|
|
|
class nsIEventTarget;
|
2014-10-16 08:56:52 +04:00
|
|
|
struct nsID;
|
2014-09-27 03:21:57 +04:00
|
|
|
|
2016-10-25 22:19:06 +03:00
|
|
|
namespace JS {
|
|
|
|
struct WasmModule;
|
|
|
|
} // namespace JS
|
|
|
|
|
2014-09-27 03:21:57 +04:00
|
|
|
namespace mozilla {
|
|
|
|
namespace ipc {
|
|
|
|
|
|
|
|
class BackgroundChildImpl;
|
|
|
|
|
|
|
|
} // namespace ipc
|
|
|
|
|
|
|
|
namespace dom {
|
|
|
|
|
|
|
|
class IDBCursor;
|
|
|
|
class IDBDatabase;
|
|
|
|
class IDBFactory;
|
2017-06-07 13:36:42 +03:00
|
|
|
class IDBFileHandle;
|
|
|
|
class IDBFileRequest;
|
2014-09-27 03:21:57 +04:00
|
|
|
class IDBMutableFile;
|
|
|
|
class IDBOpenDBRequest;
|
|
|
|
class IDBRequest;
|
2015-11-22 12:44:33 +03:00
|
|
|
class IndexedDatabaseManager;
|
2016-02-17 00:46:08 +03:00
|
|
|
|
|
|
|
namespace indexedDB {
|
|
|
|
|
2014-09-27 03:21:57 +04:00
|
|
|
class Key;
|
|
|
|
class PermissionRequestChild;
|
|
|
|
class PermissionRequestParent;
|
|
|
|
class SerializedStructuredCloneReadInfo;
|
|
|
|
|
2014-10-16 08:56:52 +04:00
|
|
|
class ThreadLocal {
|
|
|
|
friend class nsAutoPtr<ThreadLocal>;
|
2016-02-17 00:46:08 +03:00
|
|
|
friend IDBFactory;
|
2014-10-16 08:56:52 +04:00
|
|
|
|
|
|
|
LoggingInfo mLoggingInfo;
|
|
|
|
IDBTransaction* mCurrentTransaction;
|
2015-04-30 21:59:36 +03:00
|
|
|
nsCString mLoggingIdString;
|
2014-10-16 08:56:52 +04:00
|
|
|
|
2017-06-07 08:55:00 +03:00
|
|
|
NS_DECL_OWNINGTHREAD
|
2014-10-16 08:56:52 +04:00
|
|
|
|
|
|
|
public:
|
2017-06-07 08:55:00 +03:00
|
|
|
void AssertIsOnOwningThread() const { NS_ASSERT_OWNINGTHREAD(ThreadLocal); }
|
2014-10-16 08:56:52 +04:00
|
|
|
|
|
|
|
const LoggingInfo& GetLoggingInfo() const {
|
|
|
|
AssertIsOnOwningThread();
|
|
|
|
|
|
|
|
return mLoggingInfo;
|
|
|
|
}
|
|
|
|
|
|
|
|
const nsID& Id() const {
|
|
|
|
AssertIsOnOwningThread();
|
|
|
|
|
|
|
|
return mLoggingInfo.backgroundChildLoggingId();
|
|
|
|
}
|
|
|
|
|
2015-04-30 21:59:36 +03:00
|
|
|
const nsCString& IdString() const {
|
|
|
|
AssertIsOnOwningThread();
|
|
|
|
|
|
|
|
return mLoggingIdString;
|
|
|
|
}
|
|
|
|
|
2014-10-16 08:56:52 +04:00
|
|
|
int64_t NextTransactionSN(IDBTransaction::Mode aMode) {
|
|
|
|
AssertIsOnOwningThread();
|
|
|
|
MOZ_ASSERT(mLoggingInfo.nextTransactionSerialNumber() < INT64_MAX);
|
|
|
|
MOZ_ASSERT(mLoggingInfo.nextVersionChangeTransactionSerialNumber() >
|
|
|
|
INT64_MIN);
|
|
|
|
|
|
|
|
if (aMode == IDBTransaction::VERSION_CHANGE) {
|
|
|
|
return mLoggingInfo.nextVersionChangeTransactionSerialNumber()--;
|
|
|
|
}
|
|
|
|
|
|
|
|
return mLoggingInfo.nextTransactionSerialNumber()++;
|
|
|
|
}
|
|
|
|
|
|
|
|
uint64_t NextRequestSN() {
|
|
|
|
AssertIsOnOwningThread();
|
|
|
|
MOZ_ASSERT(mLoggingInfo.nextRequestSerialNumber() < UINT64_MAX);
|
|
|
|
|
|
|
|
return mLoggingInfo.nextRequestSerialNumber()++;
|
|
|
|
}
|
|
|
|
|
|
|
|
void SetCurrentTransaction(IDBTransaction* aCurrentTransaction) {
|
|
|
|
AssertIsOnOwningThread();
|
|
|
|
|
|
|
|
mCurrentTransaction = aCurrentTransaction;
|
|
|
|
}
|
|
|
|
|
|
|
|
IDBTransaction* GetCurrentTransaction() const {
|
|
|
|
AssertIsOnOwningThread();
|
|
|
|
|
|
|
|
return mCurrentTransaction;
|
|
|
|
}
|
|
|
|
|
|
|
|
private:
|
2014-12-13 22:17:04 +03:00
|
|
|
explicit ThreadLocal(const nsID& aBackgroundChildLoggingId);
|
2014-10-16 08:56:52 +04:00
|
|
|
~ThreadLocal();
|
|
|
|
|
2015-01-07 02:35:02 +03:00
|
|
|
ThreadLocal() = delete;
|
|
|
|
ThreadLocal(const ThreadLocal& aOther) = delete;
|
2014-10-16 08:56:52 +04:00
|
|
|
};
|
|
|
|
|
2014-09-27 03:21:57 +04:00
|
|
|
class BackgroundFactoryChild final : public PBackgroundIDBFactoryChild {
|
|
|
|
friend class mozilla::ipc::BackgroundChildImpl;
|
2016-02-17 00:46:08 +03:00
|
|
|
friend IDBFactory;
|
2014-09-27 03:21:57 +04:00
|
|
|
|
|
|
|
IDBFactory* mFactory;
|
|
|
|
|
2017-06-07 08:55:00 +03:00
|
|
|
NS_DECL_OWNINGTHREAD
|
2014-09-27 03:21:57 +04:00
|
|
|
|
|
|
|
public:
|
2015-09-09 14:15:05 +03:00
|
|
|
void AssertIsOnOwningThread() const {
|
2017-06-07 08:55:00 +03:00
|
|
|
NS_ASSERT_OWNINGTHREAD(BackgroundFactoryChild);
|
|
|
|
}
|
2014-09-27 03:21:57 +04:00
|
|
|
|
|
|
|
IDBFactory* GetDOMObject() const {
|
|
|
|
AssertIsOnOwningThread();
|
|
|
|
return mFactory;
|
|
|
|
}
|
|
|
|
|
|
|
|
private:
|
|
|
|
// Only created by IDBFactory.
|
|
|
|
explicit BackgroundFactoryChild(IDBFactory* aFactory);
|
|
|
|
|
|
|
|
// Only destroyed by mozilla::ipc::BackgroundChildImpl.
|
|
|
|
~BackgroundFactoryChild();
|
|
|
|
|
|
|
|
void SendDeleteMeInternal();
|
|
|
|
|
|
|
|
// IPDL methods are only called by IPDL.
|
2015-03-21 19:28:04 +03:00
|
|
|
virtual void ActorDestroy(ActorDestroyReason aWhy) override;
|
2014-09-27 03:21:57 +04:00
|
|
|
|
|
|
|
virtual PBackgroundIDBFactoryRequestChild*
|
|
|
|
AllocPBackgroundIDBFactoryRequestChild(
|
|
|
|
const FactoryRequestParams& aParams) override;
|
2018-11-30 13:46:48 +03:00
|
|
|
|
2014-09-27 03:21:57 +04:00
|
|
|
virtual bool DeallocPBackgroundIDBFactoryRequestChild(
|
|
|
|
PBackgroundIDBFactoryRequestChild* aActor) override;
|
2018-11-30 13:46:48 +03:00
|
|
|
|
2014-09-27 03:21:57 +04:00
|
|
|
virtual PBackgroundIDBDatabaseChild* AllocPBackgroundIDBDatabaseChild(
|
|
|
|
const DatabaseSpec& aSpec,
|
2015-03-21 19:28:04 +03:00
|
|
|
PBackgroundIDBFactoryRequestChild* aRequest) override;
|
2018-11-30 13:46:48 +03:00
|
|
|
|
2017-02-10 10:13:45 +03:00
|
|
|
virtual bool DeallocPBackgroundIDBDatabaseChild(
|
2017-05-23 08:50:33 +03:00
|
|
|
PBackgroundIDBDatabaseChild* aActor) override;
|
2018-11-30 13:46:48 +03:00
|
|
|
|
2017-02-10 10:13:45 +03:00
|
|
|
mozilla::ipc::IPCResult RecvPBackgroundIDBDatabaseConstructor(
|
|
|
|
PBackgroundIDBDatabaseChild* aActor, const DatabaseSpec& aSpec,
|
|
|
|
PBackgroundIDBFactoryRequestChild* aRequest) override;
|
2018-11-30 13:46:48 +03:00
|
|
|
|
2015-01-07 02:35:02 +03:00
|
|
|
bool SendDeleteMe() = delete;
|
2014-09-27 03:21:57 +04:00
|
|
|
};
|
|
|
|
|
|
|
|
class BackgroundDatabaseChild;
|
|
|
|
|
|
|
|
class BackgroundRequestChildBase {
|
|
|
|
protected:
|
2015-10-18 08:24:48 +03:00
|
|
|
RefPtr<IDBRequest> mRequest;
|
2014-09-27 03:21:57 +04:00
|
|
|
|
|
|
|
public:
|
|
|
|
void AssertIsOnOwningThread() const
|
|
|
|
#ifdef DEBUG
|
|
|
|
;
|
|
|
|
#else
|
|
|
|
{
|
|
|
|
}
|
|
|
|
#endif
|
|
|
|
|
|
|
|
protected:
|
|
|
|
explicit BackgroundRequestChildBase(IDBRequest* aRequest);
|
|
|
|
|
|
|
|
virtual ~BackgroundRequestChildBase();
|
|
|
|
};
|
|
|
|
|
2015-03-21 19:28:04 +03:00
|
|
|
class BackgroundFactoryRequestChild final
|
2014-09-27 03:21:57 +04:00
|
|
|
: public BackgroundRequestChildBase,
|
|
|
|
public PBackgroundIDBFactoryRequestChild {
|
|
|
|
typedef mozilla::dom::quota::PersistenceType PersistenceType;
|
|
|
|
|
2016-02-17 00:46:08 +03:00
|
|
|
friend IDBFactory;
|
2014-09-27 03:21:57 +04:00
|
|
|
friend class BackgroundFactoryChild;
|
|
|
|
friend class BackgroundDatabaseChild;
|
|
|
|
friend class PermissionRequestChild;
|
|
|
|
friend class PermissionRequestParent;
|
|
|
|
|
2015-10-18 08:24:48 +03:00
|
|
|
RefPtr<IDBFactory> mFactory;
|
2017-10-30 09:13:40 +03:00
|
|
|
|
|
|
|
// Normally when opening of a database is successful, we receive a database
|
|
|
|
// actor in request response, so we can use it to call ReleaseDOMObject()
|
|
|
|
// which clears temporary strong reference to IDBDatabase.
|
|
|
|
// However, when there's an error, we don't receive a database actor and
|
|
|
|
// IDBRequest::mTransaction is already cleared (must be). So the only way how
|
|
|
|
// to call ReleaseDOMObject() is to have a back-reference to database actor.
|
|
|
|
// This creates a weak ref cycle between
|
|
|
|
// BackgroundFactoryRequestChild (using mDatabaseActor member) and
|
|
|
|
// BackgroundDatabaseChild actor (using mOpenRequestActor member).
|
|
|
|
// mDatabaseActor is set in EnsureDOMObject() and cleared in
|
|
|
|
// ReleaseDOMObject().
|
|
|
|
BackgroundDatabaseChild* mDatabaseActor;
|
|
|
|
|
2014-09-27 03:21:57 +04:00
|
|
|
const uint64_t mRequestedVersion;
|
|
|
|
const bool mIsDeleteOp;
|
|
|
|
|
|
|
|
public:
|
|
|
|
IDBOpenDBRequest* GetOpenDBRequest() const;
|
|
|
|
|
|
|
|
private:
|
|
|
|
// Only created by IDBFactory.
|
|
|
|
BackgroundFactoryRequestChild(IDBFactory* aFactory,
|
|
|
|
IDBOpenDBRequest* aOpenRequest,
|
|
|
|
bool aIsDeleteOp, uint64_t aRequestedVersion);
|
|
|
|
|
|
|
|
// Only destroyed by BackgroundFactoryChild.
|
|
|
|
~BackgroundFactoryRequestChild();
|
|
|
|
|
2017-10-30 09:13:40 +03:00
|
|
|
void SetDatabaseActor(BackgroundDatabaseChild* aActor);
|
|
|
|
|
2014-09-27 03:21:57 +04:00
|
|
|
bool HandleResponse(nsresult aResponse);
|
|
|
|
|
|
|
|
bool HandleResponse(const OpenDatabaseRequestResponse& aResponse);
|
|
|
|
|
|
|
|
bool HandleResponse(const DeleteDatabaseRequestResponse& aResponse);
|
|
|
|
|
|
|
|
// IPDL methods are only called by IPDL.
|
2015-03-21 19:28:04 +03:00
|
|
|
virtual void ActorDestroy(ActorDestroyReason aWhy) override;
|
2014-09-27 03:21:57 +04:00
|
|
|
|
2016-11-15 06:26:00 +03:00
|
|
|
virtual mozilla::ipc::IPCResult Recv__delete__(
|
2015-03-21 19:28:04 +03:00
|
|
|
const FactoryRequestResponse& aResponse) override;
|
2014-09-27 03:21:57 +04:00
|
|
|
|
2016-11-15 06:26:00 +03:00
|
|
|
virtual mozilla::ipc::IPCResult RecvPermissionChallenge(
|
2015-03-21 19:28:04 +03:00
|
|
|
const PrincipalInfo& aPrincipalInfo) override;
|
2014-09-27 03:21:57 +04:00
|
|
|
|
2016-11-15 06:26:00 +03:00
|
|
|
virtual mozilla::ipc::IPCResult RecvBlocked(
|
2015-03-21 19:28:04 +03:00
|
|
|
const uint64_t& aCurrentVersion) override;
|
2014-09-27 03:21:57 +04:00
|
|
|
};
|
|
|
|
|
|
|
|
class BackgroundDatabaseChild final : public PBackgroundIDBDatabaseChild {
|
|
|
|
friend class BackgroundFactoryChild;
|
|
|
|
friend class BackgroundFactoryRequestChild;
|
2016-02-17 00:46:08 +03:00
|
|
|
friend IDBDatabase;
|
2014-09-27 03:21:57 +04:00
|
|
|
|
|
|
|
nsAutoPtr<DatabaseSpec> mSpec;
|
2015-10-18 08:24:48 +03:00
|
|
|
RefPtr<IDBDatabase> mTemporaryStrongDatabase;
|
2014-09-27 03:21:57 +04:00
|
|
|
BackgroundFactoryRequestChild* mOpenRequestActor;
|
|
|
|
IDBDatabase* mDatabase;
|
|
|
|
|
|
|
|
public:
|
|
|
|
void AssertIsOnOwningThread() const
|
2015-09-09 14:15:05 +03:00
|
|
|
#ifdef DEBUG
|
2017-06-07 08:55:00 +03:00
|
|
|
;
|
|
|
|
#else
|
|
|
|
{
|
|
|
|
}
|
2015-09-09 14:15:05 +03:00
|
|
|
#endif
|
|
|
|
|
2014-09-27 03:21:57 +04:00
|
|
|
const DatabaseSpec* Spec() const {
|
|
|
|
AssertIsOnOwningThread();
|
|
|
|
return mSpec;
|
|
|
|
}
|
|
|
|
|
|
|
|
IDBDatabase* GetDOMObject() const {
|
|
|
|
AssertIsOnOwningThread();
|
|
|
|
return mDatabase;
|
|
|
|
}
|
|
|
|
|
|
|
|
private:
|
|
|
|
// Only constructed by BackgroundFactoryChild.
|
|
|
|
BackgroundDatabaseChild(const DatabaseSpec& aSpec,
|
|
|
|
BackgroundFactoryRequestChild* aOpenRequest);
|
|
|
|
|
|
|
|
// Only destroyed by BackgroundFactoryChild.
|
|
|
|
~BackgroundDatabaseChild();
|
|
|
|
|
|
|
|
void SendDeleteMeInternal();
|
|
|
|
|
|
|
|
void EnsureDOMObject();
|
|
|
|
|
|
|
|
void ReleaseDOMObject();
|
|
|
|
|
|
|
|
// IPDL methods are only called by IPDL.
|
2015-03-21 19:28:04 +03:00
|
|
|
virtual void ActorDestroy(ActorDestroyReason aWhy) override;
|
2014-09-27 03:21:57 +04:00
|
|
|
|
|
|
|
virtual PBackgroundIDBDatabaseFileChild* AllocPBackgroundIDBDatabaseFileChild(
|
2017-05-23 08:50:33 +03:00
|
|
|
const IPCBlob& aIPCBlob) override;
|
2014-09-27 03:21:57 +04:00
|
|
|
|
|
|
|
virtual bool DeallocPBackgroundIDBDatabaseFileChild(
|
|
|
|
PBackgroundIDBDatabaseFileChild* aActor) override;
|
|
|
|
|
2015-09-09 14:15:05 +03:00
|
|
|
virtual PBackgroundIDBDatabaseRequestChild*
|
|
|
|
AllocPBackgroundIDBDatabaseRequestChild(
|
|
|
|
const DatabaseRequestParams& aParams) override;
|
|
|
|
|
|
|
|
virtual bool DeallocPBackgroundIDBDatabaseRequestChild(
|
|
|
|
PBackgroundIDBDatabaseRequestChild* aActor) override;
|
|
|
|
|
2014-09-27 03:21:57 +04:00
|
|
|
virtual PBackgroundIDBTransactionChild* AllocPBackgroundIDBTransactionChild(
|
|
|
|
const nsTArray<nsString>& aObjectStoreNames, const Mode& aMode) override;
|
|
|
|
|
|
|
|
virtual bool DeallocPBackgroundIDBTransactionChild(
|
|
|
|
PBackgroundIDBTransactionChild* aActor) override;
|
|
|
|
|
|
|
|
virtual PBackgroundIDBVersionChangeTransactionChild*
|
|
|
|
AllocPBackgroundIDBVersionChangeTransactionChild(
|
|
|
|
const uint64_t& aCurrentVersion, const uint64_t& aRequestedVersion,
|
|
|
|
const int64_t& aNextObjectStoreId, const int64_t& aNextIndexId) override;
|
|
|
|
|
2016-11-15 06:26:00 +03:00
|
|
|
virtual mozilla::ipc::IPCResult
|
2014-09-27 03:21:57 +04:00
|
|
|
RecvPBackgroundIDBVersionChangeTransactionConstructor(
|
|
|
|
PBackgroundIDBVersionChangeTransactionChild* aActor,
|
|
|
|
const uint64_t& aCurrentVersion, const uint64_t& aRequestedVersion,
|
2015-09-09 14:15:05 +03:00
|
|
|
const int64_t& aNextObjectStoreId, const int64_t& aNextIndexId) override;
|
|
|
|
|
2016-11-15 06:26:00 +03:00
|
|
|
virtual bool DeallocPBackgroundIDBVersionChangeTransactionChild(
|
2014-09-27 03:21:57 +04:00
|
|
|
PBackgroundIDBVersionChangeTransactionChild* aActor) override;
|
|
|
|
|
2016-11-15 06:26:00 +03:00
|
|
|
virtual PBackgroundMutableFileChild* AllocPBackgroundMutableFileChild(
|
2015-03-21 19:28:04 +03:00
|
|
|
const nsString& aName, const nsString& aType) override;
|
2014-09-27 03:21:57 +04:00
|
|
|
|
2015-09-09 14:15:05 +03:00
|
|
|
virtual bool DeallocPBackgroundMutableFileChild(
|
|
|
|
PBackgroundMutableFileChild* aActor) override;
|
2018-11-30 13:46:48 +03:00
|
|
|
|
2016-11-15 06:26:00 +03:00
|
|
|
virtual mozilla::ipc::IPCResult RecvVersionChange(
|
2019-03-15 20:10:29 +03:00
|
|
|
const uint64_t& aOldVersion, const Maybe<uint64_t>& aNewVersion) override;
|
2018-11-30 13:46:48 +03:00
|
|
|
|
2016-05-31 13:08:20 +03:00
|
|
|
virtual mozilla::ipc::IPCResult RecvInvalidate() override;
|
|
|
|
|
2014-09-27 03:21:57 +04:00
|
|
|
virtual mozilla::ipc::IPCResult RecvCloseAfterInvalidationComplete() override;
|
2018-11-30 13:46:48 +03:00
|
|
|
|
2015-01-07 02:35:02 +03:00
|
|
|
bool SendDeleteMe() = delete;
|
2014-09-27 03:21:57 +04:00
|
|
|
};
|
|
|
|
|
2015-09-09 14:15:05 +03:00
|
|
|
class BackgroundDatabaseRequestChild final
|
|
|
|
: public BackgroundRequestChildBase,
|
|
|
|
public PBackgroundIDBDatabaseRequestChild {
|
|
|
|
friend class BackgroundDatabaseChild;
|
2016-02-17 00:46:08 +03:00
|
|
|
friend IDBDatabase;
|
2015-09-09 14:15:05 +03:00
|
|
|
|
2015-10-18 08:24:48 +03:00
|
|
|
RefPtr<IDBDatabase> mDatabase;
|
2015-09-09 14:15:05 +03:00
|
|
|
|
|
|
|
private:
|
|
|
|
// Only created by IDBDatabase.
|
|
|
|
BackgroundDatabaseRequestChild(IDBDatabase* aDatabase, IDBRequest* aRequest);
|
|
|
|
|
|
|
|
// Only destroyed by BackgroundDatabaseChild.
|
|
|
|
~BackgroundDatabaseRequestChild();
|
|
|
|
|
|
|
|
bool HandleResponse(nsresult aResponse);
|
|
|
|
|
|
|
|
bool HandleResponse(const CreateFileRequestResponse& aResponse);
|
|
|
|
|
|
|
|
// IPDL methods are only called by IPDL.
|
2016-11-15 06:26:00 +03:00
|
|
|
virtual mozilla::ipc::IPCResult Recv__delete__(
|
2015-09-09 14:15:05 +03:00
|
|
|
const DatabaseRequestResponse& aResponse) override;
|
|
|
|
};
|
|
|
|
|
2014-09-27 03:21:57 +04:00
|
|
|
class BackgroundVersionChangeTransactionChild;
|
|
|
|
|
|
|
|
class BackgroundTransactionBase {
|
|
|
|
friend class BackgroundVersionChangeTransactionChild;
|
|
|
|
|
|
|
|
// mTemporaryStrongTransaction is strong and is only valid until the end of
|
|
|
|
// NoteComplete() member function or until the NoteActorDestroyed() member
|
|
|
|
// function is called.
|
2015-10-18 08:24:48 +03:00
|
|
|
RefPtr<IDBTransaction> mTemporaryStrongTransaction;
|
2014-09-27 03:21:57 +04:00
|
|
|
|
|
|
|
protected:
|
|
|
|
// mTransaction is weak and is valid until the NoteActorDestroyed() member
|
|
|
|
// function is called.
|
|
|
|
IDBTransaction* mTransaction;
|
|
|
|
|
|
|
|
public:
|
|
|
|
#ifdef DEBUG
|
|
|
|
virtual void AssertIsOnOwningThread() const = 0;
|
|
|
|
#else
|
|
|
|
void AssertIsOnOwningThread() const {}
|
|
|
|
#endif
|
|
|
|
|
|
|
|
IDBTransaction* GetDOMObject() const {
|
|
|
|
AssertIsOnOwningThread();
|
|
|
|
return mTransaction;
|
|
|
|
}
|
|
|
|
|
|
|
|
protected:
|
|
|
|
BackgroundTransactionBase();
|
|
|
|
explicit BackgroundTransactionBase(IDBTransaction* aTransaction);
|
|
|
|
|
|
|
|
virtual ~BackgroundTransactionBase();
|
|
|
|
|
|
|
|
void NoteActorDestroyed();
|
|
|
|
|
|
|
|
void NoteComplete();
|
|
|
|
|
|
|
|
private:
|
|
|
|
// Only called by BackgroundVersionChangeTransactionChild.
|
|
|
|
void SetDOMTransaction(IDBTransaction* aDOMObject);
|
|
|
|
};
|
|
|
|
|
2015-03-21 19:28:04 +03:00
|
|
|
class BackgroundTransactionChild final : public BackgroundTransactionBase,
|
2014-09-27 03:21:57 +04:00
|
|
|
public PBackgroundIDBTransactionChild {
|
|
|
|
friend class BackgroundDatabaseChild;
|
2016-02-17 00:46:08 +03:00
|
|
|
friend IDBDatabase;
|
2014-09-27 03:21:57 +04:00
|
|
|
|
|
|
|
public:
|
|
|
|
#ifdef DEBUG
|
2015-03-21 19:28:04 +03:00
|
|
|
virtual void AssertIsOnOwningThread() const override;
|
2014-09-27 03:21:57 +04:00
|
|
|
#endif
|
|
|
|
|
|
|
|
void SendDeleteMeInternal();
|
|
|
|
|
|
|
|
private:
|
|
|
|
// Only created by IDBDatabase.
|
|
|
|
explicit BackgroundTransactionChild(IDBTransaction* aTransaction);
|
|
|
|
|
|
|
|
// Only destroyed by BackgroundDatabaseChild.
|
|
|
|
~BackgroundTransactionChild();
|
|
|
|
|
|
|
|
// IPDL methods are only called by IPDL.
|
2015-03-21 19:28:04 +03:00
|
|
|
virtual void ActorDestroy(ActorDestroyReason aWhy) override;
|
2014-09-27 03:21:57 +04:00
|
|
|
|
2015-03-21 19:28:04 +03:00
|
|
|
mozilla::ipc::IPCResult RecvComplete(const nsresult& aResult) override;
|
2014-09-27 03:21:57 +04:00
|
|
|
|
|
|
|
virtual PBackgroundIDBRequestChild* AllocPBackgroundIDBRequestChild(
|
2015-03-21 19:28:04 +03:00
|
|
|
const RequestParams& aParams) override;
|
2014-09-27 03:21:57 +04:00
|
|
|
|
|
|
|
virtual bool DeallocPBackgroundIDBRequestChild(
|
|
|
|
PBackgroundIDBRequestChild* aActor) override;
|
|
|
|
|
|
|
|
virtual PBackgroundIDBCursorChild* AllocPBackgroundIDBCursorChild(
|
2015-03-21 19:28:04 +03:00
|
|
|
const OpenCursorParams& aParams) override;
|
2014-09-27 03:21:57 +04:00
|
|
|
|
|
|
|
virtual bool DeallocPBackgroundIDBCursorChild(
|
|
|
|
PBackgroundIDBCursorChild* aActor) override;
|
|
|
|
|
2015-01-07 02:35:02 +03:00
|
|
|
bool SendDeleteMe() = delete;
|
2014-09-27 03:21:57 +04:00
|
|
|
};
|
|
|
|
|
2015-03-21 19:28:04 +03:00
|
|
|
class BackgroundVersionChangeTransactionChild final
|
2014-09-27 03:21:57 +04:00
|
|
|
: public BackgroundTransactionBase,
|
|
|
|
public PBackgroundIDBVersionChangeTransactionChild {
|
|
|
|
friend class BackgroundDatabaseChild;
|
|
|
|
|
|
|
|
IDBOpenDBRequest* mOpenDBRequest;
|
|
|
|
|
|
|
|
public:
|
|
|
|
#ifdef DEBUG
|
2015-03-21 19:28:04 +03:00
|
|
|
virtual void AssertIsOnOwningThread() const override;
|
2014-09-27 03:21:57 +04:00
|
|
|
#endif
|
|
|
|
|
2014-12-17 09:26:15 +03:00
|
|
|
void SendDeleteMeInternal(bool aFailedConstructor);
|
2014-09-27 03:21:57 +04:00
|
|
|
|
|
|
|
private:
|
|
|
|
// Only created by BackgroundDatabaseChild.
|
|
|
|
explicit BackgroundVersionChangeTransactionChild(
|
|
|
|
IDBOpenDBRequest* aOpenDBRequest);
|
|
|
|
|
|
|
|
// Only destroyed by BackgroundDatabaseChild.
|
|
|
|
~BackgroundVersionChangeTransactionChild();
|
|
|
|
|
|
|
|
// Only called by BackgroundDatabaseChild.
|
|
|
|
void SetDOMTransaction(IDBTransaction* aDOMObject) {
|
|
|
|
BackgroundTransactionBase::SetDOMTransaction(aDOMObject);
|
|
|
|
}
|
|
|
|
|
|
|
|
// IPDL methods are only called by IPDL.
|
2015-03-21 19:28:04 +03:00
|
|
|
virtual void ActorDestroy(ActorDestroyReason aWhy) override;
|
2014-09-27 03:21:57 +04:00
|
|
|
|
2015-03-21 19:28:04 +03:00
|
|
|
mozilla::ipc::IPCResult RecvComplete(const nsresult& aResult) override;
|
2014-09-27 03:21:57 +04:00
|
|
|
|
|
|
|
virtual PBackgroundIDBRequestChild* AllocPBackgroundIDBRequestChild(
|
2015-03-21 19:28:04 +03:00
|
|
|
const RequestParams& aParams) override;
|
2014-09-27 03:21:57 +04:00
|
|
|
|
|
|
|
virtual bool DeallocPBackgroundIDBRequestChild(
|
|
|
|
PBackgroundIDBRequestChild* aActor) override;
|
|
|
|
|
|
|
|
virtual PBackgroundIDBCursorChild* AllocPBackgroundIDBCursorChild(
|
2015-03-21 19:28:04 +03:00
|
|
|
const OpenCursorParams& aParams) override;
|
2014-09-27 03:21:57 +04:00
|
|
|
|
|
|
|
virtual bool DeallocPBackgroundIDBCursorChild(
|
|
|
|
PBackgroundIDBCursorChild* aActor) override;
|
|
|
|
|
2015-01-07 02:35:02 +03:00
|
|
|
bool SendDeleteMe() = delete;
|
2014-09-27 03:21:57 +04:00
|
|
|
};
|
|
|
|
|
2015-09-09 14:15:05 +03:00
|
|
|
class BackgroundMutableFileChild final : public PBackgroundMutableFileChild {
|
|
|
|
friend class BackgroundDatabaseChild;
|
2017-06-07 13:36:42 +03:00
|
|
|
friend IDBMutableFile;
|
2015-09-09 14:15:05 +03:00
|
|
|
|
2017-06-07 13:36:42 +03:00
|
|
|
RefPtr<IDBMutableFile> mTemporaryStrongMutableFile;
|
|
|
|
IDBMutableFile* mMutableFile;
|
2015-09-09 14:15:05 +03:00
|
|
|
nsString mName;
|
|
|
|
nsString mType;
|
|
|
|
|
2017-06-07 13:36:42 +03:00
|
|
|
public:
|
|
|
|
void AssertIsOnOwningThread() const
|
|
|
|
#ifdef DEBUG
|
|
|
|
;
|
|
|
|
#else
|
|
|
|
{
|
|
|
|
}
|
|
|
|
#endif
|
|
|
|
|
|
|
|
void EnsureDOMObject();
|
|
|
|
|
|
|
|
IDBMutableFile* GetDOMObject() const {
|
|
|
|
AssertIsOnOwningThread();
|
|
|
|
return mMutableFile;
|
|
|
|
}
|
|
|
|
|
|
|
|
void ReleaseDOMObject();
|
|
|
|
|
2015-09-09 14:15:05 +03:00
|
|
|
private:
|
|
|
|
// Only constructed by BackgroundDatabaseChild.
|
2017-06-07 13:36:42 +03:00
|
|
|
BackgroundMutableFileChild(const nsAString& aName, const nsAString& aType);
|
2015-09-09 14:15:05 +03:00
|
|
|
|
|
|
|
// Only destroyed by BackgroundDatabaseChild.
|
|
|
|
~BackgroundMutableFileChild();
|
|
|
|
|
2017-06-07 13:36:42 +03:00
|
|
|
void SendDeleteMeInternal();
|
|
|
|
|
|
|
|
// IPDL methods are only called by IPDL.
|
|
|
|
virtual void ActorDestroy(ActorDestroyReason aWhy) override;
|
|
|
|
|
|
|
|
virtual PBackgroundFileHandleChild* AllocPBackgroundFileHandleChild(
|
|
|
|
const FileMode& aMode) override;
|
|
|
|
|
|
|
|
virtual bool DeallocPBackgroundFileHandleChild(
|
|
|
|
PBackgroundFileHandleChild* aActor) override;
|
|
|
|
|
|
|
|
bool SendDeleteMe() = delete;
|
2015-09-09 14:15:05 +03:00
|
|
|
};
|
|
|
|
|
2014-09-27 03:21:57 +04:00
|
|
|
class BackgroundRequestChild final : public BackgroundRequestChildBase,
|
|
|
|
public PBackgroundIDBRequestChild {
|
|
|
|
friend class BackgroundTransactionChild;
|
|
|
|
friend class BackgroundVersionChangeTransactionChild;
|
2016-02-17 00:46:08 +03:00
|
|
|
friend IDBTransaction;
|
2014-09-27 03:21:57 +04:00
|
|
|
|
2016-10-25 22:19:06 +03:00
|
|
|
class PreprocessHelper;
|
|
|
|
|
2015-10-18 08:24:48 +03:00
|
|
|
RefPtr<IDBTransaction> mTransaction;
|
2016-10-26 07:51:33 +03:00
|
|
|
nsTArray<RefPtr<PreprocessHelper>> mPreprocessHelpers;
|
|
|
|
nsTArray<nsTArray<RefPtr<JS::WasmModule>>> mModuleSets;
|
|
|
|
uint32_t mRunningPreprocessHelpers;
|
|
|
|
uint32_t mCurrentModuleSetIndex;
|
|
|
|
nsresult mPreprocessResultCode;
|
|
|
|
bool mGetAll;
|
2014-09-27 03:21:57 +04:00
|
|
|
|
|
|
|
private:
|
2015-03-19 00:20:59 +03:00
|
|
|
// Only created by IDBTransaction.
|
|
|
|
explicit BackgroundRequestChild(IDBRequest* aRequest);
|
|
|
|
|
2014-09-27 03:21:57 +04:00
|
|
|
// Only destroyed by BackgroundTransactionChild or
|
|
|
|
// BackgroundVersionChangeTransactionChild.
|
|
|
|
~BackgroundRequestChild();
|
|
|
|
|
2016-10-26 07:51:33 +03:00
|
|
|
void MaybeSendContinue();
|
2016-10-25 22:19:06 +03:00
|
|
|
|
2016-10-26 07:51:33 +03:00
|
|
|
void OnPreprocessFinished(uint32_t aModuleSetIndex,
|
|
|
|
nsTArray<RefPtr<JS::WasmModule>>& aModuleSet);
|
|
|
|
|
|
|
|
void OnPreprocessFailed(uint32_t aModuleSetIndex, nsresult aErrorCode);
|
|
|
|
|
|
|
|
const nsTArray<RefPtr<JS::WasmModule>>* GetNextModuleSet(
|
|
|
|
const StructuredCloneReadInfo& aInfo);
|
2016-10-25 22:19:06 +03:00
|
|
|
|
2014-09-27 03:21:57 +04:00
|
|
|
void HandleResponse(nsresult aResponse);
|
|
|
|
|
|
|
|
void HandleResponse(const Key& aResponse);
|
|
|
|
|
|
|
|
void HandleResponse(const nsTArray<Key>& aResponse);
|
|
|
|
|
|
|
|
void HandleResponse(const SerializedStructuredCloneReadInfo& aResponse);
|
|
|
|
|
|
|
|
void HandleResponse(
|
|
|
|
const nsTArray<SerializedStructuredCloneReadInfo>& aResponse);
|
|
|
|
|
|
|
|
void HandleResponse(JS::Handle<JS::Value> aResponse);
|
|
|
|
|
|
|
|
void HandleResponse(uint64_t aResponse);
|
|
|
|
|
2016-10-26 07:51:33 +03:00
|
|
|
nsresult HandlePreprocess(const WasmModulePreprocessInfo& aPreprocessInfo);
|
|
|
|
|
|
|
|
nsresult HandlePreprocess(
|
|
|
|
const nsTArray<WasmModulePreprocessInfo>& aPreprocessInfos);
|
|
|
|
|
2014-09-27 03:21:57 +04:00
|
|
|
// IPDL methods are only called by IPDL.
|
2015-03-21 19:28:04 +03:00
|
|
|
virtual void ActorDestroy(ActorDestroyReason aWhy) override;
|
2014-09-27 03:21:57 +04:00
|
|
|
|
2016-11-15 06:26:00 +03:00
|
|
|
virtual mozilla::ipc::IPCResult Recv__delete__(
|
2015-03-21 19:28:04 +03:00
|
|
|
const RequestResponse& aResponse) override;
|
2016-10-25 22:19:06 +03:00
|
|
|
|
2016-11-15 06:26:00 +03:00
|
|
|
virtual mozilla::ipc::IPCResult RecvPreprocess(
|
2016-10-25 22:19:06 +03:00
|
|
|
const PreprocessParams& aParams) override;
|
2014-09-27 03:21:57 +04:00
|
|
|
};
|
|
|
|
|
|
|
|
class BackgroundCursorChild final : public PBackgroundIDBCursorChild {
|
|
|
|
friend class BackgroundTransactionChild;
|
|
|
|
friend class BackgroundVersionChangeTransactionChild;
|
|
|
|
|
2015-06-09 17:57:19 +03:00
|
|
|
class DelayedActionRunnable;
|
2014-09-27 03:21:57 +04:00
|
|
|
|
|
|
|
IDBRequest* mRequest;
|
|
|
|
IDBTransaction* mTransaction;
|
|
|
|
IDBObjectStore* mObjectStore;
|
|
|
|
IDBIndex* mIndex;
|
|
|
|
IDBCursor* mCursor;
|
|
|
|
|
|
|
|
// These are only set while a request is in progress.
|
2015-10-18 08:24:48 +03:00
|
|
|
RefPtr<IDBRequest> mStrongRequest;
|
|
|
|
RefPtr<IDBCursor> mStrongCursor;
|
2014-09-27 03:21:57 +04:00
|
|
|
|
|
|
|
Direction mDirection;
|
|
|
|
|
2017-06-07 08:55:00 +03:00
|
|
|
NS_DECL_OWNINGTHREAD
|
2014-09-27 03:21:57 +04:00
|
|
|
|
|
|
|
public:
|
|
|
|
BackgroundCursorChild(IDBRequest* aRequest, IDBObjectStore* aObjectStore,
|
|
|
|
Direction aDirection);
|
|
|
|
|
|
|
|
BackgroundCursorChild(IDBRequest* aRequest, IDBIndex* aIndex,
|
|
|
|
Direction aDirection);
|
|
|
|
|
|
|
|
void AssertIsOnOwningThread() const {
|
2017-06-07 08:55:00 +03:00
|
|
|
NS_ASSERT_OWNINGTHREAD(BackgroundCursorChild);
|
|
|
|
}
|
2014-09-27 03:21:57 +04:00
|
|
|
|
2016-07-26 13:51:19 +03:00
|
|
|
void SendContinueInternal(const CursorRequestParams& aParams);
|
2014-09-27 03:21:57 +04:00
|
|
|
|
|
|
|
void SendDeleteMeInternal();
|
|
|
|
|
2014-11-08 03:42:53 +03:00
|
|
|
IDBRequest* GetRequest() const {
|
|
|
|
AssertIsOnOwningThread();
|
|
|
|
|
|
|
|
return mRequest;
|
|
|
|
}
|
|
|
|
|
|
|
|
IDBObjectStore* GetObjectStore() const {
|
|
|
|
AssertIsOnOwningThread();
|
|
|
|
|
|
|
|
return mObjectStore;
|
|
|
|
}
|
|
|
|
|
|
|
|
IDBIndex* GetIndex() const {
|
|
|
|
AssertIsOnOwningThread();
|
|
|
|
|
|
|
|
return mIndex;
|
|
|
|
}
|
|
|
|
|
|
|
|
Direction GetDirection() const {
|
|
|
|
AssertIsOnOwningThread();
|
|
|
|
|
|
|
|
return mDirection;
|
|
|
|
}
|
|
|
|
|
2014-09-27 03:21:57 +04:00
|
|
|
private:
|
|
|
|
// Only destroyed by BackgroundTransactionChild or
|
|
|
|
// BackgroundVersionChangeTransactionChild.
|
|
|
|
~BackgroundCursorChild();
|
|
|
|
|
|
|
|
void HandleResponse(nsresult aResponse);
|
|
|
|
|
|
|
|
void HandleResponse(const void_t& aResponse);
|
|
|
|
|
2015-08-20 00:59:25 +03:00
|
|
|
void HandleResponse(const nsTArray<ObjectStoreCursorResponse>& aResponse);
|
2014-09-27 03:21:57 +04:00
|
|
|
|
|
|
|
void HandleResponse(const ObjectStoreKeyCursorResponse& aResponse);
|
|
|
|
|
|
|
|
void HandleResponse(const IndexCursorResponse& aResponse);
|
|
|
|
|
|
|
|
void HandleResponse(const IndexKeyCursorResponse& aResponse);
|
|
|
|
|
|
|
|
// IPDL methods are only called by IPDL.
|
2015-03-21 19:28:04 +03:00
|
|
|
virtual void ActorDestroy(ActorDestroyReason aWhy) override;
|
2014-09-27 03:21:57 +04:00
|
|
|
|
2016-11-15 06:26:00 +03:00
|
|
|
virtual mozilla::ipc::IPCResult RecvResponse(
|
2015-03-21 19:28:04 +03:00
|
|
|
const CursorResponse& aResponse) override;
|
2014-09-27 03:21:57 +04:00
|
|
|
|
|
|
|
// Force callers to use SendContinueInternal.
|
2016-07-26 13:51:19 +03:00
|
|
|
bool SendContinue(const CursorRequestParams& aParams) = delete;
|
2014-09-27 03:21:57 +04:00
|
|
|
|
2015-01-07 02:35:02 +03:00
|
|
|
bool SendDeleteMe() = delete;
|
2014-09-27 03:21:57 +04:00
|
|
|
};
|
|
|
|
|
2017-06-07 13:36:42 +03:00
|
|
|
class BackgroundFileHandleChild : public PBackgroundFileHandleChild {
|
|
|
|
friend class BackgroundMutableFileChild;
|
|
|
|
friend IDBMutableFile;
|
|
|
|
|
|
|
|
// mTemporaryStrongFileHandle is strong and is only valid until the end of
|
|
|
|
// NoteComplete() member function or until the NoteActorDestroyed() member
|
|
|
|
// function is called.
|
|
|
|
RefPtr<IDBFileHandle> mTemporaryStrongFileHandle;
|
|
|
|
|
|
|
|
// mFileHandle is weak and is valid until the NoteActorDestroyed() member
|
|
|
|
// function is called.
|
|
|
|
IDBFileHandle* mFileHandle;
|
|
|
|
|
|
|
|
public:
|
|
|
|
void AssertIsOnOwningThread() const
|
|
|
|
#ifdef DEBUG
|
|
|
|
;
|
|
|
|
#else
|
|
|
|
{
|
|
|
|
}
|
|
|
|
#endif
|
|
|
|
|
|
|
|
void SendDeleteMeInternal();
|
|
|
|
|
|
|
|
private:
|
|
|
|
// Only created by IDBMutableFile.
|
|
|
|
explicit BackgroundFileHandleChild(IDBFileHandle* aFileHandle);
|
|
|
|
|
|
|
|
~BackgroundFileHandleChild();
|
|
|
|
|
|
|
|
void NoteActorDestroyed();
|
|
|
|
|
|
|
|
void NoteComplete();
|
|
|
|
|
|
|
|
// IPDL methods are only called by IPDL.
|
|
|
|
virtual void ActorDestroy(ActorDestroyReason aWhy) override;
|
|
|
|
|
|
|
|
mozilla::ipc::IPCResult RecvComplete(const bool& aAborted) override;
|
|
|
|
|
|
|
|
virtual PBackgroundFileRequestChild* AllocPBackgroundFileRequestChild(
|
|
|
|
const FileRequestParams& aParams) override;
|
|
|
|
|
|
|
|
virtual bool DeallocPBackgroundFileRequestChild(
|
|
|
|
PBackgroundFileRequestChild* aActor) override;
|
|
|
|
|
|
|
|
bool SendDeleteMe() = delete;
|
|
|
|
};
|
|
|
|
|
|
|
|
class BackgroundFileRequestChild final : public PBackgroundFileRequestChild {
|
|
|
|
friend class BackgroundFileHandleChild;
|
|
|
|
friend IDBFileHandle;
|
|
|
|
|
|
|
|
RefPtr<IDBFileRequest> mFileRequest;
|
|
|
|
RefPtr<IDBFileHandle> mFileHandle;
|
|
|
|
bool mActorDestroyed;
|
|
|
|
|
|
|
|
public:
|
|
|
|
void AssertIsOnOwningThread() const
|
|
|
|
#ifdef DEBUG
|
|
|
|
;
|
|
|
|
#else
|
|
|
|
{
|
|
|
|
}
|
|
|
|
#endif
|
|
|
|
|
|
|
|
private:
|
|
|
|
// Only created by IDBFileHandle.
|
|
|
|
explicit BackgroundFileRequestChild(IDBFileRequest* aFileRequest);
|
|
|
|
|
|
|
|
// Only destroyed by BackgroundFileHandleChild.
|
|
|
|
~BackgroundFileRequestChild();
|
|
|
|
|
|
|
|
void HandleResponse(nsresult aResponse);
|
|
|
|
|
|
|
|
void HandleResponse(const FileRequestGetFileResponse& aResponse);
|
|
|
|
|
|
|
|
void HandleResponse(const nsCString& aResponse);
|
|
|
|
|
|
|
|
void HandleResponse(const FileRequestMetadata& aResponse);
|
|
|
|
|
|
|
|
void HandleResponse(JS::Handle<JS::Value> aResponse);
|
|
|
|
|
|
|
|
// IPDL methods are only called by IPDL.
|
|
|
|
virtual void ActorDestroy(ActorDestroyReason aWhy) override;
|
|
|
|
|
|
|
|
virtual mozilla::ipc::IPCResult Recv__delete__(
|
|
|
|
const FileRequestResponse& aResponse) override;
|
|
|
|
|
|
|
|
virtual mozilla::ipc::IPCResult RecvProgress(
|
|
|
|
const uint64_t& aProgress, const uint64_t& aProgressMax) override;
|
|
|
|
};
|
|
|
|
|
2015-11-22 12:44:33 +03:00
|
|
|
class BackgroundUtilsChild final : public PBackgroundIndexedDBUtilsChild {
|
|
|
|
friend class mozilla::ipc::BackgroundChildImpl;
|
2016-02-17 00:46:08 +03:00
|
|
|
friend IndexedDatabaseManager;
|
2015-11-22 12:44:33 +03:00
|
|
|
|
|
|
|
IndexedDatabaseManager* mManager;
|
|
|
|
|
2017-06-07 08:55:00 +03:00
|
|
|
NS_DECL_OWNINGTHREAD
|
2015-11-22 12:44:33 +03:00
|
|
|
|
|
|
|
public:
|
|
|
|
void AssertIsOnOwningThread() const {
|
2017-06-07 08:55:00 +03:00
|
|
|
NS_ASSERT_OWNINGTHREAD(BackgroundUtilsChild);
|
|
|
|
}
|
2015-11-22 12:44:33 +03:00
|
|
|
|
|
|
|
private:
|
|
|
|
// Only created by IndexedDatabaseManager.
|
|
|
|
explicit BackgroundUtilsChild(IndexedDatabaseManager* aManager);
|
|
|
|
|
|
|
|
// Only destroyed by mozilla::ipc::BackgroundChildImpl.
|
|
|
|
~BackgroundUtilsChild();
|
|
|
|
|
|
|
|
void SendDeleteMeInternal();
|
|
|
|
|
|
|
|
// IPDL methods are only called by IPDL.
|
|
|
|
virtual void ActorDestroy(ActorDestroyReason aWhy) override;
|
|
|
|
|
|
|
|
bool SendDeleteMe() = delete;
|
|
|
|
};
|
|
|
|
|
2014-09-27 03:21:57 +04:00
|
|
|
} // namespace indexedDB
|
|
|
|
} // namespace dom
|
|
|
|
} // namespace mozilla
|
|
|
|
|
|
|
|
#endif // mozilla_dom_indexeddb_actorschild_h__
|