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

Unified Diff: extensions/browser/api/storage/storage_api.cc

Issue 2539363004: Make base::Value::TYPE a scoped enum. (Closed)
Patch Set: Rebase Created 4 years 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
Index: extensions/browser/api/storage/storage_api.cc
diff --git a/extensions/browser/api/storage/storage_api.cc b/extensions/browser/api/storage/storage_api.cc
index 6fd79ef8841747c71f928feae85b623547aa4a07..1bb7d08a0ef1485ab20d535b282a335026211d2b 100644
--- a/extensions/browser/api/storage/storage_api.cc
+++ b/extensions/browser/api/storage/storage_api.cc
@@ -149,23 +149,23 @@ ExtensionFunction::ResponseValue StorageStorageAreaGetFunction::RunWithStorage(
return BadMessage();
switch (input->GetType()) {
- case base::Value::TYPE_NULL:
+ case base::Value::Type::NONE:
return UseReadResult(storage->Get());
- case base::Value::TYPE_STRING: {
+ case base::Value::Type::STRING: {
std::string as_string;
input->GetAsString(&as_string);
return UseReadResult(storage->Get(as_string));
}
- case base::Value::TYPE_LIST: {
+ case base::Value::Type::LIST: {
std::vector<std::string> as_string_list;
AddAllStringValues(*static_cast<base::ListValue*>(input),
&as_string_list);
return UseReadResult(storage->Get(as_string_list));
}
- case base::Value::TYPE_DICTIONARY: {
+ case base::Value::Type::DICTIONARY: {
base::DictionaryValue* as_dict =
static_cast<base::DictionaryValue*>(input);
ValueStore::ReadResult result = storage->Get(GetKeys(*as_dict));
@@ -193,18 +193,18 @@ StorageStorageAreaGetBytesInUseFunction::RunWithStorage(ValueStore* storage) {
size_t bytes_in_use = 0;
switch (input->GetType()) {
- case base::Value::TYPE_NULL:
+ case base::Value::Type::NONE:
bytes_in_use = storage->GetBytesInUse();
break;
- case base::Value::TYPE_STRING: {
+ case base::Value::Type::STRING: {
std::string as_string;
input->GetAsString(&as_string);
bytes_in_use = storage->GetBytesInUse(as_string);
break;
}
- case base::Value::TYPE_LIST: {
+ case base::Value::Type::LIST: {
std::vector<std::string> as_string_list;
AddAllStringValues(*static_cast<base::ListValue*>(input),
&as_string_list);
@@ -240,13 +240,13 @@ StorageStorageAreaRemoveFunction::RunWithStorage(ValueStore* storage) {
return BadMessage();
switch (input->GetType()) {
- case base::Value::TYPE_STRING: {
+ case base::Value::Type::STRING: {
std::string as_string;
input->GetAsString(&as_string);
return UseWriteResult(storage->Remove(as_string));
}
- case base::Value::TYPE_LIST: {
+ case base::Value::Type::LIST: {
std::vector<std::string> as_string_list;
AddAllStringValues(*static_cast<base::ListValue*>(input),
&as_string_list);

Powered by Google App Engine
This is Rietveld 408576698