Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGrant Gayed2011-12-16 21:53:59 +0000
committerGrant Gayed2011-12-16 21:53:59 +0000
commit78abe5d2890d6c18bca5ab665e997506c0954a8f (patch)
tree8e2d1a784b45f76c627148330f6f4847dcfcf173 /bundles/org.eclipse.swt/Eclipse SWT WebKit
parent01134aab639daf6ddb28a9fb96ccb846dab6df63 (diff)
downloadeclipse.platform.swt-78abe5d2890d6c18bca5ab665e997506c0954a8f.tar.gz
eclipse.platform.swt-78abe5d2890d6c18bca5ab665e997506c0954a8f.tar.xz
eclipse.platform.swt-78abe5d2890d6c18bca5ab665e997506c0954a8f.zip
Bug 366989 - [Browser] WebKitGTK crashes when clearing all session
cookies
Diffstat (limited to 'bundles/org.eclipse.swt/Eclipse SWT WebKit')
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT WebKit/gtk/library/webkitgtk.c18
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT WebKit/gtk/library/webkitgtk.h2
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT WebKit/gtk/library/webkitgtk_stats.c5
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT WebKit/gtk/library/webkitgtk_stats.h1
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT WebKit/gtk/org/eclipse/swt/browser/WebKit.java3
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT WebKit/gtk/org/eclipse/swt/internal/webkit/WebKitGTK.java11
6 files changed, 36 insertions, 4 deletions
diff --git a/bundles/org.eclipse.swt/Eclipse SWT WebKit/gtk/library/webkitgtk.c b/bundles/org.eclipse.swt/Eclipse SWT WebKit/gtk/library/webkitgtk.c
index a326248cef..8bc23af9c8 100644
--- a/bundles/org.eclipse.swt/Eclipse SWT WebKit/gtk/library/webkitgtk.c
+++ b/bundles/org.eclipse.swt/Eclipse SWT WebKit/gtk/library/webkitgtk.c
@@ -681,6 +681,24 @@ JNIEXPORT jintLong JNICALL WebKitGTK_NATIVE(_1soup_1auth_1get_1scheme_1name)
}
#endif
+#ifndef NO__1soup_1cookie_1free
+JNIEXPORT void JNICALL WebKitGTK_NATIVE(_1soup_1cookie_1free)
+ (JNIEnv *env, jclass that, jintLong arg0)
+{
+ WebKitGTK_NATIVE_ENTER(env, that, _1soup_1cookie_1free_FUNC);
+/*
+ soup_cookie_free(arg0);
+*/
+ {
+ WebKitGTK_LOAD_FUNCTION(fp, soup_cookie_free)
+ if (fp) {
+ ((void (CALLING_CONVENTION*)(jintLong))fp)(arg0);
+ }
+ }
+ WebKitGTK_NATIVE_EXIT(env, that, _1soup_1cookie_1free_FUNC);
+}
+#endif
+
#ifndef NO__1soup_1cookie_1jar_1add_1cookie
JNIEXPORT void JNICALL WebKitGTK_NATIVE(_1soup_1cookie_1jar_1add_1cookie)
(JNIEnv *env, jclass that, jintLong arg0, jintLong arg1)
diff --git a/bundles/org.eclipse.swt/Eclipse SWT WebKit/gtk/library/webkitgtk.h b/bundles/org.eclipse.swt/Eclipse SWT WebKit/gtk/library/webkitgtk.h
index 72f6ac1163..0c95804f0c 100644
--- a/bundles/org.eclipse.swt/Eclipse SWT WebKit/gtk/library/webkitgtk.h
+++ b/bundles/org.eclipse.swt/Eclipse SWT WebKit/gtk/library/webkitgtk.h
@@ -26,7 +26,7 @@
if (!initialized) { \
void* handle = dlopen("libwebkit-1.0.so.2", LOAD_FLAGS); /* webkitgtk 1.2.x lib */ \
if (!handle) { \
- handle = dlopen("libwebkitgtk-1.0.so.0", LOAD_FLAGS); /* webkitgtk 1.4.x lib */ \
+ handle = dlopen("libwebkitgtk-1.0.so.0", LOAD_FLAGS); /* webkitgtk >= 1.4.x lib */ \
} \
if (handle) { \
var = dlsym(handle, #name); \
diff --git a/bundles/org.eclipse.swt/Eclipse SWT WebKit/gtk/library/webkitgtk_stats.c b/bundles/org.eclipse.swt/Eclipse SWT WebKit/gtk/library/webkitgtk_stats.c
index 7da07562ba..abe3d762a3 100644
--- a/bundles/org.eclipse.swt/Eclipse SWT WebKit/gtk/library/webkitgtk_stats.c
+++ b/bundles/org.eclipse.swt/Eclipse SWT WebKit/gtk/library/webkitgtk_stats.c
@@ -18,8 +18,8 @@
#ifdef NATIVE_STATS
-int WebKitGTK_nativeFunctionCount = 109;
-int WebKitGTK_nativeFunctionCallCount[109];
+int WebKitGTK_nativeFunctionCount = 110;
+int WebKitGTK_nativeFunctionCallCount[110];
char * WebKitGTK_nativeFunctionNames[] = {
"JSClassDefinition_1sizeof",
"_1JSClassCreate",
@@ -54,6 +54,7 @@ char * WebKitGTK_nativeFunctionNames[] = {
"_1soup_1auth_1authenticate",
"_1soup_1auth_1get_1host",
"_1soup_1auth_1get_1scheme_1name",
+ "_1soup_1cookie_1free",
"_1soup_1cookie_1jar_1add_1cookie",
"_1soup_1cookie_1jar_1all_1cookies",
"_1soup_1cookie_1jar_1delete_1cookie",
diff --git a/bundles/org.eclipse.swt/Eclipse SWT WebKit/gtk/library/webkitgtk_stats.h b/bundles/org.eclipse.swt/Eclipse SWT WebKit/gtk/library/webkitgtk_stats.h
index f2210ece9d..67fafc625e 100644
--- a/bundles/org.eclipse.swt/Eclipse SWT WebKit/gtk/library/webkitgtk_stats.h
+++ b/bundles/org.eclipse.swt/Eclipse SWT WebKit/gtk/library/webkitgtk_stats.h
@@ -62,6 +62,7 @@ typedef enum {
_1soup_1auth_1authenticate_FUNC,
_1soup_1auth_1get_1host_FUNC,
_1soup_1auth_1get_1scheme_1name_FUNC,
+ _1soup_1cookie_1free_FUNC,
_1soup_1cookie_1jar_1add_1cookie_FUNC,
_1soup_1cookie_1jar_1all_1cookies_FUNC,
_1soup_1cookie_1jar_1delete_1cookie_FUNC,
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 221499827b..467eb2515b 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
@@ -136,9 +136,10 @@ class WebKit extends WebBrowser {
/* indicates a session cookie */
WebKitGTK.soup_cookie_jar_delete_cookie (jar, cookie);
}
- OS.g_free (cookie);
+ WebKitGTK.soup_cookie_free (cookie);
current = OS.g_slist_next (current);
}
+ OS.g_slist_free (cookies);
}
};
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 f9523d7da2..b18f4e2ac4 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
@@ -400,6 +400,17 @@ public static final int /*long*/ soup_auth_get_scheme_name (int /*long*/ auth) {
}
/** @method flags=dynamic */
+public static final native void _soup_cookie_free (int /*long*/ cookie);
+public static final void soup_cookie_free (int /*long*/ cookie) {
+ lock.lock();
+ try {
+ _soup_cookie_free (cookie);
+ } finally {
+ lock.unlock();
+ }
+}
+
+/** @method flags=dynamic */
public static final native void _soup_cookie_jar_add_cookie (int /*long*/ jar, int /*long*/ cookie);
public static final void soup_cookie_jar_add_cookie (int /*long*/ jar, int /*long*/ cookie) {
lock.lock();

Back to the top