Skip to content

Commit

Permalink
CodeHealth: Remove use of DictionaryValue::size()
Browse files Browse the repository at this point in the history
This change removes the use of DictionaryValue::size()
and replaces with Value::DictSize()

Bug: 1187019
Change-Id: I3a4cb77880286900049aa3d2e113aefb0c551736
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2878265
Reviewed-by: Guido Urdaneta <guidou@chromium.org>
Commit-Queue: Fangzhen Song <songfangzhen@bytedance.com>
Cr-Commit-Position: refs/heads/master@{#880351}
  • Loading branch information
song-fangzhen authored and Chromium LUCI CQ committed May 7, 2021
1 parent e96023c commit 0c6cbff
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,7 @@ std::vector<double> ParseGoogMaxDecodeFromWebrtcInternalsTab(
ignore_result(parsed_json.release());

// |dictionary| should have exactly two entries, one per ssrc.
if (!dictionary || dictionary->size() != 2u)
if (!dictionary || dictionary->DictSize() != 2u)
return goog_decode_ms;

// Only a given |dictionary| entry will have a "stats" entry that has a key
Expand Down
6 changes: 3 additions & 3 deletions content/browser/webrtc/webrtc_internals_browsertest.cc
Original file line number Diff line number Diff line change
Expand Up @@ -462,7 +462,7 @@ class MAYBE_WebRtcInternalsBrowserTest: public ContentBrowserTest {

base::DictionaryValue* dict_dump =
static_cast<base::DictionaryValue*>(dump);
EXPECT_EQ((size_t) peer_connection_number, dict_dump->size());
EXPECT_EQ((size_t)peer_connection_number, dict_dump->DictSize());

base::DictionaryValue::Iterator it(*dict_dump);
for (; !it.IsAtEnd(); it.Advance()) {
Expand All @@ -484,7 +484,7 @@ class MAYBE_WebRtcInternalsBrowserTest: public ContentBrowserTest {
pc_dump->Get("stats", &value);
EXPECT_EQ(base::Value::Type::DICTIONARY, value->type());
base::DictionaryValue* dict = static_cast<base::DictionaryValue*>(value);
EXPECT_EQ((size_t) stats_number, dict->size());
EXPECT_EQ((size_t)stats_number, dict->DictSize());
}
}

Expand All @@ -511,7 +511,7 @@ class MAYBE_WebRtcInternalsBrowserTest: public ContentBrowserTest {

base::DictionaryValue* dataSeries =
static_cast<base::DictionaryValue*>(value);
EXPECT_EQ(stats.values.size(), dataSeries->size());
EXPECT_EQ(stats.values.size(), dataSeries->DictSize());
}
};

Expand Down

0 comments on commit 0c6cbff

Please sign in to comment.