Skip to content

Commit

Permalink
Revert "[GTK][WPE] Add API to configure and enable resource load stat…
Browse files Browse the repository at this point in the history
…istics"

This reverts commit 6fe1852f8509b29ef0869f9030179ef099cac864.
  • Loading branch information
carlosgcampos committed Mar 9, 2018
1 parent 20ec124 commit ceef224
Show file tree
Hide file tree
Showing 13 changed files with 5 additions and 219 deletions.
2 changes: 0 additions & 2 deletions Source/WebKit/UIProcess/API/glib/WebKitWebContext.cpp
Expand Up @@ -310,7 +310,6 @@ static inline WebsiteDataStore::Configuration websiteDataStoreConfigurationForWe
configuration.webSQLDatabaseDirectory = processPoolconfigurarion.webSQLDatabaseDirectory();
configuration.localStorageDirectory = processPoolconfigurarion.localStorageDirectory();
configuration.mediaKeysStorageDirectory = processPoolconfigurarion.mediaKeysStorageDirectory();
configuration.resourceLoadStatisticsDirectory = processPoolconfigurarion.resourceLoadStatisticsDirectory();
return configuration;
}

Expand All @@ -333,7 +332,6 @@ static void webkitWebContextConstructed(GObject* object)
configuration.setApplicationCacheDirectory(WebCore::FileSystem::stringFromFileSystemRepresentation(webkit_website_data_manager_get_offline_application_cache_directory(priv->websiteDataManager.get())));
configuration.setIndexedDBDatabaseDirectory(WebCore::FileSystem::stringFromFileSystemRepresentation(webkit_website_data_manager_get_indexeddb_directory(priv->websiteDataManager.get())));
configuration.setWebSQLDatabaseDirectory(WebCore::FileSystem::stringFromFileSystemRepresentation(webkit_website_data_manager_get_websql_directory(priv->websiteDataManager.get())));
configuration.setResourceLoadStatisticsDirectory(WebCore::FileSystem::stringFromFileSystemRepresentation(webkit_website_data_manager_get_resource_load_statistics_directory(priv->websiteDataManager.get())));
} else if (!priv->localStorageDirectory.isNull())
configuration.setLocalStorageDirectory(WebCore::FileSystem::stringFromFileSystemRepresentation(priv->localStorageDirectory.data()));

Expand Down
3 changes: 0 additions & 3 deletions Source/WebKit/UIProcess/API/glib/WebKitWebsiteData.cpp
Expand Up @@ -73,7 +73,6 @@ static bool recordContainsSupportedDataTypes(const WebsiteDataRecord& record)
WebsiteDataType::LocalStorage,
WebsiteDataType::WebSQLDatabases,
WebsiteDataType::IndexedDBDatabases,
WebsiteDataType::ResourceLoadStatistics,
#if ENABLE(NETSCAPE_PLUGIN_API)
WebsiteDataType::PlugInData,
#endif
Expand All @@ -99,8 +98,6 @@ static WebKitWebsiteDataTypes toWebKitWebsiteDataTypes(OptionSet<WebsiteDataType
returnValue |= WEBKIT_WEBSITE_DATA_WEBSQL_DATABASES;
if (types.contains(WebsiteDataType::IndexedDBDatabases))
returnValue |= WEBKIT_WEBSITE_DATA_INDEXEDDB_DATABASES;
if (types.contains(WebsiteDataType::ResourceLoadStatistics))
returnValue |= WEBKIT_WEBSITE_DATA_RESOURCE_LOAD_STATISTICS;
#if ENABLE(NETSCAPE_PLUGIN_API)
if (types.contains(WebsiteDataType::PlugInData))
returnValue |= WEBKIT_WEBSITE_DATA_PLUGIN_DATA;
Expand Down
87 changes: 0 additions & 87 deletions Source/WebKit/UIProcess/API/glib/WebKitWebsiteDataManager.cpp
Expand Up @@ -84,7 +84,6 @@ enum {
PROP_APPLICATION_CACHE_DIRECTORY,
PROP_INDEXEDDB_DIRECTORY,
PROP_WEBSQL_DIRECTORY,
PROP_RESOURCE_LOAD_STATISTICS_DIRECTORY,
PROP_IS_EPHEMERAL
};

Expand All @@ -102,7 +101,6 @@ struct _WebKitWebsiteDataManagerPrivate {
GUniquePtr<char> applicationCacheDirectory;
GUniquePtr<char> indexedDBDirectory;
GUniquePtr<char> webSQLDirectory;
GUniquePtr<char> resourceLoadStatisticsDirectory;

GRefPtr<WebKitCookieManager> cookieManager;
Vector<WebProcessPool*> processPools;
Expand Down Expand Up @@ -136,9 +134,6 @@ static void webkitWebsiteDataManagerGetProperty(GObject* object, guint propID, G
case PROP_WEBSQL_DIRECTORY:
g_value_set_string(value, webkit_website_data_manager_get_websql_directory(manager));
break;
case PROP_RESOURCE_LOAD_STATISTICS_DIRECTORY:
g_value_set_string(value, webkit_website_data_manager_get_resource_load_statistics_directory(manager));
break;
case PROP_IS_EPHEMERAL:
g_value_set_boolean(value, webkit_website_data_manager_is_ephemeral(manager));
break;
Expand Down Expand Up @@ -173,9 +168,6 @@ static void webkitWebsiteDataManagerSetProperty(GObject* object, guint propID, c
case PROP_WEBSQL_DIRECTORY:
manager->priv->webSQLDirectory.reset(g_value_dup_string(value));
break;
case PROP_RESOURCE_LOAD_STATISTICS_DIRECTORY:
manager->priv->resourceLoadStatisticsDirectory.reset(g_value_dup_string(value));
break;
case PROP_IS_EPHEMERAL:
if (g_value_get_boolean(value))
manager->priv->websiteDataStore = API::WebsiteDataStore::createNonPersistentDataStore();
Expand All @@ -197,8 +189,6 @@ static void webkitWebsiteDataManagerConstructed(GObject* object)
priv->indexedDBDirectory.reset(g_build_filename(priv->baseDataDirectory.get(), "databases", "indexeddb", nullptr));
if (!priv->webSQLDirectory)
priv->webSQLDirectory.reset(g_build_filename(priv->baseDataDirectory.get(), "databases", nullptr));
if (!priv->resourceLoadStatisticsDirectory)
priv->resourceLoadStatisticsDirectory.reset(g_build_filename(priv->baseDataDirectory.get(), "resourceloadstatistics", nullptr));
}

if (priv->baseCacheDirectory) {
Expand Down Expand Up @@ -338,23 +328,6 @@ static void webkit_website_data_manager_class_init(WebKitWebsiteDataManagerClass
nullptr,
static_cast<GParamFlags>(WEBKIT_PARAM_READWRITE | G_PARAM_CONSTRUCT_ONLY)));

/**
* WebKitWebsiteDataManager:resource-load-statistics-directory:
*
* The directory where resource load statistics will be stored.
*
* Since: 2.20
*/
g_object_class_install_property(
gObjectClass,
PROP_RESOURCE_LOAD_STATISTICS_DIRECTORY,
g_param_spec_string(
"resource-load-statistics-directory",
_("Resource Load Statistics Directory"),
_("The directory where resource load statistics will be stored"),
nullptr,
static_cast<GParamFlags>(WEBKIT_PARAM_READWRITE | G_PARAM_CONSTRUCT_ONLY)));

/**
* WebKitWebsiteDataManager:is-ephemeral:
*
Expand Down Expand Up @@ -397,8 +370,6 @@ API::WebsiteDataStore& webkitWebsiteDataManagerGetDataStore(WebKitWebsiteDataMan
API::WebsiteDataStore::defaultApplicationCacheDirectory() : WebCore::FileSystem::stringFromFileSystemRepresentation(priv->applicationCacheDirectory.get());
configuration.webSQLDatabaseDirectory = !priv->webSQLDirectory ?
API::WebsiteDataStore::defaultWebSQLDatabaseDirectory() : WebCore::FileSystem::stringFromFileSystemRepresentation(priv->webSQLDirectory.get());
configuration.resourceLoadStatisticsDirectory = !priv->resourceLoadStatisticsDirectory ?
API::WebsiteDataStore::defaultResourceLoadStatisticsDirectory() : WebCore::FileSystem::stringFromFileSystemRepresentation(priv->resourceLoadStatisticsDirectory.get());
configuration.mediaKeysStorageDirectory = API::WebsiteDataStore::defaultMediaKeysStorageDirectory();
priv->websiteDataStore = API::WebsiteDataStore::createLegacy(WTFMove(configuration));
}
Expand Down Expand Up @@ -635,29 +606,6 @@ const gchar* webkit_website_data_manager_get_websql_directory(WebKitWebsiteDataM
return priv->webSQLDirectory.get();
}

/**
* webkit_website_data_manager_get_resource_load_statistics_directory:
* @manager: a #WebKitWebsiteDataManager
*
* Get the #WebKitWebsiteDataManager:resource-load-statistics-directory property.
*
* Returns: (allow-none): the directory where resource load statistics are stored or %NULL if @manager is ephemeral.
*
* Since: 2.20
*/
const gchar* webkit_website_data_manager_get_resource_load_statistics_directory(WebKitWebsiteDataManager* manager)
{
g_return_val_if_fail(WEBKIT_IS_WEBSITE_DATA_MANAGER(manager), nullptr);

WebKitWebsiteDataManagerPrivate* priv = manager->priv;
if (priv->websiteDataStore && !priv->websiteDataStore->isPersistent())
return nullptr;

if (!priv->resourceLoadStatisticsDirectory)
priv->resourceLoadStatisticsDirectory.reset(g_strdup(API::WebsiteDataStore::defaultResourceLoadStatisticsDirectory().utf8().data()));
return priv->resourceLoadStatisticsDirectory.get();
}

/**
* webkit_website_data_manager_get_cookie_manager:
* @manager: a #WebKitWebsiteDataManager
Expand All @@ -678,39 +626,6 @@ WebKitCookieManager* webkit_website_data_manager_get_cookie_manager(WebKitWebsit
return manager->priv->cookieManager.get();
}

/**
* webkit_website_data_manager_set_resource_load_statistics_enabled:
* @manager: a #WebKitWebsiteDataManager
* @enabled: value to set
*
* Enable collection of resource load statistics for intelligent tracking prevention.
*
* Since: 2.20
*/
void webkit_website_data_manager_set_resource_load_statistics_enabled(WebKitWebsiteDataManager* manager, gboolean enabled)
{
g_return_if_fail(WEBKIT_IS_WEBSITE_DATA_MANAGER(manager));

manager->priv->websiteDataStore->setResourceLoadStatisticsEnabled(enabled);
}

/**
* webkit_website_data_manager_get_resource_load_statistics_enabled:
* @manager: a #WebKitWebsiteDataManager
*
* Get whether collection of resource load statistics for intelligent tracking prevention is enabled or not.
*
* Returns: %TRUE if collection of resource load statistics is enabled, or %FALSE otherwise.
*
* Since: 2.20
*/
gboolean webkit_website_data_manager_get_resource_load_statistics_enabled(WebKitWebsiteDataManager* manager)
{
g_return_val_if_fail(WEBKIT_IS_WEBSITE_DATA_MANAGER(manager), FALSE);

return manager->priv->websiteDataStore->resourceLoadStatisticsEnabled();
}

static OptionSet<WebsiteDataType> toWebsiteDataTypes(WebKitWebsiteDataTypes types)
{
OptionSet<WebsiteDataType> returnValue;
Expand All @@ -728,8 +643,6 @@ static OptionSet<WebsiteDataType> toWebsiteDataTypes(WebKitWebsiteDataTypes type
returnValue |= WebsiteDataType::WebSQLDatabases;
if (types & WEBKIT_WEBSITE_DATA_INDEXEDDB_DATABASES)
returnValue |= WebsiteDataType::IndexedDBDatabases;
if (types & WEBKIT_WEBSITE_DATA_RESOURCE_LOAD_STATISTICS)
returnValue |= WebsiteDataType::ResourceLoadStatistics;
#if ENABLE(NETSCAPE_PLUGIN_API)
if (types & WEBKIT_WEBSITE_DATA_PLUGIN_DATA)
returnValue |= WebsiteDataType::PlugInData;
Expand Down
4 changes: 1 addition & 3 deletions Source/WebKit/UIProcess/API/gtk/WebKitWebsiteData.h
Expand Up @@ -44,7 +44,6 @@ typedef struct _WebKitWebsiteData WebKitWebsiteData;
* @WEBKIT_WEBSITE_DATA_INDEXEDDB_DATABASES: IndexedDB databases.
* @WEBKIT_WEBSITE_DATA_PLUGIN_DATA: Plugins data.
* @WEBKIT_WEBSITE_DATA_COOKIES: Cookies.
* @WEBKIT_WEBSITE_DATA_RESOURCE_LOAD_STATISTICS: Resource load statistics. Since 2.20.
* @WEBKIT_WEBSITE_DATA_ALL: All types.
*
* Enum values with flags representing types of Website data.
Expand All @@ -61,8 +60,7 @@ typedef enum {
WEBKIT_WEBSITE_DATA_INDEXEDDB_DATABASES = 1 << 6,
WEBKIT_WEBSITE_DATA_PLUGIN_DATA = 1 << 7,
WEBKIT_WEBSITE_DATA_COOKIES = 1 << 8,
WEBKIT_WEBSITE_DATA_RESOURCE_LOAD_STATISTICS = 1 << 9,
WEBKIT_WEBSITE_DATA_ALL = (1 << 10) - 1
WEBKIT_WEBSITE_DATA_ALL = (1 << 9) - 1
} WebKitWebsiteDataTypes;

WEBKIT_API GType
Expand Down
10 changes: 0 additions & 10 deletions Source/WebKit/UIProcess/API/gtk/WebKitWebsiteDataManager.h
Expand Up @@ -90,19 +90,9 @@ webkit_website_data_manager_get_indexeddb_directory (WebKitWeb
WEBKIT_API const gchar *
webkit_website_data_manager_get_websql_directory (WebKitWebsiteDataManager *manager);

WEBKIT_API const gchar *
webkit_website_data_manager_get_resource_load_statistics_directory (WebKitWebsiteDataManager *manager);

WEBKIT_API WebKitCookieManager *
webkit_website_data_manager_get_cookie_manager (WebKitWebsiteDataManager *manager);

WEBKIT_API void
webkit_website_data_manager_set_resource_load_statistics_enabled (WebKitWebsiteDataManager *manager,
gboolean enabled);

WEBKIT_API gboolean
webkit_website_data_manager_get_resource_load_statistics_enabled (WebKitWebsiteDataManager *manager);

WEBKIT_API void
webkit_website_data_manager_fetch (WebKitWebsiteDataManager *manager,
WebKitWebsiteDataTypes types,
Expand Down
Expand Up @@ -1318,10 +1318,7 @@ webkit_website_data_manager_get_disk_cache_directory
webkit_website_data_manager_get_offline_application_cache_directory
webkit_website_data_manager_get_indexeddb_directory
webkit_website_data_manager_get_websql_directory
webkit_website_data_manager_get_resource_load_statistics_directory
webkit_website_data_manager_get_cookie_manager
webkit_website_data_manager_set_resource_load_statistics_enabled
webkit_website_data_manager_get_resource_load_statistics_enabled
webkit_website_data_manager_fetch
webkit_website_data_manager_fetch_finish
webkit_website_data_manager_remove
Expand Down
4 changes: 1 addition & 3 deletions Source/WebKit/UIProcess/API/wpe/WebKitWebsiteData.h
Expand Up @@ -44,7 +44,6 @@ typedef struct _WebKitWebsiteData WebKitWebsiteData;
* @WEBKIT_WEBSITE_DATA_INDEXEDDB_DATABASES: IndexedDB databases.
* @WEBKIT_WEBSITE_DATA_PLUGIN_DATA: Plugins data.
* @WEBKIT_WEBSITE_DATA_COOKIES: Cookies.
* @WEBKIT_WEBSITE_DATA_RESOURCE_LOAD_STATISTICS: Resource load statistics. Since 2.20.
* @WEBKIT_WEBSITE_DATA_ALL: All types.
*
* Enum values with flags representing types of Website data.
Expand All @@ -61,8 +60,7 @@ typedef enum {
WEBKIT_WEBSITE_DATA_INDEXEDDB_DATABASES = 1 << 6,
WEBKIT_WEBSITE_DATA_PLUGIN_DATA = 1 << 7,
WEBKIT_WEBSITE_DATA_COOKIES = 1 << 8,
WEBKIT_WEBSITE_DATA_RESOURCE_LOAD_STATISTICS = 1 << 9,
WEBKIT_WEBSITE_DATA_ALL = (1 << 10) - 1
WEBKIT_WEBSITE_DATA_ALL = (1 << 9) - 1
} WebKitWebsiteDataTypes;

WEBKIT_API GType
Expand Down
10 changes: 0 additions & 10 deletions Source/WebKit/UIProcess/API/wpe/WebKitWebsiteDataManager.h
Expand Up @@ -90,19 +90,9 @@ webkit_website_data_manager_get_indexeddb_directory (WebKitWeb
WEBKIT_API const gchar *
webkit_website_data_manager_get_websql_directory (WebKitWebsiteDataManager *manager);

WEBKIT_API const gchar *
webkit_website_data_manager_get_resource_load_statistics_directory (WebKitWebsiteDataManager *manager);

WEBKIT_API WebKitCookieManager *
webkit_website_data_manager_get_cookie_manager (WebKitWebsiteDataManager *manager);

WEBKIT_API void
webkit_website_data_manager_set_resource_load_statistics_enabled (WebKitWebsiteDataManager *manager,
gboolean enabled);

WEBKIT_API gboolean
webkit_website_data_manager_get_resource_load_statistics_enabled (WebKitWebsiteDataManager *manager);

WEBKIT_API void
webkit_website_data_manager_fetch (WebKitWebsiteDataManager *manager,
WebKitWebsiteDataTypes types,
Expand Down
5 changes: 0 additions & 5 deletions Tools/MiniBrowser/gtk/main.c
Expand Up @@ -45,7 +45,6 @@ static char *geometry;
static gboolean privateMode;
static gboolean automationMode;
static gboolean fullScreen;
static gboolean enableIntelligentTrackingPrevention;
static const char *proxy;

typedef enum {
Expand Down Expand Up @@ -103,7 +102,6 @@ static const GOptionEntry commandLineOptions[] =
{ "full-screen", 'f', 0, G_OPTION_ARG_NONE, &fullScreen, "Set the window to full-screen mode", NULL },
{ "private", 'p', 0, G_OPTION_ARG_NONE, &privateMode, "Run in private browsing mode", NULL },
{ "automation", 0, 0, G_OPTION_ARG_NONE, &automationMode, "Run in automation mode", NULL },
{ "enable-itp", 0, 0, G_OPTION_ARG_NONE, &enableIntelligentTrackingPrevention, "Enable intelligent tracking prevention", NULL },
{ "proxy", 0, 0, G_OPTION_ARG_STRING, &proxy, "Set proxy", "PROXY" },
{ "ignore-host", 0, 0, G_OPTION_ARG_STRING_ARRAY, &ignoreHosts, "Set proxy ignore hosts", "HOSTS" },
{ G_OPTION_REMAINING, 0, 0, G_OPTION_ARG_FILENAME_ARRAY, &uriArguments, 0, "[URL…]" },
Expand Down Expand Up @@ -518,9 +516,6 @@ int main(int argc, char *argv[])
// Enable the favicon database, by specifying the default directory.
webkit_web_context_set_favicon_database_directory(webContext, NULL);

WebKitWebsiteDataManager *manager = webkit_web_context_get_website_data_manager(webContext);
webkit_website_data_manager_set_resource_load_statistics_enabled(manager, enableIntelligentTrackingPrevention);

webkit_web_context_register_uri_scheme(webContext, BROWSER_ABOUT_SCHEME, (WebKitURISchemeRequestCallback)aboutURISchemeRequestCallback, webContext, NULL);

WebKitUserContentManager *userContentManager = webkit_user_content_manager_new();
Expand Down

0 comments on commit ceef224

Please sign in to comment.