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

Unified Diff: content/browser/in_process_webkit/indexed_db_dispatcher_host.cc

Issue 10695158: IndexedDB: Close open databases when user requests browsing data deletion (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Remove const from iterator (not sure how this slipped through) Created 8 years, 3 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
Index: content/browser/in_process_webkit/indexed_db_dispatcher_host.cc
diff --git a/content/browser/in_process_webkit/indexed_db_dispatcher_host.cc b/content/browser/in_process_webkit/indexed_db_dispatcher_host.cc
index fd8f318e1c1901f4d97fd7a84259bc0f445621dc..fedcafc4295dcbde3a052f7777a5ee2be7d8791b 100644
--- a/content/browser/in_process_webkit/indexed_db_dispatcher_host.cc
+++ b/content/browser/in_process_webkit/indexed_db_dispatcher_host.cc
@@ -164,7 +164,7 @@ int32 IndexedDBDispatcherHost::Add(WebIDBDatabase* idb_database,
return 0;
}
int32 idb_database_id = database_dispatcher_host_->map_.Add(idb_database);
- Context()->ConnectionOpened(origin_url);
+ Context()->ConnectionOpened(origin_url, idb_database);
database_dispatcher_host_->database_url_map_[idb_database_id] = origin_url;
return idb_database_id;
}
@@ -301,9 +301,10 @@ IndexedDBDispatcherHost::DatabaseDispatcherHost::~DatabaseDispatcherHost() {
for (WebIDBObjectIDToURLMap::iterator iter = database_url_map_.begin();
iter != database_url_map_.end(); iter++) {
WebIDBDatabase* database = map_.Lookup(iter->first);
- if (database)
+ if (database) {
database->close();
- parent_->Context()->ConnectionClosed(iter->second);
+ parent_->Context()->ConnectionClosed(iter->second, database);
+ }
}
}
@@ -473,7 +474,8 @@ void IndexedDBDispatcherHost::DatabaseDispatcherHost::OnClose(
void IndexedDBDispatcherHost::DatabaseDispatcherHost::OnDestroyed(
int32 object_id) {
- parent_->Context()->ConnectionClosed(database_url_map_[object_id]);
+ WebIDBDatabase* database = map_.Lookup(object_id);
+ parent_->Context()->ConnectionClosed(database_url_map_[object_id], database);
database_url_map_.erase(object_id);
parent_->DestroyObject(&map_, object_id);
}

Powered by Google App Engine
This is Rietveld 408576698