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/common/database_messages.h | |
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/common/database_messages.h')
-rw-r--r-- | content/common/database_messages.h | 17 |
1 files changed, 15 insertions, 2 deletions
diff --git a/content/common/database_messages.h b/content/common/database_messages.h index f8d2d18..a9dc55b 100644 --- a/content/common/database_messages.h +++ b/content/common/database_messages.h @@ -13,12 +13,20 @@ // Database messages sent from the browser to the renderer. // Notifies the child process of the new database size -IPC_MESSAGE_CONTROL4(DatabaseMsg_UpdateSize, +IPC_MESSAGE_CONTROL3(DatabaseMsg_UpdateSize, string16 /* the origin */, string16 /* the database name */, - int64 /* the new database size */, + int64 /* the new database size */) + +// Notifies the child process of the new space available +IPC_MESSAGE_CONTROL2(DatabaseMsg_UpdateSpaceAvailable, + string16 /* the origin */, int64 /* space available to origin */) +// Notifies the child process to reset it's cached value for the origin. +IPC_MESSAGE_CONTROL1(DatabaseMsg_ResetSpaceAvailable, + string16 /* the origin */) + // Asks the child process to close a database immediately IPC_MESSAGE_CONTROL2(DatabaseMsg_CloseImmediately, string16 /* the origin */, @@ -48,6 +56,11 @@ IPC_SYNC_MESSAGE_CONTROL1_1(DatabaseHostMsg_GetFileSize, string16 /* vfs file name */, int64 /* the size of the given DB file */) +// Asks the browser process for the amount of space available to an origin +IPC_SYNC_MESSAGE_CONTROL1_1(DatabaseHostMsg_GetSpaceAvailable, + string16 /* origin identifier */, + int64 /* remaining space available */) + // Notifies the browser process that a new database has been opened IPC_MESSAGE_CONTROL4(DatabaseHostMsg_Opened, string16 /* origin identifier */, |