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

Issue 2835823002: SerializeHostDescriptions ignores hosts with duplicated names (Closed)

Created:
3 years, 8 months ago by vabr (Chromium)
Modified:
3 years, 8 months ago
Reviewers:
jdoerrie, dgozman
CC:
chromium-reviews, pfeldman, devtools-reviews_chromium.org
Target Ref:
refs/heads/master
Project:
chromium
Visibility:
Public.

Description

SerializeHostDescriptions ignores hosts with duplicated names |HostDescriptionNode.name| identifies the node and should not be shared by two different nodes. If multiple nodes are passed to SerializeHostDescriptions with the same name, currently SerializeHostDescriptions ends up using DictionaryValue after performing std::move on it, because of mixing nodes with the same name. This CL replaces some internal use of std::vector with std::unordered_set to discard duplicities. The CL also improves the unit test to be less dependent on the resulting order of the serialized descriptions. The CL also fixes the test name to match its filename and the name of the tested function. BUG=714368 Review-Url: https://codereview.chromium.org/2835823002 Cr-Commit-Position: refs/heads/master@{#466913} Committed: https://chromium.googlesource.com/chromium/src/+/b95f5bc3e4433d6e28d44850506f47efcf8e4fff

Patch Set 1 #

Patch Set 2 : Self review #

Patch Set 3 : Fix test name #

Patch Set 4 : Do not reference a temporary #

Total comments: 9

Patch Set 5 : emplace #

Unified diffs Side-by-side diffs Delta from patch set Stats (+97 lines, -71 lines) Patch
M chrome/browser/devtools/serialize_host_descriptions.cc View 1 2 3 4 5 chunks +10 lines, -6 lines 0 comments Download
M chrome/browser/devtools/serialize_host_descriptions_unittest.cc View 1 2 3 chunks +87 lines, -65 lines 0 comments Download

Messages

Total messages: 29 (20 generated)
vabr (Chromium)
Hi dgozman@, Could you please review this? Thanks! Vaclav https://codereview.chromium.org/2835823002/diff/60001/chrome/browser/devtools/serialize_host_descriptions.cc File chrome/browser/devtools/serialize_host_descriptions.cc (right): https://codereview.chromium.org/2835823002/diff/60001/chrome/browser/devtools/serialize_host_descriptions.cc#newcode51 chrome/browser/devtools/serialize_host_descriptions.cc:51: ...
3 years, 8 months ago (2017-04-23 11:47:32 UTC) #13
jdoerrie
Thanks for addressing this so promptly, vabr@! https://codereview.chromium.org/2835823002/diff/60001/chrome/browser/devtools/serialize_host_descriptions.cc File chrome/browser/devtools/serialize_host_descriptions.cc (right): https://codereview.chromium.org/2835823002/diff/60001/chrome/browser/devtools/serialize_host_descriptions.cc#newcode73 chrome/browser/devtools/serialize_host_descriptions.cc:73: std::make_pair(base::StringPiece(node.name), &representations->back())); ...
3 years, 8 months ago (2017-04-23 18:16:11 UTC) #15
vabr (Chromium)
https://codereview.chromium.org/2835823002/diff/60001/chrome/browser/devtools/serialize_host_descriptions.cc File chrome/browser/devtools/serialize_host_descriptions.cc (right): https://codereview.chromium.org/2835823002/diff/60001/chrome/browser/devtools/serialize_host_descriptions.cc#newcode73 chrome/browser/devtools/serialize_host_descriptions.cc:73: std::make_pair(base::StringPiece(node.name), &representations->back())); On 2017/04/23 18:16:11, jdoerrie wrote: > Recently ...
3 years, 8 months ago (2017-04-23 18:52:14 UTC) #16
jdoerrie
https://codereview.chromium.org/2835823002/diff/60001/chrome/browser/devtools/serialize_host_descriptions.cc File chrome/browser/devtools/serialize_host_descriptions.cc (right): https://codereview.chromium.org/2835823002/diff/60001/chrome/browser/devtools/serialize_host_descriptions.cc#newcode73 chrome/browser/devtools/serialize_host_descriptions.cc:73: std::make_pair(base::StringPiece(node.name), &representations->back())); On 2017/04/23 18:52:13, vabr (Chromium) wrote: > ...
3 years, 8 months ago (2017-04-24 09:09:54 UTC) #17
vabr (Chromium)
jdoerrie@: Thanks -- addressed in patch set 5. dgozman@: When reviewing, you might want to ...
3 years, 8 months ago (2017-04-24 14:51:54 UTC) #22
dgozman
Thanks for the fix! Note this does not happen in practice since host id is ...
3 years, 8 months ago (2017-04-24 23:39:34 UTC) #23
vabr (Chromium)
On 2017/04/24 23:39:34, dgozman wrote: > Thanks for the fix! Note this does not happen ...
3 years, 8 months ago (2017-04-25 06:51:41 UTC) #24
commit-bot: I haz the power
CQ is trying da patch. Follow status at: https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.org/2835823002/80001
3 years, 8 months ago (2017-04-25 06:52:21 UTC) #26
commit-bot: I haz the power
3 years, 8 months ago (2017-04-25 07:17:19 UTC) #29
Message was sent while issue was closed.
Committed patchset #5 (id:80001) as
https://chromium.googlesource.com/chromium/src/+/b95f5bc3e4433d6e28d44850506f...

Powered by Google App Engine
This is Rietveld 408576698