Bug 2057112: Part 1 - Rename ModulePaths to ModuleIdentifiers r=win-reviewers,necko-reviewers,media-playback-reviewers,padenot,gstoll
Rename-only, since ModuleIdentifiers will be used in later parts, instead of just paths. No substantive changes. Differential Revision: https://phabricator.services.mozilla.com/D324702
This commit is contained in:
committed by
daparks@mozilla.com
parent
e0f4201b41
commit
75b4e31ffc
@@ -6889,10 +6889,10 @@ mozilla::ipc::IPCResult ContentParent::RecvAddOrRemovePageAwakeRequest(
|
||||
|
||||
#if defined(XP_WIN)
|
||||
mozilla::ipc::IPCResult ContentParent::RecvGetModulesTrust(
|
||||
ModulePaths&& aModPaths, bool aRunAtNormalPriority,
|
||||
ModuleIdentifiers&& aModIdents, bool aRunAtNormalPriority,
|
||||
GetModulesTrustResolver&& aResolver) {
|
||||
RefPtr<DllServices> dllSvc(DllServices::Get());
|
||||
dllSvc->GetModulesTrust(std::move(aModPaths), aRunAtNormalPriority)
|
||||
dllSvc->GetModulesTrust(std::move(aModIdents), aRunAtNormalPriority)
|
||||
->Then(
|
||||
GetMainThreadSerialEventTarget(), __func__,
|
||||
[aResolver](ModulesMapResult&& aResult) {
|
||||
|
||||
@@ -1275,7 +1275,7 @@ class ContentParent final : public PContentParent,
|
||||
|
||||
#if defined(XP_WIN)
|
||||
mozilla::ipc::IPCResult RecvGetModulesTrust(
|
||||
ModulePaths&& aModPaths, bool aRunAtNormalPriority,
|
||||
ModuleIdentifiers&& aModIdents, bool aRunAtNormalPriority,
|
||||
GetModulesTrustResolver&& aResolver);
|
||||
#endif // defined(XP_WIN)
|
||||
|
||||
|
||||
@@ -137,7 +137,7 @@ using mozilla::dom::PermissionState from "mozilla/dom/PermissionMessageUtils.h";
|
||||
|
||||
#if defined(XP_WIN)
|
||||
[MoveOnly] using mozilla::UntrustedModulesData from "mozilla/UntrustedModulesData.h";
|
||||
[MoveOnly] using mozilla::ModulePaths from "mozilla/UntrustedModulesData.h";
|
||||
[MoveOnly] using mozilla::ModuleIdentifiers from "mozilla/UntrustedModulesData.h";
|
||||
[MoveOnly] using mozilla::ModulesMapResult from "mozilla/UntrustedModulesData.h";
|
||||
#endif // defined(XP_WIN)
|
||||
|
||||
@@ -1790,7 +1790,7 @@ parent:
|
||||
* trustworthiness. This API asks the chrome process to perform that
|
||||
* evaluation.
|
||||
*/
|
||||
async GetModulesTrust(ModulePaths aModPaths, bool aRunAtNormalPriority)
|
||||
async GetModulesTrust(ModuleIdentifiers aModIdents, bool aRunAtNormalPriority)
|
||||
returns (ModulesMapResult? modMapResult);
|
||||
#endif // defined(XP_WIN)
|
||||
|
||||
|
||||
@@ -497,21 +497,22 @@ mozilla::ipc::IPCResult GMPParent::RecvFOGData(ByteBuf&& aBuf) {
|
||||
|
||||
#if defined(XP_WIN)
|
||||
mozilla::ipc::IPCResult GMPParent::RecvGetModulesTrust(
|
||||
ModulePaths&& aModPaths, bool aRunAtNormalPriority,
|
||||
ModuleIdentifiers&& aModIdents, bool aRunAtNormalPriority,
|
||||
GetModulesTrustResolver&& aResolver) {
|
||||
class ModulesTrustRunnable final : public Runnable {
|
||||
public:
|
||||
ModulesTrustRunnable(ModulePaths&& aModPaths, bool aRunAtNormalPriority,
|
||||
ModulesTrustRunnable(ModuleIdentifiers&& aModIdents,
|
||||
bool aRunAtNormalPriority,
|
||||
GetModulesTrustResolver&& aResolver)
|
||||
: Runnable("GMPParent::RecvGetModulesTrust::ModulesTrustRunnable"),
|
||||
mModPaths(std::move(aModPaths)),
|
||||
mModIdents(std::move(aModIdents)),
|
||||
mResolver(std::move(aResolver)),
|
||||
mEventTarget(GetCurrentSerialEventTarget()),
|
||||
mRunAtNormalPriority(aRunAtNormalPriority) {}
|
||||
|
||||
NS_IMETHOD Run() override {
|
||||
RefPtr<DllServices> dllSvc(DllServices::Get());
|
||||
dllSvc->GetModulesTrust(std::move(mModPaths), mRunAtNormalPriority)
|
||||
dllSvc->GetModulesTrust(std::move(mModIdents), mRunAtNormalPriority)
|
||||
->Then(
|
||||
mEventTarget, __func__,
|
||||
[self = RefPtr{this}](ModulesMapResult&& aResult) {
|
||||
@@ -526,14 +527,14 @@ mozilla::ipc::IPCResult GMPParent::RecvGetModulesTrust(
|
||||
private:
|
||||
~ModulesTrustRunnable() override = default;
|
||||
|
||||
ModulePaths mModPaths;
|
||||
ModuleIdentifiers mModIdents;
|
||||
GetModulesTrustResolver mResolver;
|
||||
nsCOMPtr<nsISerialEventTarget> mEventTarget;
|
||||
bool mRunAtNormalPriority;
|
||||
};
|
||||
|
||||
NS_DispatchToMainThread(MakeAndAddRef<ModulesTrustRunnable>(
|
||||
std::move(aModPaths), aRunAtNormalPriority, std::move(aResolver)));
|
||||
std::move(aModIdents), aRunAtNormalPriority, std::move(aResolver)));
|
||||
return IPC_OK();
|
||||
}
|
||||
#endif // defined(XP_WIN)
|
||||
|
||||
@@ -175,7 +175,7 @@ class GMPParent final : public PGMPParent,
|
||||
|
||||
#if defined(XP_WIN)
|
||||
mozilla::ipc::IPCResult RecvGetModulesTrust(
|
||||
ModulePaths&& aModPaths, bool aRunAtNormalPriority,
|
||||
ModuleIdentifiers&& aModIdents, bool aRunAtNormalPriority,
|
||||
GetModulesTrustResolver&& aResolver);
|
||||
#endif // defined(XP_WIN)
|
||||
|
||||
|
||||
@@ -251,7 +251,7 @@ void SendFOGData(ipc::ByteBuf&& buf) {
|
||||
|
||||
#ifdef XP_WIN
|
||||
RefPtr<PGMPChild::GetModulesTrustPromise> SendGetModulesTrust(
|
||||
ModulePaths&& aModules, bool aRunAtNormalPriority) {
|
||||
ModuleIdentifiers&& aModules, bool aRunAtNormalPriority) {
|
||||
if (!sChild) {
|
||||
return PGMPChild::GetModulesTrustPromise::CreateAndReject(
|
||||
ipc::ResponseRejectReason::SendError, __func__);
|
||||
|
||||
@@ -11,7 +11,7 @@
|
||||
|
||||
namespace mozilla {
|
||||
#ifdef XP_WIN
|
||||
struct ModulePaths;
|
||||
struct ModuleIdentifiers;
|
||||
#endif
|
||||
|
||||
namespace ipc {
|
||||
@@ -46,7 +46,7 @@ void SendFOGData(ipc::ByteBuf&& buf);
|
||||
|
||||
#ifdef XP_WIN
|
||||
RefPtr<PGMPChild::GetModulesTrustPromise> SendGetModulesTrust(
|
||||
ModulePaths&& aModules, bool aRunNormal);
|
||||
ModuleIdentifiers&& aModules, bool aRunNormal);
|
||||
#endif
|
||||
|
||||
} // namespace gmp
|
||||
|
||||
@@ -12,7 +12,7 @@ include protocol PProfiler;
|
||||
|
||||
#if defined(XP_WIN)
|
||||
[MoveOnly] using mozilla::UntrustedModulesData from "mozilla/UntrustedModulesData.h";
|
||||
[MoveOnly] using mozilla::ModulePaths from "mozilla/UntrustedModulesData.h";
|
||||
[MoveOnly] using mozilla::ModuleIdentifiers from "mozilla/UntrustedModulesData.h";
|
||||
[MoveOnly] using mozilla::ModulesMapResult from "mozilla/UntrustedModulesData.h";
|
||||
#endif
|
||||
|
||||
@@ -42,7 +42,7 @@ parent:
|
||||
async FOGData(ByteBuf buf);
|
||||
|
||||
#if defined(XP_WIN)
|
||||
async GetModulesTrust(ModulePaths aModPaths, bool aRunAtNormalPriority)
|
||||
async GetModulesTrust(ModuleIdentifiers aModIdents, bool aRunAtNormalPriority)
|
||||
returns (ModulesMapResult? modMapResult);
|
||||
#endif // defined(XP_WIN)
|
||||
|
||||
|
||||
@@ -30,7 +30,7 @@ using mozilla::Telemetry::DiscardedData from "mozilla/TelemetryComms.h";
|
||||
|
||||
#if defined(XP_WIN)
|
||||
[MoveOnly] using mozilla::UntrustedModulesData from "mozilla/UntrustedModulesData.h";
|
||||
[MoveOnly] using mozilla::ModulePaths from "mozilla/UntrustedModulesData.h";
|
||||
[MoveOnly] using mozilla::ModuleIdentifiers from "mozilla/UntrustedModulesData.h";
|
||||
[MoveOnly] using mozilla::ModulesMapResult from "mozilla/UntrustedModulesData.h";
|
||||
#endif // defined(XP_WIN)
|
||||
|
||||
@@ -102,7 +102,7 @@ child:
|
||||
async AddMemoryReport(MemoryReport aReport);
|
||||
|
||||
#if defined(XP_WIN)
|
||||
async GetModulesTrust(ModulePaths aModPaths, bool aRunAtNormalPriority)
|
||||
async GetModulesTrust(ModuleIdentifiers aModIdents, bool aRunAtNormalPriority)
|
||||
returns (ModulesMapResult? modMapResult);
|
||||
#endif // defined(XP_WIN)
|
||||
|
||||
|
||||
@@ -131,10 +131,10 @@ mozilla::ipc::IPCResult RDDChild::RecvAddMemoryReport(
|
||||
|
||||
#if defined(XP_WIN)
|
||||
mozilla::ipc::IPCResult RDDChild::RecvGetModulesTrust(
|
||||
ModulePaths&& aModPaths, bool aRunAtNormalPriority,
|
||||
ModuleIdentifiers&& aModIdents, bool aRunAtNormalPriority,
|
||||
GetModulesTrustResolver&& aResolver) {
|
||||
RefPtr<DllServices> dllSvc(DllServices::Get());
|
||||
dllSvc->GetModulesTrust(std::move(aModPaths), aRunAtNormalPriority)
|
||||
dllSvc->GetModulesTrust(std::move(aModIdents), aRunAtNormalPriority)
|
||||
->Then(
|
||||
GetMainThreadSerialEventTarget(), __func__,
|
||||
[aResolver](ModulesMapResult&& aResult) {
|
||||
|
||||
@@ -44,7 +44,7 @@ class RDDChild final : public PRDDChild,
|
||||
mozilla::ipc::IPCResult RecvAddMemoryReport(const MemoryReport& aReport);
|
||||
#if defined(XP_WIN)
|
||||
mozilla::ipc::IPCResult RecvGetModulesTrust(
|
||||
ModulePaths&& aModPaths, bool aRunAtNormalPriority,
|
||||
ModuleIdentifiers&& aModIdents, bool aRunAtNormalPriority,
|
||||
GetModulesTrustResolver&& aResolver);
|
||||
#endif // defined(XP_WIN)
|
||||
mozilla::ipc::IPCResult RecvUpdateMediaCodecsSupported(
|
||||
|
||||
@@ -42,7 +42,7 @@ using mozilla::Telemetry::DiscardedData from "mozilla/TelemetryComms.h";
|
||||
|
||||
#if defined(XP_WIN)
|
||||
[MoveOnly] using mozilla::UntrustedModulesData from "mozilla/UntrustedModulesData.h";
|
||||
[MoveOnly] using mozilla::ModulePaths from "mozilla/UntrustedModulesData.h";
|
||||
[MoveOnly] using mozilla::ModuleIdentifiers from "mozilla/UntrustedModulesData.h";
|
||||
[MoveOnly] using mozilla::ModulesMapResult from "mozilla/UntrustedModulesData.h";
|
||||
#endif // defined(XP_WIN)
|
||||
|
||||
@@ -70,7 +70,7 @@ parent:
|
||||
async GeckoTraceExport(ByteBuf aBuf);
|
||||
|
||||
#if defined(XP_WIN)
|
||||
async GetModulesTrust(ModulePaths aModPaths, bool aRunAtNormalPriority)
|
||||
async GetModulesTrust(ModuleIdentifiers aModIdents, bool aRunAtNormalPriority)
|
||||
returns (ModulesMapResult? modMapResult);
|
||||
#endif // defined(XP_WIN)
|
||||
|
||||
|
||||
@@ -75,10 +75,10 @@ mozilla::ipc::IPCResult UtilityProcessParent::RecvGeckoTraceExport(
|
||||
|
||||
#if defined(XP_WIN)
|
||||
mozilla::ipc::IPCResult UtilityProcessParent::RecvGetModulesTrust(
|
||||
ModulePaths&& aModPaths, bool aRunAtNormalPriority,
|
||||
ModuleIdentifiers&& aModIdents, bool aRunAtNormalPriority,
|
||||
GetModulesTrustResolver&& aResolver) {
|
||||
RefPtr<DllServices> dllSvc(DllServices::Get());
|
||||
dllSvc->GetModulesTrust(std::move(aModPaths), aRunAtNormalPriority)
|
||||
dllSvc->GetModulesTrust(std::move(aModIdents), aRunAtNormalPriority)
|
||||
->Then(
|
||||
GetMainThreadSerialEventTarget(), __func__,
|
||||
[aResolver](ModulesMapResult&& aResult) {
|
||||
|
||||
@@ -42,7 +42,7 @@ class UtilityProcessParent final
|
||||
|
||||
#if defined(XP_WIN)
|
||||
mozilla::ipc::IPCResult RecvGetModulesTrust(
|
||||
ModulePaths&& aModPaths, bool aRunAtNormalPriority,
|
||||
ModuleIdentifiers&& aModIdents, bool aRunAtNormalPriority,
|
||||
GetModulesTrustResolver&& aResolver);
|
||||
#endif // defined(XP_WIN)
|
||||
|
||||
|
||||
@@ -50,7 +50,7 @@ using nsIDNSService::DNSFlags from "nsIDNSService.h";
|
||||
|
||||
#if defined(XP_WIN)
|
||||
[MoveOnly] using mozilla::UntrustedModulesData from "mozilla/UntrustedModulesData.h";
|
||||
[MoveOnly] using mozilla::ModulePaths from "mozilla/UntrustedModulesData.h";
|
||||
[MoveOnly] using mozilla::ModuleIdentifiers from "mozilla/UntrustedModulesData.h";
|
||||
[MoveOnly] using mozilla::ModulesMapResult from "mozilla/UntrustedModulesData.h";
|
||||
#endif // defined(XP_WIN)
|
||||
|
||||
@@ -149,7 +149,7 @@ parent:
|
||||
async AppleFastDatapathProbeResult(bool aAvailable);
|
||||
#endif
|
||||
#if defined(XP_WIN)
|
||||
async GetModulesTrust(ModulePaths aModPaths, bool aRunAtNormalPriority)
|
||||
async GetModulesTrust(ModuleIdentifiers aModIdents, bool aRunAtNormalPriority)
|
||||
returns (ModulesMapResult? modMapResult);
|
||||
#endif // defined(XP_WIN)
|
||||
|
||||
|
||||
@@ -363,10 +363,10 @@ mozilla::ipc::IPCResult SocketProcessParent::RecvSSLTokensCacheData(
|
||||
|
||||
#if defined(XP_WIN)
|
||||
mozilla::ipc::IPCResult SocketProcessParent::RecvGetModulesTrust(
|
||||
ModulePaths&& aModPaths, bool aRunAtNormalPriority,
|
||||
ModuleIdentifiers&& aModIdents, bool aRunAtNormalPriority,
|
||||
GetModulesTrustResolver&& aResolver) {
|
||||
RefPtr<DllServices> dllSvc(DllServices::Get());
|
||||
dllSvc->GetModulesTrust(std::move(aModPaths), aRunAtNormalPriority)
|
||||
dllSvc->GetModulesTrust(std::move(aModIdents), aRunAtNormalPriority)
|
||||
->Then(
|
||||
GetMainThreadSerialEventTarget(), __func__,
|
||||
[aResolver](ModulesMapResult&& aResult) {
|
||||
|
||||
@@ -105,7 +105,7 @@ class SocketProcessParent final
|
||||
#endif
|
||||
#if defined(XP_WIN)
|
||||
mozilla::ipc::IPCResult RecvGetModulesTrust(
|
||||
ModulePaths&& aModPaths, bool aRunAtNormalPriority,
|
||||
ModuleIdentifiers&& aModIdents, bool aRunAtNormalPriority,
|
||||
GetModulesTrustResolver&& aResolver);
|
||||
#endif // defined(XP_WIN)
|
||||
|
||||
|
||||
@@ -109,22 +109,22 @@ class ModuleRecord final {
|
||||
* serialized from either representation into a common format over the wire.
|
||||
* Deserialization always uses the Vector representation.
|
||||
*/
|
||||
struct ModulePaths final {
|
||||
struct ModuleIdentifiers final {
|
||||
using SetType = nsTHashtable<nsStringCaseInsensitiveHashKey>;
|
||||
using VecType = Vector<nsString>;
|
||||
|
||||
Variant<SetType, VecType> mModuleNtPaths;
|
||||
|
||||
template <typename T>
|
||||
explicit ModulePaths(T&& aPaths)
|
||||
explicit ModuleIdentifiers(T&& aPaths)
|
||||
: mModuleNtPaths(AsVariant(std::forward<T>(aPaths))) {}
|
||||
|
||||
ModulePaths() : mModuleNtPaths(VecType()) {}
|
||||
ModuleIdentifiers() : mModuleNtPaths(VecType()) {}
|
||||
|
||||
ModulePaths(const ModulePaths& aOther) = delete;
|
||||
ModulePaths(ModulePaths&& aOther) = default;
|
||||
ModulePaths& operator=(const ModulePaths&) = delete;
|
||||
ModulePaths& operator=(ModulePaths&&) = default;
|
||||
ModuleIdentifiers(const ModuleIdentifiers& aOther) = delete;
|
||||
ModuleIdentifiers(ModuleIdentifiers&& aOther) = default;
|
||||
ModuleIdentifiers& operator=(const ModuleIdentifiers&) = delete;
|
||||
ModuleIdentifiers& operator=(ModuleIdentifiers&&) = default;
|
||||
};
|
||||
|
||||
class ProcessedModuleLoadEvent final {
|
||||
@@ -392,8 +392,8 @@ struct ParamTraits<mozilla::ModulesMap> {
|
||||
};
|
||||
|
||||
template <>
|
||||
struct ParamTraits<mozilla::ModulePaths> {
|
||||
typedef mozilla::ModulePaths paramType;
|
||||
struct ParamTraits<mozilla::ModuleIdentifiers> {
|
||||
typedef mozilla::ModuleIdentifiers paramType;
|
||||
|
||||
static void Write(MessageWriter* aWriter, const paramType& aParam) {
|
||||
aParam.mModuleNtPaths.match(
|
||||
@@ -409,8 +409,8 @@ struct ParamTraits<mozilla::ModulePaths> {
|
||||
return false;
|
||||
}
|
||||
|
||||
// As noted in the comments for ModulePaths, we only deserialize using the
|
||||
// Vector representation.
|
||||
// As noted in the comments for ModuleIdentifiers, we only deserialize using
|
||||
// the Vector representation.
|
||||
auto& vec = aResult->mModuleNtPaths.as<paramType::VecType>();
|
||||
if (!vec.reserve(len)) {
|
||||
return false;
|
||||
@@ -632,7 +632,7 @@ namespace mozilla {
|
||||
|
||||
// For compiling IPDL on non-Windows platforms
|
||||
using UntrustedModulesData = uint32_t;
|
||||
using ModulePaths = uint32_t;
|
||||
using ModuleIdentifiers = uint32_t;
|
||||
using ModulesMapResult = uint32_t;
|
||||
|
||||
} // namespace mozilla
|
||||
|
||||
@@ -379,7 +379,7 @@ RefPtr<UntrustedModulesPromise> UntrustedModulesProcessor::GetProcessedData() {
|
||||
}
|
||||
|
||||
RefPtr<ModulesTrustPromise> UntrustedModulesProcessor::GetModulesTrust(
|
||||
ModulePaths&& aModPaths, bool aRunAtNormalPriority) {
|
||||
ModuleIdentifiers&& aModIdents, bool aRunAtNormalPriority) {
|
||||
MOZ_ASSERT(XRE_IsParentProcess() && NS_IsMainThread());
|
||||
|
||||
if (!IsReadyForBackgroundProcessing()) {
|
||||
@@ -388,9 +388,9 @@ RefPtr<ModulesTrustPromise> UntrustedModulesProcessor::GetModulesTrust(
|
||||
}
|
||||
|
||||
RefPtr<UntrustedModulesProcessor> self(this);
|
||||
auto run = [self = std::move(self), modPaths = std::move(aModPaths),
|
||||
auto run = [self = std::move(self), modIdents = std::move(aModIdents),
|
||||
runNormal = aRunAtNormalPriority]() mutable {
|
||||
return self->GetModulesTrustInternal(std::move(modPaths), runNormal);
|
||||
return self->GetModulesTrustInternal(std::move(modIdents), runNormal);
|
||||
};
|
||||
|
||||
if (aRunAtNormalPriority) {
|
||||
@@ -733,14 +733,14 @@ void UntrustedModulesProcessor::ProcessModuleLoadQueue() {
|
||||
|
||||
template <typename ActorT>
|
||||
static RefPtr<GetModulesTrustIpcPromise> SendGetModulesTrust(
|
||||
ActorT* aActor, ModulePaths&& aModPaths, bool aRunAtNormalPriority) {
|
||||
ActorT* aActor, ModuleIdentifiers&& aModIdents, bool aRunAtNormalPriority) {
|
||||
MOZ_ASSERT(NS_IsMainThread());
|
||||
return aActor->SendGetModulesTrust(std::move(aModPaths),
|
||||
return aActor->SendGetModulesTrust(std::move(aModIdents),
|
||||
aRunAtNormalPriority);
|
||||
}
|
||||
|
||||
RefPtr<GetModulesTrustIpcPromise>
|
||||
UntrustedModulesProcessor::SendGetModulesTrust(ModulePaths&& aModules,
|
||||
UntrustedModulesProcessor::SendGetModulesTrust(ModuleIdentifiers&& aModules,
|
||||
Priority aPriority) {
|
||||
MOZ_ASSERT(NS_IsMainThread());
|
||||
bool runNormal = aPriority == Priority::Default;
|
||||
@@ -833,7 +833,7 @@ UntrustedModulesProcessor::ProcessModuleLoadQueueChildProcess(
|
||||
return GetModulesTrustPromise::CreateAndResolve(Nothing(), __func__);
|
||||
}
|
||||
|
||||
ModulePaths moduleNtPaths(std::move(moduleNtPathSet));
|
||||
ModuleIdentifiers moduleNtPaths(std::move(moduleNtPathSet));
|
||||
|
||||
if (!IsReadyForBackgroundProcessing()) {
|
||||
return GetModulesTrustPromise::CreateAndReject(
|
||||
@@ -992,7 +992,7 @@ void UntrustedModulesProcessor::CompleteProcessing(
|
||||
// The thread priority of this job should match the priority that the child
|
||||
// process is running with, as specified by |aRunAtNormalPriority|.
|
||||
RefPtr<ModulesTrustPromise> UntrustedModulesProcessor::GetModulesTrustInternal(
|
||||
ModulePaths&& aModPaths, bool aRunAtNormalPriority) {
|
||||
ModuleIdentifiers&& aModIdents, bool aRunAtNormalPriority) {
|
||||
MOZ_ASSERT(XRE_IsParentProcess());
|
||||
AssertRunningOnLazyIdleThread();
|
||||
|
||||
@@ -1002,18 +1002,18 @@ RefPtr<ModulesTrustPromise> UntrustedModulesProcessor::GetModulesTrustInternal(
|
||||
}
|
||||
|
||||
if (aRunAtNormalPriority) {
|
||||
return GetModulesTrustInternal(std::move(aModPaths));
|
||||
return GetModulesTrustInternal(std::move(aModIdents));
|
||||
}
|
||||
|
||||
BackgroundPriorityRegion bgRgn;
|
||||
return GetModulesTrustInternal(std::move(aModPaths));
|
||||
return GetModulesTrustInternal(std::move(aModIdents));
|
||||
}
|
||||
|
||||
// For each module in |aModPaths|, evaluate its trustworthiness and only send
|
||||
// For each module in |aModIdents|, evaluate its trustworthiness and only send
|
||||
// ModuleRecords for untrusted modules back to the child process. We also save
|
||||
// XUL's ModuleRecord so that the child process may report XUL's load time.
|
||||
RefPtr<ModulesTrustPromise> UntrustedModulesProcessor::GetModulesTrustInternal(
|
||||
ModulePaths&& aModPaths) {
|
||||
ModuleIdentifiers&& aModIdents) {
|
||||
MOZ_ASSERT(XRE_IsParentProcess());
|
||||
AssertRunningOnLazyIdleThread();
|
||||
|
||||
@@ -1029,7 +1029,7 @@ RefPtr<ModulesTrustPromise> UntrustedModulesProcessor::GetModulesTrustInternal(
|
||||
}
|
||||
|
||||
for (auto& resolvedNtPath :
|
||||
aModPaths.mModuleNtPaths.as<ModulePaths::VecType>()) {
|
||||
aModIdents.mModuleNtPaths.as<ModuleIdentifiers::VecType>()) {
|
||||
if (!IsReadyForBackgroundProcessing()) {
|
||||
return ModulesTrustPromise::CreateAndReject(
|
||||
NS_ERROR_ILLEGAL_DURING_SHUTDOWN, __func__);
|
||||
|
||||
@@ -73,7 +73,7 @@ class UntrustedModulesProcessor final : public nsIObserver,
|
||||
|
||||
// Called by IPC actors in the parent process to evaluate module trust
|
||||
// on behalf of child processes
|
||||
RefPtr<ModulesTrustPromise> GetModulesTrust(ModulePaths&& aModPaths,
|
||||
RefPtr<ModulesTrustPromise> GetModulesTrust(ModuleIdentifiers&& aModIdents,
|
||||
bool aRunAtNormalPriority);
|
||||
|
||||
UntrustedModulesProcessor(const UntrustedModulesProcessor&) = delete;
|
||||
@@ -129,8 +129,9 @@ class UntrustedModulesProcessor final : public nsIObserver,
|
||||
RefPtr<UntrustedModulesPromise> GetProcessedDataInternalChildProcess();
|
||||
|
||||
RefPtr<ModulesTrustPromise> GetModulesTrustInternal(
|
||||
ModulePaths&& aModPaths, bool aRunAtNormalPriority);
|
||||
RefPtr<ModulesTrustPromise> GetModulesTrustInternal(ModulePaths&& aModPaths);
|
||||
ModuleIdentifiers&& aModIdents, bool aRunAtNormalPriority);
|
||||
RefPtr<ModulesTrustPromise> GetModulesTrustInternal(
|
||||
ModuleIdentifiers&& aModIdents);
|
||||
|
||||
// This function is only called by the parent process
|
||||
RefPtr<ModuleRecord> GetOrAddModuleRecord(const ModuleEvaluator& aModEval,
|
||||
@@ -141,8 +142,8 @@ class UntrustedModulesProcessor final : public nsIObserver,
|
||||
const ModulesMap& aModules,
|
||||
const glue::EnhancedModuleLoadInfo& aModuleLoadInfo);
|
||||
|
||||
RefPtr<GetModulesTrustIpcPromise> SendGetModulesTrust(ModulePaths&& aModules,
|
||||
Priority aPriority);
|
||||
RefPtr<GetModulesTrustIpcPromise> SendGetModulesTrust(
|
||||
ModuleIdentifiers&& aModules, Priority aPriority);
|
||||
|
||||
void CompleteProcessing(ModulesMapResultWithLoads&& aModulesAndLoads);
|
||||
RefPtr<UntrustedModulesPromise> GetAllProcessedData(StaticString aSource);
|
||||
|
||||
@@ -79,13 +79,13 @@ void DllServices::DisableFull() {
|
||||
}
|
||||
|
||||
RefPtr<ModulesTrustPromise> DllServices::GetModulesTrust(
|
||||
ModulePaths&& aModPaths, bool aRunAtNormalPriority) {
|
||||
ModuleIdentifiers&& aModIdents, bool aRunAtNormalPriority) {
|
||||
if (!mUntrustedModulesProcessor) {
|
||||
return ModulesTrustPromise::CreateAndReject(NS_ERROR_NOT_IMPLEMENTED,
|
||||
__func__);
|
||||
}
|
||||
|
||||
return mUntrustedModulesProcessor->GetModulesTrust(std::move(aModPaths),
|
||||
return mUntrustedModulesProcessor->GetModulesTrust(std::move(aModIdents),
|
||||
aRunAtNormalPriority);
|
||||
}
|
||||
|
||||
|
||||
@@ -18,7 +18,7 @@ class UntrustedModulesProcessor;
|
||||
using UntrustedModulesPromise =
|
||||
MozPromise<Maybe<UntrustedModulesData>, nsresult, true>;
|
||||
|
||||
struct ModulePaths;
|
||||
struct ModuleIdentifiers;
|
||||
class ModulesMapResult;
|
||||
|
||||
using ModulesTrustPromise = MozPromise<ModulesMapResult, nsresult, true>;
|
||||
@@ -37,7 +37,7 @@ class DllServices final : public glue::DllServices {
|
||||
|
||||
RefPtr<UntrustedModulesPromise> GetUntrustedModulesData();
|
||||
|
||||
RefPtr<ModulesTrustPromise> GetModulesTrust(ModulePaths&& aModPaths,
|
||||
RefPtr<ModulesTrustPromise> GetModulesTrust(ModuleIdentifiers&& aModIdents,
|
||||
bool aRunAtNormalPriority);
|
||||
|
||||
private:
|
||||
|
||||
Reference in New Issue
Block a user