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

Unified Diff: components/leveldb_proto/leveldb_database.cc

Issue 545193008: Use base::StringPairs where appropriate from /components (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 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
« no previous file with comments | « components/leveldb_proto/leveldb_database.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: components/leveldb_proto/leveldb_database.cc
diff --git a/components/leveldb_proto/leveldb_database.cc b/components/leveldb_proto/leveldb_database.cc
index b8af59cc75553855a2c59bcbe7ceb7f986cba93c..65d68a9d138da76dbfd6274abb05e4b1d19f2f2f 100644
--- a/components/leveldb_proto/leveldb_database.cc
+++ b/components/leveldb_proto/leveldb_database.cc
@@ -10,6 +10,7 @@
#include "base/files/file_path.h"
#include "base/files/file_util.h"
#include "base/memory/scoped_ptr.h"
+#include "base/strings/string_split.h"
#include "base/threading/thread_checker.h"
#include "third_party/leveldatabase/src/include/leveldb/db.h"
#include "third_party/leveldatabase/src/include/leveldb/iterator.h"
@@ -51,15 +52,14 @@ bool LevelDB::Init(const base::FilePath& database_dir) {
return false;
}
-bool LevelDB::Save(
- const std::vector<std::pair<std::string, std::string> >& entries_to_save,
- const std::vector<std::string>& keys_to_remove) {
+bool LevelDB::Save(const base::StringPairs& entries_to_save,
+ const std::vector<std::string>& keys_to_remove) {
DFAKE_SCOPED_LOCK(thread_checker_);
leveldb::WriteBatch updates;
- for (std::vector<std::pair<std::string, std::string> >::const_iterator it =
- entries_to_save.begin();
- it != entries_to_save.end(); ++it) {
+ for (base::StringPairs::const_iterator it = entries_to_save.begin();
+ it != entries_to_save.end();
+ ++it) {
updates.Put(leveldb::Slice(it->first), leveldb::Slice(it->second));
}
for (std::vector<std::string>::const_iterator it = keys_to_remove.begin();
« no previous file with comments | « components/leveldb_proto/leveldb_database.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698