2014-05-18 07:05:46 +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 GMPChild_h_
|
|
|
|
#define GMPChild_h_
|
|
|
|
|
|
|
|
#include "mozilla/gmp/PGMPChild.h"
|
2014-08-05 11:56:05 +04:00
|
|
|
#include "GMPTimerChild.h"
|
2014-08-19 12:56:33 +04:00
|
|
|
#include "GMPStorageChild.h"
|
2014-11-14 11:26:24 +03:00
|
|
|
#include "GMPLoader.h"
|
2014-05-18 07:05:46 +04:00
|
|
|
#include "gmp-entrypoints.h"
|
|
|
|
#include "prlink.h"
|
|
|
|
|
|
|
|
namespace mozilla {
|
|
|
|
namespace gmp {
|
|
|
|
|
2015-02-10 13:48:42 +03:00
|
|
|
class GMPContentChild;
|
|
|
|
|
2014-08-18 01:41:56 +04:00
|
|
|
class GMPChild : public PGMPChild
|
2014-05-18 07:05:46 +04:00
|
|
|
{
|
|
|
|
public:
|
|
|
|
GMPChild();
|
|
|
|
virtual ~GMPChild();
|
|
|
|
|
2015-08-04 07:06:32 +03:00
|
|
|
bool Init(const nsAString& aPluginPath,
|
2015-04-01 11:40:35 +03:00
|
|
|
base::ProcessId aParentPid,
|
2014-05-18 07:05:46 +04:00
|
|
|
MessageLoop* aIOLoop,
|
|
|
|
IPC::Channel* aChannel);
|
|
|
|
MessageLoop* GMPMessageLoop();
|
|
|
|
|
2014-08-05 11:56:05 +04:00
|
|
|
// Main thread only.
|
|
|
|
GMPTimerChild* GetGMPTimers();
|
2014-08-19 12:56:33 +04:00
|
|
|
GMPStorageChild* GetGMPStorage();
|
2014-08-05 11:56:05 +04:00
|
|
|
|
2014-10-24 06:19:16 +04:00
|
|
|
#if defined(XP_MACOSX) && defined(MOZ_GMP_SANDBOX)
|
2016-05-02 20:33:08 +03:00
|
|
|
bool SetMacSandboxInfo(MacSandboxPluginType aPluginType);
|
2014-10-24 06:19:16 +04:00
|
|
|
#endif
|
|
|
|
|
2014-11-14 11:26:24 +03:00
|
|
|
private:
|
2015-02-10 13:48:42 +03:00
|
|
|
friend class GMPContentChild;
|
2014-11-14 11:26:24 +03:00
|
|
|
|
2015-07-17 02:09:49 +03:00
|
|
|
bool GetUTF8LibPath(nsACString& aOutLibPath);
|
2014-11-14 11:26:24 +03:00
|
|
|
|
2016-11-15 06:26:00 +03:00
|
|
|
mozilla::ipc::IPCResult AnswerStartPlugin(const nsString& aAdapter) override;
|
|
|
|
mozilla::ipc::IPCResult RecvPreloadLibs(const nsCString& aLibs) override;
|
2014-10-13 02:53:44 +04:00
|
|
|
|
2016-01-18 06:40:49 +03:00
|
|
|
PGMPTimerChild* AllocPGMPTimerChild() override;
|
|
|
|
bool DeallocPGMPTimerChild(PGMPTimerChild* aActor) override;
|
2014-08-05 11:56:05 +04:00
|
|
|
|
2016-01-18 06:40:49 +03:00
|
|
|
PGMPStorageChild* AllocPGMPStorageChild() override;
|
|
|
|
bool DeallocPGMPStorageChild(PGMPStorageChild* aActor) override;
|
2014-08-19 12:56:33 +04:00
|
|
|
|
2015-02-10 13:48:42 +03:00
|
|
|
void GMPContentChildActorDestroy(GMPContentChild* aGMPContentChild);
|
|
|
|
|
2016-11-15 06:26:00 +03:00
|
|
|
mozilla::ipc::IPCResult RecvCrashPluginNow() override;
|
|
|
|
mozilla::ipc::IPCResult RecvCloseActive() override;
|
2014-07-31 01:40:43 +04:00
|
|
|
|
2017-01-05 23:55:27 +03:00
|
|
|
mozilla::ipc::IPCResult RecvInitGMPContentChild(Endpoint<PGMPContentChild>&& aEndpoint) override;
|
|
|
|
|
2016-01-18 06:40:49 +03:00
|
|
|
void ActorDestroy(ActorDestroyReason aWhy) override;
|
|
|
|
void ProcessingError(Result aCode, const char* aReason) override;
|
2014-05-18 07:05:46 +04:00
|
|
|
|
2016-11-11 04:55:56 +03:00
|
|
|
GMPErr GetAPI(const char* aAPIName, void* aHostAPI, void** aPluginAPI, uint32_t aDecryptorId = 0);
|
2014-11-14 11:26:24 +03:00
|
|
|
|
2015-02-10 13:48:42 +03:00
|
|
|
nsTArray<UniquePtr<GMPContentChild>> mGMPContentChildren;
|
|
|
|
|
2015-10-18 08:24:48 +03:00
|
|
|
RefPtr<GMPTimerChild> mTimerChild;
|
|
|
|
RefPtr<GMPStorageChild> mStorage;
|
2014-08-05 11:56:05 +04:00
|
|
|
|
2014-05-18 07:05:46 +04:00
|
|
|
MessageLoop* mGMPMessageLoop;
|
2015-08-04 07:06:32 +03:00
|
|
|
nsString mPluginPath;
|
2017-01-19 05:39:03 +03:00
|
|
|
UniquePtr<GMPLoader> mGMPLoader;
|
2014-05-18 07:05:46 +04:00
|
|
|
};
|
|
|
|
|
|
|
|
} // namespace gmp
|
|
|
|
} // namespace mozilla
|
|
|
|
|
|
|
|
#endif // GMPChild_h_
|