зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1525427 - Part 4: Correctly tear down TabParent within BrowserBridgeParent, r=farre
Differential Revision: https://phabricator.services.mozilla.com/D25184 --HG-- extra : moz-landing-system : lando
This commit is contained in:
Родитель
9778d014f1
Коммит
6c4519cec0
|
@ -19,11 +19,7 @@ namespace dom {
|
|||
|
||||
BrowserBridgeParent::BrowserBridgeParent() : mIPCOpen(false) {}
|
||||
|
||||
BrowserBridgeParent::~BrowserBridgeParent() {
|
||||
if (mTabParent) {
|
||||
mTabParent->mBrowserBridgeParent = nullptr;
|
||||
}
|
||||
}
|
||||
BrowserBridgeParent::~BrowserBridgeParent() { Destroy(); }
|
||||
|
||||
nsresult BrowserBridgeParent::Init(const nsString& aPresentationURL,
|
||||
const nsString& aRemoteType,
|
||||
|
@ -103,6 +99,12 @@ nsresult BrowserBridgeParent::Init(const nsString& aPresentationURL,
|
|||
return NS_OK;
|
||||
}
|
||||
|
||||
void BrowserBridgeParent::Destroy() {
|
||||
if (mTabParent) {
|
||||
mTabParent->Destroy();
|
||||
}
|
||||
}
|
||||
|
||||
IPCResult BrowserBridgeParent::RecvShow(const ScreenIntSize& aSize,
|
||||
const bool& aParentIsActive,
|
||||
const nsSizeMode& aSizeMode) {
|
||||
|
@ -152,6 +154,7 @@ IPCResult BrowserBridgeParent::RecvDeactivate() {
|
|||
|
||||
void BrowserBridgeParent::ActorDestroy(ActorDestroyReason aWhy) {
|
||||
mIPCOpen = false;
|
||||
Destroy();
|
||||
}
|
||||
|
||||
} // namespace dom
|
||||
|
|
|
@ -36,6 +36,9 @@ class BrowserBridgeParent : public PBrowserBridgeParent {
|
|||
return static_cast<TabParent*>(PBrowserBridgeParent::Manager());
|
||||
}
|
||||
|
||||
// Tear down this BrowserBridgeParent.
|
||||
void Destroy();
|
||||
|
||||
protected:
|
||||
friend class PBrowserBridgeParent;
|
||||
|
||||
|
|
|
@ -417,6 +417,8 @@ void TabParent::Destroy() {
|
|||
// corner cases.
|
||||
mBrowserDOMWindow = nullptr;
|
||||
|
||||
mBrowserBridgeParent = nullptr;
|
||||
|
||||
if (mIsDestroyed) {
|
||||
return;
|
||||
}
|
||||
|
|
Загрузка…
Ссылка в новой задаче