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

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

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 #include "chrome/browser/value_store/testing_value_store.h" 5 #include "chrome/browser/value_store/testing_value_store.h"
6 6
7 #include "base/logging.h" 7 #include "base/logging.h"
8 8
9 namespace { 9 namespace {
10 10
(...skipping 106 matching lines...) Expand 10 before | Expand all | Expand 10 after
117 117
118 ValueStore::WriteResult TestingValueStore::Clear() { 118 ValueStore::WriteResult TestingValueStore::Clear() {
119 std::vector<std::string> keys; 119 std::vector<std::string> keys;
120 for (base::DictionaryValue::Iterator it(storage_); 120 for (base::DictionaryValue::Iterator it(storage_);
121 !it.IsAtEnd(); it.Advance()) { 121 !it.IsAtEnd(); it.Advance()) {
122 keys.push_back(it.key()); 122 keys.push_back(it.key());
123 } 123 }
124 return Remove(keys); 124 return Remove(keys);
125 } 125 }
126 126
127 bool TestingValueStore::Restore() {
128 return true;
129 }
130
131 bool TestingValueStore::RestoreKey(const std::string& key) {
132 return true;
133 }
134
127 scoped_ptr<ValueStore::Error> TestingValueStore::TestingError() { 135 scoped_ptr<ValueStore::Error> TestingValueStore::TestingError() {
128 return make_scoped_ptr(new ValueStore::Error( 136 return make_scoped_ptr(new ValueStore::Error(
129 error_code_, kGenericErrorMessage, scoped_ptr<std::string>())); 137 error_code_, kGenericErrorMessage, scoped_ptr<std::string>()));
130 } 138 }
OLDNEW
« no previous file with comments | « chrome/browser/value_store/testing_value_store.h ('k') | chrome/browser/value_store/value_store.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698