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

Unified Diff: chrome/browser/value_store/leveldb_value_store.h

Issue 10956008: Revert 157713 - Make database failures in LeveldbValueStore more descriptive. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: 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
« no previous file with comments | « no previous file | chrome/browser/value_store/leveldb_value_store.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/value_store/leveldb_value_store.h
===================================================================
--- chrome/browser/value_store/leveldb_value_store.h (revision 157722)
+++ chrome/browser/value_store/leveldb_value_store.h (working copy)
@@ -45,27 +45,29 @@
// Ownership of db is taken.
LeveldbValueStore(const FilePath& db_path, leveldb::DB* db);
- // Reads a setting from the database. Returns the error message on failure,
- // or "" on success in which case |setting| will be reset to the Value read
- // from the database. This value may be NULL.
- std::string ReadFromDb(
+ // Reads a setting from the database. Returns whether the read was
+ // successful, in which case |setting| will be reset to the Value read
+ // from the database. This value may be NULL.
+ bool ReadFromDb(
leveldb::ReadOptions options,
const std::string& key,
// Will be reset() with the result, if any.
scoped_ptr<Value>* setting);
- // Adds a setting to a WriteBatch, and logs the change in |changes|. For use
- // with WriteToDb. Returns the error message on failure, or "" on success.
- std::string AddToBatch(
+ // Adds a setting to a WriteBatch, and logs the change in |changes|. For
+ // use with WriteToDb.
+ bool AddToBatch(
ValueStore::WriteOptions options,
const std::string& key,
const base::Value& value,
leveldb::WriteBatch* batch,
ValueStoreChangeList* changes);
- // Commits the changes in |batch| to the database, returning the error message
- // on failure or "" on success.
- std::string WriteToDb(leveldb::WriteBatch* batch);
+ // Commits the changes in |batch| to the database, and returns a WriteResult
+ // with the changes.
+ WriteResult WriteToDb(
+ leveldb::WriteBatch* batch,
+ scoped_ptr<ValueStoreChangeList> changes);
// Returns whether the database is empty.
bool IsEmpty();
« no previous file with comments | « no previous file | chrome/browser/value_store/leveldb_value_store.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698