Skip to content

Commit

Permalink
Backed out 6 changesets (bug 1681043) for causing multiple failures.
Browse files Browse the repository at this point in the history
CLOSED TREE

Backed out changeset ea075101dc94 (bug 1681043)
Backed out changeset 64d8abe2104d (bug 1681043)
Backed out changeset 5ecb208a85d3 (bug 1681043)
Backed out changeset 9319fdd0389c (bug 1681043)
Backed out changeset 25a015e84cc4 (bug 1681043)
Backed out changeset e8fac91d4012 (bug 1681043)
  • Loading branch information
Mihai Alexandru Michis committed Jan 4, 2021
1 parent f7895c0 commit f8a4120
Show file tree
Hide file tree
Showing 24 changed files with 221 additions and 414 deletions.
9 changes: 1 addition & 8 deletions dom/ipc/ContentChild.cpp
Expand Up @@ -1323,6 +1323,7 @@ void ContentChild::InitXPCOM(

DataStorage::SetCachedStorageEntries(aXPCOMInit.dataStorage());

PDMFactory::SetSupported(aXPCOMInit.codecsSupported());
// Initialize the RemoteDecoderManager thread and its associated PBackground
// channel.
RemoteDecoderManagerChild::Init();
Expand Down Expand Up @@ -4452,14 +4453,6 @@ IPCResult ContentChild::RecvFlushFOGData(FlushFOGDataResolver&& aResolver) {
return IPC_OK();
}

IPCResult ContentChild::RecvUpdateMediaCodecsSupported(
RemoteDecodeIn aLocation,
const PDMFactory::MediaCodecsSupported& aSupported) {
RemoteDecoderManagerChild::SetSupported(aLocation, aSupported);

return IPC_OK();
}

} // namespace dom

#if defined(__OpenBSD__) && defined(MOZ_SANDBOX)
Expand Down
4 changes: 0 additions & 4 deletions dom/ipc/ContentChild.h
Expand Up @@ -837,10 +837,6 @@ class ContentChild final : public PContentChild,
private:
mozilla::ipc::IPCResult RecvFlushFOGData(FlushFOGDataResolver&& aResolver);

mozilla::ipc::IPCResult RecvUpdateMediaCodecsSupported(
RemoteDecodeIn aLocation,
const PDMFactory::MediaCodecsSupported& aSupported);

#ifdef NIGHTLY_BUILD
virtual PContentChild::Result OnMessageReceived(const Message& aMsg) override;
#else
Expand Down
28 changes: 4 additions & 24 deletions dom/ipc/ContentParent.cpp
Expand Up @@ -30,14 +30,14 @@
# include "mozilla/a11y/AccessibleWrap.h"
# include "mozilla/a11y/Compatibility.h"
#endif
#include <map>
#include <utility>

#include "BrowserParent.h"
#include "ContentProcessManager.h"
#include "Geolocation.h"
#include "GfxInfoBase.h"
#include "MMPrinter.h"
#include "PDMFactory.h"
#include "PreallocatedProcessManager.h"
#include "ProcessPriorityManager.h"
#include "SandboxHal.h"
Expand Down Expand Up @@ -66,7 +66,6 @@
#include "mozilla/PresShell.h"
#include "mozilla/ProcessHangMonitor.h"
#include "mozilla/ProcessHangMonitorIPC.h"
#include "mozilla/RDDProcessManager.h"
#include "mozilla/ScopeExit.h"
#include "mozilla/ScriptPreloader.h"
#include "mozilla/Services.h"
Expand Down Expand Up @@ -368,9 +367,6 @@ namespace dom {

LazyLogModule gProcessLog("Process");

static std::map<RemoteDecodeIn, PDMFactory::MediaCodecsSupported>
sCodecsSupported;

/* static */
LogModule* ContentParent::GetLog() { return gProcessLog; }

Expand Down Expand Up @@ -1505,16 +1501,6 @@ void ContentParent::BroadcastThemeUpdate(widget::ThemeChangeKind aKind) {
}
}

/*static */
void ContentParent::BroadcastMediaCodecsSupportedUpdate(
RemoteDecodeIn aLocation,
const PDMFactory::MediaCodecsSupported& aSupported) {
sCodecsSupported[aLocation] = aSupported;
for (auto* cp : AllProcesses(eAll)) {
Unused << cp->SendUpdateMediaCodecsSupported(aLocation, aSupported);
}
}

const nsACString& ContentParent::GetRemoteType() const { return mRemoteType; }

void ContentParent::Init() {
Expand Down Expand Up @@ -2802,9 +2788,9 @@ bool ContentParent::InitInternal(ProcessPriority aInitialPriority) {
// Send the dynamic scalar definitions to the new process.
TelemetryIPC::GetDynamicScalarDefinitions(xpcomInit.dynamicScalarDefs());

for (auto const& [location, supported] : sCodecsSupported) {
Unused << SendUpdateMediaCodecsSupported(location, supported);
}
// Pre-calculate the various PlatformDecoderModule (PDM) supported on this
// machine.
xpcomInit.codecsSupported() = PDMFactory::Supported();

// Must send screen info before send initialData
ScreenManager& screenManager = ScreenManager::GetSingleton();
Expand Down Expand Up @@ -2903,12 +2889,6 @@ bool ContentParent::InitInternal(ProcessPriority aInitialPriority) {

gpm->AddListener(this);

if (StaticPrefs::media_rdd_process_enabled()) {
// Ensure the RDD process has been started.
RDDProcessManager* rdd = RDDProcessManager::Get();
rdd->LaunchRDDProcess();
}

nsStyleSheetService* sheetService = nsStyleSheetService::GetInstance();
if (sheetService) {
// This looks like a lot of work, but in a normal browser session we just
Expand Down
4 changes: 0 additions & 4 deletions dom/ipc/ContentParent.h
Expand Up @@ -257,10 +257,6 @@ class ContentParent final

static void BroadcastThemeUpdate(widget::ThemeChangeKind);

static void BroadcastMediaCodecsSupportedUpdate(
RemoteDecodeIn aLocation,
const PDMFactory::MediaCodecsSupported& aSupported);

const nsACString& GetRemoteType() const override;

virtual void DoGetRemoteType(nsACString& aRemoteType,
Expand Down
5 changes: 1 addition & 4 deletions dom/ipc/PContent.ipdl
Expand Up @@ -146,7 +146,6 @@ using class mozilla::dom::SessionHistoryInfo from "mozilla/dom/SessionHistoryEnt
using struct nsPoint from "nsPoint.h";
using struct mozilla::dom::LoadingSessionHistoryInfo from "mozilla/dom/SessionHistoryEntry.h";
using mozilla::PDMFactory::MediaCodecsSupported from "PDMFactory.h";
using mozilla::RemoteDecodeIn from "mozilla/RemoteDecoderManagerChild.h";
using mozilla::dom::PerformanceTimingData from "mozilla/dom/PerformanceTiming.h";

union ChromeRegistryItem
Expand Down Expand Up @@ -328,6 +327,7 @@ struct XPCOMInitData
nsCString[] requestedLocales;
DynamicScalarDefinition[] dynamicScalarDefs;
SystemParameterKVPair[] systemParameters;
MediaCodecsSupported codecsSupported;
};

struct VisitedQueryResult
Expand Down Expand Up @@ -947,9 +947,6 @@ child:
async DispatchBeforeUnloadToSubtree(MaybeDiscardedBrowsingContext aStartingAt)
returns (PermitUnloadResult result);

// Update the cached list of codec supported in the given process.
async UpdateMediaCodecsSupported(RemoteDecodeIn aLocation, MediaCodecsSupported aSupported);

parent:
/**
* This is a temporary way to pass index and length through parent process.
Expand Down
5 changes: 0 additions & 5 deletions dom/media/ipc/PRDD.ipdl
Expand Up @@ -15,7 +15,6 @@ using mozilla::dom::NativeThreadId from "mozilla/dom/NativeThreadId.h";
using moveonly mozilla::UntrustedModulesData from "mozilla/UntrustedModulesData.h";
using moveonly mozilla::ModulePaths from "mozilla/UntrustedModulesData.h";
using moveonly mozilla::ModulesMapResult from "mozilla/UntrustedModulesData.h";
using mozilla::PDMFactory::MediaCodecsSupported from "PDMFactory.h";

namespace mozilla {

Expand Down Expand Up @@ -59,10 +58,6 @@ child:

async GetModulesTrust(ModulePaths aModPaths, bool aRunAtNormalPriority)
returns (ModulesMapResult? modMapResult);

// Update the cached list of codec supported following a check in the
// RDD parent.
async UpdateMediaCodecsSupported(MediaCodecsSupported aSupported);
};

} // namespace mozilla
12 changes: 2 additions & 10 deletions dom/media/ipc/RDDChild.cpp
Expand Up @@ -6,12 +6,11 @@
#include "RDDChild.h"

#include "mozilla/RDDProcessManager.h"
#include "mozilla/dom/ContentParent.h"
#include "mozilla/dom/MemoryReportRequest.h"
#include "mozilla/gfx/GPUProcessManager.h"
#include "mozilla/gfx/gfxVars.h"
#include "mozilla/ipc/CrashReporterHost.h"
#include "mozilla/ipc/Endpoint.h"
#include "mozilla/gfx/gfxVars.h"
#include "mozilla/gfx/GPUProcessManager.h"

#if defined(XP_LINUX) && defined(MOZ_SANDBOX)
# include "mozilla/SandboxBroker.h"
Expand Down Expand Up @@ -139,13 +138,6 @@ mozilla::ipc::IPCResult RDDChild::RecvGetModulesTrust(
#endif // defined(XP_WIN)
}

mozilla::ipc::IPCResult RDDChild::RecvUpdateMediaCodecsSupported(
const PDMFactory::MediaCodecsSupported& aSupported) {
dom::ContentParent::BroadcastMediaCodecsSupportedUpdate(
RemoteDecodeIn::RddProcess, aSupported);
return IPC_OK();
}

void RDDChild::ActorDestroy(ActorDestroyReason aWhy) {
if (aWhy == AbnormalShutdown) {
GenerateCrashReport(OtherPid());
Expand Down
7 changes: 3 additions & 4 deletions dom/media/ipc/RDDChild.h
Expand Up @@ -6,10 +6,11 @@
#ifndef _include_dom_media_ipc_RDDChild_h_
#define _include_dom_media_ipc_RDDChild_h_
#include "mozilla/PRDDChild.h"

#include "mozilla/ipc/CrashReporterHelper.h"
#include "mozilla/UniquePtr.h"
#include "mozilla/gfx/GPUProcessListener.h"
#include "mozilla/gfx/gfxVarReceiver.h"
#include "mozilla/ipc/CrashReporterHelper.h"
#include "mozilla/gfx/GPUProcessListener.h"

namespace mozilla {

Expand Down Expand Up @@ -44,8 +45,6 @@ class RDDChild final : public PRDDChild,
mozilla::ipc::IPCResult RecvGetModulesTrust(
ModulePaths&& aModPaths, bool aRunAtNormalPriority,
GetModulesTrustResolver&& aResolver);
mozilla::ipc::IPCResult RecvUpdateMediaCodecsSupported(
const PDMFactory::MediaCodecsSupported& aSupported);

bool SendRequestMemoryReport(const uint32_t& aGeneration,
const bool& aAnonymize,
Expand Down
33 changes: 7 additions & 26 deletions dom/media/ipc/RDDParent.cpp
Expand Up @@ -6,31 +6,27 @@
#include "RDDParent.h"

#if defined(XP_WIN)
# include <dwrite.h>
# include <process.h>

# include "mozilla/gfx/DeviceManagerDx.h"
# include "WMF.h"
# include "WMFDecoderModule.h"
# include <process.h>
# include <dwrite.h>
# include "mozilla/WinDllServices.h"
# include "mozilla/gfx/DeviceManagerDx.h"
#else
# include <unistd.h>
#endif

#include "PDMFactory.h"
#include "chrome/common/ipc_channel.h"
#include "gfxConfig.h"
#include "mozilla/Assertions.h"
#include "mozilla/HangDetails.h"
#include "mozilla/Preferences.h"
#include "mozilla/RemoteDecoderManagerChild.h"
#include "mozilla/RemoteDecoderManagerParent.h"
#include "mozilla/ScopeExit.h"
#include "mozilla/TimeStamp.h"
#include "mozilla/dom/MemoryReportRequest.h"
#include "mozilla/gfx/gfxVars.h"
#include "mozilla/ipc/CrashReporterClient.h"
#include "mozilla/ipc/ProcessChild.h"
#include "mozilla/gfx/gfxVars.h"
#include "gfxConfig.h"

#if defined(XP_LINUX) && defined(MOZ_SANDBOX)
# include "mozilla/Sandbox.h"
Expand All @@ -41,14 +37,14 @@
#endif

#if defined(XP_MACOSX) && defined(MOZ_SANDBOX)
# include "RDDProcessHost.h"
# include "mozilla/Sandbox.h"
# include "nsMacUtilsImpl.h"
# include "RDDProcessHost.h"
#endif

#include "ProcessUtils.h"
#include "nsDebugImpl.h"
#include "nsThreadManager.h"
#include "ProcessUtils.h"

namespace mozilla {

Expand Down Expand Up @@ -124,9 +120,6 @@ mozilla::ipc::IPCResult RDDParent::RecvInit(
gfxVars::ApplyUpdate(var);
}

auto supported = PDMFactory::Supported();
Unused << SendUpdateMediaCodecsSupported(supported);

#if defined(MOZ_SANDBOX)
# if defined(XP_MACOSX)
// Close all current connections to the WindowServer. This ensures that the
Expand All @@ -153,18 +146,6 @@ mozilla::ipc::IPCResult RDDParent::RecvInit(
}

IPCResult RDDParent::RecvUpdateVar(const GfxVarUpdate& aUpdate) {
#if defined(XP_WIN)
auto scopeExit = MakeScopeExit(
[couldUseHWDecoder = gfx::gfxVars::CanUseHardwareVideoDecoding()] {
if (couldUseHWDecoder != gfx::gfxVars::CanUseHardwareVideoDecoding()) {
// The capabilities of the system may have changed, force a refresh by
// re-initializing the WMF PDM.
WMFDecoderModule::Init();
Unused << RDDParent::GetSingleton()->SendUpdateMediaCodecsSupported(
PDMFactory::Supported(true /* force refresh */));
}
});
#endif
gfxVars::ApplyUpdate(aUpdate);
return IPC_OK();
}
Expand Down

0 comments on commit f8a4120

Please sign in to comment.