Diff
Modified: trunk/Source/WebKit/ChangeLog (117463 => 117464)
--- trunk/Source/WebKit/ChangeLog 2012-05-17 17:54:40 UTC (rev 117463)
+++ trunk/Source/WebKit/ChangeLog 2012-05-17 18:09:37 UTC (rev 117464)
@@ -1,5 +1,16 @@
2012-05-17 Thiago Marcos P. Santos <thiago.san...@intel.com>
+ [EFL] Add API for Web Database handling
+ https://bugs.webkit.org/show_bug.cgi?id=85178
+
+ Reviewed by Antonio Gomes.
+
+ Added the new Web Database API to the buildsystem.
+
+ * PlatformEfl.cmake:
+
+2012-05-17 Thiago Marcos P. Santos <thiago.san...@intel.com>
+
[EFL] Fix link error caused by not directly linking with edbus
https://bugs.webkit.org/show_bug.cgi?id=86747
Modified: trunk/Source/WebKit/PlatformEfl.cmake (117463 => 117464)
--- trunk/Source/WebKit/PlatformEfl.cmake 2012-05-17 17:54:40 UTC (rev 117463)
+++ trunk/Source/WebKit/PlatformEfl.cmake 2012-05-17 18:09:37 UTC (rev 117464)
@@ -120,6 +120,7 @@
efl/ewk/ewk_view_single.cpp
efl/ewk/ewk_view_tiled.cpp
efl/ewk/ewk_window_features.cpp
+ efl/ewk/ewk_web_database.cpp
)
LIST(APPEND WebKit_LIBRARIES
@@ -267,6 +268,7 @@
${CMAKE_CURRENT_SOURCE_DIR}/efl/ewk/ewk_settings.h
${CMAKE_CURRENT_SOURCE_DIR}/efl/ewk/ewk_view.h
${CMAKE_CURRENT_SOURCE_DIR}/efl/ewk/ewk_window_features.h
+ ${CMAKE_CURRENT_SOURCE_DIR}/efl/ewk/ewk_web_database.h
)
INSTALL(FILES ${EWebKit_HEADERS}
Modified: trunk/Source/WebKit/efl/ChangeLog (117463 => 117464)
--- trunk/Source/WebKit/efl/ChangeLog 2012-05-17 17:54:40 UTC (rev 117463)
+++ trunk/Source/WebKit/efl/ChangeLog 2012-05-17 18:09:37 UTC (rev 117464)
@@ -1,3 +1,38 @@
+2012-05-17 Thiago Marcos P. Santos <thiago.san...@intel.com>
+
+ [EFL] Add API for Web Database handling
+ https://bugs.webkit.org/show_bug.cgi?id=85178
+
+ Reviewed by Antonio Gomes.
+
+ Add API for Web Database. This API will allow a browser
+ to query information about size, name, filename and remove
+ databases based on the origin. It will be also possible to
+ list all databases for a given origin.
+
+ * ewk/EWebKit.h:
+ * ewk/ewk_security_origin.cpp:
+ (ewk_security_origin_web_database_get_all):
+ * ewk/ewk_security_origin.h:
+ * ewk/ewk_settings.cpp:
+ * ewk/ewk_settings.h:
+ * ewk/ewk_web_database.cpp: Added.
+ (_Ewk_Web_Database):
+ (ewk_web_database_display_name_get):
+ (ewk_web_database_expected_size_get):
+ (ewk_web_database_filename_get):
+ (ewk_web_database_name_get):
+ (ewk_web_database_security_origin_get):
+ (ewk_web_database_size_get):
+ (ewk_web_database_remove):
+ (ewk_web_database_remove_all):
+ (ewk_web_database_free):
+ (ewk_web_database_list_free):
+ (ewk_web_database_new):
+ * ewk/ewk_web_database.h: Added.
+ * ewk/ewk_web_database_private.h: Copied from Source/WebKit/efl/ewk/EWebKit.h.
+ (WebCore):
+
2012-05-17 Mariusz Grzegorczyk <marius...@samsung.com>
[EFL] [DRT] EFL's DumpRenderTree should support LayoutTestController's dumpEditingCallbacks()
Modified: trunk/Source/WebKit/efl/ewk/EWebKit.h (117463 => 117464)
--- trunk/Source/WebKit/efl/ewk/EWebKit.h 2012-05-17 17:54:40 UTC (rev 117463)
+++ trunk/Source/WebKit/efl/ewk/EWebKit.h 2012-05-17 18:09:37 UTC (rev 117464)
@@ -41,6 +41,7 @@
#include "ewk_security_policy.h"
#include "ewk_settings.h"
#include "ewk_view.h"
+#include "ewk_web_database.h"
#include "ewk_window_features.h"
#include <Evas.h>
Modified: trunk/Source/WebKit/efl/ewk/ewk_security_origin.cpp (117463 => 117464)
--- trunk/Source/WebKit/efl/ewk/ewk_security_origin.cpp 2012-05-17 17:54:40 UTC (rev 117463)
+++ trunk/Source/WebKit/efl/ewk/ewk_security_origin.cpp 2012-05-17 18:09:37 UTC (rev 117464)
@@ -24,8 +24,12 @@
#include "DatabaseTracker.h"
#include "SecurityOrigin.h"
#include "ewk_private.h"
+#include "ewk_security_origin_private.h"
+#include "ewk_web_database.h"
+#include "ewk_web_database_private.h"
#include <Eina.h>
#include <wtf/RefPtr.h>
+#include <wtf/UnusedParam.h>
#include <wtf/text/CString.h>
struct _Ewk_Security_Origin {
@@ -85,6 +89,25 @@
WebCore::cacheStorage().storeUpdatedQuotaForOrigin(origin->securityOrigin.get(), quota);
}
+Eina_List* ewk_security_origin_web_database_get_all(const Ewk_Security_Origin* origin)
+{
+ Eina_List* databases = 0;
+#if ENABLE(SQL_DATABASE)
+ Vector<WTF::String> names;
+
+ if (!WebCore::DatabaseTracker::tracker().databaseNamesForOrigin(origin->securityOrigin.get(), names))
+ return 0;
+
+ for (unsigned i = 0; i < names.size(); i++) {
+ Ewk_Web_Database* database = ewk_web_database_new(origin->securityOrigin.get(), names[i].utf8().data());
+ databases = eina_list_append(databases, database);
+ }
+#else
+ UNUSED_PARAM(origin);
+#endif
+ return databases;
+}
+
void ewk_security_origin_free(Ewk_Security_Origin* origin)
{
origin->securityOrigin = 0;
Modified: trunk/Source/WebKit/efl/ewk/ewk_security_origin.h (117463 => 117464)
--- trunk/Source/WebKit/efl/ewk/ewk_security_origin.h 2012-05-17 17:54:40 UTC (rev 117463)
+++ trunk/Source/WebKit/efl/ewk/ewk_security_origin.h 2012-05-17 18:09:37 UTC (rev 117464)
@@ -118,6 +118,24 @@
EAPI void ewk_security_origin_application_cache_quota_set(const Ewk_Security_Origin *o, int64_t quota);
/**
+ * Return the list of web databases in the security origin.
+ *
+ * Each item of the list should be release using ewk_web_database_free() or
+ * use ewk_web_database_list_free() as convenience.
+ *
+ * This function won't work if Web SQL Database was not enabled when
+ * building WebKit and will just return 0.
+ *
+ * @param o security origin object
+ *
+ * @return list of web databases in the security origin
+ *
+ * @see ewk_web_database_free()
+ * @see ewk_web_database_list_free()
+ */
+EAPI Eina_List *ewk_security_origin_web_database_get_all(const Ewk_Security_Origin *o);
+
+/**
* Release all resources allocated by a security origin object.
*
* @param o security origin object
Modified: trunk/Source/WebKit/efl/ewk/ewk_settings.cpp (117463 => 117464)
--- trunk/Source/WebKit/efl/ewk/ewk_settings.cpp 2012-05-17 17:54:40 UTC (rev 117463)
+++ trunk/Source/WebKit/efl/ewk/ewk_settings.cpp 2012-05-17 18:09:37 UTC (rev 117464)
@@ -105,13 +105,6 @@
s_webDatabaseQuota = maximumSize;
}
-void ewk_settings_web_database_clear()
-{
-#if ENABLE(SQL_DATABASE)
- WebCore::DatabaseTracker::tracker().deleteAllDatabases();
-#endif
-}
-
void ewk_settings_local_storage_path_set(const char* path)
{
WebCore::StorageTracker::tracker().setDatabaseDirectoryPath(WTF::String::fromUTF8(path));
Modified: trunk/Source/WebKit/efl/ewk/ewk_settings.h (117463 => 117464)
--- trunk/Source/WebKit/efl/ewk/ewk_settings.h 2012-05-17 17:54:40 UTC (rev 117463)
+++ trunk/Source/WebKit/efl/ewk/ewk_settings.h 2012-05-17 18:09:37 UTC (rev 117464)
@@ -53,11 +53,6 @@
EAPI void ewk_settings_web_database_default_quota_set(uint64_t maximum_size);
/**
- * Removes all HTML5 Web Database databases.
- */
-EAPI void ewk_settings_web_database_clear(void);
-
-/**
* Sets the current path to the directory WebKit will write Web
* Database databases.
*
Added: trunk/Source/WebKit/efl/ewk/ewk_web_database.cpp (0 => 117464)
--- trunk/Source/WebKit/efl/ewk/ewk_web_database.cpp (rev 0)
+++ trunk/Source/WebKit/efl/ewk/ewk_web_database.cpp 2012-05-17 18:09:37 UTC (rev 117464)
@@ -0,0 +1,182 @@
+/*
+ Copyright (C) 2012 Intel Corporation
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Library General Public
+ License as published by the Free Software Foundation; either
+ version 2 of the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Library General Public License for more details.
+
+ You should have received a copy of the GNU Library General Public License
+ along with this library; see the file COPYING.LIB. If not, write to
+ the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ Boston, MA 02110-1301, USA.
+*/
+
+#include "config.h"
+#include "ewk_web_database.h"
+
+#include "DatabaseTracker.h"
+#include "SecurityOrigin.h"
+#include "ewk_security_origin.h"
+#include "ewk_security_origin_private.h"
+#include "ewk_web_database_private.h"
+#include <Eina.h>
+#include <wtf/RefPtr.h>
+#include <wtf/UnusedParam.h>
+#include <wtf/text/WTFString.h>
+
+struct _Ewk_Web_Database {
+ WTF::RefPtr<WebCore::SecurityOrigin> securityOrigin;
+ WTF::String coreName;
+ const char* displayName;
+ const char* filename;
+ const char* name;
+};
+
+const char* ewk_web_database_display_name_get(Ewk_Web_Database* database)
+{
+#if ENABLE(SQL_DATABASE)
+ if (database->displayName)
+ return database->displayName;
+
+ WebCore::SecurityOrigin* origin = database->securityOrigin.get();
+ WebCore::DatabaseDetails details = WebCore::DatabaseTracker::tracker().detailsForNameAndOrigin(database->name, origin);
+ database->displayName = eina_stringshare_add(details.displayName().utf8().data());
+
+ return database->displayName;
+#else
+ UNUSED_PARAM(database);
+ return 0;
+#endif
+}
+
+uint64_t ewk_web_database_expected_size_get(const Ewk_Web_Database* database)
+{
+#if ENABLE(SQL_DATABASE)
+ WebCore::SecurityOrigin* origin = database->securityOrigin.get();
+ WebCore::DatabaseDetails details = WebCore::DatabaseTracker::tracker().detailsForNameAndOrigin(database->name, origin);
+ return details.expectedUsage();
+#else
+ UNUSED_PARAM(database);
+ return 0;
+#endif
+}
+
+const char* ewk_web_database_filename_get(Ewk_Web_Database* database)
+{
+#if ENABLE(SQL_DATABASE)
+ if (database->filename)
+ return database->filename;
+
+ WebCore::SecurityOrigin* origin = database->securityOrigin.get();
+ WTF::String path = WebCore::DatabaseTracker::tracker().fullPathForDatabase(origin, database->coreName);
+ database->filename = eina_stringshare_add(path.utf8().data());
+
+ return database->filename;
+#else
+ UNUSED_PARAM(database);
+ return 0;
+#endif
+}
+
+const char* ewk_web_database_name_get(Ewk_Web_Database* database)
+{
+#if ENABLE(SQL_DATABASE)
+ if (database->name)
+ return database->name;
+
+ database->name = eina_stringshare_add(database->coreName.utf8().data());
+
+ return database->name;
+#else
+ UNUSED_PARAM(database);
+ return 0;
+#endif
+}
+
+Ewk_Security_Origin* ewk_web_database_security_origin_get(const Ewk_Web_Database* database)
+{
+ return ewk_security_origin_new(database->securityOrigin.get());
+}
+
+uint64_t ewk_web_database_size_get(const Ewk_Web_Database* database)
+{
+#if ENABLE(SQL_DATABASE)
+ WebCore::SecurityOrigin* origin = database->securityOrigin.get();
+ WebCore::DatabaseDetails details = WebCore::DatabaseTracker::tracker().detailsForNameAndOrigin(database->name, origin);
+ return details.currentUsage();
+#else
+ UNUSED_PARAM(database);
+ return 0;
+#endif
+}
+
+void ewk_web_database_remove(Ewk_Web_Database* database)
+{
+#if ENABLE(SQL_DATABASE)
+ WebCore::DatabaseTracker::tracker().deleteDatabase(database->securityOrigin.get(), database->coreName);
+#else
+ UNUSED_PARAM(database);
+#endif
+}
+
+void ewk_web_database_remove_all(void)
+{
+#if ENABLE(SQL_DATABASE)
+ WebCore::DatabaseTracker::tracker().deleteAllDatabases();
+#endif
+}
+
+void ewk_web_database_free(Ewk_Web_Database* database)
+{
+#if ENABLE(SQL_DATABASE)
+ eina_stringshare_del(database->displayName);
+ eina_stringshare_del(database->filename);
+ eina_stringshare_del(database->name);
+
+ delete database;
+#else
+ UNUSED_PARAM(database);
+#endif
+}
+
+void ewk_web_database_list_free(Eina_List* databaseList)
+{
+ void* database;
+ EINA_LIST_FREE(databaseList, database)
+ ewk_web_database_free(static_cast<Ewk_Web_Database*>(database));
+}
+
+/**
+ * @internal
+ * Creates a wrapper representing a Web Database.
+ *
+ * @param coreOrigin WebCore Security Origin object
+ * @param coreName Web Database name
+ *
+ * @return a wrapper for manipulating a Web Database. It should be freed
+ * by ewk_web_database_free().
+ */
+Ewk_Web_Database* ewk_web_database_new(WebCore::SecurityOrigin* coreOrigin, const WTF::String& coreName)
+{
+#if ENABLE(SQL_DATABASE)
+ Ewk_Web_Database* database = new Ewk_Web_Database;
+
+ database->securityOrigin = coreOrigin;
+ database->coreName = coreName;
+ database->displayName = 0;
+ database->filename = 0;
+ database->name = 0;
+
+ return database;
+#else
+ UNUSED_PARAM(coreOrigin);
+ UNUSED_PARAM(coreName);
+ return 0;
+#endif
+}
Added: trunk/Source/WebKit/efl/ewk/ewk_web_database.h (0 => 117464)
--- trunk/Source/WebKit/efl/ewk/ewk_web_database.h (rev 0)
+++ trunk/Source/WebKit/efl/ewk/ewk_web_database.h 2012-05-17 18:09:37 UTC (rev 117464)
@@ -0,0 +1,136 @@
+/*
+ Copyright (C) 2012 Intel Corporation
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Library General Public
+ License as published by the Free Software Foundation; either
+ version 2 of the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Library General Public License for more details.
+
+ You should have received a copy of the GNU Library General Public License
+ along with this library; see the file COPYING.LIB. If not, write to
+ the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ Boston, MA 02110-1301, USA.
+*/
+
+/**
+ * @file ewk_web_database.h
+ * @brief Web Database API.
+ *
+ * This API provides functions for managing Web Database created for a security
+ * origin. WebKit needs to be compiled with Web Database support in order to use
+ * this API.
+ */
+
+#ifndef ewk_web_database_h
+#define ewk_web_database_h
+
+#include "ewk_security_origin.h"
+
+#include <Evas.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+typedef struct _Ewk_Web_Database Ewk_Web_Database;
+
+/**
+ * Returns the user friendly name of the database.
+ *
+ * It returns a internal string which should not
+ * be modified. The string is guaranteed to be stringshared.
+ *
+ * @param o web database object
+ *
+ * @return the database name
+ */
+EAPI const char *ewk_web_database_display_name_get(Ewk_Web_Database *o);
+
+/**
+ * Returns the size of the database expected by the web author.
+ *
+ * @param o web database object
+ *
+ * @return expected size
+ */
+EAPI uint64_t ewk_web_database_expected_size_get(const Ewk_Web_Database *o);
+
+/**
+ * Returns the absolute path to the database file.
+ *
+ * It returns a internal string which should not
+ * be modified. The string is guaranteed to be stringshared.
+ *
+ * @param o web database object
+ *
+ * @return the database path
+ */
+EAPI const char *ewk_web_database_filename_get(Ewk_Web_Database *o);
+
+/**
+ * Returns the name of the database.
+ *
+ * It returns a internal string which should not
+ * be modified. The string is guaranteed to be stringshared.
+ *
+ * @param o web database object
+ *
+ * @return the database name
+ */
+EAPI const char *ewk_web_database_name_get(Ewk_Web_Database *o);
+
+/**
+ * Retrieves the security origin of the database.
+ *
+ * The returned value should be freed by ewk_security_origin_free().
+ *
+ * @param o web database object
+ *
+ * @return the security origin
+ */
+EAPI Ewk_Security_Origin *ewk_web_database_security_origin_get(const Ewk_Web_Database *o);
+
+/**
+ * Returns the size of the database.
+ *
+ * @param o web database object
+ *
+ * @return the current size of the database
+ */
+EAPI uint64_t ewk_web_database_size_get(const Ewk_Web_Database *o);
+
+/**
+ * Remove the database from the security origin and destroy all data.
+ *
+ * @param o web database object
+ */
+EAPI void ewk_web_database_remove(Ewk_Web_Database *o);
+
+/**
+ * Remove all the databases in the current default path.
+ */
+EAPI void ewk_web_database_remove_all(void);
+
+/**
+ * Release all resources allocated by a web database object.
+ *
+ * @param o web database object
+ */
+EAPI void ewk_web_database_free(Ewk_Web_Database *o);
+
+/**
+ * Convenience function for releasing all web database objects from a list.
+ *
+ * @param database_list list of web database objects to be freed
+ */
+EAPI void ewk_web_database_list_free(Eina_List *database_list);
+
+#ifdef __cplusplus
+}
+#endif
+#endif // ewk_web_database_h
Copied: trunk/Source/WebKit/efl/ewk/ewk_web_database_private.h (from rev 117463, trunk/Source/WebKit/efl/ewk/EWebKit.h) (0 => 117464)
--- trunk/Source/WebKit/efl/ewk/ewk_web_database_private.h (rev 0)
+++ trunk/Source/WebKit/efl/ewk/ewk_web_database_private.h 2012-05-17 18:09:37 UTC (rev 117464)
@@ -0,0 +1,31 @@
+/*
+ Copyright (C) 2012 Intel Corporation
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Library General Public
+ License as published by the Free Software Foundation; either
+ version 2 of the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Library General Public License for more details.
+
+ You should have received a copy of the GNU Library General Public License
+ along with this library; see the file COPYING.LIB. If not, write to
+ the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ Boston, MA 02110-1301, USA.
+*/
+
+#ifndef ewk_web_database_private_h
+#define ewk_web_database_private_h
+
+#include <wtf/text/WTFString.h>
+
+namespace WebCore {
+class SecurityOrigin;
+}
+
+Ewk_Web_Database* ewk_web_database_new(WebCore::SecurityOrigin* coreOrigin, const WTF::String& coreName);
+
+#endif // ewk_web_database_private_h
Modified: trunk/Tools/ChangeLog (117463 => 117464)
--- trunk/Tools/ChangeLog 2012-05-17 17:54:40 UTC (rev 117463)
+++ trunk/Tools/ChangeLog 2012-05-17 18:09:37 UTC (rev 117464)
@@ -1,3 +1,17 @@
+2012-05-17 Thiago Marcos P. Santos <thiago.san...@intel.com>
+
+ [EFL] Add API for Web Database handling
+ https://bugs.webkit.org/show_bug.cgi?id=85178
+
+ Reviewed by Antonio Gomes.
+
+ Use the newly introduced Web Database API in EFL's DRT.
+
+ * DumpRenderTree/efl/DumpRenderTreeChrome.cpp:
+ (DumpRenderTreeChrome::resetDefaultsToConsistentValues):
+ * DumpRenderTree/efl/LayoutTestControllerEfl.cpp:
+ (LayoutTestController::clearAllDatabases):
+
2012-05-17 Dan Bernstein <m...@apple.com>
REGRESSION (r117428): WebKit API/SPI was removed
Modified: trunk/Tools/DumpRenderTree/efl/DumpRenderTreeChrome.cpp (117463 => 117464)
--- trunk/Tools/DumpRenderTree/efl/DumpRenderTreeChrome.cpp 2012-05-17 17:54:40 UTC (rev 117463)
+++ trunk/Tools/DumpRenderTree/efl/DumpRenderTreeChrome.cpp 2012-05-17 18:09:37 UTC (rev 117464)
@@ -210,7 +210,7 @@
ewk_settings_icon_database_clear();
ewk_settings_icon_database_path_set(0);
- ewk_settings_web_database_clear();
+ ewk_web_database_remove_all();
ewk_settings_web_database_default_quota_set(5 * 1024 * 1024);
ewk_settings_memory_cache_clear();
Modified: trunk/Tools/DumpRenderTree/efl/LayoutTestControllerEfl.cpp (117463 => 117464)
--- trunk/Tools/DumpRenderTree/efl/LayoutTestControllerEfl.cpp 2012-05-17 17:54:40 UTC (rev 117463)
+++ trunk/Tools/DumpRenderTree/efl/LayoutTestControllerEfl.cpp 2012-05-17 18:09:37 UTC (rev 117464)
@@ -578,7 +578,7 @@
void LayoutTestController::clearAllDatabases()
{
- ewk_settings_web_database_clear();
+ ewk_web_database_remove_all();
}
void LayoutTestController::setDatabaseQuota(unsigned long long quota)