Bug 1186582 - AskPermission should check for prompt exceptions; r=fabrice
authorKyle Machulis <kyle@nonpolynomial.com>
Wed, 22 Jul 2015 12:46:45 -0700
changeset 256554 d9bb3467a3b2425057b7086d01d4bae21a7b9411
parent 256553 1639af64e372ff6a398f5418d32967521239ad81
child 256555 4a90edbfe8ff9665b26b2ec3950f30a28b9da7ba
push id29178
push userryanvm@gmail.com
push dateThu, 06 Aug 2015 19:22:44 +0000
treeherdermozilla-central@9bdbdad287e0 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersfabrice
bugs1186582
milestone42.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1186582 - AskPermission should check for prompt exceptions; r=fabrice
dom/base/nsContentPermissionHelper.cpp
--- a/dom/base/nsContentPermissionHelper.cpp
+++ b/dom/base/nsContentPermissionHelper.cpp
@@ -367,17 +367,19 @@ nsContentPermissionUtils::AskPermission(
     req->Sendprompt();
     return NS_OK;
   }
 
   // for chrome process
   nsCOMPtr<nsIContentPermissionPrompt> prompt =
     do_GetService(NS_CONTENT_PERMISSION_PROMPT_CONTRACTID);
   if (prompt) {
-    prompt->Prompt(aRequest);
+    if (NS_FAILED(prompt->Prompt(aRequest))) {
+      return NS_ERROR_FAILURE;
+    }
   }
   return NS_OK;
 }
 
 /* static */ nsTArray<PContentPermissionRequestParent*>
 nsContentPermissionUtils::GetContentPermissionRequestParentById(const TabId& aTabId)
 {
   nsTArray<PContentPermissionRequestParent*> parentArray;