1 /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
2 /* vim: set ts=8 sts=2 et sw=2 tw=80: */
3 /* This Source Code Form is subject to the terms of the Mozilla Public
4 * License, v. 2.0. If a copy of the MPL was not distributed with this
5 * file, You can obtain one at https://mozilla.org/MPL/2.0/. */
7 #ifndef mozilla_WinDllServices_h
8 #define mozilla_WinDllServices_h
10 #include "mozilla/glue/WindowsDllServices.h"
11 #include "mozilla/Maybe.h"
12 #include "mozilla/MozPromise.h"
13 #include "mozilla/RefPtr.h"
17 class UntrustedModulesData
;
18 class UntrustedModulesProcessor
;
20 using UntrustedModulesPromise
=
21 MozPromise
<Maybe
<UntrustedModulesData
>, nsresult
, true>;
24 class ModulesMapResult
;
26 using ModulesTrustPromise
= MozPromise
<ModulesMapResult
, nsresult
, true>;
28 class DllServices final
: public glue::DllServices
{
30 static DllServices
* Get();
32 virtual void DisableFull() override
;
34 static const char* kTopicDllLoadedMainThread
;
35 static const char* kTopicDllLoadedNonMainThread
;
37 void StartUntrustedModulesProcessor(bool aIsReadyForBackgroundProcessing
);
38 bool IsReadyForBackgroundProcessing() const;
40 RefPtr
<UntrustedModulesPromise
> GetUntrustedModulesData();
42 RefPtr
<ModulesTrustPromise
> GetModulesTrust(ModulePaths
&& aModPaths
,
43 bool aRunAtNormalPriority
);
46 DllServices() = default;
49 void NotifyDllLoad(glue::EnhancedModuleLoadInfo
&& aModLoadInfo
) override
;
50 void NotifyModuleLoadBacklog(ModuleLoadInfoVec
&& aEvents
) override
;
52 RefPtr
<UntrustedModulesProcessor
> mUntrustedModulesProcessor
;
55 } // namespace mozilla
57 #endif // mozilla_WinDllServices_h