Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLakshmi Shanmugam2017-07-03 08:17:08 +0000
committerLakshmi Shanmugam2017-07-05 04:58:15 +0000
commit3eb0ab74bc19875dc25783eb8c9fcbe70f2319ce (patch)
tree0d6c61f11e2e095c8199bac2ffc0ae61a3c3751f
parent57066d16faa29453d64a1d21ad4bd96f47a4ef2a (diff)
downloadeclipse.platform.swt-3eb0ab74bc19875dc25783eb8c9fcbe70f2319ce.tar.gz
eclipse.platform.swt-3eb0ab74bc19875dc25783eb8c9fcbe70f2319ce.tar.xz
eclipse.platform.swt-3eb0ab74bc19875dc25783eb8c9fcbe70f2319ce.zip
Bug 419757: HTML5 database doesn't work for embedded webkit browser
under Mac OSX Implement WebUIDelegate method - webView:frame:exceededDatabaseQuotaForSecurityOrigin:database: and increase the quota as desired when that method is called Change-Id: Icf8fa3682134ae2d4796ba1f07d0dcdf5ac42b35 Signed-off-by: Lakshmi Shanmugam <lshanmug@in.ibm.com>
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/OS.java4
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT WebKit/cocoa/org/eclipse/swt/browser/WebKit.java11
2 files changed, 14 insertions, 1 deletions
diff --git a/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/OS.java b/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/OS.java
index 94a6831620..c32c57de3a 100644
--- a/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/OS.java
+++ b/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/OS.java
@@ -127,6 +127,9 @@ public class OS extends C {
public static final long /*int*/ sel_setShouldExpandItem_ = sel_registerName("setShouldExpandItem:");
public static final long /*int*/ sel_setShouldScrollClipView_ = sel_registerName("setShouldScrollClipView:");
+ public static final long /*int*/ sel_setQuota = sel_registerName( "setQuota:" );
+ public static final long /*int*/ sel_webView_frame_exceededDatabaseQuotaForSecurityOrigin_database_ = sel_registerName( "webView:frame:exceededDatabaseQuotaForSecurityOrigin:database:" );
+
/* These are not generated in order to avoid creating static methods on all classes */
public static final long /*int*/ sel_isSelectorExcludedFromWebScript_ = sel_registerName("isSelectorExcludedFromWebScript:");
public static final long /*int*/ sel_webScriptNameForSelector_ = sel_registerName("webScriptNameForSelector:");
@@ -655,7 +658,6 @@ public static final native int objc_super_sizeof();
*/
public static final native void objc_msgSend_stret(NSSize result, long /*int*/ id, long /*int*/ sel, NSSize arg0, long /*int*/ arg1, long /*int*/ arg2, long /*int*/ arg3, long /*int*/ arg4, long /*int*/ arg5);
-
/** This section is auto generated */
/** Custom callbacks */
diff --git a/bundles/org.eclipse.swt/Eclipse SWT WebKit/cocoa/org/eclipse/swt/browser/WebKit.java b/bundles/org.eclipse.swt/Eclipse SWT WebKit/cocoa/org/eclipse/swt/browser/WebKit.java
index 34e6996bf4..617e2acb1f 100644
--- a/bundles/org.eclipse.swt/Eclipse SWT WebKit/cocoa/org/eclipse/swt/browser/WebKit.java
+++ b/bundles/org.eclipse.swt/Eclipse SWT WebKit/cocoa/org/eclipse/swt/browser/WebKit.java
@@ -57,6 +57,7 @@ class WebKit extends WebBrowser {
static final String ADD_WIDGET_KEY = "org.eclipse.swt.internal.addWidget"; //$NON-NLS-1$
static final String WEBKIT_EVENTS_FIX_KEY = "org.eclipse.swt.internal.webKitEventsFix"; //$NON-NLS-1$
static final byte[] SWT_OBJECT = {'S', 'W', 'T', '_', 'O', 'B', 'J', 'E', 'C', 'T', '\0'};
+ static final long DEFAULT_DB_QUOTA = 5 * 1024 * 1024;
/* event strings */
static final String DOMEVENT_KEYUP = "keyup"; //$NON-NLS-1$
@@ -151,6 +152,7 @@ public void create (Composite parent, int style) {
OS.class_addMethod(delegateClass, OS.sel_webView_resource_didFinishLoadingFromDataSource_, proc5, "@:@@@"); //$NON-NLS-1$
OS.class_addMethod(delegateClass, OS.sel_webView_resource_didReceiveAuthenticationChallenge_fromDataSource_, proc6, "@:@@@@"); //$NON-NLS-1$
OS.class_addMethod(delegateClass, OS.sel_webView_resource_didFailLoadingWithError_fromDataSource_, proc6, "@:@@@@"); //$NON-NLS-1$
+ OS.class_addMethod(delegateClass, OS.sel_webView_frame_exceededDatabaseQuotaForSecurityOrigin_database_, proc6, "@:@@@@" ); //$NON-NLS-1$
OS.class_addMethod(delegateClass, OS.sel_webView_identifierForInitialRequest_fromDataSource_, proc5, "@:@@@"); //$NON-NLS-1$
OS.class_addMethod(delegateClass, OS.sel_webView_resource_willSendRequest_redirectResponse_fromDataSource_, proc7, "@:@@@@@"); //$NON-NLS-1$
OS.class_addMethod(delegateClass, OS.sel_webView_createWebViewWithRequest_, proc4, "@:@@"); //$NON-NLS-1$
@@ -400,6 +402,8 @@ static long /*int*/ browserProc(long /*int*/ id, long /*int*/ sel, long /*int*/
} else if (sel == OS.sel_callJava) {
id result = webKit.callJava(arg0, arg1, arg2, arg3);
return result == null ? 0 : result.id;
+ } else if (sel == OS.sel_webView_frame_exceededDatabaseQuotaForSecurityOrigin_database_){
+ webView_frame_exceededDatabaseQuotaForSecurityOrigin_database(arg0, arg1, arg2, arg3);
}
return 0;
}
@@ -436,6 +440,13 @@ static long /*int*/ webScriptNameForSelector (long /*int*/ aSelector) {
return 0;
}
+static void webView_frame_exceededDatabaseQuotaForSecurityOrigin_database(
+ long /* int */sender, long /* int */frame, long /* int */origin,
+ long /* int */database )
+{
+ OS.objc_msgSend( origin, OS.sel_setQuota, DEFAULT_DB_QUOTA );
+}
+
@Override
public boolean close () {
return close (true);

Back to the top