| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 "extensions/browser/api/storage/storage_api.h" | 5 #include "extensions/browser/api/storage/storage_api.h" |
| 6 | 6 |
| 7 #include <stddef.h> | 7 #include <stddef.h> |
| 8 | 8 |
| 9 #include <string> | 9 #include <string> |
| 10 #include <utility> | 10 #include <utility> |
| (...skipping 90 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 101 | 101 |
| 102 namespace { | 102 namespace { |
| 103 | 103 |
| 104 // Adds all StringValues from a ListValue to a vector of strings. | 104 // Adds all StringValues from a ListValue to a vector of strings. |
| 105 void AddAllStringValues(const base::ListValue& from, | 105 void AddAllStringValues(const base::ListValue& from, |
| 106 std::vector<std::string>* to) { | 106 std::vector<std::string>* to) { |
| 107 DCHECK(to->empty()); | 107 DCHECK(to->empty()); |
| 108 std::string as_string; | 108 std::string as_string; |
| 109 for (base::ListValue::const_iterator it = from.begin(); | 109 for (base::ListValue::const_iterator it = from.begin(); |
| 110 it != from.end(); ++it) { | 110 it != from.end(); ++it) { |
| 111 if (it->GetAsString(&as_string)) { | 111 if ((*it)->GetAsString(&as_string)) { |
| 112 to->push_back(as_string); | 112 to->push_back(as_string); |
| 113 } | 113 } |
| 114 } | 114 } |
| 115 } | 115 } |
| 116 | 116 |
| 117 // Gets the keys of a DictionaryValue. | 117 // Gets the keys of a DictionaryValue. |
| 118 std::vector<std::string> GetKeys(const base::DictionaryValue& dict) { | 118 std::vector<std::string> GetKeys(const base::DictionaryValue& dict) { |
| 119 std::vector<std::string> keys; | 119 std::vector<std::string> keys; |
| 120 for (base::DictionaryValue::Iterator it(dict); !it.IsAtEnd(); it.Advance()) { | 120 for (base::DictionaryValue::Iterator it(dict); !it.IsAtEnd(); it.Advance()) { |
| 121 keys.push_back(it.key()); | 121 keys.push_back(it.key()); |
| (...skipping 145 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 267 StorageStorageAreaClearFunction::RunWithStorage(ValueStore* storage) { | 267 StorageStorageAreaClearFunction::RunWithStorage(ValueStore* storage) { |
| 268 return UseWriteResult(storage->Clear()); | 268 return UseWriteResult(storage->Clear()); |
| 269 } | 269 } |
| 270 | 270 |
| 271 void StorageStorageAreaClearFunction::GetQuotaLimitHeuristics( | 271 void StorageStorageAreaClearFunction::GetQuotaLimitHeuristics( |
| 272 QuotaLimitHeuristics* heuristics) const { | 272 QuotaLimitHeuristics* heuristics) const { |
| 273 GetModificationQuotaLimitHeuristics(heuristics); | 273 GetModificationQuotaLimitHeuristics(heuristics); |
| 274 } | 274 } |
| 275 | 275 |
| 276 } // namespace extensions | 276 } // namespace extensions |
| OLD | NEW |