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 209854 Details for
Bug 369285
[Browser] libjavascriptcoregtk can crash at shutdown in WebKitGTK >= 1.4.x
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.
minimal WebKit Browser implementation, still shows the problem
WebKit.java (text/x-java), 3.68 KB, created by
Grant Gayed
on 2012-01-20 15:17:20 EST
(
hide
)
Description:
minimal WebKit Browser implementation, still shows the problem
Filename:
MIME Type:
Creator:
Grant Gayed
Created:
2012-01-20 15:17:20 EST
Size:
3.68 KB
patch
obsolete
>/******************************************************************************* > * Copyright (c) 2010, 2011 IBM Corporation and others. > * All rights reserved. This program and the accompanying materials > * are made available under the terms of the Eclipse Public License v1.0 > * which accompanies this distribution, and is available at > * http://www.eclipse.org/legal/epl-v10.html > * > * Contributors: > * IBM Corporation - initial API and implementation > *******************************************************************************/ >package org.eclipse.swt.browser; > > >import java.io.UnsupportedEncodingException; >import java.net.*; >import java.util.*; > >import org.eclipse.swt.*; >import org.eclipse.swt.graphics.*; >import org.eclipse.swt.internal.*; >import org.eclipse.swt.internal.gtk.OS; >import org.eclipse.swt.internal.webkit.*; >import org.eclipse.swt.layout.*; >import org.eclipse.swt.widgets.*; > >class WebKit extends WebBrowser { > long /*int*/ webView, /*webViewData,*/ scrolledWindow; > static final String PROTOCOL_FILE = "file://"; //$NON-NLS-1$ > static final String PROTOCOL_HTTP = "http://"; //$NON-NLS-1$ > static final char SEPARATOR_FILE = System.getProperty ("file.separator").charAt (0); //$NON-NLS-1$ > > static { > try { > Library.loadLibrary ("swt-webkit"); // $NON-NLS-1$ > } catch (Throwable e) { > } > } > >static boolean IsInstalled () { > return true; >} > >public void create (Composite parent, int style) { > System.out.println("here"); > scrolledWindow = OS.gtk_scrolled_window_new (0, 0); > OS.gtk_scrolled_window_set_policy (scrolledWindow, OS.GTK_POLICY_AUTOMATIC, OS.GTK_POLICY_AUTOMATIC); > webView = WebKitGTK.webkit_web_view_new (); > OS.gtk_container_add (scrolledWindow, webView); > OS.gtk_container_add (browser.handle, scrolledWindow); > OS.gtk_widget_show (scrolledWindow); > OS.gtk_widget_show (webView); > > Listener listener = new Listener () { > public void handleEvent (Event event) { > switch (event.type) { > case SWT.Resize: { > onResize (event); > break; > } > } > } > }; > browser.addListener (SWT.Resize, listener); >} > >public boolean back () { > return true; >} > >public boolean close () { > return true; >} > >boolean close (boolean showPrompters) { > return true; >} > >public boolean execute (String script) { > return true; >} > >public boolean forward () { > return true; >} > >public String getBrowserType () { > return "webkit"; //$NON-NLS-1$ >} > >public String getText () { > return ""; >} > >public String getUrl () { > return ""; >} > >public boolean isBackEnabled () { > return true; >} > >public boolean isForwardEnabled () { > return true; >} > >void onResize (Event e) { > Rectangle rect = browser.getClientArea (); > OS.gtk_widget_set_size_request (scrolledWindow, rect.width, rect.height); >} > >public void refresh () { >} > >public boolean setText (String html, boolean trusted) { > return true; >} > >public boolean setUrl (String url, String postData, String[] headers) { > /* > * WebKitGTK attempts to open the exact url string that is passed to it and > * will not infer a protocol if it's not specified. Detect the case of an > * invalid URL string and try to fix it by prepending an appropriate protocol. > */ > try { > new URL(url); > } catch (MalformedURLException e) { > String testUrl = null; > if (url.charAt (0) == SEPARATOR_FILE) { > /* appears to be a local file */ > testUrl = PROTOCOL_FILE + url; > } else { > testUrl = PROTOCOL_HTTP + url; > } > try { > new URL (testUrl); > url = testUrl; /* adding the protocol made the url valid */ > } catch (MalformedURLException e2) { > /* adding the protocol did not make the url valid, so do nothing */ > } > } > > byte[] uriBytes = Converter.wcsToMbcs (null, url, true); > WebKitGTK.webkit_web_view_load_uri (webView, uriBytes); > return true; >} > >public void stop () { >} > >}
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 369285
:
209852
| 209854