Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLeo Ufimtsev2017-10-04 23:02:02 +0000
committerAlexander Kurtakov2017-10-05 10:05:00 +0000
commit61b1bc783bfeed2794539b90633fbaf9ac64819e (patch)
tree6383ced899e08283dc87aca95184f415f31f62d2
parent5d455e5e20def7b9fbc72b6121f7b4bdade6828a (diff)
downloadeclipse.platform.swt-61b1bc783bfeed2794539b90633fbaf9ac64819e.tar.gz
eclipse.platform.swt-61b1bc783bfeed2794539b90633fbaf9ac64819e.tar.xz
eclipse.platform.swt-61b1bc783bfeed2794539b90633fbaf9ac64819e.zip
Bug 514859 [Webkit2] Verify that no webkit1-only functions are called on
Webkit2. As part of the webkit2 port, we must ensure that no webkit1 functions are ever called by webkit2. To ensure this, I've added assertions around native function calls. During the patch, I discovered multiple webkit1 only functions that were reached by webkit2. (Will post into bug). This patch has no real functional impact, only asserts, comments and some refactoring. Note: assertions are not executed normally, only by jUnits and if '-ea' is specified in vm args. Technical notes: - I moved the "WEBKIT2" variable and the logic that loads the native libraries from WebKit.java to WebKitGTK.java, so that the native function wrappers can access the WEBKIT2 variable. I ensured that classes are loaded in proper order. - I added a WEBKIT1 flag for clarity. The negation !WEBKIT2 slows down code reading, it's very annoying. I also carefully ensured that there is no functional difference. - I added asserts around every webkit(1|2) function call. (I did this with some help of programmatically checking if a function is webkit1 or only webkit2). - Found some Webkit1 only functions being called on Webkit2 (see bug for details. See "TODO - guard from being called on webkit2" inline comments in patch). - Sprinkled some more asserts into WebKit.java and added comments. - Guarded a few Webkit1 only functions from being reached by webkit2 and added some TODO's into that code. - Found that my SWT_LIB_VERSIONS logic was calling a webkit2 only function when webkit2 was called. Fixed that up. - I changed org.eclipse.jdt.ui.prefs a bit so that it it doesn't turn static imports into "*" for WEBKIT1 and WEBKIT2 flag. (WEBKIT1 and WEBKIT2 flag is imported statically in WebKit.java, for sake of brevity). Testing - Junits for Webkit1 & Webkit2 - Child eclipse with webkit1 & webkit2 Change-Id: Ic63503e68e73974a0ca2c7716faabe5039df5ccb Signed-off-by: Leo Ufimtsev <lufimtse@redhat.com>
-rw-r--r--bundles/org.eclipse.swt/.settings/org.eclipse.jdt.ui.prefs2
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT WebKit/gtk/org/eclipse/swt/browser/WebKit.java146
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT WebKit/gtk/org/eclipse/swt/internal/webkit/WebKitGTK.java150
-rw-r--r--bundles/org.eclipse.swt/Readme.md13
4 files changed, 228 insertions, 83 deletions
diff --git a/bundles/org.eclipse.swt/.settings/org.eclipse.jdt.ui.prefs b/bundles/org.eclipse.swt/.settings/org.eclipse.jdt.ui.prefs
index 5a9440f9dd..dc92561f1e 100644
--- a/bundles/org.eclipse.swt/.settings/org.eclipse.jdt.ui.prefs
+++ b/bundles/org.eclipse.swt/.settings/org.eclipse.jdt.ui.prefs
@@ -3,7 +3,7 @@ editor_save_participant_org.eclipse.jdt.ui.postsavelistener.cleanup=true
org.eclipse.jdt.ui.ignorelowercasenames=true
org.eclipse.jdt.ui.importorder=java;javax;org;com;
org.eclipse.jdt.ui.ondemandthreshold=1
-org.eclipse.jdt.ui.staticondemandthreshold=1
+org.eclipse.jdt.ui.staticondemandthreshold=3
sp_cleanup.add_default_serial_version_id=true
sp_cleanup.add_generated_serial_version_id=false
sp_cleanup.add_missing_annotations=true
diff --git a/bundles/org.eclipse.swt/Eclipse SWT WebKit/gtk/org/eclipse/swt/browser/WebKit.java b/bundles/org.eclipse.swt/Eclipse SWT WebKit/gtk/org/eclipse/swt/browser/WebKit.java
index fe16843869..4dfd67b8b2 100644
--- a/bundles/org.eclipse.swt/Eclipse SWT WebKit/gtk/org/eclipse/swt/browser/WebKit.java
+++ b/bundles/org.eclipse.swt/Eclipse SWT WebKit/gtk/org/eclipse/swt/browser/WebKit.java
@@ -12,6 +12,9 @@
package org.eclipse.swt.browser;
+import static org.eclipse.swt.internal.webkit.WebKitGTK.WEBKIT1;
+import static org.eclipse.swt.internal.webkit.WebKitGTK.WEBKIT2;
+
import java.io.*;
import java.lang.reflect.*;
import java.net.*;
@@ -63,7 +66,7 @@ class WebKit extends WebBrowser {
static long /*int*/ ExternalClass;
static long /*int*/ PostString, WebViewType;
- static boolean IsWebKit14orNewer, LibraryLoaded;
+ static boolean IsWebKit14orNewer;
static Map<LONG, LONG> WindowMappings = new HashMap<> ();
static final String ABOUT_BLANK = "about:blank"; //$NON-NLS-1$
@@ -144,25 +147,8 @@ class WebKit extends WebBrowser {
/** Webkit1 & Webkit2, Process key/mouse events from javascript. */
static Callback JSDOMEventProc;
- static boolean WEBKIT2;
-
static {
- try {
- Library.loadLibrary ("swt-webkit"); // $NON-NLS-1$
- LibraryLoaded = true;
- } catch (Throwable e) {
- }
-
- if (LibraryLoaded) {
- String webkit2 = System.getenv("SWT_WEBKIT2"); // $NON-NLS-1$
- int webkit2VersionFunction = WebKitGTK.webkit_get_major_version();
- if (webkit2VersionFunction != 0) { // SWT_WEBKIT2 env variable is not set but webkit2 was loaded as fallback
- webkit2 = "1";
- }
- WEBKIT2 = webkit2 != null && webkit2.equals("1") && OS.GTK3; // $NON-NLS-1$
-
WebViewType = WebKitGTK.webkit_web_view_get_type ();
-
Proc2 = new Callback (WebKit.class, "Proc", 2); //$NON-NLS-1$
if (Proc2.getAddress () == 0) SWT.error (SWT.ERROR_NO_MORE_CALLBACKS);
Proc3 = new Callback (WebKit.class, "Proc", 3); //$NON-NLS-1$
@@ -193,7 +179,7 @@ class WebKit extends WebBrowser {
if (JSDOMEventProc.getAddress () == 0) SWT.error (SWT.ERROR_NO_MORE_CALLBACKS);
NativeClearSessions = () -> {
- if (!LibraryLoaded) return;
+ if (!WebKitGTK.LibraryLoaded) return;
if (WEBKIT2) {
// TODO - implement equivalent. Bug 522181
@@ -223,7 +209,7 @@ class WebKit extends WebBrowser {
};
NativeGetCookie = () -> {
- if (!LibraryLoaded) return;
+ if (!WebKitGTK.LibraryLoaded) return;
if (WEBKIT2) {
// TODO - implement equivalent. Bug 522181
@@ -262,7 +248,7 @@ class WebKit extends WebBrowser {
};
NativeSetCookie = () -> {
- if (!LibraryLoaded) return;
+ if (!WebKitGTK.LibraryLoaded) return;
if (WEBKIT2) {
// TODO - implement equivalent. Bug 522181
@@ -298,9 +284,9 @@ class WebKit extends WebBrowser {
SetPendingCookies (NativePendingCookies);
NativePendingCookies = null;
}
- }
}
+
/**
* For javascript to call java.
* This callback is special in that we link Javascript to a C function and a C function to
@@ -427,14 +413,14 @@ static String getString (long /*int*/ strPtr) {
static Browser FindBrowser (long /*int*/ webView) {
if (webView == 0) return null;
long /*int*/ parent = OS.gtk_widget_get_parent (webView);
- if (!WEBKIT2){
+ if (WEBKIT1){
parent = OS.gtk_widget_get_parent (parent);
}
return (Browser)Display.getCurrent ().findWidget (parent);
}
static boolean IsInstalled () {
- if (!LibraryLoaded) return false;
+ if (!WebKitGTK.LibraryLoaded) return false;
// TODO webkit_check_version() should take care of the following, but for some
// reason this symbol is missing from the latest build. If it is present in
// Linux distro-provided builds then replace the following with this call.
@@ -575,15 +561,21 @@ static long /*int*/ Proc (long /*int*/ handle, long /*int*/ user_data) {
}
static long /*int*/ Proc (long /*int*/ handle, long /*int*/ arg0, long /*int*/ user_data) {
- long /*int*/ webView;
+ long /*int*/ webView = 0;
if (OS.G_TYPE_CHECK_INSTANCE_TYPE (handle, WebKitGTK.webkit_web_view_get_type ())) {
webView = handle;
} else if (OS.G_TYPE_CHECK_INSTANCE_TYPE (handle, WebKitGTK.webkit_web_frame_get_type ())) {
- webView = WebKitGTK.webkit_web_frame_get_web_view (handle);
+ if (WEBKIT2) {
+ // TODO investigate webkit2 equivalent. (or if one is needed at all?)
+ } else {
+ webView = WebKitGTK.webkit_web_frame_get_web_view (handle); // webkit1 only.
+ }
} else {
return 0;
}
+ assert webView != 0 : "Webview shouldn't be null here";
+
Browser browser = FindBrowser (webView);
if (browser == null) return 0;
WebKit webkit = (WebKit)browser.webBrowser;
@@ -603,7 +595,7 @@ static long /*int*/ Proc (long /*int*/ handle, long /*int*/ arg0, long /*int*/ a
static long /*int*/ Proc (long /*int*/ handle, long /*int*/ arg0, long /*int*/ arg1, long /*int*/ arg2, long /*int*/ user_data) {
long /*int*/ webView;
- if (!WEBKIT2 && OS.G_TYPE_CHECK_INSTANCE_TYPE (handle, WebKitGTK.soup_session_get_type ())) {
+ if (WEBKIT1 && OS.G_TYPE_CHECK_INSTANCE_TYPE (handle, WebKitGTK.soup_session_get_type ())) {
webView = user_data;
} else {
webView = handle;
@@ -612,7 +604,7 @@ static long /*int*/ Proc (long /*int*/ handle, long /*int*/ arg0, long /*int*/ a
if (browser == null) return 0;
WebKit webkit = (WebKit)browser.webBrowser;
- if (!WEBKIT2 && webView == user_data) {
+ if (WEBKIT1 && webView == user_data) {
return webkit.sessionProc (handle, arg0, arg1, arg2, user_data); // Webkit1's way of authentication.
} else {
return webkit.webViewProc (handle, arg0, arg1, arg2, user_data);
@@ -629,6 +621,7 @@ static long /*int*/ Proc (long /*int*/ handle, long /*int*/ arg0, long /*int*/ a
/** Webkit1 only */
long /*int*/ sessionProc (long /*int*/ session, long /*int*/ msg, long /*int*/ auth, long /*int*/ retrying, long /*int*/ user_data) {
/* authentication challenges are currently the only notification received from the session */
+ assert WEBKIT1 : WebKitGTK.Webkit1AssertMsg;
if (retrying == 0) {
failureCount = 0;
} else {
@@ -710,7 +703,7 @@ long /*int*/ webkit_authenticate (long /*int*/ web_view, long /*int*/ request){
long /*int*/ webFrameProc (long /*int*/ handle, long /*int*/ arg0, long /*int*/ user_data) {
switch ((int)/*64*/user_data) {
- case NOTIFY_LOAD_STATUS: return webframe_notify_load_status (handle, arg0);
+ case NOTIFY_LOAD_STATUS: return webframe_notify_load_status (handle, arg0); //webkit1
case LOAD_CHANGED: return webkit_load_changed (handle, (int) arg0, user_data);
default: return 0;
}
@@ -728,7 +721,7 @@ long /*int*/ webViewProc (long /*int*/ handle, long /*int*/ arg0, long /*int*/ u
switch ((int)/*64*/user_data) {
case CREATE_WEB_VIEW: return webkit_create_web_view (handle, arg0);
case DOWNLOAD_REQUESTED: return webkit_download_requested (handle, arg0);
- case NOTIFY_LOAD_STATUS: return webkit_notify_load_status (handle, arg0);
+ case NOTIFY_LOAD_STATUS: return webkit_notify_load_status (handle, arg0); // Webkit1
case LOAD_CHANGED: return webkit_load_changed (handle, (int) arg0, user_data);
case NOTIFY_PROGRESS: return webkit_notify_progress (handle, arg0);
case NOTIFY_TITLE: return webkit_notify_title (handle, arg0);
@@ -759,9 +752,9 @@ long /*int*/ webViewProc (long /*int*/ handle, long /*int*/ arg0, long /*int*/ a
long /*int*/ webViewProc (long /*int*/ handle, long /*int*/ arg0, long /*int*/ arg1, long /*int*/ arg2, long /*int*/ arg3, long /*int*/ user_data) {
switch ((int)/*64*/user_data) {
- case MIME_TYPE_POLICY_DECISION_REQUESTED: return webkit_mime_type_policy_decision_requested (handle, arg0, arg1, arg2, arg3);
+ case MIME_TYPE_POLICY_DECISION_REQUESTED: return webkit_mime_type_policy_decision_requested (handle, arg0, arg1, arg2, arg3); // Webkit1
case NAVIGATION_POLICY_DECISION_REQUESTED: return webkit_navigation_policy_decision_requested (handle, arg0, arg1, arg2, arg3);
- case RESOURCE_REQUEST_STARTING: return webkit_resource_request_starting (handle, arg0, arg1, arg2, arg3);
+ case RESOURCE_REQUEST_STARTING: return webkit_resource_request_starting (handle, arg0, arg1, arg2, arg3); // Webkit1
default: return 0;
}
}
@@ -776,7 +769,7 @@ public void create (Composite parent, int style) {
System.out.println(String.format("WebKit version %s.%s.%s", vers[0], vers[1], vers[2])); //$NON-NLS-1$
}
- if (!WEBKIT2) { // 'external' object only used on webkit1 for javaCall. Webkit2 has a different mechanism.
+ if (WEBKIT1) { // 'external' object only used on webkit1 for javaCall. Webkit2 has a different mechanism.
JSClassDefinition jsClassDefinition = new JSClassDefinition ();
byte[] bytes = Converter.wcsToMbcs (CLASSNAME_EXTERNAL, true);
jsClassDefinition.className = C.malloc (bytes.length);
@@ -801,7 +794,7 @@ public void create (Composite parent, int style) {
* thread. Work around this crash by disabling the use of WebKitGTK's
* icon database, which should not affect the Browser in any way.
*/
- if (!WEBKIT2){
+ if (WEBKIT1){
long /*int*/ database = WebKitGTK.webkit_get_favicon_database ();
if (database != 0) {
/* WebKitGTK version is >= 1.8.x */
@@ -810,7 +803,7 @@ public void create (Composite parent, int style) {
}
}
- if (!WEBKIT2){
+ if (WEBKIT1){
scrolledWindow = OS.gtk_scrolled_window_new (0, 0);
OS.gtk_scrolled_window_set_policy (scrolledWindow, OS.GTK_POLICY_AUTOMATIC, OS.GTK_POLICY_AUTOMATIC);
}
@@ -833,12 +826,12 @@ public void create (Composite parent, int style) {
OS.g_object_ref(webView);
}
- if (!WEBKIT2) {
+ if (WEBKIT1) {
webViewData = C.malloc (C.PTR_SIZEOF);
C.memmove (webViewData, new long /*int*/[] {webView}, C.PTR_SIZEOF);
}
- if (!WEBKIT2){
+ if (WEBKIT1){
OS.gtk_container_add (scrolledWindow, webView);
OS.gtk_container_add (browser.handle, scrolledWindow);
OS.gtk_widget_show (scrolledWindow);
@@ -891,7 +884,7 @@ public void create (Composite parent, int style) {
* This hook is set after WebKit and is therefore called after WebKit's
* handler because GTK dispatches events in their order of registration.
*/
- if (!WEBKIT2){
+ if (WEBKIT1){
OS.g_signal_connect (scrolledWindow, OS.button_press_event, JSDOMEventProc.getAddress (), STOP_PROPOGATE);
OS.g_signal_connect (scrolledWindow, OS.button_release_event, JSDOMEventProc.getAddress (), STOP_PROPOGATE);
OS.g_signal_connect (scrolledWindow, OS.key_press_event, JSDOMEventProc.getAddress (), STOP_PROPOGATE);
@@ -943,7 +936,7 @@ public void create (Composite parent, int style) {
browser.addListener (SWT.KeyDown, listener);
browser.addListener (SWT.Resize, listener);
- if (!WEBKIT2){
+ if (WEBKIT1){
/*
* Ensure that our Authenticate listener is at the front of the signal
* queue by removing the default Authenticate listener, adding ours,
@@ -988,7 +981,7 @@ public void create (Composite parent, int style) {
}
}
- if (!WEBKIT2) { // HandleWebKitEvent registration. Pre Webkit 1.4 way of handling mouse/keyboard events. Webkit2 uses dom.
+ if (WEBKIT1) { // HandleWebKitEvent registration. Pre Webkit 1.4 way of handling mouse/keyboard events. Webkit2 uses dom.
eventFunction = new BrowserFunction (browser, "HandleWebKitEvent") { //$NON-NLS-1$
@Override
public Object function(Object[] arguments) {
@@ -1032,31 +1025,36 @@ void addEventHandlers (long /*int*/ web_view, boolean top) {
if (!jsEnabled) return;
if (top && IsWebKit14orNewer) {
- long /*int*/ domDocument = WebKitGTK.webkit_web_view_get_dom_document (web_view);
- if (domDocument != 0) {
- WindowMappings.put (new LONG (domDocument), new LONG (web_view));
- WebKitGTK.webkit_dom_event_target_add_event_listener (domDocument, WebKitGTK.dragstart, JSDOMEventProc.getAddress (), 0, SWT.DragDetect);
- WebKitGTK.webkit_dom_event_target_add_event_listener (domDocument, WebKitGTK.keydown, JSDOMEventProc.getAddress (), 0, SWT.KeyDown);
- WebKitGTK.webkit_dom_event_target_add_event_listener (domDocument, WebKitGTK.keypress, JSDOMEventProc.getAddress (), 0, SENTINEL_KEYPRESS);
- WebKitGTK.webkit_dom_event_target_add_event_listener (domDocument, WebKitGTK.keyup, JSDOMEventProc.getAddress (), 0, SWT.KeyUp);
- WebKitGTK.webkit_dom_event_target_add_event_listener (domDocument, WebKitGTK.mousedown, JSDOMEventProc.getAddress (), 0, SWT.MouseDown);
- WebKitGTK.webkit_dom_event_target_add_event_listener (domDocument, WebKitGTK.mousemove, JSDOMEventProc.getAddress (), 0, SWT.MouseMove);
- WebKitGTK.webkit_dom_event_target_add_event_listener (domDocument, WebKitGTK.mouseup, JSDOMEventProc.getAddress (), 0, SWT.MouseUp);
- WebKitGTK.webkit_dom_event_target_add_event_listener (domDocument, WebKitGTK.mousewheel, JSDOMEventProc.getAddress (), 0, SWT.MouseWheel);
-
- /*
- * The following two lines are intentionally commented because they cannot be used to
- * consistently send MouseEnter/MouseExit events until https://bugs.webkit.org/show_bug.cgi?id=35246
- * is fixed.
- */
- //WebKitGTK.webkit_dom_event_target_add_event_listener (domWindow, WebKitGTK.mouseover, JSDOMEventProc.getAddress (), 0, SWT.MouseEnter);
- //WebKitGTK.webkit_dom_event_target_add_event_listener (domWindow, WebKitGTK.mouseout, JSDOMEventProc.getAddress (), 0, SWT.MouseExit);
+ if (WEBKIT2) {
+ // TODO implement equivalent?
+ // As a note, this entire function only seems to do webkit1-only stuff at the moment...
+ } else {
+ long /*int*/ domDocument = WebKitGTK.webkit_web_view_get_dom_document (web_view); // Webkit1 only
+ if (domDocument != 0) {
+ WindowMappings.put (new LONG (domDocument), new LONG (web_view));
+ WebKitGTK.webkit_dom_event_target_add_event_listener (domDocument, WebKitGTK.dragstart, JSDOMEventProc.getAddress (), 0, SWT.DragDetect);
+ WebKitGTK.webkit_dom_event_target_add_event_listener (domDocument, WebKitGTK.keydown, JSDOMEventProc.getAddress (), 0, SWT.KeyDown);
+ WebKitGTK.webkit_dom_event_target_add_event_listener (domDocument, WebKitGTK.keypress, JSDOMEventProc.getAddress (), 0, SENTINEL_KEYPRESS);
+ WebKitGTK.webkit_dom_event_target_add_event_listener (domDocument, WebKitGTK.keyup, JSDOMEventProc.getAddress (), 0, SWT.KeyUp);
+ WebKitGTK.webkit_dom_event_target_add_event_listener (domDocument, WebKitGTK.mousedown, JSDOMEventProc.getAddress (), 0, SWT.MouseDown);
+ WebKitGTK.webkit_dom_event_target_add_event_listener (domDocument, WebKitGTK.mousemove, JSDOMEventProc.getAddress (), 0, SWT.MouseMove);
+ WebKitGTK.webkit_dom_event_target_add_event_listener (domDocument, WebKitGTK.mouseup, JSDOMEventProc.getAddress (), 0, SWT.MouseUp);
+ WebKitGTK.webkit_dom_event_target_add_event_listener (domDocument, WebKitGTK.mousewheel, JSDOMEventProc.getAddress (), 0, SWT.MouseWheel);
+
+ /*
+ * The following two lines are intentionally commented because they cannot be used to
+ * consistently send MouseEnter/MouseExit events until https://bugs.webkit.org/show_bug.cgi?id=35246
+ * is fixed.
+ */
+ //WebKitGTK.webkit_dom_event_target_add_event_listener (domWindow, WebKitGTK.mouseover, JSDOMEventProc.getAddress (), 0, SWT.MouseEnter);
+ //WebKitGTK.webkit_dom_event_target_add_event_listener (domWindow, WebKitGTK.mouseout, JSDOMEventProc.getAddress (), 0, SWT.MouseExit);
+ }
+ return;
}
- return;
}
- if (!WEBKIT2) { // add HandleWebKitEvent key/mouse handlers
+ if (WEBKIT1) { // add HandleWebKitEvent key/mouse handlers
/* install the JS call-out to the registered BrowserFunction */
StringBuffer buffer = new StringBuffer ("window.SWTkeyhandler = function SWTkeyhandler(e) {"); //$NON-NLS-1$
buffer.append ("try {e.returnValue = HandleWebKitEvent(e.type, e.keyCode, e.charCode, e.altKey, e.ctrlKey, e.shiftKey, e.metaKey);} catch (e) {}};"); //$NON-NLS-1$
@@ -1122,6 +1120,7 @@ public boolean close () {
// false = blocks disposal. In Browser.java, user is told widget was not disposed.
// See Snippet326.
boolean close (boolean showPrompters) {
+ assert WEBKIT1 || WEBKIT2;
if (!jsEnabled) return true;
String message1 = Compatibility.getMessage("SWT_OnBeforeUnload_Message1"); // $NON-NLS-1$
@@ -1148,10 +1147,11 @@ boolean close (boolean showPrompters) {
execute (buffer.toString ());
Boolean result;
- if (!WEBKIT2) {
+ if (WEBKIT1) {
result = (Boolean)evaluate ("return " + functionName +"(window);"); // $NON-NLS-1$ // $NON-NLS-2$
if (result == null) return false; // Default to prevent disposal.
} else {
+ assert WEBKIT2 : WebKitGTK.Webkit2AssertMsg;
// Sometimes if a disposal is already underway (ex parent shell disposed), then
// Webkit1: Silently fails
// Webkit2: Javascript execution can throw. We have to account for that.
@@ -1858,7 +1858,7 @@ long /*int*/ handleLoadCommitted (long /*int*/ uri, boolean top) {
}
// Bug 511797 : On webkit2, this code is only reached once per page load.
- if (!WEBKIT2) {
+ if (WEBKIT1) {
/*
* Webkit1:
* Each invocation of setText() causes webkit_notify_load_status to be invoked
@@ -1890,7 +1890,7 @@ long /*int*/ handleLoadCommitted (long /*int*/ uri, boolean top) {
}
private void fireNewTitleEvent(String title){
- if (!WEBKIT2) {
+ if (WEBKIT1) {
// titleListener is already handled/fired in webkit_notify_title()
// [which is triggered by 'notify::title'. No need to fire it twice.
//
@@ -1942,6 +1942,7 @@ private void fireProgressCompletedEvent(){
* (Webkit2 equivalent is webkit_load_changed())
*/
long /*int*/ handleLoadFinished (long /*int*/ uri, boolean top) {
+ assert WEBKIT1 : WebKitGTK.Webkit1AssertMsg;
int length = C.strlen (uri);
byte[] bytes = new byte[length];
C.memmove (bytes, uri, length);
@@ -2032,7 +2033,7 @@ void onDispose (Event e) {
}
functions = null;
- if (!WEBKIT2) {
+ if (WEBKIT1) {
// event function/external object only used by webkit1. For Webkit2, see Webkit2JavaCallback
if (eventFunction != null) {
eventFunction.dispose (false);
@@ -2249,6 +2250,7 @@ public void stop () {
}
long /*int*/ webframe_notify_load_status (long /*int*/ web_frame, long /*int*/ pspec) {
+ assert WEBKIT1 : WebKitGTK.Webkit1AssertMsg;
int status = WebKitGTK.webkit_web_frame_get_load_status (web_frame);
switch (status) {
case WebKitGTK.WEBKIT_LOAD_COMMITTED: {
@@ -2385,6 +2387,7 @@ long /*int*/ webkit_download_requested (long /*int*/ web_view, long /*int*/ down
* - https://webkitgtk.org/reference/webkit2gtk/stable/WebKitWebView.html#WebKitWebView-mouse-target-changed
* */
long /*int*/ webkit_mouse_target_changed (long /*int*/ web_view, long /*int*/ hit_test_result, long /*int*/ modifiers) {
+ assert WEBKIT2 : WebKitGTK.Webkit2AssertMsg;
if (WebKitGTK.webkit_hit_test_result_context_is_link(hit_test_result)){
long /*int*/ uri = WebKitGTK.webkit_hit_test_result_get_link_uri(hit_test_result);
long /*int*/ title = WebKitGTK.webkit_hit_test_result_get_link_title(hit_test_result);
@@ -2430,6 +2433,7 @@ long /*int*/ webkit_hovering_over_link (long /*int*/ web_view, long /*int*/ titl
}
long /*int*/ webkit_mime_type_policy_decision_requested (long /*int*/ web_view, long /*int*/ frame, long /*int*/ request, long /*int*/ mimetype, long /*int*/ policy_decision) {
+ assert WEBKIT1 : WebKitGTK.Webkit1AssertMsg;
boolean canShow = WebKitGTK.webkit_web_view_can_show_mime_type (webView, mimetype) != 0;
if (!canShow) {
WebKitGTK.webkit_web_policy_decision_download (policy_decision);
@@ -2440,7 +2444,7 @@ long /*int*/ webkit_mime_type_policy_decision_requested (long /*int*/ web_view,
/** Webkit1 only */
long /*int*/ webkit_navigation_policy_decision_requested (long /*int*/ web_view, long /*int*/ frame, long /*int*/ request, long /*int*/ navigation_action, long /*int*/ policy_decision) {
- assert !WEBKIT2 : "Webkit1 only code was ran by webkit2";
+ assert WEBKIT1 : WebKitGTK.Webkit1AssertMsg;
if (loadingText) {
/*
* WebKit is auto-navigating to about:blank in response to a
@@ -2513,7 +2517,7 @@ long /*int*/ webkit_navigation_policy_decision_requested (long /*int*/ web_view,
/** Webkit2 only */
long /*int*/ webkit_decide_policy (long /*int*/ web_view, long /*int*/ decision, int decision_type, long /*int*/ user_data) {
- assert WEBKIT2 : "Webkit2 only code was ran by webkit1";
+ assert WEBKIT2 : WebKitGTK.Webkit2AssertMsg;
switch (decision_type) {
case WebKitGTK.WEBKIT_POLICY_DECISION_TYPE_NAVIGATION_ACTION:
long /*int*/ request = WebKitGTK. webkit_navigation_policy_decision_get_request(decision);
@@ -2584,6 +2588,7 @@ long /*int*/ webkit_decide_policy (long /*int*/ web_view, long /*int*/ decision,
}
long /*int*/ webkit_notify_load_status (long /*int*/ web_view, long /*int*/ pspec) {
+ assert WEBKIT1 : WebKitGTK.Webkit1AssertMsg;
int status = WebKitGTK.webkit_web_view_get_load_status (webView);
switch (status) {
case WebKitGTK.WEBKIT_LOAD_COMMITTED: {
@@ -2778,6 +2783,7 @@ private void addRequestHeaders(long /*int*/ requestHeaders, String[] headers){
}
long /*int*/ webkit_resource_request_starting (long /*int*/ web_view, long /*int*/ web_frame, long /*int*/ web_resource, long /*int*/ request, long /*int*/ response) {
+ assert WEBKIT1;
if (postData != null || headers != null) {
long /*int*/ message = WebKitGTK.webkit_network_request_get_message (request);
if (message == 0) {
@@ -2861,7 +2867,7 @@ long /*int*/ webkit_web_view_ready (long /*int*/ web_view) {
newEvent.display = browser.getDisplay ();
newEvent.widget = browser;
- if (!WEBKIT2) {
+ if (WEBKIT1) {
long /*int*/ webKitWebWindowFeatures = WebKitGTK.webkit_web_view_get_window_features (webView);
newEvent.addressBar = webkit_settings_get(webKitWebWindowFeatures, WebKitGTK.locationbar_visible) != 0;
newEvent.menuBar = webkit_settings_get(webKitWebWindowFeatures, WebKitGTK.menubar_visible) != 0;
@@ -2875,7 +2881,8 @@ long /*int*/ webkit_web_view_ready (long /*int*/ web_view) {
newEvent.location = new Point (x,y);
if (width != -1 && height != -1)
newEvent.size = new Point (width,height);
- } else { // Webkit2
+ } else {
+ assert WEBKIT2 : WebKitGTK.Webkit2AssertMsg;
long /*int*/ properties = WebKitGTK.webkit_web_view_get_window_properties(webView);
newEvent.addressBar = webkit_settings_get(properties, WebKitGTK.locationbar_visible) != 0;
newEvent.menuBar = webkit_settings_get(properties, WebKitGTK.menubar_visible) != 0;
@@ -2922,6 +2929,7 @@ long /*int*/ webkit_web_view_ready (long /*int*/ web_view) {
* The webkit2 equivalent is webkit_load_changed(..):caseWEBKIT2__LOAD_FINISHED
*/
long /*int*/ webkit_window_object_cleared (long /*int*/ web_view, long /*int*/ frame, long /*int*/ context, long /*int*/ window_object) {
+ assert WEBKIT1 : WebKitGTK.Webkit1AssertMsg;
long /*int*/ globalObject = WebKitGTK.JSContextGetGlobalObject (context);
long /*int*/ externalObject = WebKitGTK.JSObjectMake (context, ExternalClass, webViewData);
byte[] bytes = (OBJECTNAME_EXTERNAL + '\0').getBytes (StandardCharsets.UTF_8);
diff --git a/bundles/org.eclipse.swt/Eclipse SWT WebKit/gtk/org/eclipse/swt/internal/webkit/WebKitGTK.java b/bundles/org.eclipse.swt/Eclipse SWT WebKit/gtk/org/eclipse/swt/internal/webkit/WebKitGTK.java
index 0b3ab99883..701cebc669 100644
--- a/bundles/org.eclipse.swt/Eclipse SWT WebKit/gtk/org/eclipse/swt/internal/webkit/WebKitGTK.java
+++ b/bundles/org.eclipse.swt/Eclipse SWT WebKit/gtk/org/eclipse/swt/internal/webkit/WebKitGTK.java
@@ -20,14 +20,38 @@ import org.eclipse.swt.internal.gtk.*;
public class WebKitGTK extends C {
+ public static boolean LibraryLoaded;
+ public static boolean WEBKIT1, WEBKIT2;
+ public static final String Webkit1AssertMsg = "Webkit2 code reached by webkit1"; // $NON-NLS-1$
+ public static final String Webkit2AssertMsg = "Webkit1 code reached by webkit2"; // $NON-NLS-1$
- // Bug 519124
static {
+ try {
+ Library.loadLibrary ("swt-webkit"); // $NON-NLS-1$
+ LibraryLoaded = true;
+ } catch (Throwable e) {
+ }
+
+ if (LibraryLoaded) {
+ String webkit2 = System.getenv("SWT_WEBKIT2"); // $NON-NLS-1$
+ int webkit2VersionFunction = webkit_get_major_version();
+ if (webkit2VersionFunction != 0) { // SWT_WEBKIT2 env variable is not set but webkit2 was loaded as fallback
+ webkit2 = "1";
+ }
+ WEBKIT2 = webkit2 != null && webkit2.equals("1") && OS.GTK3; // $NON-NLS-1$
+ WEBKIT1 = !WEBKIT2;
+ }
+
String swt_lib_versions = OS.getEnvironmentalVariable ("SWT_LIB_VERSIONS"); // Note, this is read in multiple places.
if (swt_lib_versions != null && swt_lib_versions.equals("1")) {
- System.out.println("SWT_LIB_WebkitGtk:"+webkit_get_major_version()+"."+webkit_get_minor_version()+"."+webkit_micro_version() + " (Version >=2.5 is Webkit2)");
+ if (WEBKIT1) {
+ System.out.println("SWT_LIB Webkit1 Webkitgtk:"+ webkit_major_version() +"."+ webkit_minor_version() + "." + webkit_micro_version() + " (webkitgtk < 2.5 is Webkit1)");
+ }
+ if (WEBKIT2) {
+ System.out.println("SWT_LIB Webkit2 Webkitgtk:"+ webkit_get_major_version()+"."+ webkit_get_minor_version() + "." + webkit_get_micro_version() + " (webkitgtk >=2.5 is Webkit2)");
+ }
}
- }
+ };
/** Constants */
public static final int kJSTypeUndefined = 0;
@@ -74,16 +98,16 @@ public class WebKitGTK extends C {
/** Webkit2 only, to implement equivalent of webkit1 window_object_cleared*/
public static final byte[] load_changed = ascii ("load-changed"); // $NON-NLS-1$
- public static final byte[] mime_type_policy_decision_requested = ascii ("mime-type-policy-decision-requested"); // $NON-NLS-1$
+ public static final byte[] mime_type_policy_decision_requested = ascii ("mime-type-policy-decision-requested"); // $NON-NLS-1$ // webkit1
public static final byte[] navigation_policy_decision_requested = ascii ("navigation-policy-decision-requested"); // $NON-NLS-1$
- public static final byte[] notify_load_status = ascii ("notify::load-status"); // $NON-NLS-1$
+ public static final byte[] notify_load_status = ascii ("notify::load-status"); // $NON-NLS-1$ // Webkit1
public static final byte[] notify_progress = ascii ("notify::progress"); // $NON-NLS-1$ // ->Webkit1 Progress.changed()
public static final byte[] notify_estimated_load_progress = ascii ("notify::estimated-load-progress"); // $NON-NLS-1$ // ->Webkit2 Progress.changed()
public static final byte[] notify_title = ascii ("notify::title"); // $NON-NLS-1$
public static final byte[] populate_popup = ascii ("populate-popup"); // $NON-NLS-1$
- public static final byte[] resource_request_starting = ascii ("resource-request-starting"); // $NON-NLS-1$
+ public static final byte[] resource_request_starting = ascii ("resource-request-starting"); // $NON-NLS-1$ //Webkit1
public static final byte[] resource_load_started = ascii ("resource-load-started"); // $NON-NLS-1$
/** Webkit1 only. On webkit2 & newer browsers 'window.status=txt' has no effect anymore.
* Status bar only updated when you hover mouse over hyperlink.*/
@@ -340,6 +364,7 @@ public static final void JSStringRelease (long /*int*/ string) {
/** @method flags=dynamic */
public static final native void _webkit_javascript_result_unref(long /*int*/ js_result);
public static final void webkit_javascript_result_unref(long /*int*/ js_result) {
+ assert WEBKIT2 : Webkit2AssertMsg;
lock.lock();
try {
_webkit_javascript_result_unref (js_result);
@@ -685,6 +710,7 @@ public static final long /*int*/ soup_uri_to_string (long /*int*/ uri, int just_
/** @method flags=dynamic */
public static final native void _webkit_authentication_request_authenticate (long /*int*/ request, long /*int*/ credential);
public static final void webkit_authentication_request_authenticate (long /*int*/ request, long /*int*/ credential) {
+ assert WEBKIT2 : Webkit2AssertMsg;
lock.lock();
try {
_webkit_authentication_request_authenticate (request, credential);
@@ -696,6 +722,7 @@ public static final void webkit_authentication_request_authenticate (long /*int*
/** @method flags=dynamic */
public static final native void _webkit_authentication_request_cancel (long /*int*/ request);
public static final void webkit_authentication_request_cancel (long /*int*/ request) {
+ assert WEBKIT2 : Webkit2AssertMsg;
lock.lock();
try {
_webkit_authentication_request_cancel (request);
@@ -707,6 +734,7 @@ public static final void webkit_authentication_request_cancel (long /*int*/ requ
/** @method flags=dynamic */
public static final native boolean _webkit_authentication_request_is_retry (long /*int*/ request);
public static final boolean webkit_authentication_request_is_retry (long /*int*/ request) {
+ assert WEBKIT2 : Webkit2AssertMsg;
lock.lock();
try {
return _webkit_authentication_request_is_retry (request);
@@ -718,6 +746,7 @@ public static final boolean webkit_authentication_request_is_retry (long /*int*/
/** @method flags=dynamic */
public static final native void _webkit_credential_free (long /*int*/ credential);
public static final void webkit_credential_free (long /*int*/ credential) {
+ assert WEBKIT2 : Webkit2AssertMsg;
lock.lock();
try {
_webkit_credential_free (credential);
@@ -729,6 +758,7 @@ public static final void webkit_credential_free (long /*int*/ credential) {
/** @method flags=dynamic */
public static final native long /*int*/ _webkit_credential_new (byte[] username, byte[] password, int persistence);
public static final long /*int*/ webkit_credential_new (byte[] username, byte[] password, int persistence) {
+ assert WEBKIT2 : Webkit2AssertMsg;
lock.lock();
try {
return _webkit_credential_new (username, password, persistence);
@@ -862,6 +892,7 @@ public static final long webkit_dom_ui_event_get_key_code (long /*int*/ self) {
/** @method flags=dynamic */
public static final native void _webkit_download_cancel (long /*int*/ download);
public static final void webkit_download_cancel (long /*int*/ download) {
+ assert WEBKIT1 || WEBKIT2;
lock.lock();
try {
_webkit_download_cancel (download);
@@ -873,6 +904,8 @@ public static final void webkit_download_cancel (long /*int*/ download) {
/** @method flags=dynamic */
public static final native long _webkit_download_get_current_size (long /*int*/ download);
public static final long webkit_download_get_current_size (long /*int*/ download) {
+ assert WEBKIT1 : Webkit1AssertMsg;
+ //TODO - guard from being called on webkit2.
lock.lock();
try {
return _webkit_download_get_current_size (download);
@@ -884,6 +917,8 @@ public static final long webkit_download_get_current_size (long /*int*/ download
/** @method flags=dynamic */
public static final native long /*int*/ _webkit_download_get_network_request (long /*int*/ download);
public static final long /*int*/ webkit_download_get_network_request (long /*int*/ download) {
+ assert WEBKIT1 : Webkit1AssertMsg;
+ //TODO - guard from being called on webkit2.
lock.lock();
try {
return _webkit_download_get_network_request (download);
@@ -895,6 +930,8 @@ public static final long /*int*/ webkit_download_get_network_request (long /*int
/** @method flags=dynamic */
public static final native int _webkit_download_get_status (long /*int*/ download);
public static final int webkit_download_get_status (long /*int*/ download) {
+ assert WEBKIT1 : Webkit1AssertMsg;
+ //TODO - guard from being called on webkit2.
lock.lock();
try {
return _webkit_download_get_status (download);
@@ -906,6 +943,8 @@ public static final int webkit_download_get_status (long /*int*/ download) {
/** @method flags=dynamic */
public static final native long /*int*/ _webkit_download_get_suggested_filename (long /*int*/ download);
public static final long /*int*/ webkit_download_get_suggested_filename (long /*int*/ download) {
+ assert WEBKIT1 : Webkit1AssertMsg;
+ //TODO - guard from being called on webkit2.
lock.lock();
try {
return _webkit_download_get_suggested_filename (download);
@@ -917,6 +956,8 @@ public static final long /*int*/ webkit_download_get_suggested_filename (long /*
/** @method flags=dynamic */
public static final native long _webkit_download_get_total_size (long /*int*/ download);
public static final long webkit_download_get_total_size (long /*int*/ download) {
+ assert WEBKIT1 : Webkit1AssertMsg;
+ //TODO - guard from being called on webkit2.
lock.lock();
try {
return _webkit_download_get_total_size (download);
@@ -928,6 +969,8 @@ public static final long webkit_download_get_total_size (long /*int*/ download)
/** @method flags=dynamic */
public static final native long /*int*/ _webkit_download_get_uri (long /*int*/ download);
public static final long /*int*/ webkit_download_get_uri (long /*int*/ download) {
+ assert WEBKIT1 : Webkit1AssertMsg;
+ //TODO - guard from being called on webkit2.
lock.lock();
try {
return _webkit_download_get_uri (download);
@@ -939,6 +982,8 @@ public static final long /*int*/ webkit_download_get_uri (long /*int*/ download)
/** @method flags=dynamic */
public static final native long /*int*/ _webkit_download_new (long /*int*/ request);
public static final long /*int*/ webkit_download_new (long /*int*/ request) {
+ assert WEBKIT1 : Webkit1AssertMsg;
+ //TODO - guard from being called on webkit2.
lock.lock();
try {
return _webkit_download_new (request);
@@ -950,6 +995,8 @@ public static final long /*int*/ webkit_download_new (long /*int*/ request) {
/** @method flags=dynamic */
public static final native void _webkit_download_set_destination_uri (long /*int*/ download, byte[] destination_uri);
public static final void webkit_download_set_destination_uri (long /*int*/ download, byte[] destination_uri) {
+ assert WEBKIT1 : Webkit1AssertMsg;
+ //TODO - guard from being called on webkit2.
lock.lock();
try {
_webkit_download_set_destination_uri (download, destination_uri);
@@ -961,6 +1008,8 @@ public static final void webkit_download_set_destination_uri (long /*int*/ downl
/** @method flags=dynamic */
public static final native void _webkit_download_start (long /*int*/ download);
public static final void webkit_download_start (long /*int*/ download) {
+ assert WEBKIT1 : Webkit1AssertMsg;
+ //TODO - guard from being called on webkit2.
lock.lock();
try {
_webkit_download_start (download);
@@ -972,6 +1021,7 @@ public static final void webkit_download_start (long /*int*/ download) {
/** @method flags=dynamic */
public static final native void _webkit_favicon_database_set_path (long /*int*/ database, long /*int*/ path);
public static final void webkit_favicon_database_set_path (long /*int*/ database, long /*int*/ path) {
+ assert WEBKIT1 : Webkit1AssertMsg;
lock.lock();
try {
_webkit_favicon_database_set_path (database, path);
@@ -983,6 +1033,7 @@ public static final void webkit_favicon_database_set_path (long /*int*/ database
/** @method flags=dynamic */
public static final native long /*int*/ _webkit_get_default_session ();
public static final long /*int*/ webkit_get_default_session () {
+ assert WEBKIT1 : Webkit1AssertMsg;
lock.lock();
try {
return _webkit_get_default_session ();
@@ -994,6 +1045,7 @@ public static final long /*int*/ webkit_get_default_session () {
/** @method flags=dynamic */
public static final native long /*int*/ _webkit_get_favicon_database ();
public static final long /*int*/ webkit_get_favicon_database () {
+ assert WEBKIT1 : Webkit1AssertMsg;
lock.lock();
try {
return _webkit_get_favicon_database ();
@@ -1005,6 +1057,7 @@ public static final long /*int*/ webkit_get_favicon_database () {
/** @method flags=dynamic */
public static final native boolean _webkit_hit_test_result_context_is_link (long /*int*/ hit_test_result);
public static final boolean webkit_hit_test_result_context_is_link (long /*int*/ hit_test_result) {
+ assert WEBKIT2 : Webkit2AssertMsg;
lock.lock();
try {
return _webkit_hit_test_result_context_is_link (hit_test_result);
@@ -1016,6 +1069,7 @@ public static final boolean webkit_hit_test_result_context_is_link (long /*int*/
/** @method flags=dynamic */
public static final native long /*int*/ _webkit_hit_test_result_get_link_uri (long /*int*/ hit_test_result);
public static final long /*int*/ webkit_hit_test_result_get_link_uri (long /*int*/ hit_test_result) {
+ assert WEBKIT2 : Webkit2AssertMsg;
lock.lock();
try {
return _webkit_hit_test_result_get_link_uri (hit_test_result);
@@ -1027,6 +1081,7 @@ public static final long /*int*/ webkit_hit_test_result_get_link_uri (long /*int
/** @method flags=dynamic */
public static final native long /*int*/ _webkit_hit_test_result_get_link_title (long /*int*/ hit_test_result);
public static final long /*int*/ webkit_hit_test_result_get_link_title (long /*int*/ hit_test_result) {
+ assert WEBKIT2 : Webkit2AssertMsg;
lock.lock();
try {
return _webkit_hit_test_result_get_link_title (hit_test_result);
@@ -1038,6 +1093,7 @@ public static final long /*int*/ webkit_hit_test_result_get_link_title (long /*i
/** @method flags=dynamic */
public static final native int _webkit_major_version ();
public static final int webkit_major_version () {
+ assert WEBKIT1 : Webkit1AssertMsg;
lock.lock();
try {
return _webkit_major_version ();
@@ -1049,6 +1105,7 @@ public static final int webkit_major_version () {
/** @method flags=dynamic */
public static final native int _webkit_get_major_version ();
public static final int webkit_get_major_version () {
+// assert WEBKIT2; //Corner case, this function is called in order to determine WEBKIT2 flag. Can't use in assert.
lock.lock();
try {
return _webkit_get_major_version ();
@@ -1060,6 +1117,7 @@ public static final int webkit_get_major_version () {
/** @method flags=dynamic */
public static final native int _webkit_micro_version ();
public static final int webkit_micro_version () {
+ assert WEBKIT1 : Webkit1AssertMsg;
lock.lock();
try {
return _webkit_micro_version ();
@@ -1071,6 +1129,7 @@ public static final int webkit_micro_version () {
/** @method flags=dynamic */
public static final native int _webkit_get_micro_version ();
public static final int webkit_get_micro_version () {
+ assert WEBKIT2 : Webkit2AssertMsg;
lock.lock();
try {
return _webkit_get_micro_version ();
@@ -1082,6 +1141,7 @@ public static final int webkit_get_micro_version () {
/** @method flags=dynamic */
public static final native int _webkit_minor_version ();
public static final int webkit_minor_version () {
+ assert WEBKIT1 : Webkit1AssertMsg;
lock.lock();
try {
return _webkit_minor_version ();
@@ -1093,6 +1153,7 @@ public static final int webkit_minor_version () {
/** @method flags=dynamic */
public static final native int _webkit_get_minor_version ();
public static final int webkit_get_minor_version () {
+ assert WEBKIT2 : Webkit2AssertMsg;
lock.lock();
try {
return _webkit_get_minor_version ();
@@ -1104,6 +1165,7 @@ public static final int webkit_get_minor_version () {
/** @method flags=dynamic */
public static final native long /*int*/ _webkit_navigation_policy_decision_get_request (long /*int*/ decision);
public static final long /*int*/ webkit_navigation_policy_decision_get_request (long /*int*/ decision) {
+ assert WEBKIT2 : Webkit2AssertMsg;
lock.lock();
try {
return _webkit_navigation_policy_decision_get_request (decision);
@@ -1115,6 +1177,7 @@ public static final long /*int*/ webkit_navigation_policy_decision_get_request (
/** @method flags=dynamic */
public static final native long /*int*/ _webkit_network_request_get_message (long /*int*/ request);
public static final long /*int*/ webkit_network_request_get_message (long /*int*/ request) {
+ assert WEBKIT1 : Webkit1AssertMsg;
lock.lock();
try {
return _webkit_network_request_get_message (request);
@@ -1126,6 +1189,7 @@ public static final long /*int*/ webkit_network_request_get_message (long /*int*
/** @method flags=dynamic */
public static final native long /*int*/ _webkit_network_request_get_uri (long /*int*/ request);
public static final long /*int*/ webkit_network_request_get_uri (long /*int*/ request) {
+ assert WEBKIT1 : Webkit1AssertMsg;
lock.lock();
try {
return _webkit_network_request_get_uri (request);
@@ -1137,6 +1201,7 @@ public static final long /*int*/ webkit_network_request_get_uri (long /*int*/ re
/** @method flags=dynamic */
public static final native long /*int*/ _webkit_network_request_new (byte[] uri);
public static final long /*int*/ webkit_network_request_new (byte[] uri) {
+ assert WEBKIT1 : Webkit1AssertMsg;
lock.lock();
try {
return _webkit_network_request_new (uri);
@@ -1148,6 +1213,7 @@ public static final long /*int*/ webkit_network_request_new (byte[] uri) {
/** @method flags=dynamic */
public static final native void _webkit_policy_decision_download (long /*int*/ decision);
public static final void webkit_policy_decision_download (long /*int*/ decision) {
+ assert WEBKIT2 : Webkit2AssertMsg;
lock.lock();
try {
_webkit_policy_decision_download (decision);
@@ -1159,6 +1225,7 @@ public static final void webkit_policy_decision_download (long /*int*/ decision)
/** @method flags=dynamic */
public static final native void _webkit_policy_decision_ignore (long /*int*/ decision);
public static final void webkit_policy_decision_ignore (long /*int*/ decision) {
+ assert WEBKIT2 : Webkit2AssertMsg;
lock.lock();
try {
_webkit_policy_decision_ignore (decision);
@@ -1170,6 +1237,8 @@ public static final void webkit_policy_decision_ignore (long /*int*/ decision) {
/** @method flags=dynamic */
public static final native long /*int*/ _webkit_soup_auth_dialog_get_type ();
public static final long /*int*/ webkit_soup_auth_dialog_get_type () {
+ // Can't find reference for this. Currently used only by webkit1 thou, probably webkit1-only.
+ assert WEBKIT1 : Webkit1AssertMsg;
lock.lock();
try {
return _webkit_soup_auth_dialog_get_type ();
@@ -1181,6 +1250,7 @@ public static final long /*int*/ webkit_soup_auth_dialog_get_type () {
/** @method flags=dynamic */
public static final native long /*int*/ _webkit_web_context_get_default ();
public static final long /*int*/ webkit_web_context_get_default () {
+ assert WEBKIT2 : Webkit2AssertMsg;
lock.lock();
try {
return _webkit_web_context_get_default ();
@@ -1191,7 +1261,8 @@ public static final long /*int*/ webkit_web_context_get_default () {
/** @method flags=dynamic */
public static final native long /*int*/ _webkit_web_context_set_favicon_database_directory (long /*int*/ context, long /*int*/ path);
-public static final long /*int*/ webkit_web_context_set_favicon_database_directory (long /*int*/ context, long /*int*/ path) {
+public static final long /*int*/ webkit_web_context_set_favicon_database_directory (long /*int*/ context, long /*int*/ path) { // Never called.
+ assert WEBKIT2 : Webkit2AssertMsg;
lock.lock();
try {
return _webkit_web_context_set_favicon_database_directory (context, path);
@@ -1204,6 +1275,7 @@ public static final long /*int*/ webkit_web_context_set_favicon_database_directo
/** @method flags=dynamic */
public static final native long /*int*/ _webkit_web_data_source_get_data (long /*int*/ data_source);
public static final long /*int*/ webkit_web_data_source_get_data (long /*int*/ data_source) {
+ assert WEBKIT1 : Webkit1AssertMsg;
lock.lock();
try {
return _webkit_web_data_source_get_data (data_source);
@@ -1215,6 +1287,7 @@ public static final long /*int*/ webkit_web_data_source_get_data (long /*int*/ d
/** @method flags=dynamic */
public static final native long /*int*/ _webkit_web_data_source_get_encoding (long /*int*/ data_source);
public static final long /*int*/ webkit_web_data_source_get_encoding (long /*int*/ data_source) {
+ assert WEBKIT1 : Webkit1AssertMsg;
lock.lock();
try {
return _webkit_web_data_source_get_encoding (data_source);
@@ -1226,6 +1299,7 @@ public static final long /*int*/ webkit_web_data_source_get_encoding (long /*int
/** @method flags=dynamic */
public static final native long /*int*/ _webkit_web_frame_get_data_source (long /*int*/ frame);
public static final long /*int*/ webkit_web_frame_get_data_source (long /*int*/ frame) {
+ assert WEBKIT1 : Webkit1AssertMsg;
lock.lock();
try {
return _webkit_web_frame_get_data_source (frame);
@@ -1237,6 +1311,7 @@ public static final long /*int*/ webkit_web_frame_get_data_source (long /*int*/
/** @method flags=dynamic */
public static final native long /*int*/ _webkit_web_frame_get_global_context (long /*int*/ frame);
public static final long /*int*/ webkit_web_frame_get_global_context (long /*int*/ frame) {
+ assert WEBKIT1 : Webkit1AssertMsg;
lock.lock();
try {
return _webkit_web_frame_get_global_context (frame);
@@ -1248,6 +1323,7 @@ public static final long /*int*/ webkit_web_frame_get_global_context (long /*int
/** @method flags=dynamic */
public static final native int _webkit_web_frame_get_load_status (long /*int*/ frame);
public static final int webkit_web_frame_get_load_status (long /*int*/ frame) {
+ assert WEBKIT1 : Webkit1AssertMsg;
lock.lock();
try {
return _webkit_web_frame_get_load_status (frame);
@@ -1259,6 +1335,7 @@ public static final int webkit_web_frame_get_load_status (long /*int*/ frame) {
/** @method flags=dynamic */
public static final native long /*int*/ _webkit_web_frame_get_parent (long /*int*/ frame);
public static final long /*int*/ webkit_web_frame_get_parent (long /*int*/ frame) {
+ assert WEBKIT1 : Webkit1AssertMsg;
lock.lock();
try {
return _webkit_web_frame_get_parent (frame);
@@ -1270,6 +1347,7 @@ public static final long /*int*/ webkit_web_frame_get_parent (long /*int*/ frame
/** @method flags=dynamic */
public static final native long /*int*/ _webkit_web_frame_get_title (long /*int*/ frame);
public static final long /*int*/ webkit_web_frame_get_title (long /*int*/ frame) {
+ assert WEBKIT1 : Webkit1AssertMsg;
lock.lock();
try {
return _webkit_web_frame_get_title (frame);
@@ -1281,6 +1359,8 @@ public static final long /*int*/ webkit_web_frame_get_title (long /*int*/ frame)
/** @method flags=dynamic */
public static final native long /*int*/ _webkit_web_frame_get_type ();
public static final long /*int*/ webkit_web_frame_get_type () {
+ // Can't find reference. Probably a webkit1 macro.
+ assert WEBKIT1 : Webkit1AssertMsg;
lock.lock();
try {
return _webkit_web_frame_get_type ();
@@ -1292,6 +1372,7 @@ public static final long /*int*/ webkit_web_frame_get_type () {
/** @method flags=dynamic */
public static final native long /*int*/ _webkit_web_frame_get_uri (long /*int*/ frame);
public static final long /*int*/ webkit_web_frame_get_uri (long /*int*/ frame) {
+ assert WEBKIT1 : Webkit1AssertMsg;
lock.lock();
try {
return _webkit_web_frame_get_uri (frame);
@@ -1303,6 +1384,7 @@ public static final long /*int*/ webkit_web_frame_get_uri (long /*int*/ frame) {
/** @method flags=dynamic */
public static final native long /*int*/ _webkit_web_frame_get_web_view (long /*int*/ frame);
public static final long /*int*/ webkit_web_frame_get_web_view (long /*int*/ frame) {
+ assert WEBKIT1 : Webkit1AssertMsg;
lock.lock();
try {
return _webkit_web_frame_get_web_view (frame);
@@ -1314,6 +1396,7 @@ public static final long /*int*/ webkit_web_frame_get_web_view (long /*int*/ fra
/** @method flags=dynamic */
public static final native void _webkit_web_policy_decision_download (long /*int*/ decision);
public static final void webkit_web_policy_decision_download (long /*int*/ decision) {
+ assert WEBKIT1 : Webkit1AssertMsg;
lock.lock();
try {
_webkit_web_policy_decision_download (decision);
@@ -1325,6 +1408,7 @@ public static final void webkit_web_policy_decision_download (long /*int*/ decis
/** @method flags=dynamic */
public static final native void _webkit_web_policy_decision_ignore (long /*int*/ decision);
public static final void webkit_web_policy_decision_ignore (long /*int*/ decision) {
+ assert WEBKIT1 : Webkit1AssertMsg;
lock.lock();
try {
_webkit_web_policy_decision_ignore (decision);
@@ -1336,6 +1420,7 @@ public static final void webkit_web_policy_decision_ignore (long /*int*/ decisio
/** @method flags=dynamic */
public static final native int _webkit_web_view_can_go_back (long /*int*/ web_view);
public static final int webkit_web_view_can_go_back (long /*int*/ web_view) {
+ assert WEBKIT1 || WEBKIT2;
lock.lock();
try {
return _webkit_web_view_can_go_back (web_view);
@@ -1347,6 +1432,7 @@ public static final int webkit_web_view_can_go_back (long /*int*/ web_view) {
/** @method flags=dynamic */
public static final native long /*int*/ _webkit_web_view_get_main_resource (long /*int*/ web_view);
public static final long /*int*/ webkit_web_view_get_main_resource (long /*int*/ web_view) {
+ assert WEBKIT2 : Webkit2AssertMsg;
lock.lock();
try {
return _webkit_web_view_get_main_resource (web_view);
@@ -1358,6 +1444,7 @@ public static final long /*int*/ webkit_web_view_get_main_resource (long /*int*/
/** @method flags=dynamic */
public static final native int _webkit_web_view_can_go_forward (long /*int*/ web_view);
public static final int webkit_web_view_can_go_forward (long /*int*/ web_view) {
+ assert WEBKIT1 || WEBKIT2;
lock.lock();
try {
return _webkit_web_view_can_go_forward (web_view);
@@ -1369,6 +1456,7 @@ public static final int webkit_web_view_can_go_forward (long /*int*/ web_view) {
/** @method flags=dynamic */
public static final native int _webkit_web_view_can_show_mime_type (long /*int*/ web_view, long /*int*/ mime_type);
public static final int webkit_web_view_can_show_mime_type (long /*int*/ web_view, long /*int*/ mime_type) {
+ assert WEBKIT1 || WEBKIT2;
lock.lock();
try {
return _webkit_web_view_can_show_mime_type (web_view, mime_type);
@@ -1379,7 +1467,8 @@ public static final int webkit_web_view_can_show_mime_type (long /*int*/ web_vie
/** @method flags=dynamic */
public static final native void _webkit_web_view_execute_script (long /*int*/ web_view, byte[] script);
-public static final void webkit_web_view_execute_script (long /*int*/ web_view, byte[] script) {
+public static final void webkit_web_view_execute_script (long /*int*/ web_view, byte[] script) { // never called
+ assert WEBKIT1 : Webkit1AssertMsg;
lock.lock();
try {
_webkit_web_view_execute_script (web_view, script);
@@ -1391,6 +1480,8 @@ public static final void webkit_web_view_execute_script (long /*int*/ web_view,
/** @method flags=dynamic */
public static final native long /*int*/ _webkit_web_view_get_dom_document (long /*int*/ web_view);
public static final long /*int*/ webkit_web_view_get_dom_document (long /*int*/ web_view) {
+ assert WEBKIT1 : Webkit1AssertMsg;
+ //TODO - guard from being called on webkit2 (webkit_web_view_get_dom_document)
lock.lock();
try {
return _webkit_web_view_get_dom_document (web_view);
@@ -1402,6 +1493,7 @@ public static final long /*int*/ webkit_web_view_get_dom_document (long /*int*/
/** @method flags=dynamic */
public static final native double /*int*/ _webkit_web_view_get_estimated_load_progress (long /*int*/ web_view);
public static final double /*int*/ webkit_web_view_get_estimated_load_progress (long /*int*/ web_view) {
+ assert WEBKIT2 : Webkit2AssertMsg;
lock.lock();
try {
return _webkit_web_view_get_estimated_load_progress (web_view);
@@ -1413,6 +1505,7 @@ public static final double /*int*/ webkit_web_view_get_estimated_load_progress (
/** @method flags=dynamic */
public static final native int _webkit_web_view_get_load_status (long /*int*/ web_view);
public static final int webkit_web_view_get_load_status (long /*int*/ web_view) {
+ assert WEBKIT1 : Webkit1AssertMsg;
lock.lock();
try {
return _webkit_web_view_get_load_status (web_view);
@@ -1424,6 +1517,7 @@ public static final int webkit_web_view_get_load_status (long /*int*/ web_view)
/** @method flags=dynamic */
public static final native long /*int*/ _webkit_web_view_get_main_frame (long /*int*/ web_view);
public static final long /*int*/ webkit_web_view_get_main_frame (long /*int*/ web_view) {
+ assert WEBKIT1 : Webkit1AssertMsg;
lock.lock();
try {
return _webkit_web_view_get_main_frame (web_view);
@@ -1435,6 +1529,7 @@ public static final long /*int*/ webkit_web_view_get_main_frame (long /*int*/ we
/** @method flags=dynamic */
public static final native double _webkit_web_view_get_progress (long /*int*/ web_view);
public static final double webkit_web_view_get_progress (long /*int*/ web_view) {
+ assert WEBKIT1 : Webkit1AssertMsg;
lock.lock();
try {
return _webkit_web_view_get_progress (web_view);
@@ -1445,7 +1540,8 @@ public static final double webkit_web_view_get_progress (long /*int*/ web_view)
/** @method flags=dynamic */
public static final native long /*int*/ _webkit_web_view_get_settings (long /*int*/ web_view);
-public static final long /*int*/ webkit_web_view_get_settings (long /*int*/ web_view) { // Webkit1 & Webkit2
+public static final long /*int*/ webkit_web_view_get_settings (long /*int*/ web_view) {
+ assert WEBKIT1 || WEBKIT2;
lock.lock();
try {
return _webkit_web_view_get_settings (web_view);
@@ -1457,6 +1553,7 @@ public static final long /*int*/ webkit_web_view_get_settings (long /*int*/ web_
/** @method flags=dynamic */
public static final native long /*int*/ _webkit_web_view_get_title (long /*int*/ web_view);
public static final long /*int*/ webkit_web_view_get_title (long /*int*/ web_view) {
+ assert WEBKIT1 || WEBKIT2;
lock.lock();
try {
return _webkit_web_view_get_title (web_view);
@@ -1468,6 +1565,8 @@ public static final long /*int*/ webkit_web_view_get_title (long /*int*/ web_vie
/** @method flags=dynamic */
public static final native long /*int*/ _webkit_web_view_get_type ();
public static final long /*int*/ webkit_web_view_get_type () {
+ // TODO Bug 514859 Investigate if this is a webkit1 only function or if it can be used on webkit2 also.
+ // can't find reference for it. Could be a macro.
lock.lock();
try {
return _webkit_web_view_get_type ();
@@ -1479,6 +1578,7 @@ public static final long /*int*/ webkit_web_view_get_type () {
/** @method flags=dynamic */
public static final native long /*int*/ _webkit_web_view_get_uri (long /*int*/ web_view);
public static final long /*int*/ webkit_web_view_get_uri (long /*int*/ web_view) {
+ assert WEBKIT1 || WEBKIT2;
lock.lock();
try {
return _webkit_web_view_get_uri (web_view);
@@ -1487,10 +1587,10 @@ public static final long /*int*/ webkit_web_view_get_uri (long /*int*/ web_view)
}
}
-// Webkit1 only.
/** @method flags=dynamic */
public static final native long /*int*/ _webkit_web_view_get_window_features (long /*int*/ web_view);
public static final long /*int*/ webkit_web_view_get_window_features (long /*int*/ web_view) {
+ assert WEBKIT1 : Webkit1AssertMsg;
lock.lock();
try {
return _webkit_web_view_get_window_features (web_view);
@@ -1499,11 +1599,11 @@ public static final long /*int*/ webkit_web_view_get_window_features (long /*int
}
}
-// Webkit2 only.
/** @method flags=dynamic */
public static final native long /*int*/ _webkit_web_view_get_window_properties (long /*int*/ webView);
/** WebKitWindowProperties * webkit_web_view_get_window_properties (WebKitWebView *web_view); */
public static final long /*int*/ webkit_web_view_get_window_properties (long /*int*/ webView) {
+ assert WEBKIT2 : Webkit2AssertMsg;
lock.lock();
try {
return _webkit_web_view_get_window_properties (webView);
@@ -1512,13 +1612,13 @@ public static final long /*int*/ webkit_web_view_get_window_properties (long /*i
}
}
-// Webkit2 only.
/**
* @method flags=dynamic
* @param rectangle cast=(GdkRectangle *),flags=no_in
*/
public static final native void _webkit_window_properties_get_geometry (long /*int*/ webKitWindowProperties, GdkRectangle rectangle);
public static final void webkit_window_properties_get_geometry (long /*int*/ webKitWindowProperties, GdkRectangle rectangle ) {
+ assert WEBKIT2 : Webkit2AssertMsg;
lock.lock();
try {
_webkit_window_properties_get_geometry (webKitWindowProperties, rectangle);
@@ -1532,6 +1632,7 @@ public static final void webkit_window_properties_get_geometry (long /*int*/ web
/** @method flags=dynamic */
public static final native void _webkit_web_view_go_back (long /*int*/ web_view);
public static final void webkit_web_view_go_back (long /*int*/ web_view) {
+ assert WEBKIT1 || WEBKIT2;
lock.lock();
try {
_webkit_web_view_go_back (web_view);
@@ -1543,6 +1644,7 @@ public static final void webkit_web_view_go_back (long /*int*/ web_view) {
/** @method flags=dynamic */
public static final native void _webkit_web_view_go_forward (long /*int*/ web_view);
public static final void webkit_web_view_go_forward (long /*int*/ web_view) {
+ assert WEBKIT1 || WEBKIT2;
lock.lock();
try {
_webkit_web_view_go_forward (web_view);
@@ -1554,6 +1656,7 @@ public static final void webkit_web_view_go_forward (long /*int*/ web_view) {
/** @method flags=dynamic */
public static final native void _webkit_web_view_load_html (long /*int*/ web_view, byte[] content, byte[] base_uri);
public static final void webkit_web_view_load_html (long /*int*/ web_view, byte[] content, byte[] base_uri) {
+ assert WEBKIT1 || WEBKIT2;
lock.lock();
try {
_webkit_web_view_load_html (web_view, content, base_uri);
@@ -1565,6 +1668,7 @@ public static final void webkit_web_view_load_html (long /*int*/ web_view, byte[
/** @method flags=dynamic */
public static final native void _webkit_web_view_load_string (long /*int*/ web_view, byte[] content, byte[] mime_type, byte[] encoding, byte[] base_uri);
public static final void webkit_web_view_load_string (long /*int*/ web_view, byte[] content, byte[] mime_type, byte[] encoding, byte[] base_uri) {
+ assert WEBKIT1 : Webkit1AssertMsg;
lock.lock();
try {
_webkit_web_view_load_string (web_view, content, mime_type, encoding, base_uri);
@@ -1576,6 +1680,7 @@ public static final void webkit_web_view_load_string (long /*int*/ web_view, byt
/** @method flags=dynamic */
public static final native void _webkit_web_view_load_request (long /*int*/ web_view, long /*int*/ request);
public static final void webkit_web_view_load_request (long /*int*/ web_view, long /*int*/ request) {
+ assert WEBKIT1 || WEBKIT2;
lock.lock();
try {
_webkit_web_view_load_request (web_view, request);
@@ -1587,6 +1692,7 @@ public static final void webkit_web_view_load_request (long /*int*/ web_view, lo
/** @method flags=dynamic */
public static final native void _webkit_web_view_load_uri (long /*int*/ web_view, byte[] uri);
public static final void webkit_web_view_load_uri (long /*int*/ web_view, byte[] uri) {
+ assert WEBKIT1 || WEBKIT2;
lock.lock();
try {
_webkit_web_view_load_uri (web_view, uri);
@@ -1598,6 +1704,7 @@ public static final void webkit_web_view_load_uri (long /*int*/ web_view, byte[]
/** @method flags=dynamic */
public static final native long /*int*/ _webkit_web_view_new ();
public static final long /*int*/ webkit_web_view_new () {
+ assert WEBKIT1 || WEBKIT2;
lock.lock();
try {
return _webkit_web_view_new ();
@@ -1609,6 +1716,7 @@ public static final long /*int*/ webkit_web_view_new () {
/** @method flags=dynamic */
public static final native long /*int*/ _webkit_user_content_manager_new();
public static final long /*int*/ webkit_user_content_manager_new() {
+ assert WEBKIT2 : Webkit2AssertMsg;
lock.lock();
try {
return _webkit_user_content_manager_new ();
@@ -1624,6 +1732,7 @@ public static final long /*int*/ webkit_user_content_manager_new() {
public static final native long /*int*/ _webkit_javascript_result_get_global_context(long /*int*/ js_result);
/** JSGlobalContextRef webkit_javascript_result_get_global_context (WebKitJavascriptResult *js_result); */
public static final long /*int*/ webkit_javascript_result_get_global_context(long /*int*/ js_result) {
+ assert WEBKIT2 : Webkit2AssertMsg;
lock.lock();
try {
return _webkit_javascript_result_get_global_context (js_result);
@@ -1639,6 +1748,7 @@ public static final long /*int*/ webkit_javascript_result_get_global_context(lon
public static final native long /*int*/ _webkit_javascript_result_get_value(long /*int*/ js_result);
/** JSValueRef webkit_javascript_result_get_value (WebKitJavascriptResult *js_result); */
public static final long /*int*/ webkit_javascript_result_get_value(long /*int*/ js_result) {
+ assert WEBKIT2 : Webkit2AssertMsg;
lock.lock();
try {
return _webkit_javascript_result_get_value (js_result);
@@ -1650,6 +1760,7 @@ public static final long /*int*/ webkit_javascript_result_get_value(long /*int*/
/** @method flags=dynamic */
public static final native boolean _webkit_user_content_manager_register_script_message_handler(long /*int*/ WebKitUserContentManager, byte[] name);
public static final boolean webkit_user_content_manager_register_script_message_handler(long /*int*/ WebKitUserContentManager, byte[] name) {
+ assert WEBKIT2 : Webkit2AssertMsg;
lock.lock();
try {
return _webkit_user_content_manager_register_script_message_handler (WebKitUserContentManager, name);
@@ -1661,6 +1772,7 @@ public static final boolean webkit_user_content_manager_register_script_message_
/** @method flags=dynamic */
public static final native long /*int*/ _webkit_web_view_new_with_user_content_manager (long /*int*/ WebKitUserContentManager);
public static final long /*int*/ webkit_web_view_new_with_user_content_manager (long /*int*/ WebKitUserContentManager) {
+ assert WEBKIT2 : Webkit2AssertMsg;
lock.lock();
try {
return _webkit_web_view_new_with_user_content_manager (WebKitUserContentManager);
@@ -1672,6 +1784,7 @@ public static final long /*int*/ webkit_web_view_new_with_user_content_manager (
/** @method flags=dynamic */
public static final native void _webkit_web_view_reload (long /*int*/ web_view);
public static final void webkit_web_view_reload (long /*int*/ web_view) {
+ assert WEBKIT1 || WEBKIT2;
lock.lock();
try {
_webkit_web_view_reload (web_view);
@@ -1685,6 +1798,7 @@ public static final void webkit_web_view_reload (long /*int*/ web_view) {
public static final native void _webkit_web_view_run_javascript (long /*int*/ web_view, byte [] script, long /*int*/ cancellable, long /*int*/ callback, long /*int*/ user_data);
/** void webkit_web_view_run_javascript (WebKitWebView *web_view, const gchar *script, GCancellable *cancellable, GAsyncReadyCallback callback, gpointer user_data); **/
public static final void webkit_web_view_run_javascript (long /*int*/ web_view, byte[] script, long /*int*/ cancellable, long /*int*/ callback, long /*int*/ user_data) {
+ assert WEBKIT2 : Webkit2AssertMsg;
lock.lock();
try {
_webkit_web_view_run_javascript (web_view, script, cancellable, callback, user_data);
@@ -1696,6 +1810,7 @@ public static final void webkit_web_view_run_javascript (long /*int*/ web_view,
/** @method flags=dynamic */
public static final native void _webkit_web_resource_get_data (long /*int*/ webKitWebResource, long /*int*/ gCancellable, long /*int*/ GAsyncReadyCallback, long /*int*/ user_data);
public static final void webkit_web_resource_get_data (long /*int*/ webKitWebResource, long /*int*/ gCancellable, long /*int*/ GAsyncReadyCallback, long /*int*/ user_data) {
+ assert WEBKIT1 || WEBKIT2;
lock.lock();
try {
_webkit_web_resource_get_data (webKitWebResource, gCancellable, GAsyncReadyCallback, user_data);
@@ -1707,6 +1822,7 @@ public static final void webkit_web_resource_get_data (long /*int*/ webKitWebRes
/** @method flags=dynamic */
public static final native long /*int*/ _webkit_web_resource_get_data_finish(long /*int*/ WebKitWebResource, long /*int*/ GAsyncResult, long /*int*/[] gsize, long /*int*/ GError[]);
public static final long /*int*/ webkit_web_resource_get_data_finish(long /*int*/ WebKitWebResource, long /*int*/ GAsyncResult, long /*int*/[] gsize, long /*int*/ GError[]) {
+ assert WEBKIT2 : Webkit2AssertMsg;
lock.lock();
try {
return _webkit_web_resource_get_data_finish(WebKitWebResource, GAsyncResult, gsize, GError);
@@ -1723,6 +1839,7 @@ public static final long /*int*/ webkit_web_resource_get_data_finish(long /*int*
public static final native long /*int*/ _webkit_web_view_run_javascript_finish(long /*int*/ web_view, long /*int*/ GAsyncResult, long /*int*/[] gerror);
/**WebKitJavascriptResult * webkit_web_view_run_javascript_finish (WebKitWebView *web_view, GAsyncResult *result, GError **error);*/
public static long /*int*/ webkit_web_view_run_javascript_finish(long /*int*/ web_view, long /*int*/ GAsyncResult, long /*int*/[] gerror) {
+ assert WEBKIT2 : Webkit2AssertMsg;
lock.lock();
try {
return _webkit_web_view_run_javascript_finish (web_view, GAsyncResult, gerror);
@@ -1734,6 +1851,7 @@ public static long /*int*/ webkit_web_view_run_javascript_finish(long /*int*/ we
/** @method flags=dynamic */
public static final native void _webkit_web_view_stop_loading (long /*int*/ web_view);
public static final void webkit_web_view_stop_loading (long /*int*/ web_view) {
+ assert WEBKIT1 || WEBKIT2;
lock.lock();
try {
_webkit_web_view_stop_loading (web_view);
@@ -1744,7 +1862,8 @@ public static final void webkit_web_view_stop_loading (long /*int*/ web_view) {
/** @method flags=dynamic */
public static final native long /*int*/ _webkit_response_policy_decision_get_request (long /*int*/ decision);
-public static final long /*int*/ webkit_response_policy_decision_get_request (long /*int*/ decision) {
+public static final long /*int*/ webkit_response_policy_decision_get_request (long /*int*/ decision) { // never called
+ assert WEBKIT2 : Webkit2AssertMsg;
lock.lock();
try {
return _webkit_response_policy_decision_get_request (decision);
@@ -1756,6 +1875,7 @@ public static final long /*int*/ webkit_response_policy_decision_get_request (l
/** @method flags=dynamic */
public static final native long /*int*/ _webkit_response_policy_decision_get_response (long /*int*/ decision);
public static final long /*int*/ webkit_response_policy_decision_get_response (long /*int*/ decision) {
+ assert WEBKIT2 : Webkit2AssertMsg;
lock.lock();
try {
return _webkit_response_policy_decision_get_response (decision);
@@ -1767,6 +1887,7 @@ public static final long /*int*/ webkit_response_policy_decision_get_response (
/** @method flags=dynamic */
public static final native long /*int*/ _webkit_uri_request_new (byte[] uri);
public static final long /*int*/ webkit_uri_request_new (byte[] uri) {
+ assert WEBKIT2 : Webkit2AssertMsg;
lock.lock();
try {
return _webkit_uri_request_new (uri);
@@ -1778,6 +1899,7 @@ public static final long /*int*/ webkit_uri_request_new (byte[] uri) {
/** @method flags=dynamic */
public static final native long /*int*/ _webkit_uri_request_get_http_headers (long /*int*/ request);
public static final long /*int*/ webkit_uri_request_get_http_headers (long /*int*/ request) {
+ assert WEBKIT2 : Webkit2AssertMsg;
lock.lock();
try {
return _webkit_uri_request_get_http_headers (request);
@@ -1789,6 +1911,7 @@ public static final long /*int*/ webkit_uri_request_get_http_headers (long /*in
/** @method flags=dynamic */
public static final native long /*int*/ _webkit_uri_request_get_uri (long /*int*/ request);
public static final long /*int*/ webkit_uri_request_get_uri (long /*int*/ request) {
+ assert WEBKIT2 : Webkit2AssertMsg;
lock.lock();
try {
return _webkit_uri_request_get_uri (request);
@@ -1800,6 +1923,7 @@ public static final long /*int*/ webkit_uri_request_get_uri (long /*int*/ reque
/** @method flags=dynamic */
public static final native long /*int*/ _webkit_uri_response_get_mime_type (long /*int*/ responce);
public static final long /*int*/ webkit_uri_response_get_mime_type (long /*int*/ response) {
+ assert WEBKIT2 : Webkit2AssertMsg;
lock.lock();
try {
return _webkit_uri_response_get_mime_type (response);
diff --git a/bundles/org.eclipse.swt/Readme.md b/bundles/org.eclipse.swt/Readme.md
index 0fd6c5fdba..86b6c002a0 100644
--- a/bundles/org.eclipse.swt/Readme.md
+++ b/bundles/org.eclipse.swt/Readme.md
@@ -26,6 +26,19 @@ and ensure that the fragment matching your windowing_system.operating_system.cpu
The fragments provide the platform-specific native libraries.
+Using Assertions:
+----------------
+Assertions are added to the code. These don't run in production, but they do when:
+* JUnits are ran, they turn on assertions by default.
+* If you run a java run configuration and add '-ea' to the 'VM Arguments'
+
+Assertions look like:
+
+ assert expression ;
+ assert expression : msg ;
+
+See: https://docs.oracle.com/javase/8/docs/technotes/guides/language/assert.html
+
More Information:
-----------------

Back to the top