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,27 @@ class CefAuthCallback : public virtual CefBase {
};
///
// Callback interface used for asynchronous continuation of quota requests.
///
/*--cef(source=library)--*/
class CefQuotaCallback : public virtual CefBase {
public:
///
// Continue the quota request. If |allow| is true the request will be
// allowed. Otherwise, the request will be denied.
///
/*--cef(capi_name=cont)--*/
virtual void Continue(bool allow) =0;
///
// Cancel the quota request.
///
/*--cef()--*/
virtual void Cancel() =0;
};
///
// Implement this interface to handle events related to browser requests. The
// methods of this class will be called on the thread indicated.
@ -131,6 +152,22 @@ class CefRequestHandler : public virtual CefBase {
return false;
}
///
// 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 and call CefQuotaCallback::Complete() either in
// this function or at a later time to grant or deny the request. Return false
// to cancel the request.
///
/*--cef(optional_param=realm)--*/
virtual bool OnQuotaRequest(CefRefPtr<CefBrowser> browser,
const CefString& origin_url,
int64 new_size,
CefRefPtr<CefQuotaCallback> callback) {
return false;
}
///
// 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