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

Side by Side Diff: chrome/browser/value_store/testing_value_store.h

Issue 165223003: Add a Restore() method to ValueStore and make StorageAPI use it (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Latest master Created 6 years, 10 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 unified diff | Download patch
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #ifndef CHROME_BROWSER_VALUE_STORE_TESTING_VALUE_STORE_H_ 5 #ifndef CHROME_BROWSER_VALUE_STORE_TESTING_VALUE_STORE_H_
6 #define CHROME_BROWSER_VALUE_STORE_TESTING_VALUE_STORE_H_ 6 #define CHROME_BROWSER_VALUE_STORE_TESTING_VALUE_STORE_H_
7 7
8 #include "base/compiler_specific.h" 8 #include "base/compiler_specific.h"
9 #include "chrome/browser/value_store/value_store.h" 9 #include "chrome/browser/value_store/value_store.h"
10 10
(...skipping 25 matching lines...) Expand all
36 virtual ReadResult Get() OVERRIDE; 36 virtual ReadResult Get() OVERRIDE;
37 virtual WriteResult Set( 37 virtual WriteResult Set(
38 WriteOptions options, 38 WriteOptions options,
39 const std::string& key, 39 const std::string& key,
40 const base::Value& value) OVERRIDE; 40 const base::Value& value) OVERRIDE;
41 virtual WriteResult Set( 41 virtual WriteResult Set(
42 WriteOptions options, const base::DictionaryValue& values) OVERRIDE; 42 WriteOptions options, const base::DictionaryValue& values) OVERRIDE;
43 virtual WriteResult Remove(const std::string& key) OVERRIDE; 43 virtual WriteResult Remove(const std::string& key) OVERRIDE;
44 virtual WriteResult Remove(const std::vector<std::string>& keys) OVERRIDE; 44 virtual WriteResult Remove(const std::vector<std::string>& keys) OVERRIDE;
45 virtual WriteResult Clear() OVERRIDE; 45 virtual WriteResult Clear() OVERRIDE;
46 // TestingValueStores can't get corrupted (they're all in-memory), so these
47 // just return true.
48 virtual bool Restore() OVERRIDE;
49 virtual bool RestoreKey(const std::string& key) OVERRIDE;
46 50
47 private: 51 private:
48 scoped_ptr<ValueStore::Error> TestingError(); 52 scoped_ptr<ValueStore::Error> TestingError();
49 53
50 base::DictionaryValue storage_; 54 base::DictionaryValue storage_;
51 int read_count_; 55 int read_count_;
52 int write_count_; 56 int write_count_;
53 ErrorCode error_code_; 57 ErrorCode error_code_;
54 58
55 DISALLOW_COPY_AND_ASSIGN(TestingValueStore); 59 DISALLOW_COPY_AND_ASSIGN(TestingValueStore);
56 }; 60 };
57 61
58 #endif // CHROME_BROWSER_VALUE_STORE_TESTING_VALUE_STORE_H_ 62 #endif // CHROME_BROWSER_VALUE_STORE_TESTING_VALUE_STORE_H_
OLDNEW
« no previous file with comments | « chrome/browser/value_store/leveldb_value_store_unittest.cc ('k') | chrome/browser/value_store/testing_value_store.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698