Skip to content

Commit

Permalink
[CodeHealth] Remove uses of ListValue::begin()/end() in /content/brow…
Browse files Browse the repository at this point in the history
…ser/devtools/protocol.

This CL removes calls to these deprecated member functions. It also
converts to the newer "for" loop syntax when possible, along with
other minor cleanup.

This CL was uploaded by git cl split.

R=yangguo@chromium.org

Bug: 1187107
Change-Id: I07c37c1ac3f58c8956294c592f01e8e1d4996793
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2877401
Auto-Submit: David Bertoni <dbertoni@chromium.org>
Reviewed-by: Yang Guo <yangguo@chromium.org>
Commit-Queue: Yang Guo <yangguo@chromium.org>
Cr-Commit-Position: refs/heads/master@{#880061}
  • Loading branch information
David Bertoni authored and Chromium LUCI CQ committed May 6, 2021
1 parent c73ffd8 commit a4dbfac
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ bool GetCertificateFromNotificationParams(base::DictionaryValue* params,
if (!params->GetList("explanations", &explanations)) {
return false;
}
for (const auto& explanation : *explanations) {
for (const auto& explanation : explanations->GetList()) {
const base::DictionaryValue* explanation_dict;
if (explanation.GetAsDictionary(&explanation_dict) &&
explanation_dict->GetList("certificate", certificate) &&
Expand Down Expand Up @@ -2221,7 +2221,7 @@ IN_PROC_BROWSER_TEST_F(DevToolsProtocolTest, CertificateExplanations) {
const base::ListValue* certificate;
ASSERT_TRUE(GetCertificateFromNotificationParams(params.get(), &certificate));
std::vector<std::string> der_certs;
for (const auto& cert : *certificate) {
for (const auto& cert : certificate->GetList()) {
std::string decoded;
ASSERT_TRUE(base::Base64Decode(cert.GetString(), &decoded));
der_certs.push_back(decoded);
Expand Down
2 changes: 1 addition & 1 deletion content/browser/devtools/protocol/tracing_handler.cc
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ std::unique_ptr<base::Value> ConvertDictKeyStyle(const base::Value& value) {
const base::ListValue* list = nullptr;
if (value.GetAsList(&list)) {
std::unique_ptr<base::ListValue> out_list(new base::ListValue());
for (const auto& key : *list)
for (const auto& key : list->GetList())
out_list->Append(ConvertDictKeyStyle(key));
return std::move(out_list);
}
Expand Down

0 comments on commit a4dbfac

Please sign in to comment.