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

Unified Diff: content/browser/indexed_db/leveldb/leveldb_database.cc

Issue 16256014: IndexedDB: Convert decoding functions to pass StringPieces vs. pointers (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebased Created 7 years, 7 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/indexed_db/leveldb/leveldb_database.cc
diff --git a/content/browser/indexed_db/leveldb/leveldb_database.cc b/content/browser/indexed_db/leveldb/leveldb_database.cc
index e08d6576018ff60ab4d248a1f1529737d07fe18f..8ab0f2e801c3bdc4473fe3689bf1f294ad8dca52 100644
--- a/content/browser/indexed_db/leveldb/leveldb_database.cc
+++ b/content/browser/indexed_db/leveldb/leveldb_database.cc
@@ -242,21 +242,18 @@ bool LevelDBDatabase::Remove(const LevelDBSlice& key) {
}
bool LevelDBDatabase::Get(const LevelDBSlice& key,
- std::vector<char>& value,
+ std::string* value,
bool& found,
const LevelDBSnapshot* snapshot) {
found = false;
- std::string result;
leveldb::ReadOptions read_options;
read_options.verify_checksums = true; // TODO(jsbell): Disable this if the
// performance impact is too great.
read_options.snapshot = snapshot ? snapshot->snapshot_ : 0;
- const leveldb::Status s = db_->Get(read_options, MakeSlice(key), &result);
+ const leveldb::Status s = db_->Get(read_options, MakeSlice(key), value);
if (s.ok()) {
found = true;
- value.clear();
- value.insert(value.end(), result.begin(), result.end());
return true;
}
if (s.IsNotFound())

Powered by Google App Engine
This is Rietveld 408576698