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 12:32:50.000000000

Uploaded patch set 1.

-------------------------------------
author: Brenden Conley
date: 2016-04-11 12:32:56.000000000

Patch Set 1:

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

-------------------------------------
author: Fernando Hood
date: 2016-04-11 12:37:20.000000000

Patch Set 1:

(4 comments)

This is my first change to org.eclipse.ui. Please have a look at the inline comments; the point out areas where I was unsure about the project's best practices. Thank you.

Line:58, bundles/org.eclipse.ui.Diego Hamiltonr/src/org/eclipse/ui/internal/browser/OpenBrowserHandler.java -> Mirrored ContextMenuHandler with its use of Display.getCurrent() as a fallback. An alternative would be to use

  HandlerUtil.getActiveShellChecked(event).getDisplay()

What is preferred?

Line:59, bundles/org.eclipse.ui.Diego Hamiltonr/src/org/eclipse/ui/internal/browser/OpenBrowserHandler.java -> SyncExec vs. AsyncExec. What's preferred for handlers?

Line:64, bundles/org.eclipse.ui.Diego Hamiltonr/src/org/eclipse/ui/internal/browser/OpenBrowserHandler.java -> Technically, createBrowser doesn't need to be called on the UI thread. Moved it in here to save a second PartInitException catch block.

Line:69, bundles/org.eclipse.ui.Diego Hamiltonr/src/org/eclipse/ui/internal/browser/OpenBrowserHandler.java -> Throwing RuntimeException OK?

-------------------------------------
author: Brenden Conley
date: 2016-04-11 13:02:39.000000000

Patch Set 1: Verified+1

Build Successful 

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

-------------------------------------
author: Teagan Marsh
date: 2016-04-11 14:37:57.000000000

Patch Set 1:

(4 comments)

Thanks for the submission!  Some tweaks below

Line:54, bundles/org.eclipse.ui.Diego Hamiltonr/src/org/eclipse/ui/internal/browser/OpenBrowserHandler.java -> I think you should add a comment here explaining that we open the browser from the UI thread.

Line:58, bundles/org.eclipse.ui.Diego Hamiltonr/src/org/eclipse/ui/internal/browser/OpenBrowserHandler.java -> Just use getActiveShellChecked().  Could you add a reference to bug 400932 and note that ideally you'd have used a HandlerUtil#getDisplay?

Line:59, bundles/org.eclipse.ui.Diego Hamiltonr/src/org/eclipse/ui/internal/browser/OpenBrowserHandler.java -> asyncExec unless you *know* it can't be done.  syncExec() can lead to synchronization issues.

Line:69, bundles/org.eclipse.ui.Diego Hamiltonr/src/org/eclipse/ui/internal/browser/OpenBrowserHandler.java -> Log it with the bundle activator's WebBrowserUIPlugin.logError() instead.

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