Skip to content

Commit

Permalink
Backed out 2 changesets (bug 1645528) for leakcheck failures on nsTAr…
Browse files Browse the repository at this point in the history
…ray. CLOSED TREE

Backed out changeset df3577321bfe (bug 1645528)
Backed out changeset fbc13c3ea551 (bug 1645528)
  • Loading branch information
nbeleuzu committed Nov 25, 2020
1 parent ab78a14 commit efbd3dc
Show file tree
Hide file tree
Showing 19 changed files with 315 additions and 272 deletions.
40 changes: 0 additions & 40 deletions dom/ipc/BrowserChild.cpp
Expand Up @@ -14,7 +14,6 @@
#include <algorithm>
#include <utility>

#include "BackgroundChild.h"
#include "BrowserParent.h"
#include "ClientLayerManager.h"
#include "ContentChild.h"
Expand Down Expand Up @@ -75,7 +74,6 @@
#include "mozilla/gfx/Matrix.h"
#include "mozilla/gfx/gfxVars.h"
#include "mozilla/ipc/BackgroundUtils.h"
#include "mozilla/ipc/PBackgroundChild.h"
#include "mozilla/ipc/URIUtils.h"
#include "mozilla/layers/APZCCallbackHelper.h"
#include "mozilla/layers/APZCTreeManagerChild.h"
Expand Down Expand Up @@ -144,10 +142,6 @@
# include "mozilla/plugins/PluginWidgetChild.h"
#endif

#ifdef MOZ_WAYLAND
# include "nsAppRunner.h"
#endif

#ifdef NS_PRINTING
# include "nsIPrintSession.h"
# include "nsIPrintSettings.h"
Expand Down Expand Up @@ -320,7 +314,6 @@ BrowserChild::BrowserChild(ContentChild* aManager, const TabId& aTabId,
mDidFakeShow(false),
mTriedBrowserInit(false),
mOrientation(hal::eScreenOrientation_PortraitPrimary),
mVsyncChild(nullptr),
mIgnoreKeyPressEvent(false),
mHasValidInnerSize(false),
mDestroyed(false),
Expand Down Expand Up @@ -557,29 +550,13 @@ nsresult BrowserChild::Init(mozIDOMWindowProxy* aParent,
NS_ENSURE_SUCCESS(rv, rv);
#endif

InitVsyncChild();

// We've all set up, make sure our visibility state is consistent. This is
// important for OOP iframes, which start off as hidden.
UpdateVisibility();

return NS_OK;
}

void BrowserChild::InitVsyncChild() {
#if defined(MOZ_WAYLAND)
if (!IsWaylandDisabled()) {
PVsyncChild* actor = SendPVsyncConstructor();
mVsyncChild = static_cast<VsyncChild*>(actor);
} else
#endif
{
PBackgroundChild* actorChild =
BackgroundChild::GetOrCreateForCurrentThread();
mVsyncChild = static_cast<VsyncChild*>(actorChild->SendPVsyncConstructor());
}
}

void BrowserChild::NotifyTabContextUpdated() {
nsCOMPtr<nsIDocShell> docShell = do_GetInterface(WebNavigation());
MOZ_ASSERT(docShell);
Expand Down Expand Up @@ -2166,23 +2143,6 @@ bool BrowserChild::DeallocPFilePickerChild(PFilePickerChild* actor) {
return true;
}

PVsyncChild* BrowserChild::AllocPVsyncChild() {
RefPtr<dom::VsyncChild> actor = new VsyncChild();
// There still has one ref-count after return, and it will be released in
// DeallocPVsyncChild().
return actor.forget().take();
}

bool BrowserChild::DeallocPVsyncChild(PVsyncChild* aActor) {
MOZ_ASSERT(aActor);

// This actor already has one ref-count. Please check AllocPVsyncChild().
RefPtr<VsyncChild> actor = dont_AddRef(static_cast<VsyncChild*>(aActor));
return true;
}

RefPtr<VsyncChild> BrowserChild::GetVsyncChild() { return mVsyncChild; }

mozilla::ipc::IPCResult BrowserChild::RecvActivateFrameEvent(
const nsString& aType, const bool& capture) {
nsCOMPtr<nsPIDOMWindowOuter> window = do_GetInterface(WebNavigation());
Expand Down
11 changes: 0 additions & 11 deletions dom/ipc/BrowserChild.h
Expand Up @@ -29,7 +29,6 @@
#include "mozilla/dom/CoalescedMouseData.h"
#include "mozilla/dom/CoalescedWheelData.h"
#include "mozilla/dom/MessageManagerCallback.h"
#include "mozilla/dom/VsyncChild.h"
#include "mozilla/DOMEventTargetHelper.h"
#include "mozilla/EventDispatcher.h"
#include "mozilla/EventForwards.h"
Expand Down Expand Up @@ -437,12 +436,6 @@ class BrowserChild final : public nsMessageManagerScriptExecutor,
PFilePickerChild* AllocPFilePickerChild(const nsString& aTitle,
const int16_t& aMode);

virtual PVsyncChild* AllocPVsyncChild();

virtual bool DeallocPVsyncChild(PVsyncChild* aActor);

RefPtr<VsyncChild> GetVsyncChild();

bool DeallocPFilePickerChild(PFilePickerChild* aActor);

nsIWebNavigation* WebNavigation() const { return mWebNav; }
Expand Down Expand Up @@ -754,8 +747,6 @@ class BrowserChild final : public nsMessageManagerScriptExecutor,
const mozilla::layers::CompositorOptions& aCompositorOptions);
void InitAPZState();

void InitVsyncChild();

void DestroyWindow();

void ApplyParentShowInfo(const ParentShowInfo&);
Expand Down Expand Up @@ -823,8 +814,6 @@ class BrowserChild final : public nsMessageManagerScriptExecutor,
bool mTriedBrowserInit;
hal::ScreenOrientation mOrientation;

RefPtr<VsyncChild> mVsyncChild;

bool mIgnoreKeyPressEvent;
RefPtr<APZEventState> mAPZEventState;
SetAllowedTouchBehaviorCallback mSetAllowedTouchBehaviorCallback;
Expand Down
26 changes: 0 additions & 26 deletions dom/ipc/BrowserParent.cpp
Expand Up @@ -129,7 +129,6 @@
#include "mozilla/dom/CrashReport.h"
#include "nsISecureBrowserUI.h"
#include "nsIXULRuntime.h"
#include "VsyncSource.h"

#ifdef XP_WIN
# include "mozilla/plugins/PluginWidgetParent.h"
Expand Down Expand Up @@ -225,7 +224,6 @@ BrowserParent::BrowserParent(ContentParent* aManager, const TabId& aTabId,
mCustomCursorHotspotX(0),
mCustomCursorHotspotY(0),
mVerifyDropLinks{},
mVsyncParent(nullptr),
mDocShellIsActive(false),
mMarkedDestroying(false),
mIsDestroyed(false),
Expand Down Expand Up @@ -565,8 +563,6 @@ void BrowserParent::SetOwnerElement(Element* aElement) {
mBrowsingContext->SetEmbedderElement(mFrameElement);
}

UpdateVsyncParentVsyncSource();

VisitChildren([aElement](BrowserBridgeParent* aBrowser) {
if (auto* browserParent = aBrowser->GetBrowserParent()) {
browserParent->SetOwnerElement(aElement);
Expand Down Expand Up @@ -1350,28 +1346,6 @@ IPCResult BrowserParent::RecvNewWindowGlobal(
return IPC_OK();
}

PVsyncParent* BrowserParent::AllocPVsyncParent() {
MOZ_ASSERT(!mVsyncParent);
mVsyncParent = new VsyncParent();
UpdateVsyncParentVsyncSource();
return mVsyncParent.get();
}

bool BrowserParent::DeallocPVsyncParent(PVsyncParent* aActor) {
mVsyncParent = nullptr;
return true;
}

void BrowserParent::UpdateVsyncParentVsyncSource() {
if (!mVsyncParent) {
return;
}

if (nsCOMPtr<nsIWidget> widget = GetWidget()) {
mVsyncParent->UpdateVsyncSource(widget->GetVsyncSource());
}
}

void BrowserParent::SendMouseEvent(const nsAString& aType, float aX, float aY,
int32_t aButton, int32_t aClickCount,
int32_t aModifiers) {
Expand Down
9 changes: 0 additions & 9 deletions dom/ipc/BrowserParent.h
Expand Up @@ -18,7 +18,6 @@
#include "mozilla/dom/BrowserBridgeParent.h"
#include "mozilla/dom/PBrowserParent.h"
#include "mozilla/dom/TabContext.h"
#include "mozilla/dom/VsyncParent.h"
#include "mozilla/dom/ipc/IdType.h"
#include "mozilla/layout/RemoteLayerTreeOwner.h"
#include "nsCOMPtr.h"
Expand Down Expand Up @@ -461,10 +460,6 @@ class BrowserParent final : public PBrowserParent,

bool DeallocPColorPickerParent(PColorPickerParent* aColorPicker);

PVsyncParent* AllocPVsyncParent();

bool DeallocPVsyncParent(PVsyncParent* aActor);

#ifdef ACCESSIBILITY
PDocAccessibleParent* AllocPDocAccessibleParent(PDocAccessibleParent*,
const uint64_t&,
Expand Down Expand Up @@ -877,8 +872,6 @@ class BrowserParent final : public PBrowserParent,
void SendRealTouchMoveEvent(WidgetTouchEvent& aEvent, APZData& aAPZData,
uint32_t aConsecutiveTouchMoveCount);

void UpdateVsyncParentVsyncSource();

public:
// Unsets sTopLevelWebFocus regardless of its current value.
static void UnsetTopLevelWebFocusAll();
Expand Down Expand Up @@ -964,8 +957,6 @@ class BrowserParent final : public PBrowserParent,

nsTArray<nsString> mVerifyDropLinks;

RefPtr<VsyncParent> mVsyncParent;

#ifdef DEBUG
int32_t mActiveSupressDisplayportCount = 0;
#endif
Expand Down
7 changes: 0 additions & 7 deletions dom/ipc/PBrowser.ipdl
Expand Up @@ -20,7 +20,6 @@ include protocol PRemoteLazyInputStream;
include protocol PPaymentRequest;
include protocol PWindowGlobal;
include protocol PBrowserBridge;
include protocol PVsync;

include DOMTypes;
include NeckoChannelParams;
Expand Down Expand Up @@ -191,7 +190,6 @@ nested(upto inside_cpow) sync refcounted protocol PBrowser
manages PPaymentRequest;
manages PWindowGlobal;
manages PBrowserBridge;
manages PVsync;

both:
async AsyncMessage(nsString aMessage, ClonedMessageData aData);
Expand Down Expand Up @@ -219,11 +217,6 @@ parent:

async PPaymentRequest();

/**
* Create a new Vsync connection for our associated root widget
*/
async PVsync();

/**
* Sends an NS_NATIVE_CHILD_OF_SHAREABLE_WINDOW to be adopted by the
* widget's shareable window on the chrome side. Only used on Windows.
Expand Down
5 changes: 0 additions & 5 deletions dom/ipc/moz.build
Expand Up @@ -71,8 +71,6 @@ EXPORTS.mozilla.dom += [
"URLClassifierChild.h",
"URLClassifierParent.h",
"UserActivationIPCUtils.h",
"VsyncChild.h",
"VsyncParent.h",
"WindowGlobalActor.h",
"WindowGlobalChild.h",
"WindowGlobalParent.h",
Expand Down Expand Up @@ -132,8 +130,6 @@ UNIFIED_SOURCES += [
SOURCES += [
"ContentChild.cpp",
"ProcessHangMonitor.cpp",
"VsyncChild.cpp",
"VsyncParent.cpp",
]

PREPROCESSED_IPDL_SOURCES += [
Expand All @@ -159,7 +155,6 @@ IPDL_SOURCES += [
"PURLClassifier.ipdl",
"PURLClassifierInfo.ipdlh",
"PURLClassifierLocal.ipdl",
"PVsync.ipdl",
"PWindowGlobal.ipdl",
"ServiceWorkerConfiguration.ipdlh",
"WindowGlobalTypes.ipdlh",
Expand Down
12 changes: 6 additions & 6 deletions ipc/glue/BackgroundChildImpl.cpp
Expand Up @@ -46,11 +46,11 @@
#include "mozilla/dom/ServiceWorkerContainerChild.h"
#include "mozilla/dom/ServiceWorkerManagerChild.h"
#include "mozilla/dom/BrowserChild.h"
#include "mozilla/dom/VsyncChild.h"
#include "mozilla/ipc/IPCStreamAlloc.h"
#include "mozilla/ipc/PBackgroundTestChild.h"
#include "mozilla/ipc/PChildToParentStreamChild.h"
#include "mozilla/ipc/PParentToChildStreamChild.h"
#include "mozilla/layout/VsyncChild.h"
#include "mozilla/net/HttpBackgroundChannelChild.h"
#include "mozilla/net/PUDPSocketChild.h"
#include "mozilla/dom/network/UDPSocketChild.h"
Expand Down Expand Up @@ -408,8 +408,8 @@ bool BackgroundChildImpl::DeallocPFileDescriptorSetChild(
return true;
}

dom::PVsyncChild* BackgroundChildImpl::AllocPVsyncChild() {
RefPtr<dom::VsyncChild> actor = new dom::VsyncChild();
BackgroundChildImpl::PVsyncChild* BackgroundChildImpl::AllocPVsyncChild() {
RefPtr<mozilla::layout::VsyncChild> actor = new mozilla::layout::VsyncChild();
// There still has one ref-count after return, and it will be released in
// DeallocPVsyncChild().
return actor.forget().take();
Expand All @@ -419,8 +419,8 @@ bool BackgroundChildImpl::DeallocPVsyncChild(PVsyncChild* aActor) {
MOZ_ASSERT(aActor);

// This actor already has one ref-count. Please check AllocPVsyncChild().
RefPtr<dom::VsyncChild> actor =
dont_AddRef(static_cast<dom::VsyncChild*>(aActor));
RefPtr<mozilla::layout::VsyncChild> actor =
dont_AddRef(static_cast<mozilla::layout::VsyncChild*>(aActor));
return true;
}

Expand Down Expand Up @@ -619,7 +619,7 @@ bool BackgroundChildImpl::DeallocPClientManagerChild(

#ifdef EARLY_BETA_OR_EARLIER
void BackgroundChildImpl::OnChannelReceivedMessage(const Message& aMsg) {
if (aMsg.type() == dom::PVsync::MessageType::Msg_Notify__ID) {
if (aMsg.type() == layout::PVsync::MessageType::Msg_Notify__ID) {
// Not really necessary to look at the message payload, it will be
// <0.5ms away from TimeStamp::Now()
SchedulerGroup::MarkVsyncReceived();
Expand Down
10 changes: 5 additions & 5 deletions ipc/glue/BackgroundParentImpl.cpp
Expand Up @@ -55,7 +55,6 @@
#include "mozilla/dom/network/UDPSocketParent.h"
#include "mozilla/dom/quota/ActorsParent.h"
#include "mozilla/dom/simpledb/ActorsParent.h"
#include "mozilla/dom/VsyncParent.h"
#include "mozilla/ipc/BackgroundParent.h"
#include "mozilla/ipc/BackgroundUtils.h"
#include "mozilla/ipc/Endpoint.h"
Expand All @@ -65,6 +64,7 @@
#include "mozilla/ipc/PBackgroundTestParent.h"
#include "mozilla/ipc/PChildToParentStreamParent.h"
#include "mozilla/ipc/PParentToChildStreamParent.h"
#include "mozilla/layout/VsyncParent.h"
#include "mozilla/media/MediaParent.h"
#include "mozilla/net/BackgroundDataBridgeParent.h"
#include "mozilla/net/HttpBackgroundChannelParent.h"
Expand Down Expand Up @@ -717,8 +717,8 @@ BackgroundParentImpl::PVsyncParent* BackgroundParentImpl::AllocPVsyncParent() {
AssertIsInMainOrSocketProcess();
AssertIsOnBackgroundThread();

RefPtr<mozilla::dom::VsyncParent> actor = new mozilla::dom::VsyncParent();
actor->UpdateVsyncSource(nullptr);
RefPtr<mozilla::layout::VsyncParent> actor =
mozilla::layout::VsyncParent::Create();
// There still has one ref-count after return, and it will be released in
// DeallocPVsyncParent().
return actor.forget().take();
Expand All @@ -730,8 +730,8 @@ bool BackgroundParentImpl::DeallocPVsyncParent(PVsyncParent* aActor) {
MOZ_ASSERT(aActor);

// This actor already has one ref-count. Please check AllocPVsyncParent().
RefPtr<mozilla::dom::VsyncParent> actor =
dont_AddRef(static_cast<mozilla::dom::VsyncParent*>(aActor));
RefPtr<mozilla::layout::VsyncParent> actor =
dont_AddRef(static_cast<mozilla::layout::VsyncParent*>(aActor));
return true;
}

Expand Down
5 changes: 5 additions & 0 deletions ipc/glue/BackgroundParentImpl.h
Expand Up @@ -12,6 +12,11 @@
#include "mozilla/ipc/PBackgroundParent.h"

namespace mozilla {

namespace layout {
class VsyncParent;
} // namespace layout

namespace ipc {

// Instances of this class should never be created directly. This class is meant
Expand Down
3 changes: 3 additions & 0 deletions layout/base/nsPresContext.cpp
Expand Up @@ -692,6 +692,9 @@ nsresult nsPresContext::Init(nsDeviceContext* aDeviceContext) {

if (!mRefreshDriver) {
mRefreshDriver = new nsRefreshDriver(this);
if (XRE_IsContentProcess()) {
mRefreshDriver->InitializeTimer();
}
}
}

Expand Down

0 comments on commit efbd3dc

Please sign in to comment.