From e5e9387408836842aed9f383681d337707015084 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=90=D0=BB=D0=B5=D0=BA=D1=81=D0=B0=D0=BD=D0=B4=D1=8A?= =?UTF-8?q?=D1=80=20=D0=9A=D1=83=D1=80=D1=82=D0=B0=D0=BA=D0=BE=D0=B2?= Date: Thu, 21 Nov 2024 15:00:11 +0200 Subject: [PATCH] Print Webkit process model --- .../gtk/library/webkitgtk.c | 22 ++++++++++++++++++- .../gtk/library/webkitgtk_stats.h | 3 ++- .../gtk/org/eclipse/swt/browser/WebKit.java | 1 + .../swt/internal/webkit/WebKitGTK.java | 3 +++ 4 files changed, 27 insertions(+), 2 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 f9ea531f0ca..cdd77d596e6 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 @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2009, 2022 IBM Corporation and others. All rights reserved. + * Copyright (c) 2009, 2024 IBM Corporation and others. All rights reserved. * The contents of this file are made available under the terms * of the GNU Lesser General Public License (LGPL) Version 2.1 that * accompanies this distribution (lgpl-v21.txt). The LGPL is also @@ -1551,6 +1551,26 @@ JNIEXPORT jlong JNICALL WebKitGTK_NATIVE(webkit_1web_1context_1get_1default) } #endif +#ifndef NO_webkit_1web_1context_1get_1process_1model +JNIEXPORT jint JNICALL WebKitGTK_NATIVE(webkit_1web_1context_1get_1process_1model) + (JNIEnv *env, jclass that, jlong arg0) +{ + jint rc = 0; + WebKitGTK_NATIVE_ENTER(env, that, webkit_1web_1context_1get_1process_1model_FUNC); +/* + rc = (jint)webkit_web_context_get_process_model(arg0); +*/ + { + WebKitGTK_LOAD_FUNCTION(fp, webkit_web_context_get_process_model) + if (fp) { + rc = (jint)((jint (CALLING_CONVENTION*)(jlong))fp)(arg0); + } + } + WebKitGTK_NATIVE_EXIT(env, that, webkit_1web_1context_1get_1process_1model_FUNC); + return rc; +} +#endif + #ifndef NO_webkit_1web_1context_1get_1security_1manager JNIEXPORT jlong JNICALL WebKitGTK_NATIVE(webkit_1web_1context_1get_1security_1manager) (JNIEnv *env, jclass that, jlong arg0) 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 c18d59c46f1..80ecf80b3a0 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 @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2009, 2023 IBM Corporation and others. All rights reserved. + * Copyright (c) 2009, 2024 IBM Corporation and others. All rights reserved. * The contents of this file are made available under the terms * of the GNU Lesser General Public License (LGPL) Version 2.1 that * accompanies this distribution (lgpl-v21.txt). The LGPL is also @@ -98,6 +98,7 @@ typedef enum { webkit_1web_1context_1allow_1tls_1certificate_1for_1host_FUNC, webkit_1web_1context_1get_1cookie_1manager_FUNC, webkit_1web_1context_1get_1default_FUNC, + webkit_1web_1context_1get_1process_1model_FUNC, webkit_1web_1context_1get_1security_1manager_FUNC, webkit_1web_1context_1get_1type_FUNC, webkit_1web_1context_1get_1website_1data_1manager_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 68b8f4cdc61..98a0205b229 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 @@ -638,6 +638,7 @@ public void create (Composite parent, int style) { // Register the swt:// custom protocol for BrowserFunction calls via XMLHttpRequest long context = WebKitGTK.webkit_web_context_get_default(); WebKitGTK.webkit_web_context_register_uri_scheme(context, SWT_PROTOCOL, RequestProc.getAddress(), 0, 0); + System.out.println("Process Model:"+WebKitGTK.webkit_web_context_get_process_model(context)); long security = WebKitGTK.webkit_web_context_get_security_manager(context); WebKitGTK.webkit_security_manager_register_uri_scheme_as_secure(security, SWT_PROTOCOL); } 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 dd75efa6d96..0c2b27152cb 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 @@ -371,6 +371,9 @@ public class WebKitGTK extends C { /** @method flags=dynamic */ public static final native void webkit_web_context_register_uri_scheme(long context, byte[] scheme, long callback, long user_data, long user_data_destroy_func); +/** @method flags=dynamic */ +public static final native int webkit_web_context_get_process_model(long context); + /** @method flags=dynamic */ public static final native int webkit_web_view_can_go_back(long web_view);