Diff
Modified: trunk/Source/WebKit2/ChangeLog (129870 => 129871)
--- trunk/Source/WebKit2/ChangeLog 2012-09-28 10:35:11 UTC (rev 129870)
+++ trunk/Source/WebKit2/ChangeLog 2012-09-28 10:39:53 UTC (rev 129871)
@@ -1,3 +1,24 @@
+2012-09-28 Christophe Dumez <[email protected]>
+
+ [EFL][WK2] exceededDatabaseQuota event is not handled
+ https://bugs.webkit.org/show_bug.cgi?id=97882
+
+ Reviewed by Kenneth Rohde Christiansen.
+
+ Handle exceededDatabaseQuota callback from WKPageUIClient so
+ that we let the browser a chance to decide what to do when
+ the database quota is reached. If the browser does not handle
+ this, then we return a realistic default quota (5MB as
+ recommended by the spec).
+
+ * UIProcess/API/efl/ewk_view.cpp:
+ (ewk_view_database_quota_exceeded):
+ * UIProcess/API/efl/ewk_view.h:
+ * UIProcess/API/efl/ewk_view_private.h:
+ * UIProcess/API/efl/ewk_view_ui_client.cpp:
+ (exceededDatabaseQuota):
+ (ewk_view_ui_client_attach):
+
2012-09-28 Kai Koehne <[email protected]>
[Qt] Use qInstallMessageHandler()
Modified: trunk/Source/WebKit2/UIProcess/API/efl/ewk_view.cpp (129870 => 129871)
--- trunk/Source/WebKit2/UIProcess/API/efl/ewk_view.cpp 2012-09-28 10:35:11 UTC (rev 129870)
+++ trunk/Source/WebKit2/UIProcess/API/efl/ewk_view.cpp 2012-09-28 10:39:53 UTC (rev 129871)
@@ -1254,7 +1254,23 @@
}
#endif
+#if ENABLE(SQL_DATABASE)
+/**
+ * @internal
+ * Calls exceeded_database_quota callback or falls back to default behavior returns default database quota.
+ */
+unsigned long long ewk_view_database_quota_exceeded(Evas_Object* ewkView, const char* databaseName, const char* displayName, unsigned long long currentQuota, unsigned long long currentOriginUsage, unsigned long long currentDatabaseUsage, unsigned long long expectedUsage)
+{
+ EWK_VIEW_SD_GET_OR_RETURN(ewkView, smartData, 0);
+ static const unsigned long long defaultQuota = 5 * 1024 * 1204; // 5 MB
+ if (smartData->api->exceeded_database_quota)
+ return smartData->api->exceeded_database_quota(smartData, databaseName, displayName, currentQuota, currentOriginUsage, currentDatabaseUsage, expectedUsage);
+
+ return defaultQuota;
+}
+#endif
+
/**
* @internal
* A download for that view was cancelled.
Modified: trunk/Source/WebKit2/UIProcess/API/efl/ewk_view.h (129870 => 129871)
--- trunk/Source/WebKit2/UIProcess/API/efl/ewk_view.h 2012-09-28 10:35:11 UTC (rev 129870)
+++ trunk/Source/WebKit2/UIProcess/API/efl/ewk_view.h 2012-09-28 10:39:53 UTC (rev 129871)
@@ -127,13 +127,17 @@
// - Shows and hides color picker.
Eina_Bool (*input_picker_color_request)(Ewk_View_Smart_Data *sd, int r, int g, int b, int a);
Eina_Bool (*input_picker_color_dismiss)(Ewk_View_Smart_Data *sd);
+
+ // storage:
+ // - Web database.
+ unsigned long long (*exceeded_database_quota)(Ewk_View_Smart_Data *sd, const char *databaseName, const char *displayName, unsigned long long currentQuota, unsigned long long currentOriginUsage, unsigned long long currentDatabaseUsage, unsigned long long expectedUsage);
};
/**
* The version you have to put into the version field
* in the @a Ewk_View_Smart_Class structure.
*/
-#define EWK_VIEW_SMART_CLASS_VERSION 5UL
+#define EWK_VIEW_SMART_CLASS_VERSION 6UL
/**
* Initializer for whole Ewk_View_Smart_Class structure.
@@ -145,7 +149,7 @@
* @see EWK_VIEW_SMART_CLASS_INIT_VERSION
* @see EWK_VIEW_SMART_CLASS_INIT_NAME_VERSION
*/
-#define EWK_VIEW_SMART_CLASS_INIT(smart_class_init) {smart_class_init, EWK_VIEW_SMART_CLASS_VERSION, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}
+#define EWK_VIEW_SMART_CLASS_INIT(smart_class_init) {smart_class_init, EWK_VIEW_SMART_CLASS_VERSION, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}
/**
* Initializer to zero a whole Ewk_View_Smart_Class structure.
Modified: trunk/Source/WebKit2/UIProcess/API/efl/ewk_view_private.h (129870 => 129871)
--- trunk/Source/WebKit2/UIProcess/API/efl/ewk_view_private.h 2012-09-28 10:35:11 UTC (rev 129870)
+++ trunk/Source/WebKit2/UIProcess/API/efl/ewk_view_private.h 2012-09-28 10:39:53 UTC (rev 129871)
@@ -114,4 +114,8 @@
void ewk_view_color_picker_dismiss(Evas_Object* ewkView);
#endif
+#if ENABLE(SQL_DATABASE)
+unsigned long long ewk_view_database_quota_exceeded(Evas_Object* ewkView, const char* databaseName, const char* displayName, unsigned long long currentQuota, unsigned long long currentOriginUsage, unsigned long long currentDatabaseUsage, unsigned long long expectedUsage);
+#endif
+
#endif // ewk_view_private_h
Modified: trunk/Source/WebKit2/UIProcess/API/efl/ewk_view_ui_client.cpp (129870 => 129871)
--- trunk/Source/WebKit2/UIProcess/API/efl/ewk_view_ui_client.cpp 2012-09-28 10:35:11 UTC (rev 129870)
+++ trunk/Source/WebKit2/UIProcess/API/efl/ewk_view_ui_client.cpp 2012-09-28 10:39:53 UTC (rev 129871)
@@ -73,6 +73,13 @@
}
#endif
+#if ENABLE(SQL_DATABASE)
+static unsigned long long exceededDatabaseQuota(WKPageRef, WKFrameRef, WKSecurityOriginRef origin, WKStringRef databaseName, WKStringRef displayName, unsigned long long currentQuota, unsigned long long currentOriginUsage, unsigned long long currentDatabaseUsage, unsigned long long expectedUsage, const void* clientInfo)
+{
+ return ewk_view_database_quota_exceeded(toEwkView(clientInfo), WKEinaSharedString(databaseName), WKEinaSharedString(displayName), currentQuota, currentOriginUsage, currentDatabaseUsage, expectedUsage);
+}
+#endif
+
void ewk_view_ui_client_attach(WKPageRef pageRef, Evas_Object* ewkView)
{
WKPageUIClient uiClient;
@@ -84,6 +91,9 @@
uiClient.runJavaScriptAlert = runJavaScriptAlert;
uiClient.runJavaScriptConfirm = runJavaScriptConfirm;
uiClient.runJavaScriptPrompt = runJavaScriptPrompt;
+#if ENABLE(SQL_DATABASE)
+ uiClient.exceededDatabaseQuota = exceededDatabaseQuota;
+#endif
#if ENABLE(INPUT_TYPE_COLOR)
uiClient.showColorPicker = showColorPicker;