Top |
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 * | hsts-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 |
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.
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.
first_option_name |
name of the first option to set |
|
... |
value of first option, followed by more options, |
Since: 2.10
WebKitWebsiteDataManager *
webkit_website_data_manager_new_ephemeral
(void
);
Creates an ephemeral WebKitWebsiteDataManager. See “is-ephemeral” for more details.
Since: 2.16
gboolean
webkit_website_data_manager_is_ephemeral
(WebKitWebsiteDataManager *manager
);
Get whether a WebKitWebsiteDataManager is ephemeral. See “is-ephemeral” for more details.
Since: 2.16
const gchar *
webkit_website_data_manager_get_base_data_directory
(WebKitWebsiteDataManager *manager
);
Get the “base-data-directory” property.
the base directory for Website data, or NULL
if
“base-data-directory” was not provided or manager
is ephemeral.
[allow-none]
Since: 2.10
const gchar *
webkit_website_data_manager_get_base_cache_directory
(WebKitWebsiteDataManager *manager
);
Get the “base-cache-directory” property.
the base directory for Website cache, or NULL
if
“base-cache-directory” was not provided or manager
is ephemeral.
[allow-none]
Since: 2.10
const gchar *
webkit_website_data_manager_get_local_storage_directory
(WebKitWebsiteDataManager *manager
);
Get the “local-storage-directory” property.
the directory where local storage data is stored or NULL
if manager
is ephemeral.
[allow-none]
Since: 2.10
const gchar *
webkit_website_data_manager_get_disk_cache_directory
(WebKitWebsiteDataManager *manager
);
Get the “disk-cache-directory” property.
Since: 2.10
const gchar *
webkit_website_data_manager_get_offline_application_cache_directory
(WebKitWebsiteDataManager *manager
);
Get the “offline-application-cache-directory” property.
the directory where offline web application cache is stored or NULL
if manager
is ephemeral.
[allow-none]
Since: 2.10
const gchar *
webkit_website_data_manager_get_indexeddb_directory
(WebKitWebsiteDataManager *manager
);
Get the “indexeddb-directory” property.
the directory where IndexedDB databases are stored or NULL
if manager
is ephemeral.
[allow-none]
Since: 2.10
const gchar *
webkit_website_data_manager_get_websql_directory
(WebKitWebsiteDataManager *manager
);
webkit_website_data_manager_get_websql_directory
has been deprecated since version 2.24. and should not be used in newly-written code.
WebSQL is no longer supported. Use IndexedDB instead.
Get the “websql-directory” property.
the directory where WebSQL databases are stored or NULL
if manager
is ephemeral.
[allow-none]
Since: 2.10
const gchar *
webkit_website_data_manager_get_hsts_cache_directory
(WebKitWebsiteDataManager *manager
);
Get the “hsts-cache-directory” property.
Since: 2.26
WebKitCookieManager *
webkit_website_data_manager_get_cookie_manager
(WebKitWebsiteDataManager *manager
);
Get the WebKitCookieManager of manager
.
Since: 2.16
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.
manager |
||
types |
||
cancellable |
a GCancellable or |
[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
GList * webkit_website_data_manager_fetch_finish (WebKitWebsiteDataManager *manager
,GAsyncResult *result
,GError **error
);
Finish an asynchronous operation started with webkit_website_data_manager_fetch()
.
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
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.
manager |
||
types |
||
website_data |
a GList of WebKitWebsiteData. |
[element-type WebKitWebsiteData] |
cancellable |
a GCancellable or |
[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
gboolean webkit_website_data_manager_remove_finish (WebKitWebsiteDataManager *manager
,GAsyncResult *result
,GError **error
);
Finish an asynchronous operation started with webkit_website_data_manager_remove()
.
Since: 2.16
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.
manager |
||
types |
||
timespan |
||
cancellable |
a GCancellable or |
[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
gboolean webkit_website_data_manager_clear_finish (WebKitWebsiteDataManager *manager
,GAsyncResult *result
,GError **error
);
Finish an asynchronous operation started with webkit_website_data_manager_clear()
Since: 2.16
“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.
Owner: WebKitWebsiteDataManager
Flags: Read / Write / Construct Only
Default value: NULL
Since: 2.10
“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.
Owner: WebKitWebsiteDataManager
Flags: Read / Write / Construct Only
Default value: NULL
Since: 2.10
“disk-cache-directory”
property“disk-cache-directory” gchar *
The directory where HTTP disk cache will be stored.
Owner: WebKitWebsiteDataManager
Flags: Read / Write / Construct Only
Default value: NULL
Since: 2.10
“hsts-cache-directory”
property“hsts-cache-directory” gchar *
The directory where the HTTP Strict-Transport-Security (HSTS) cache will be stored.
Owner: WebKitWebsiteDataManager
Flags: Read / Write / Construct Only
Default value: NULL
Since: 2.26
“indexeddb-directory”
property“indexeddb-directory” gchar *
The directory where IndexedDB databases will be stored.
Owner: WebKitWebsiteDataManager
Flags: Read / Write / Construct Only
Default value: NULL
Since: 2.10
“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.
Owner: WebKitWebsiteDataManager
Flags: Read / Write / Construct Only
Default value: FALSE
Since: 2.16
“local-storage-directory”
property“local-storage-directory” gchar *
The directory where local storage data will be stored.
Owner: WebKitWebsiteDataManager
Flags: Read / Write / Construct Only
Default value: NULL
Since: 2.10
“offline-application-cache-directory”
property“offline-application-cache-directory” gchar *
The directory where offline web application cache will be stored.
Owner: WebKitWebsiteDataManager
Flags: Read / Write / Construct Only
Default value: NULL
Since: 2.10
“websql-directory”
property“websql-directory” gchar *
The directory where WebSQL databases will be stored.
WebKitWebsiteDataManager:websql-directory
has been deprecated since version 2.24. and should not be used in newly-written code.
WebSQL is no longer supported. Use IndexedDB instead.
Owner: WebKitWebsiteDataManager
Flags: Read / Write / Construct Only
Default value: NULL
Since: 2.10