[tor-commits] [tor-browser/tor-browser-52.4.0esr-7.0-1] squash! Bug 6253: Add canvas image extraction prompt.

gk at torproject.org gk at torproject.org
Wed Sep 20 13:36:50 UTC 2017


commit 852e4a1ef17e19ea5f57072f1ea3779107e7dce2
Author: Kathy Brade <brade at pearlcrescent.com>
Date:   Wed Sep 20 09:26:21 2017 -0400

    squash! Bug 6253: Add canvas image extraction prompt.
    
    When processing the ShowCanvasPermissionPrompt message in the main
    (parent) process, avoid returning an error from the IPC handler if
    the browser element cannot be obtained. Prior to this change, canvas
    prompt requests that arrived as a tab was closing would generate
    an error, which in turn caused the main process to kill the content
    process.
---
 dom/ipc/TabParent.cpp | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/dom/ipc/TabParent.cpp b/dom/ipc/TabParent.cpp
index ff1b41afafdb..9731561ce0b3 100644
--- a/dom/ipc/TabParent.cpp
+++ b/dom/ipc/TabParent.cpp
@@ -3281,7 +3281,12 @@ bool
 TabParent::RecvShowCanvasPermissionPrompt(const nsCString& firstPartyURI)
 {
   nsCOMPtr<nsIBrowser> browser = do_QueryInterface(mFrameElement);
-  NS_ENSURE_TRUE(browser, false);
+  if (!browser) {
+    // If the tab is being closed, the browser may not be available.
+    // In this case we can ignore the request.
+    return true;
+  }
+
   nsCOMPtr<nsIObserverService> os = services::GetObserverService();
   NS_ENSURE_TRUE(os, false);
   nsresult rv = os->NotifyObservers(browser, "canvas-permissions-prompt",



More information about the tor-commits mailing list