Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLeo Ufimtsev2018-04-18 18:28:04 +0000
committerLeo Ufimtsev2018-04-19 17:38:42 +0000
commit1051e263ec1b8326a206ad1caa1bc5c80c682487 (patch)
tree43c7f0d5c573469be87242254002197dfffab6af /bundles/org.eclipse.swt/Eclipse SWT PI/gtk
parentb320b3a0933b22debc7a65f4acbabc4040ebf1d2 (diff)
downloadeclipse.platform.swt-1051e263ec1b8326a206ad1caa1bc5c80c682487.tar.gz
eclipse.platform.swt-1051e263ec1b8326a206ad1caa1bc5c80c682487.tar.xz
eclipse.platform.swt-1051e263ec1b8326a206ad1caa1bc5c80c682487.zip
Bug 525946 [Webkit2] Port download functionality (rewrite some logic)
G_TYPE_CHECK_INSTANCE_TYPE is not a reliable method to check if type is webview or webcontext at run time. On my & Roland's system it works, but on Andrey's system it miss-fires. This is a macro and by the looks is not reliable method because we use it with dynamically loaded libraries and via JNI. Solution: Rewrite the callback logic to determine types of callback based on user_data instead of relying on type checking macro. Also, created task to remove usage of the macro to prevent simmila issues: https://bugs.eclipse.org/bugs/show_bug.cgi?id=533833 Tests: - Environment: Webkit2 2.18, Gtk3.22, Fedora 27, wayland on host, x11 eclipse backend. - JUnit AllBrowserTests - ChildEclipse. - Bug Snippet attached to this patch. - Also tested with webkit1. - Andrey reports that this patch fixes his crash issue: https://bugs.eclipse.org/bugs/show_bug.cgi?id=533545#c34 Bug: https://bugs.eclipse.org/bugs/show_bug.cgi?id=5259462 Change-Id: I485a54804285dbf114961422799ea34796413404 Signed-off-by: Leo Ufimtsev <lufimtse@redhat.com>
Diffstat (limited to 'bundles/org.eclipse.swt/Eclipse SWT PI/gtk')
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT PI/gtk/org/eclipse/swt/internal/gtk/OS.java6
1 files changed, 6 insertions, 0 deletions
diff --git a/bundles/org.eclipse.swt/Eclipse SWT PI/gtk/org/eclipse/swt/internal/gtk/OS.java b/bundles/org.eclipse.swt/Eclipse SWT PI/gtk/org/eclipse/swt/internal/gtk/OS.java
index ec0375a0c2..b2cb13fe65 100644
--- a/bundles/org.eclipse.swt/Eclipse SWT PI/gtk/org/eclipse/swt/internal/gtk/OS.java
+++ b/bundles/org.eclipse.swt/Eclipse SWT PI/gtk/org/eclipse/swt/internal/gtk/OS.java
@@ -1089,6 +1089,12 @@ public static final long /*int*/ G_OBJECT_TYPE_NAME (long /*int*/ object) {
lock.unlock();
}
}
+
+/**
+ * This method is not a reliable way to test for a type.
+ * Use G_OBJECT_TYPE type instead or use alternate means (e.g custom userdata).
+ * TODO: remove usage of this call.
+ */
public static final native boolean _G_TYPE_CHECK_INSTANCE_TYPE (long /*int*/ instance, long /*int*/ type);
public static final boolean G_TYPE_CHECK_INSTANCE_TYPE (long /*int*/ instance, long /*int*/ type) {
lock.lock();

Back to the top