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

Unified Diff: extensions/browser/api/web_request/web_request_api_helpers.cc

Issue 2037703004: Remove ListValue::Append(new {Fundamental,String}Value(...)) pattern in //extensions (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: 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/web_request/web_request_api_helpers.cc
diff --git a/extensions/browser/api/web_request/web_request_api_helpers.cc b/extensions/browser/api/web_request/web_request_api_helpers.cc
index 11b15638792bf3ddbb07e4b9d302b3802742c39f..53dfc88655edc29f9a8cf5289df13da868f0d37e 100644
--- a/extensions/browser/api/web_request/web_request_api_helpers.cc
+++ b/extensions/browser/api/web_request/web_request_api_helpers.cc
@@ -271,7 +271,7 @@ std::unique_ptr<base::Value> NetLogModificationCallback(
delta->modified_request_headers);
while (modification.GetNext()) {
std::string line = modification.name() + ": " + modification.value();
- modified_headers->Append(new base::StringValue(line));
+ modified_headers->AppendString(line);
}
dict->Set("modified_headers", modified_headers);
@@ -280,7 +280,7 @@ std::unique_ptr<base::Value> NetLogModificationCallback(
delta->deleted_request_headers.begin();
key != delta->deleted_request_headers.end();
++key) {
- deleted_headers->Append(new base::StringValue(*key));
+ deleted_headers->AppendString(*key);
}
dict->Set("deleted_headers", deleted_headers);
return std::move(dict);
@@ -295,9 +295,7 @@ bool InDecreasingExtensionInstallationTimeOrder(
base::ListValue* StringToCharList(const std::string& s) {
base::ListValue* result = new base::ListValue;
for (size_t i = 0, n = s.size(); i < n; ++i) {
- result->Append(
- new base::FundamentalValue(
- *reinterpret_cast<const unsigned char*>(&s[i])));
+ result->AppendInteger(*reinterpret_cast<const unsigned char*>(&s[i]));
}
return result;
}
« no previous file with comments | « extensions/browser/api/web_request/upload_data_presenter_unittest.cc ('k') | extensions/browser/event_router.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698