WebKitWebsiteDataManager

WebKitWebsiteDataManager — Website data manager

Functions

Properties

gchar * base-cache-directory Read / Write / Construct Only
gchar * base-data-directory Read / Write / Construct Only
gchar * disk-cache-directory Read / Write / Construct Only
gchar * indexeddb-directory Read / Write / Construct Only
gboolean is-ephemeral Read / Write / Construct Only
gchar * local-storage-directory Read / Write / Construct Only
gchar * offline-application-cache-directory Read / Write / Construct Only
gchar * websql-directory Read / Write / Construct Only

Types and Values

Object Hierarchy

    GObject
    ╰── WebKitWebsiteDataManager

Description

WebKitWebsiteDataManager allows you to manage the data that websites can store in the client file system like databases or caches. You can use WebKitWebsiteDataManager to configure the local directories where the Website data will be stored, by creating a new manager with webkit_website_data_manager_new() passing the values you want to set. You can set all the possible configuration values or only some of them, a default value will be used automatically for the configuration options not provided. “base-data-directory” and “base-cache-directory” are two special properties that can be used to set a common base directory for all Website data and caches. It's possible to provide both, a base directory and a specific value, but in that case, the specific value takes precedence over the base directory. The newly created WebKitWebsiteDataManager must be passed as a construct property to a WebKitWebContext, you can use webkit_web_context_new_with_website_data_manager() to create a new WebKitWebContext with a WebKitWebsiteDataManager. In case you don't want to set any specific configuration, you don't need to create a WebKitWebsiteDataManager, the WebKitWebContext will create a WebKitWebsiteDataManager with the default configuration. To get the WebKitWebsiteDataManager of a WebKitWebContext you can use webkit_web_context_get_website_data_manager().

A WebKitWebsiteDataManager can also be ephemeral and then all the directories configuration is not needed because website data will never persist. You can create an ephemeral WebKitWebsiteDataManager with webkit_website_data_manager_new_ephemeral(). Then you can pass an ephemeral WebKitWebsiteDataManager to a WebKitWebContext to make it ephemeral or use webkit_web_context_new_ephemeral() and the WebKitWebsiteDataManager will be automatically created by the WebKitWebContext.

WebKitWebsiteDataManager can also be used to fetch websites data, remove data stored by particular websites, or clear data for all websites modified since a given period of time.

Functions

webkit_website_data_manager_new ()

WebKitWebsiteDataManager *
webkit_website_data_manager_new (const gchar *first_option_name,
                                 ...);

Creates a new WebKitWebsiteDataManager with the given options. It must be passed as construction parameter of a WebKitWebContext.

Parameters

first_option_name

name of the first option to set

 

...

value of first option, followed by more options, NULL-terminated

 

Returns

the newly created WebKitWebsiteDataManager.

[transfer full]

Since: 2.10


webkit_website_data_manager_new_ephemeral ()

WebKitWebsiteDataManager *
webkit_website_data_manager_new_ephemeral
                               (void);

Creates an ephemeral WebKitWebsiteDataManager. See “is-ephemeral” for more details.

Returns

a new ephemeral WebKitWebsiteDataManager.

[transfer full]

Since: 2.16


webkit_website_data_manager_is_ephemeral ()

gboolean
webkit_website_data_manager_is_ephemeral
                               (WebKitWebsiteDataManager *manager);

Get whether a WebKitWebsiteDataManager is ephemeral. See “is-ephemeral” for more details.

Parameters

Returns

TRUE if manager is epheral or FALSE otherwise.

Since: 2.16


webkit_website_data_manager_get_base_data_directory ()

const gchar *
webkit_website_data_manager_get_base_data_directory
                               (WebKitWebsiteDataManager *manager);

Get the “base-data-directory” property.

Parameters

Returns

the base directory for Website data, or NULL if “base-data-directory” was not provided or manager is ephemeral.

[allow-none]

Since: 2.10


webkit_website_data_manager_get_base_cache_directory ()

const gchar *
webkit_website_data_manager_get_base_cache_directory
                               (WebKitWebsiteDataManager *manager);

Get the “base-cache-directory” property.

Parameters

Returns

the base directory for Website cache, or NULL if “base-cache-directory” was not provided or manager is ephemeral.

[allow-none]

Since: 2.10


webkit_website_data_manager_get_local_storage_directory ()

const gchar *
webkit_website_data_manager_get_local_storage_directory
                               (WebKitWebsiteDataManager *manager);

Get the “local-storage-directory” property.

Parameters

Returns

the directory where local storage data is stored or NULL if manager is ephemeral.

[allow-none]

Since: 2.10


webkit_website_data_manager_get_disk_cache_directory ()

const gchar *
webkit_website_data_manager_get_disk_cache_directory
                               (WebKitWebsiteDataManager *manager);

Get the “disk-cache-directory” property.

Parameters

Returns

the directory where HTTP disk cache is stored or NULL if manager is ephemeral.

[allow-none]

Since: 2.10


webkit_website_data_manager_get_offline_application_cache_directory ()

const gchar *
webkit_website_data_manager_get_offline_application_cache_directory
                               (WebKitWebsiteDataManager *manager);

Get the “offline-application-cache-directory” property.

Parameters

Returns

the directory where offline web application cache is stored or NULL if manager is ephemeral.

[allow-none]

Since: 2.10


webkit_website_data_manager_get_indexeddb_directory ()

const gchar *
webkit_website_data_manager_get_indexeddb_directory
                               (WebKitWebsiteDataManager *manager);

Get the “indexeddb-directory” property.

Parameters

Returns

the directory where IndexedDB databases are stored or NULL if manager is ephemeral.

[allow-none]

Since: 2.10


webkit_website_data_manager_get_websql_directory ()

const gchar *
webkit_website_data_manager_get_websql_directory
                               (WebKitWebsiteDataManager *manager);

Get the “websql-directory” property.

Parameters

Returns

the directory where WebSQL databases are stored or NULL if manager is ephemeral.

[allow-none]

Since: 2.10


webkit_website_data_manager_get_cookie_manager ()

WebKitCookieManager *
webkit_website_data_manager_get_cookie_manager
                               (WebKitWebsiteDataManager *manager);

Get the WebKitCookieManager of manager .

Parameters

Returns

a WebKitCookieManager.

[transfer none]

Since: 2.16


webkit_website_data_manager_fetch ()

void
webkit_website_data_manager_fetch (WebKitWebsiteDataManager *manager,
                                   WebKitWebsiteDataTypes types,
                                   GCancellable *cancellable,
                                   GAsyncReadyCallback callback,
                                   gpointer user_data);

Asynchronously get the list of WebKitWebsiteData for the given types .

When the operation is finished, callback will be called. You can then call webkit_website_data_manager_fetch_finish() to get the result of the operation.

Parameters

manager

a WebKitWebsiteDataManager

 

types

WebKitWebsiteDataTypes

 

cancellable

a GCancellable or NULL to ignore.

[allow-none]

callback

a GAsyncReadyCallback to call when the request is satisfied.

[scope async]

user_data

the data to pass to callback function.

[closure]

Since: 2.16


webkit_website_data_manager_fetch_finish ()

GList *
webkit_website_data_manager_fetch_finish
                               (WebKitWebsiteDataManager *manager,
                                GAsyncResult *result,
                                GError **error);

Finish an asynchronous operation started with webkit_website_data_manager_fetch().

Parameters

manager

a WebKitWebsiteDataManager

 

result

a GAsyncResult

 

error

return location for error or NULL to ignore

 

Returns

a GList of WebKitWebsiteData. You must free the GList with g_list_free() and unref the WebKitWebsiteDatas with webkit_website_data_unref() when you're done with them.

[element-type WebKitWebsiteData][transfer full]

Since: 2.16


webkit_website_data_manager_remove ()

void
webkit_website_data_manager_remove (WebKitWebsiteDataManager *manager,
                                    WebKitWebsiteDataTypes types,
                                    GList *website_data,
                                    GCancellable *cancellable,
                                    GAsyncReadyCallback callback,
                                    gpointer user_data);

Asynchronously removes the website data of the for the given types for websites in the given website_data list. Use webkit_website_data_manager_clear() if you want to remove the website data for all sites.

When the operation is finished, callback will be called. You can then call webkit_website_data_manager_remove_finish() to get the result of the operation.

Parameters

manager

a WebKitWebsiteDataManager

 

types

WebKitWebsiteDataTypes

 

website_data

a GList of WebKitWebsiteData.

[element-type WebKitWebsiteData]

cancellable

a GCancellable or NULL to ignore.

[allow-none]

callback

a GAsyncReadyCallback to call when the request is satisfied.

[scope async]

user_data

the data to pass to callback function.

[closure]

Since: 2.16


webkit_website_data_manager_remove_finish ()

gboolean
webkit_website_data_manager_remove_finish
                               (WebKitWebsiteDataManager *manager,
                                GAsyncResult *result,
                                GError **error);

Finish an asynchronous operation started with webkit_website_data_manager_remove().

Parameters

manager

a WebKitWebsiteDataManager

 

result

a GAsyncResult

 

error

return location for error or NULL to ignore

 

Returns

TRUE if website data resources were successfully removed, or FALSE otherwise.

Since: 2.16


webkit_website_data_manager_clear ()

void
webkit_website_data_manager_clear (WebKitWebsiteDataManager *manager,
                                   WebKitWebsiteDataTypes types,
                                   GTimeSpan timespan,
                                   GCancellable *cancellable,
                                   GAsyncReadyCallback callback,
                                   gpointer user_data);

Asynchronously clear the website data of the given types modified in the past timespan . If timespan is 0, all website data will be removed.

When the operation is finished, callback will be called. You can then call webkit_website_data_manager_clear_finish() to get the result of the operation.

Due to implementation limitations, this function does not currently delete any stored cookies if timespan is nonzero. This behavior may change in the future.

Parameters

manager

a WebKitWebsiteDataManager

 

types

WebKitWebsiteDataTypes

 

timespan

a GTimeSpan

 

cancellable

a GCancellable or NULL to ignore.

[allow-none]

callback

a GAsyncReadyCallback to call when the request is satisfied.

[scope async]

user_data

the data to pass to callback function.

[closure]

Since: 2.16


webkit_website_data_manager_clear_finish ()

gboolean
webkit_website_data_manager_clear_finish
                               (WebKitWebsiteDataManager *manager,
                                GAsyncResult *result,
                                GError **error);

Finish an asynchronous operation started with webkit_website_data_manager_clear()

Parameters

manager

a WebKitWebsiteDataManager

 

result

a GAsyncResult

 

error

return location for error or NULL to ignore

 

Returns

TRUE if website data was successfully cleared, or FALSE otherwise.

Since: 2.16

Types and Values

struct WebKitWebsiteDataManager

struct WebKitWebsiteDataManager;

Property Details

The “base-cache-directory” property

  “base-cache-directory”     gchar *

The base directory for Website cache. This is used as a base directory for any Website cache when no specific cache directory has been provided.

Flags: Read / Write / Construct Only

Default value: NULL

Since: 2.10


The “base-data-directory” property

  “base-data-directory”      gchar *

The base directory for Website data. This is used as a base directory for any Website data when no specific data directory has been provided.

Flags: Read / Write / Construct Only

Default value: NULL

Since: 2.10


The “disk-cache-directory” property

  “disk-cache-directory”     gchar *

The directory where HTTP disk cache will be stored.

Flags: Read / Write / Construct Only

Default value: NULL

Since: 2.10


The “indexeddb-directory” property

  “indexeddb-directory”      gchar *

The directory where IndexedDB databases will be stored.

Flags: Read / Write / Construct Only

Default value: NULL

Since: 2.10


The “is-ephemeral” property

  “is-ephemeral”             gboolean

Whether the WebKitWebsiteDataManager is ephemeral. An ephemeral WebKitWebsiteDataManager handles all websites data as non-persistent, and nothing will be written to the client storage. Note that if you create an ephemeral WebKitWebsiteDataManager all other construction parameters to configure data directories will be ignored.

Flags: Read / Write / Construct Only

Default value: FALSE

Since: 2.16


The “local-storage-directory” property

  “local-storage-directory”  gchar *

The directory where local storage data will be stored.

Flags: Read / Write / Construct Only

Default value: NULL

Since: 2.10


The “offline-application-cache-directory” property

  “offline-application-cache-directory” gchar *

The directory where offline web application cache will be stored.

Flags: Read / Write / Construct Only

Default value: NULL

Since: 2.10


The “websql-directory” property

  “websql-directory”         gchar *

The directory where WebSQL databases will be stored.

Flags: Read / Write / Construct Only

Default value: NULL

Since: 2.10

See Also

WebKitWebContext, WebKitWebsiteData