Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(62)

Unified Diff: webkit/tools/test_shell/simple_database_system.cc

Issue 507014: Adding methods that will be used by the quota management UI.... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 10 years, 12 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « webkit/tools/test_shell/simple_database_system.h ('k') | webkit/tools/test_shell/test_shell.gyp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: webkit/tools/test_shell/simple_database_system.cc
===================================================================
--- webkit/tools/test_shell/simple_database_system.cc (revision 35502)
+++ webkit/tools/test_shell/simple_database_system.cc (working copy)
@@ -91,6 +91,7 @@
int64 estimated_size) {
int64 database_size = 0;
int64 space_available = 0;
+ database_connections_.AddConnection(origin_identifier, database_name);
db_tracker_->DatabaseOpened(origin_identifier, database_name, description,
estimated_size, &database_size, &space_available);
SetFullFilePathsForVfsFile(origin_identifier, database_name);
@@ -101,12 +102,17 @@
void SimpleDatabaseSystem::DatabaseModified(const string16& origin_identifier,
const string16& database_name) {
+ DCHECK(database_connections_.IsDatabaseOpened(
+ origin_identifier, database_name));
db_tracker_->DatabaseModified(origin_identifier, database_name);
}
void SimpleDatabaseSystem::DatabaseClosed(const string16& origin_identifier,
const string16& database_name) {
+ DCHECK(database_connections_.IsDatabaseOpened(
+ origin_identifier, database_name));
db_tracker_->DatabaseClosed(origin_identifier, database_name);
+ database_connections_.RemoveConnection(origin_identifier, database_name);
}
void SimpleDatabaseSystem::OnDatabaseSizeChanged(
@@ -114,8 +120,10 @@
const string16& database_name,
int64 database_size,
int64 space_available) {
- WebKit::WebDatabase::updateDatabaseSize(
- origin_identifier, database_name, database_size, space_available);
+ if (database_connections_.IsOriginUsed(origin_identifier)) {
+ WebKit::WebDatabase::updateDatabaseSize(
+ origin_identifier, database_name, database_size, space_available);
+ }
}
void SimpleDatabaseSystem::databaseOpened(const WebKit::WebDatabase& database) {
@@ -136,6 +144,8 @@
}
void SimpleDatabaseSystem::ClearAllDatabases() {
+ db_tracker_->CloseDatabases(database_connections_);
+ database_connections_.RemoveAllConnections();
db_tracker_->CloseTrackerDatabaseAndClearCaches();
file_util::Delete(db_tracker_->DatabaseDirectory(), true);
file_names_.clear();
« no previous file with comments | « webkit/tools/test_shell/simple_database_system.h ('k') | webkit/tools/test_shell/test_shell.gyp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698