Setting Unlimited Storage in CEF

Having problems with building or using CEF's C/C++ APIs? This forum is here to help. Please do not post bug reports or feature requests here.

Setting Unlimited Storage in CEF

Postby stmcpherson » Tue Feb 14, 2012 9:34 pm

I am developing an application that runs completely on the client (all app code is offline).

I'm hitting an error " TypeError: Cannot call method 'requestQuota' of undefined " when we try to run the following code
Code: Select all
try{
                window.requestFileSystem  = window.requestFileSystem || window.webkitRequestFileSystem;
                //persistent storage request
                window.webkitStorageInfo.requestQuota(PERSISTENT, 1024*1024, function(grantedBytes) {
                    window.requestFileSystem(PERSISTENT, grantedBytes, function(fs) {
                        Ext.getCmp('infoLog').update('<div>callback returned the filesystem object '+fs+'</div>');
                    },function errorHandler(error){
                        Ext.getCmp('errorLog').update('<div>fs init error on  requestFileSystem: '+error+'</div>');
                    });
                },function errorHandler(error){
                    Ext.getCmp('errorLog').update('<div>fs init error on requestQuota: '+error+'</div>');
                });
            //temporary storage request
            //window.requestFileSystem(window.TEMPORARY, 1024 * 1024, function(fs) {
            //    ViewsUtils.fs = fs;
            //}, this.opt_errorHandler);
            } catch(error){
                Ext.getCmp('errorLog').update('<div>cef issues : '+error+'</div>');
                console.log("cef issues : "+error);
            }


Is there a way to set the available local storage to unlimited similar to the "unlimitedStorage" parameter of chrome extensions? (as discussed in http://updates.html5rocks.com/tag/filesystem )

Any ideas on a workarround for this?
stmcpherson
Techie
 
Posts: 32
Joined: Tue Feb 14, 2012 1:48 am

Re: Setting Unlimited Storage in CEF

Postby magreenblatt » Wed Feb 15, 2012 12:27 pm

You can set the storage limits using CefSettings.local_storage_quota and session_storage_quota. The value is in bytes.
magreenblatt
Site Admin
 
Posts: 12382
Joined: Fri May 29, 2009 6:57 pm

Re: Setting Unlimited Storage in CEF

Postby stmcpherson » Wed Feb 22, 2012 2:58 pm

Is it appropriate to set local_storage_quota = INT_MAX to accomplish unlimited storage?
stmcpherson
Techie
 
Posts: 32
Joined: Tue Feb 14, 2012 1:48 am

Re: Setting Unlimited Storage in CEF

Postby magreenblatt » Thu Feb 23, 2012 10:34 am

stmcpherson wrote:Is it appropriate to set local_storage_quota = INT_MAX to accomplish unlimited storage?

It will be large but not unlimited. LocalStorage is not intended for storing large amounts of data (it uses a single file per origin that must be loaded into memory). You might want to use a database instead.
magreenblatt
Site Admin
 
Posts: 12382
Joined: Fri May 29, 2009 6:57 pm


Return to Support Forum

Who is online

Users browsing this forum: Google [Bot] and 39 guests