Bug 513354 - Destroy the baseWindow on tab destruction, r=bs

This commit is contained in:
Frederic Plourde<frederic.plourde@polymtl.ca> 2009-11-13 07:43:43 -05:00
parent b579e4a306
commit 36bdecc47f
6 changed files with 16 additions and 5 deletions

View File

@ -998,6 +998,8 @@ nsFrameLoader::Destroy()
#ifdef MOZ_IPC
if (mChildProcess) {
mChildProcess->SetOwnerElement(nsnull);
ContentProcessParent::GetSingleton()->SendPIFrameEmbeddingDestructor(mChildProcess);
mChildProcess = nsnull;
}
#endif

View File

@ -57,7 +57,7 @@ namespace dom {
class TabParent;
class ContentProcessParent : private PContentProcessParent,
class ContentProcessParent : public PContentProcessParent,
public base::WaitableEventWatcher::Delegate,
public nsIObserver
{

View File

@ -66,7 +66,6 @@ parent:
sendEvent(RemoteDOMEvent aEvent);
child:
createWidget(MagicWindowHandle parentWidget);
destroyWidget();
loadURL(nsCString uri);

View File

@ -276,7 +276,7 @@ TabChild::RecvcreateWidget(const MagicWindowHandle& parentWidget)
}
bool
TabChild::RecvdestroyWidget()
TabChild::destroyWidget()
{
nsCOMPtr<nsIBaseWindow> baseWindow = do_QueryInterface(mWebNav);
if (baseWindow)
@ -287,11 +287,11 @@ TabChild::RecvdestroyWidget()
TabChild::~TabChild()
{
destroyWidget();
nsCOMPtr<nsIWebBrowser> webBrowser = do_QueryInterface(mWebNav);
if (webBrowser) {
webBrowser->SetContainerWindow(nsnull);
}
// TODObsmedberg: destroy the window!
}
bool

View File

@ -72,6 +72,7 @@ class TabChild : public PIFrameEmbeddingChild,
public:
TabChild();
virtual ~TabChild();
bool destroyWidget();
nsresult Init();
NS_DECL_ISUPPORTS
@ -82,7 +83,6 @@ public:
NS_DECL_NSIWEBBROWSERCHROMEFOCUS
virtual bool RecvcreateWidget(const MagicWindowHandle& parentWidget);
virtual bool RecvdestroyWidget();
virtual bool RecvloadURL(const nsCString& uri);
virtual bool Recvmove(const PRUint32& x,
const PRUint32& y,

View File

@ -69,6 +69,14 @@
frameLoader.sendCrossProcessMouseEvent("mousedown", x, y, 0, 1, 0, false);
frameLoader.sendCrossProcessMouseEvent("mouseup", x, y, 0, 1, 0, false);
}
function openWindow() {
window.open('chrome://global/content/test-ipc.xul', '_blank', 'chrome,resizable,width=800,height=800');
}
function closeWindow() {
window.close();
}
</script>
<toolbar id="controls">
@ -77,6 +85,8 @@
<textbox onchange="loadURL(this.value)" flex="1" id="URL"/>
<toolbarbutton onclick="restart()" label="Recover"/>
<toolbarbutton onclick="randomClick()" label="random click"/>
<toolbarbutton onclick="openWindow()" label="open new window"/>
<toolbarbutton onclick="closeWindow()" label="close this window"/>
</toolbar>
<browser type="content" src="http://www.google.com/" flex="1" id="page" remote="true"