1 /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
2 /* This Source Code Form is subject to the terms of the Mozilla Public
3 * License, v. 2.0. If a copy of the MPL was not distributed with this
4 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
9 #include "mozilla/gmp/PGMPChild.h"
10 #include "GMPTimerChild.h"
11 #include "GMPStorageChild.h"
12 #include "GMPLoader.h"
13 #include "gmp-entrypoints.h"
18 class ChildProfilerController
;
22 class GMPContentChild
;
24 class GMPChild
: public PGMPChild
{
25 friend class PGMPChild
;
28 NS_INLINE_DECL_REFCOUNTING(GMPChild
, override
)
32 bool Init(const nsAString
& aPluginPath
, const char* aParentBuildID
,
33 mozilla::ipc::UntypedEndpoint
&& aEndpoint
);
35 MessageLoop
* GMPMessageLoop();
38 GMPTimerChild
* GetGMPTimers();
39 GMPStorageChild
* GetGMPStorage();
41 #if defined(XP_MACOSX) && defined(MOZ_SANDBOX)
42 bool SetMacSandboxInfo(bool aAllowWindowServer
);
46 friend class GMPContentChild
;
50 bool GetUTF8LibPath(nsACString
& aOutLibPath
);
52 bool GetPluginName(nsACString
& aPluginName
) const;
54 mozilla::ipc::IPCResult
RecvProvideStorageId(const nsCString
& aStorageId
);
56 mozilla::ipc::IPCResult
RecvStartPlugin(const nsString
& aAdapter
);
57 mozilla::ipc::IPCResult
RecvPreloadLibs(const nsCString
& aLibs
);
59 PGMPTimerChild
* AllocPGMPTimerChild();
60 bool DeallocPGMPTimerChild(PGMPTimerChild
* aActor
);
62 PGMPStorageChild
* AllocPGMPStorageChild();
63 bool DeallocPGMPStorageChild(PGMPStorageChild
* aActor
);
65 void GMPContentChildActorDestroy(GMPContentChild
* aGMPContentChild
);
67 mozilla::ipc::IPCResult
RecvCrashPluginNow();
68 mozilla::ipc::IPCResult
RecvCloseActive();
70 mozilla::ipc::IPCResult
RecvInitGMPContentChild(
71 Endpoint
<PGMPContentChild
>&& aEndpoint
);
73 mozilla::ipc::IPCResult
RecvFlushFOGData(FlushFOGDataResolver
&& aResolver
);
75 mozilla::ipc::IPCResult
RecvTestTriggerMetrics(
76 TestTriggerMetricsResolver
&& aResolve
);
78 mozilla::ipc::IPCResult
RecvInitProfiler(
79 Endpoint
<mozilla::PProfilerChild
>&& aEndpoint
);
81 mozilla::ipc::IPCResult
RecvPreferenceUpdate(const Pref
& aPref
);
83 mozilla::ipc::IPCResult
RecvShutdown(ShutdownResolver
&& aResolver
);
86 mozilla::ipc::IPCResult
RecvInitDllServices(
87 const bool& aCanRecordReleaseTelemetry
,
88 const bool& aIsReadyForBackgroundProcessing
);
90 mozilla::ipc::IPCResult
RecvGetUntrustedModulesData(
91 GetUntrustedModulesDataResolver
&& aResolver
);
92 mozilla::ipc::IPCResult
RecvUnblockUntrustedModulesThread();
93 #endif // defined(XP_WIN)
95 void ActorDestroy(ActorDestroyReason aWhy
) override
;
96 void ProcessingError(Result aCode
, const char* aReason
) override
;
98 GMPErr
GetAPI(const char* aAPIName
, void* aHostAPI
, void** aPluginAPI
,
99 const nsACString
& aKeySystem
= ""_ns
);
101 nsTArray
<std::pair
<nsCString
, nsCString
>> MakeCDMHostVerificationPaths(
102 const nsACString
& aPluginLibPath
);
104 nsTArray
<RefPtr
<GMPContentChild
>> mGMPContentChildren
;
106 RefPtr
<GMPTimerChild
> mTimerChild
;
107 RefPtr
<GMPStorageChild
> mStorage
;
109 RefPtr
<ChildProfilerController
> mProfilerController
;
111 MessageLoop
* mGMPMessageLoop
;
112 nsString mPluginPath
;
113 nsCString mStorageId
;
114 UniquePtr
<GMPLoader
> mGMPLoader
;
116 nsTArray
<void*> mLibHandles
;
121 } // namespace mozilla
123 #endif // GMPChild_h_