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

Unified Diff: extensions/browser/api/declarative_webrequest/webrequest_condition_attribute_unittest.cc

Issue 2843813002: Remove SetWithoutPathExpansion (Closed)
Patch Set: Fix CrOS Error Created 3 years, 8 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 side-by-side diff with in-line comments
Download patch
Index: extensions/browser/api/declarative_webrequest/webrequest_condition_attribute_unittest.cc
diff --git a/extensions/browser/api/declarative_webrequest/webrequest_condition_attribute_unittest.cc b/extensions/browser/api/declarative_webrequest/webrequest_condition_attribute_unittest.cc
index 0b507c535f9cf9ddd2b86a27e24f55d0c8118b1d..6f179d52fef7afdb7891e82f92f75e15991b8717 100644
--- a/extensions/browser/api/declarative_webrequest/webrequest_condition_attribute_unittest.cc
+++ b/extensions/browser/api/declarative_webrequest/webrequest_condition_attribute_unittest.cc
@@ -385,22 +385,21 @@ std::unique_ptr<base::DictionaryValue> GetDictionaryFromArray(
if (dictionary->HasKey(*name)) {
base::Value* entry = NULL;
std::unique_ptr<base::Value> entry_owned;
- base::ListValue* list = NULL;
+ std::unique_ptr<base::ListValue> list;
if (!dictionary->GetWithoutPathExpansion(*name, &entry))
return std::unique_ptr<base::DictionaryValue>();
switch (entry->GetType()) {
case base::Value::Type::STRING:
// Replace the present string with a list.
- list = new base::ListValue;
+ list = base::MakeUnique<base::ListValue>();
// Ignoring return value, we already verified the entry is there.
dictionary->RemoveWithoutPathExpansion(*name, &entry_owned);
list->Append(std::move(entry_owned));
list->AppendString(*value);
- dictionary->SetWithoutPathExpansion(*name, base::WrapUnique(list));
+ dictionary->SetWithoutPathExpansion(*name, std::move(list));
break;
case base::Value::Type::LIST: // Just append to the list.
- CHECK(entry->GetAsList(&list));
- list->AppendString(*value);
+ entry->GetList().emplace_back(*value);
break;
default:
NOTREACHED(); // We never put other Values here.
« no previous file with comments | « extensions/browser/api/bluetooth_low_energy/utils.cc ('k') | extensions/browser/api/web_request/upload_data_presenter.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698