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

Unified Diff: storage/common/database/database_connections.cc

Issue 442383002: Move storage-related files from webkit/ to new top-level directory storage/ (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: . Created 6 years, 4 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 | « storage/common/database/database_connections.h ('k') | storage/common/database/database_identifier.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: storage/common/database/database_connections.cc
diff --git a/webkit/common/database/database_connections.cc b/storage/common/database/database_connections.cc
similarity index 88%
rename from webkit/common/database/database_connections.cc
rename to storage/common/database/database_connections.cc
index f85cbd68bb6c79993ce094bde51d50391bdf699e..9e46d4a3a806f7d812c42efa87c8f6126a986a8a 100644
--- a/webkit/common/database/database_connections.cc
+++ b/storage/common/database/database_connections.cc
@@ -2,7 +2,7 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-#include "webkit/common/database/database_connections.h"
+#include "storage/common/database/database_connections.h"
#include "base/auto_reset.h"
#include "base/bind.h"
@@ -39,9 +39,8 @@ bool DatabaseConnections::IsOriginUsed(
return (connections_.find(origin_identifier) != connections_.end());
}
-bool DatabaseConnections::AddConnection(
- const std::string& origin_identifier,
- const base::string16& database_name) {
+bool DatabaseConnections::AddConnection(const std::string& origin_identifier,
+ const base::string16& database_name) {
int& count = connections_[origin_identifier][database_name].first;
return ++count == 1;
}
@@ -65,9 +64,10 @@ void DatabaseConnections::RemoveConnections(
origin_it++) {
const DBConnections& db_connections = origin_it->second;
for (DBConnections::const_iterator db_it = db_connections.begin();
- db_it != db_connections.end(); db_it++) {
- if (RemoveConnectionsHelper(origin_it->first, db_it->first,
- db_it->second.first))
+ db_it != db_connections.end();
+ db_it++) {
+ if (RemoveConnectionsHelper(
+ origin_it->first, db_it->first, db_it->second.first))
closed_dbs->push_back(std::make_pair(origin_it->first, db_it->first));
}
}
@@ -89,14 +89,14 @@ void DatabaseConnections::SetOpenDatabaseSize(
}
void DatabaseConnections::ListConnections(
- std::vector<std::pair<std::string, base::string16> > *list) const {
- for (OriginConnections::const_iterator origin_it =
- connections_.begin();
+ std::vector<std::pair<std::string, base::string16> >* list) const {
+ for (OriginConnections::const_iterator origin_it = connections_.begin();
origin_it != connections_.end();
origin_it++) {
const DBConnections& db_connections = origin_it->second;
for (DBConnections::const_iterator db_it = db_connections.begin();
- db_it != db_connections.end(); db_it++) {
+ db_it != db_connections.end();
+ db_it++) {
list->push_back(std::make_pair(origin_it->first, db_it->first));
}
}
@@ -162,8 +162,10 @@ void DatabaseConnectionsWrapper::RemoveOpenConnection(
if (!main_thread_->BelongsToCurrentThread()) {
main_thread_->PostTask(
FROM_HERE,
- base::Bind(&DatabaseConnectionsWrapper::RemoveOpenConnection, this,
- origin_identifier, database_name));
+ base::Bind(&DatabaseConnectionsWrapper::RemoveOpenConnection,
+ this,
+ origin_identifier,
+ database_name));
return;
}
base::AutoLock auto_lock(open_connections_lock_);
« no previous file with comments | « storage/common/database/database_connections.h ('k') | storage/common/database/database_identifier.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698