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

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

Issue 10928227: Make database failures in LeveldbValueStore more descriptive. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: remove ternary ifs, ms doesnt like 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
diff --git a/chrome/browser/value_store/leveldb_value_store.h b/chrome/browser/value_store/leveldb_value_store.h
index f98613e191984466ec4ad7fd582a43562281fa14..b49b70863f451d5b2e43e80ba3ece30264dffb60 100644
--- a/chrome/browser/value_store/leveldb_value_store.h
+++ b/chrome/browser/value_store/leveldb_value_store.h
@@ -45,29 +45,27 @@ class LeveldbValueStore : public ValueStore {
// Ownership of db is taken.
LeveldbValueStore(const FilePath& db_path, leveldb::DB* db);
- // 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(
+ // 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(
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.
- bool AddToBatch(
+ // 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(
ValueStore::WriteOptions options,
const std::string& key,
const base::Value& value,
leveldb::WriteBatch* batch,
ValueStoreChangeList* changes);
- // Commits the changes in |batch| to the database, and returns a WriteResult
- // with the changes.
- WriteResult WriteToDb(
- leveldb::WriteBatch* batch,
- scoped_ptr<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);
// 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