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

Parts 2 and beyond will come at a later date.
This commit is contained in:
Justin Lebar 2012-07-31 23:12:04 -04:00
parent 45485bc982
commit f6b8217588
3 changed files with 10 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 URL the new window should load. The empty string is
* allowed.
* @param aOpenerTabParent the TabParent whose TabChild called window.open.
* @param aPopupTabParent the TabParent inside which the opened window will
* live.
@ -75,6 +77,8 @@ 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.
*/
static bool
OpenWindowInProcess(nsIDOMWindow* aOpenerWindow,

View File

@ -385,7 +385,9 @@ TabChild::BrowserFrameProvideWindow(nsIDOMWindow* aOpener,
/* aChromeFlags = */ 0, mIsBrowserElement, mAppId));
nsCAutoString spec;
aURI->GetSpec(spec);
if (aURI) {
aURI->GetSpec(spec);
}
NS_ConvertUTF8toUTF16 url(spec);
nsString name(aName);