Add CefRequestHandler::OnQuotaRequest callback for handling webkitStorageInfo.requestQuota requests (issue #732).

git-svn-id: https://chromiumembedded.googlecode.com/svn/trunk@816 5089003a-bbd8-11dd-ad1f-f1f9622dbc98
This commit is contained in:
Marshall Greenblatt
2012-09-27 22:52:15 +00:00
parent c4a2ee9b8d
commit 149ae3df88
16 changed files with 464 additions and 0 deletions

View File

@@ -68,6 +68,28 @@ typedef struct _cef_auth_callback_t {
} cef_auth_callback_t;
///
// Callback structure used for asynchronous continuation of quota requests.
///
typedef struct _cef_quota_callback_t {
///
// Base structure.
///
cef_base_t base;
///
// Continue the quota request. If |allow| is true (1) the request will be
// allowed. Otherwise, the request will be denied.
///
void (CEF_CALLBACK *cont)(struct _cef_quota_callback_t* self, int allow);
///
// Cancel the quota request.
///
void (CEF_CALLBACK *cancel)(struct _cef_quota_callback_t* self);
} cef_quota_callback_t;
///
// Implement this structure to handle events related to browser requests. The
// functions of this structure will be called on the thread indicated.
@@ -119,6 +141,18 @@ typedef struct _cef_request_handler_t {
const cef_string_t* host, int port, const cef_string_t* realm,
const cef_string_t* scheme, struct _cef_auth_callback_t* callback);
///
// Called on the IO thread when JavaScript requests a specific storage quota
// size via the webkitStorageInfo.requestQuota function. |origin_url| is the
// origin of the page making the request. |new_size| is the requested quota
// size in bytes. Return true (1) and call cef_quota_callback_t::Complete()
// either in this function or at a later time to grant or deny the request.
// Return false (0) to cancel the request.
///
int (CEF_CALLBACK *on_quota_request)(struct _cef_request_handler_t* self,
struct _cef_browser_t* browser, const cef_string_t* origin_url,
int64 new_size, struct _cef_quota_callback_t* callback);
///
// Called on the IO thread to retrieve the cookie manager. |main_url| is the
// URL of the top-level frame. Cookies managers can be unique per browser or