cztomczak/phpdesktop

HTML5 persistent storage - quota requests are denied

GoogleCodeExporter opened this issue · 2 comments

Need to implement CefRequestHandler::OnQuotaRequest:

  ///
  // 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::Continue() either in
  // this method 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;
  } 

Original issue reported on code.google.com by czarek.t...@gmail.com on 2 May 2014 at 6:26

A javascript example for requesting additional space for local storage or 
indexed db:

https://code.google.com/p/phpdesktop/source/browse/phpdesktop-chrome/www/request
-quota.php?r=a08269c0e01b

Currently it doesn't work, the result is "Granted 0 bytes". OnQuotaRequest 
needs to be implemented to fix this.

Shall we allow all quota requests? Or should it be configurable through 
settings.json? For 127.0.0.1 all requests should be allowed. For other internet 
domains a limit in the settings.json file may be a good idea.

Original comment by czarek.t...@gmail.com on 3 May 2014 at 8:03

Fixed on Linux in commit 170d7c3.