Bug 910431 - Electrolysis: Permission code followup. f=felipe

This commit is contained in:
Tom Schuster 2013-09-04 11:40:16 -04:00
parent 8773f9140b
commit f3a1f4283a
3 changed files with 10 additions and 10 deletions

View File

@ -1734,15 +1734,11 @@ ContentPermissionPrompt.prototype = {
QueryInterface: XPCOMUtils.generateQI([Ci.nsIContentPermissionPrompt]),
_getBrowserForRequest: function (aRequest) {
var browser;
try {
// "element" is only defined in e10s mode, otherwise it throws.
browser = aRequest.element;
} catch (e) {}
// "element" is only defined in e10s mode.
let browser = aRequest.element;
if (!browser) {
var requestingWindow = aRequest.window.top;
// find the requesting browser or iframe
browser = requestingWindow.QueryInterface(Ci.nsIInterfaceRequestor)
// Find the requesting browser.
browser = aRequest.window.QueryInterface(Ci.nsIInterfaceRequestor)
.getInterface(Ci.nsIWebNavigation)
.QueryInterface(Ci.nsIDocShell)
.chromeEventHandler;

View File

@ -318,7 +318,9 @@ DesktopNotificationRequest::GetWindow(nsIDOMWindow * *aRequestingWindow)
NS_IMETHODIMP
DesktopNotificationRequest::GetElement(nsIDOMElement * *aElement)
{
return NS_ERROR_FAILURE;
NS_ENSURE_ARG_POINTER(aElement);
*aElement = nullptr;
return NS_OK;
}
NS_IMETHODIMP

View File

@ -179,7 +179,9 @@ NotificationPermissionRequest::GetWindow(nsIDOMWindow** aRequestingWindow)
NS_IMETHODIMP
NotificationPermissionRequest::GetElement(nsIDOMElement** aElement)
{
return NS_ERROR_FAILURE;
NS_ENSURE_ARG_POINTER(aElement);
*aElement = nullptr;
return NS_OK;
}
NS_IMETHODIMP