From 3897afb506f7507ad643063292c41eb543be1bf9 Mon Sep 17 00:00:00 2001 From: Oleg Romashin Date: Tue, 11 May 2010 13:29:57 -0400 Subject: [PATCH] Bug 564602 - provide Parent::GetSingleton() without force child process creation.r=jones.chris.g --- dom/ipc/ContentProcessParent.cpp | 4 ++-- dom/ipc/ContentProcessParent.h | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/dom/ipc/ContentProcessParent.cpp b/dom/ipc/ContentProcessParent.cpp index 12035d7b93fa..2786c571f47f 100644 --- a/dom/ipc/ContentProcessParent.cpp +++ b/dom/ipc/ContentProcessParent.cpp @@ -60,12 +60,12 @@ namespace dom { ContentProcessParent* ContentProcessParent::gSingleton; ContentProcessParent* -ContentProcessParent::GetSingleton() +ContentProcessParent::GetSingleton(PRBool aForceNew) { if (gSingleton && !gSingleton->IsAlive()) gSingleton = nsnull; - if (!gSingleton) { + if (!gSingleton && aForceNew) { nsRefPtr parent = new ContentProcessParent(); if (parent) { nsCOMPtr obs = diff --git a/dom/ipc/ContentProcessParent.h b/dom/ipc/ContentProcessParent.h index 78b5191c30ef..8fe5c53cd6bf 100644 --- a/dom/ipc/ContentProcessParent.h +++ b/dom/ipc/ContentProcessParent.h @@ -67,7 +67,7 @@ private: typedef mozilla::ipc::TestShellParent TestShellParent; public: - static ContentProcessParent* GetSingleton(); + static ContentProcessParent* GetSingleton(PRBool aForceNew = PR_TRUE); #if 0 // TODO: implement this somewhere!