From 6065102f13a612e016d999d16a0e43948b78883f Mon Sep 17 00:00:00 2001 From: Kartikaya Gupta Date: Wed, 21 Aug 2013 12:03:02 -0400 Subject: [PATCH] Bug 898443 - Add a parent pointer to the AsyncPanZoomController class. r=BenWa --- gfx/layers/ipc/AsyncPanZoomController.cpp | 1 + gfx/layers/ipc/AsyncPanZoomController.h | 18 ++++++++++++++++-- 2 files changed, 17 insertions(+), 2 deletions(-) diff --git a/gfx/layers/ipc/AsyncPanZoomController.cpp b/gfx/layers/ipc/AsyncPanZoomController.cpp index c5d590771ad..bba94dc28bb 100644 --- a/gfx/layers/ipc/AsyncPanZoomController.cpp +++ b/gfx/layers/ipc/AsyncPanZoomController.cpp @@ -255,6 +255,7 @@ AsyncPanZoomController::Destroy() } mPrevSibling = nullptr; mLastChild = nullptr; + mParent = nullptr; } /* static */float diff --git a/gfx/layers/ipc/AsyncPanZoomController.h b/gfx/layers/ipc/AsyncPanZoomController.h index 9150a0c6127..1941283c7ea 100644 --- a/gfx/layers/ipc/AsyncPanZoomController.h +++ b/gfx/layers/ipc/AsyncPanZoomController.h @@ -616,13 +616,27 @@ private: * instance. */ public: - void SetLastChild(AsyncPanZoomController* child) { mLastChild = child; } - void SetPrevSibling(AsyncPanZoomController* sibling) { mPrevSibling = sibling; } + void SetLastChild(AsyncPanZoomController* child) { + mLastChild = child; + if (child) { + child->mParent = this; + } + } + + void SetPrevSibling(AsyncPanZoomController* sibling) { + mPrevSibling = sibling; + if (sibling) { + sibling->mParent = mParent; + } + } + AsyncPanZoomController* GetLastChild() const { return mLastChild; } AsyncPanZoomController* GetPrevSibling() const { return mPrevSibling; } + AsyncPanZoomController* GetParent() const { return mParent; } private: nsRefPtr mLastChild; nsRefPtr mPrevSibling; + nsRefPtr mParent; /* The functions and members in this section are used to maintain the * area that this APZC instance is responsible for. This is used when