diff options
author | michaeln@google.com <michaeln@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-05-25 00:34:32 +0000 |
---|---|---|
committer | michaeln@google.com <michaeln@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-05-25 00:34:32 +0000 |
commit | db4d4981a0089230ac88060d7c817e054de3f2e2 (patch) | |
tree | 2cfd032c1fdb6aece674d7a83d8a39ffeb410578 /content/worker | |
parent | 80c2915f7a7e3857b52fceb22fd7ce30a4e3ec20 (diff) | |
download | chromium_src-db4d4981a0089230ac88060d7c817e054de3f2e2.zip chromium_src-db4d4981a0089230ac88060d7c817e054de3f2e2.tar.gz chromium_src-db4d4981a0089230ac88060d7c817e054de3f2e2.tar.bz2 |
Use the QuotaManager to determine the space available to WebSQLDatabases. Since activity outside of the database system now affect how much space is available, our strategy for informing the client side of the new limit needed to change. It's not enough to just send the new limit when a change within the DB system has occurred.
This change depends on a webkit/webcore change.
https://bugs.webkit.org/show_bug.cgi?id=60985
In this CL the renderer will ask the browser for the limit when needed. But also in this CL are ipc plumbing additions to support notifying the renderer as changes occur. That plumbing will be utilized in a later CL.
* [Chrome] DatabaseMessageFilter uses the QuotaManager respond to the SpaceAvailable query.
* [DRT] SimpleDatabaseSystem uses quota_per_origin_ data member to respond to the SpaceAvailable query.
* Mostly mind numbing plumbing for WebKit API additions.
// Sync getter for use on webcore's background db threads to
// call out to chrome to get the value.
long long WebKitClient::databaseGetSpaceAvailableForOrigin(origin_identifier);
// Split the existing updateDatabaseSize method into three methods. Chrome calls into these.
static void WebDatabase::updateDatabaseSize(originIdentifier, dbname, spaceAvailable);
static void WebDatabase::updateSpaceAvailable(originIdentifier, spaceAvailable);
static void WebDatabase::resetSpaceAvailable(originIdentifier);
Review URL: http://codereview.chromium.org/7037018
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@86537 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'content/worker')
-rw-r--r-- | content/worker/worker_webkitclient_impl.cc | 13 | ||||
-rw-r--r-- | content/worker/worker_webkitclient_impl.h | 2 |
2 files changed, 11 insertions, 4 deletions
diff --git a/content/worker/worker_webkitclient_impl.cc b/content/worker/worker_webkitclient_impl.cc index 0da3322..75a822b 100644 --- a/content/worker/worker_webkitclient_impl.cc +++ b/content/worker/worker_webkitclient_impl.cc @@ -178,22 +178,27 @@ WebSharedWorkerRepository* WorkerWebKitClientImpl::sharedWorkerRepository() { WebKitClient::FileHandle WorkerWebKitClientImpl::databaseOpenFile( const WebString& vfs_file_name, int desired_flags) { - return DatabaseUtil::databaseOpenFile(vfs_file_name, desired_flags); + return DatabaseUtil::DatabaseOpenFile(vfs_file_name, desired_flags); } int WorkerWebKitClientImpl::databaseDeleteFile( const WebString& vfs_file_name, bool sync_dir) { - return DatabaseUtil::databaseDeleteFile(vfs_file_name, sync_dir); + return DatabaseUtil::DatabaseDeleteFile(vfs_file_name, sync_dir); } long WorkerWebKitClientImpl::databaseGetFileAttributes( const WebString& vfs_file_name) { - return DatabaseUtil::databaseGetFileAttributes(vfs_file_name); + return DatabaseUtil::DatabaseGetFileAttributes(vfs_file_name); } long long WorkerWebKitClientImpl::databaseGetFileSize( const WebString& vfs_file_name) { - return DatabaseUtil::databaseGetFileSize(vfs_file_name); + return DatabaseUtil::DatabaseGetFileSize(vfs_file_name); +} + +long long WorkerWebKitClientImpl::databaseGetSpaceAvailableForOrigin( + const WebString& origin_identifier) { + return DatabaseUtil::DatabaseGetSpaceAvailable(origin_identifier); } WebMimeRegistry::SupportsType WorkerWebKitClientImpl::supportsMIMEType( diff --git a/content/worker/worker_webkitclient_impl.h b/content/worker/worker_webkitclient_impl.h index dd2c0a7..d38db0e 100644 --- a/content/worker/worker_webkitclient_impl.h +++ b/content/worker/worker_webkitclient_impl.h @@ -57,6 +57,8 @@ class WorkerWebKitClientImpl : public webkit_glue::WebKitClientImpl, const WebKit::WebString& vfs_file_name); virtual long long databaseGetFileSize( const WebKit::WebString& vfs_file_name); + virtual long long databaseGetSpaceAvailableForOrigin( + const WebKit::WebString& origin_identifier); virtual WebKit::WebBlobRegistry* blobRegistry(); |