Bug 769254 - Part 1: Fix crashes in BrowserElementParent.cpp, TabChild.cpp on null URI to window-opening code. r=bz

--HG--
extra : rebase_source : c5a75bed6a70ab9482fc7c6c4bf98f1ae41a7898
This commit is contained in:
Justin Lebar 2012-07-11 16:02:20 -04:00
parent a5d2de3e53
commit 17f2523571
3 changed files with 11 additions and 2 deletions

View File

@ -193,7 +193,9 @@ BrowserElementParent::OpenWindowInProcess(nsIDOMWindow* aOpenerWindow,
NS_ENSURE_TRUE(popupFrameElement, false);
nsCAutoString spec;
aURI->GetSpec(spec);
if (aURI) {
aURI->GetSpec(spec);
}
bool dispatchSucceeded =
DispatchOpenWindowEvent(openerFrameElement, popupFrameElement,
NS_ConvertUTF8toUTF16(spec),

View File

@ -53,6 +53,8 @@ public:
* set aPopupTabParent's frame element to event.detail.frameElement.
* Otherwise, we return false.
*
* @param aURL the absolute URL the new window should load. The empty string
* is allowed indicates we shouldn't load anything.
* @param aOpenerTabParent the TabParent whose TabChild called window.open.
* @param aPopupTabParent the TabParent inside which the opened window will
* live.
@ -75,6 +77,9 @@ public:
*
* (These parameter types are silly, but they match what our caller has in
* hand. Feel free to add an override, if they are inconvenient to you.)
*
* @param aURI the URI the new window should load. May be null, which
* indicates that we shouldn't load anything.
*/
static bool
OpenWindowInProcess(nsIDOMWindow* aOpenerWindow,

View File

@ -381,7 +381,9 @@ TabChild::BrowserFrameProvideWindow(nsIDOMWindow* aOpener,
/* aIsBrowserFrame = */ true));
nsCAutoString spec;
aURI->GetSpec(spec);
if (aURI) {
aURI->GetSpec(spec);
}
NS_ConvertUTF8toUTF16 url(spec);
nsString name(aName);