Download
Getting Started
Members
Projects
Community
Marketplace
Events
Planet Eclipse
Newsletter
Videos
Participate
Report a Bug
Forums
Mailing Lists
Wiki
IRC
How to Contribute
Working Groups
Automotive
Internet of Things
LocationTech
Long-Term Support
PolarSys
Science
OpenMDM
More
Community
Marketplace
Events
Planet Eclipse
Newsletter
Videos
Participate
Report a Bug
Forums
Mailing Lists
Wiki
IRC
How to Contribute
Working Groups
Automotive
Internet of Things
LocationTech
Long-Term Support
PolarSys
Science
OpenMDM
Toggle navigation
Bugzilla – Attachment 271575 Details for
Bug 527564
[Webkit2] Deadlock due to blocking javascript execution in a synchronous callback from webkit2
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
Log In
[x]
|
Terms of Use
|
Copyright Agent
Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read
this important communication.
snippet to reproduce
file_527564.txt (text/plain), 2.84 KB, created by
Leo Ufimtsev
on 2017-11-21 11:24:48 EST
(
hide
)
Description:
snippet to reproduce
Filename:
MIME Type:
Creator:
Leo Ufimtsev
Created:
2017-11-21 11:24:48 EST
Size:
2.84 KB
patch
obsolete
>public class Temp { > > static int count = 0; > > public static void main(String[] args) { > Display display = new Display(); > Shell shell = new Shell(display); > shell.setSize(500, 600); > > shell.setLayout(new RowLayout()); > > Composite leftBrowser = new Composite(shell, SWT.NONE); > Composite rightBrowser = new Composite(shell, SWT.None); > Button button = new Button (rightBrowser, SWT.PUSH); > button.setText("my button"); > > > final Browser browser = makeBrowserWithConsole(leftBrowser, "theJavaFunction"); > new CustomFunction (browser, "theJavaFunction"); > > final Browser browser2 = makeBrowserWithConsole(rightBrowser, "theJavaFunction"); > new CustomFunction (browser2, "theJavaFunction"); // <<<<<<<, HANG OCCURS HERE. when execute() is called in webbrowser create method. > > shell.open(); > while (!shell.isDisposed()) { > if (!display.readAndDispatch()) > display.sleep(); > } > display.dispose(); > } > > /** > * @param leftBrowser > * @return > */ > private static Browser makeBrowserWithConsole(Composite leftBrowser, String funcName) { > GridLayout gridLayout = new GridLayout(); > leftBrowser.setLayout(gridLayout); > > final Text jsConsole = new Text(leftBrowser, SWT.BORDER); > jsConsole.setText("document.body.innerHTML = " + funcName + "(123)"); // Case where there are no paramaters. > jsConsole.setSelection(jsConsole.getText().length()); > GridData data = new GridData(SWT.FILL, SWT.BEGINNING, true, false); > jsConsole.setLayoutData(data); > > final Browser browser = new Browser(leftBrowser, SWT.NONE); > browser.setText("hello <b>world!</b>"); > data = new GridData(SWT.FILL, SWT.FILL, true, true); > browser.setLayoutData(data); > > jsConsole.addKeyListener(new KeyAdapter() { > @Override > public void keyPressed(KeyEvent e) { > if (e.keyCode == 13) { // 13 = Enter > browser.execute(jsConsole.getText()); > } > } > }); > > Button loadNewPage = new Button(leftBrowser, SWT.PUSH); > loadNewPage.setLayoutData(new GridData(SWT.BEGINNING, SWT.CENTER, false, false)); > loadNewPage.setText("Load new Page"); > loadNewPage.addSelectionListener(new SelectionAdapter() { > @Override > public void widgetSelected(SelectionEvent e) { > browser.setText("New page!" + count++); > } > }); > return browser; > } > > static class CustomFunction extends BrowserFunction { // copied from snippet 307 > CustomFunction (Browser browser, String name) { > super (browser, name); > } > @Override > public Object function (Object[] arguments) { > System.out.println ("theJavaFunction() called from javascript with args:"); > for (int i = 0; i < arguments.length; i++) { > Object arg = arguments[i]; > if (arg == null) { > System.out.println ("\t-->null"); > } else { > System.out.println ("\t-->" + arg.getClass ().getName () + ": " + arg.toString ()); > } > } > return arguments; > } > } >}
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Raw
Actions:
View
Attachments on
bug 527564
: 271575 |
271576