2014-08-19 12:56:33 +04:00
|
|
|
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
|
|
|
|
/* 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 GMPStorageParent_h_
|
|
|
|
#define GMPStorageParent_h_
|
|
|
|
|
|
|
|
#include "mozilla/gmp/PGMPStorageParent.h"
|
2016-05-05 02:41:33 +03:00
|
|
|
#include "GMPStorage.h"
|
2014-08-19 12:56:33 +04:00
|
|
|
|
|
|
|
namespace mozilla {
|
|
|
|
namespace gmp {
|
|
|
|
|
|
|
|
class GMPParent;
|
|
|
|
|
|
|
|
class GMPStorageParent : public PGMPStorageParent {
|
2019-02-06 18:57:37 +03:00
|
|
|
friend class PGMPStorageParent;
|
|
|
|
|
2014-08-19 12:56:33 +04:00
|
|
|
public:
|
|
|
|
NS_INLINE_DECL_REFCOUNTING(GMPStorageParent)
|
2014-10-13 02:53:44 +04:00
|
|
|
GMPStorageParent(const nsCString& aNodeId, GMPParent* aPlugin);
|
2014-08-19 12:56:33 +04:00
|
|
|
|
2014-10-13 02:53:44 +04:00
|
|
|
nsresult Init();
|
2014-08-19 12:56:33 +04:00
|
|
|
void Shutdown();
|
|
|
|
|
|
|
|
protected:
|
2016-11-15 06:26:00 +03:00
|
|
|
mozilla::ipc::IPCResult RecvOpen(const nsCString& aRecordName) override;
|
|
|
|
mozilla::ipc::IPCResult RecvRead(const nsCString& aRecordName) override;
|
|
|
|
mozilla::ipc::IPCResult RecvWrite(
|
|
|
|
const nsCString& aRecordName,
|
|
|
|
InfallibleTArray<uint8_t>&& aBytes) override;
|
|
|
|
mozilla::ipc::IPCResult RecvClose(const nsCString& aRecordName) override;
|
2016-01-18 06:40:49 +03:00
|
|
|
void ActorDestroy(ActorDestroyReason aWhy) override;
|
2014-08-19 12:56:33 +04:00
|
|
|
|
|
|
|
private:
|
|
|
|
~GMPStorageParent() {}
|
|
|
|
|
2016-05-05 02:41:33 +03:00
|
|
|
RefPtr<GMPStorage> mStorage;
|
2014-10-13 02:53:44 +04:00
|
|
|
|
|
|
|
const nsCString mNodeId;
|
2015-10-18 08:24:48 +03:00
|
|
|
RefPtr<GMPParent> mPlugin;
|
2016-01-07 00:06:47 +03:00
|
|
|
// True after Shutdown(), or if Init() has not completed successfully.
|
2014-08-19 12:56:33 +04:00
|
|
|
bool mShutdown;
|
|
|
|
};
|
|
|
|
|
|
|
|
} // namespace gmp
|
|
|
|
} // namespace mozilla
|
|
|
|
|
|
|
|
#endif // GMPStorageParent_h_
|