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 199 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
210 &as_string_list); | 210 &as_string_list); |
211 bytes_in_use = storage->GetBytesInUse(as_string_list); | 211 bytes_in_use = storage->GetBytesInUse(as_string_list); |
212 break; | 212 break; |
213 } | 213 } |
214 | 214 |
215 default: | 215 default: |
216 return BadMessage(); | 216 return BadMessage(); |
217 } | 217 } |
218 | 218 |
219 return OneArgument( | 219 return OneArgument( |
220 base::MakeUnique<base::FundamentalValue>(static_cast<int>(bytes_in_use))); | 220 base::MakeUnique<base::Value>(static_cast<int>(bytes_in_use))); |
221 } | 221 } |
222 | 222 |
223 ExtensionFunction::ResponseValue StorageStorageAreaSetFunction::RunWithStorage( | 223 ExtensionFunction::ResponseValue StorageStorageAreaSetFunction::RunWithStorage( |
224 ValueStore* storage) { | 224 ValueStore* storage) { |
225 base::DictionaryValue* input = NULL; | 225 base::DictionaryValue* input = NULL; |
226 if (!args_->GetDictionary(0, &input)) | 226 if (!args_->GetDictionary(0, &input)) |
227 return BadMessage(); | 227 return BadMessage(); |
228 return UseWriteResult(storage->Set(ValueStore::DEFAULTS, *input)); | 228 return UseWriteResult(storage->Set(ValueStore::DEFAULTS, *input)); |
229 } | 229 } |
230 | 230 |
(...skipping 36 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 |