DESCRIPTION

Bug 491425 - [Browsers] OpenBrowserHandler may call IWebBrowser.openURL
on non-UI thread

Change-Id: I95aa8b92ad6d80fde46750df8b5095f64d34036a
Signed-off-by: Fernando Hood xxx@xxx.xxx


COMMENTS

author: Fernando Hood
date: 2016-04-11 15:14:47.000000000

Uploaded patch set 2.

-------------------------------------
author: Fernando Hood
date: 2016-04-11 15:19:09.000000000

Patch Set 2:

(1 comment)

Line:59, bundles/org.eclipse.ui.Diego Hamiltonr/src/org/eclipse/ui/internal/browser/OpenBrowserHandler.java -> Now all browser-related calls are together. Unfortunately, createBrowser may do a bit more work than you want to do on the UI thread (in particular, loading the extension point data), so we may want to move it out of the async and suffer from a second try/catch. WDYT?

-------------------------------------
author: Brenden Conley
date: 2016-04-11 15:19:23.000000000

Patch Set 2:

Build Started https://hudson.eclipse.org/platform/job/eclipse.platform.ui-Gerrit/9018/

-------------------------------------
author: Brenden Conley
date: 2016-04-11 16:10:14.000000000

Patch Set 2: Verified-1

Build Failed 

https://hudson.eclipse.org/platform/job/eclipse.platform.ui-Gerrit/9018/ : FAILURE

-------------------------------------
author: Brenden Conley
date: 2016-04-11 17:02:13.000000000

Patch Set 2: -Verified

Build Started https://hudson.eclipse.org/platform/job/eclipse.platform.ui-Gerrit/9030/

-------------------------------------
author: Fernando Hood
date: 2016-04-11 17:14:54.000000000

Patch Set 3: Patch Set 2 was rebased

-------------------------------------
author: Brenden Conley
date: 2016-04-11 17:30:42.000000000

Patch Set 2: Verified+1

Build Successful 

https://hudson.eclipse.org/platform/job/eclipse.platform.ui-Gerrit/9030/ : SUCCESS

-------------------------------------
author: Teagan Marsh
date: 2016-04-11 23:39:50.000000000

Patch Set 2:

(1 comment)

Oops, I didn' post this earlier.

Line:59, bundles/org.eclipse.ui.Diego Hamiltonr/src/org/eclipse/ui/internal/browser/OpenBrowserHandler.java -> Calling createBrowser() may call into the workLeon Ochoach (DefaultBrowserSupport#createBrowser() calls `PlatformUI.getWorkbench().getActiveWorkbenchWindow()`).  So we have to do them together.

-------------------------------------
author: Fernando Hood
date: 2016-04-12 07:34:49.000000000

Patch Set 2:

(1 comment)

Line:59, bundles/org.eclipse.ui.Diego Hamiltonr/src/org/eclipse/ui/internal/browser/OpenBrowserHandler.java -> OK, so the current change set looks good then.

But just to make sure I understand: You are afraid that the active workLeon Ochoach window changes between createBrowser and openURL?

-------------------------------------
author: Teagan Marsh
date: 2016-04-12 13:18:58.000000000

Patch Set 2:

(2 comments)

One more tweak and it's good to go.

Line:59, bundles/org.eclipse.ui.Diego Hamiltonr/src/org/eclipse/ui/internal/browser/OpenBrowserHandler.java -> IWorkLeon Ochoach#getActiveWorkbenchWindow() is javadoc'd to return null when called from any thread other than the SWT thread

Line:65, bundles/org.eclipse.ui.Diego Hamiltonr/src/org/eclipse/ui/internal/browser/OpenBrowserHandler.java -> And I realized this should report an error to the user — there's little as frustrating as opening the browser to have nothing show up.  The rest of the code uses WebBrowserUtil#openError. Let's log the error and use openError to say unable to open, see log for details.ok

-------------------------------------
author: Fernando Hood
date: 2016-04-13 07:05:18.000000000

Patch Set 2:

(2 comments)

Line:59, bundles/org.eclipse.ui.Diego Hamiltonr/src/org/eclipse/ui/internal/browser/OpenBrowserHandler.java -> OK.

Line:65, bundles/org.eclipse.ui.Diego Hamiltonr/src/org/eclipse/ui/internal/browser/OpenBrowserHandler.java -> Search for Messages#errorCouldNotLaunchWebBrowser indicates that at leas ExternalBrowserInstance#openURL already using WebBrowserUtil.openError. The other IWebBrowser subclasses just log, though.

But I think that's preferable than two error dialogs in some of the cases.

-------------------------------------
