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

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

Issue 2051663003: base::ListValue::Append cleanup: pass unique_ptr instead of the released pointer. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebase Created 4 years, 6 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 265e593cd4ce57489b9e9b89e716d224f0372be0..30a70bf82674d22118de5a93ccdc89455e667c87 100644
--- a/extensions/browser/api/declarative_webrequest/webrequest_condition_attribute_unittest.cc
+++ b/extensions/browser/api/declarative_webrequest/webrequest_condition_attribute_unittest.cc
@@ -7,6 +7,7 @@
#include <stddef.h>
#include <memory>
+#include <utility>
#include "base/files/file_path.h"
#include "base/macros.h"
@@ -388,7 +389,7 @@ std::unique_ptr<base::DictionaryValue> GetDictionaryFromArray(
list = new base::ListValue;
// Ignoring return value, we already verified the entry is there.
dictionary->RemoveWithoutPathExpansion(*name, &entry_owned);
- list->Append(entry_owned.release());
+ list->Append(std::move(entry_owned));
list->AppendString(*value);
dictionary->SetWithoutPathExpansion(*name, list);
break;
@@ -422,7 +423,7 @@ void MatchAndCheck(const std::vector< std::vector<const std::string*> >& tests,
std::unique_ptr<base::DictionaryValue> temp(
GetDictionaryFromArray(tests[i]));
ASSERT_TRUE(temp.get());
- contains_headers.Append(temp.release());
+ contains_headers.Append(std::move(temp));
}
std::string error;

Powered by Google App Engine
This is Rietveld 408576698