commit 69666b09b12a51ce30d7b0d0e669eb773aca4e0f Author: Kathy Brade brade@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",
tbb-commits@lists.torproject.org