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

Issue 2003973002: net::AddressList no longer privately inherits from std::vector (Closed)

Created:
4 years, 7 months ago by mpawlowski
Modified:
4 years, 7 months ago
CC:
chromium-reviews, cbentzel+watch_chromium.org
Base URL:
https://chromium.googlesource.com/chromium/src.git@master
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

net::AddressList no longer privately inherits from std::vector The private inheritance was not only against the style guide, it also forbade anyone from using a standalone std::vector<net::IPEndPoint>, since the manually defined AddressList ctor/dtor conflicted with automatically generated ones for vector<T> instantiation. This should be considered a first step of refactoring that class. AddressList is neither a list, nor does it store addresses, it's a vector of endpoints, so the name is misleading. It should be changed. The canonical_name_ member is only currently used in PepperHostResolverMessageFilter, it's probably not the best idea to keep it around in a generic class like this. Grepping AddressList reveals 500+ instances in the codeebase, and ony one use of canonical_name() outside of unit tests. Perhaps a pair<AddressList, string> should be used for that one particular use-case and a bare AddressList without that extra member should be used everywhere else. This "conservative" approach, with employing composition instead of inheritance and delegating method calls was suggested by Nico Weber and indeed that meant not having to change anything but the header. Committed: https://crrev.com/74eaaac1d94b0151b70aac90e34d48c74f7d6e11 Cr-Commit-Position: refs/heads/master@{#395605}

Patch Set 1 #

Patch Set 2 : #

Patch Set 3 : #

Unified diffs Side-by-side diffs Delta from patch set Stats (+32 lines, -26 lines) Patch
M net/base/address_list.h View 1 2 4 chunks +30 lines, -26 lines 0 comments Download
M net/base/address_list.cc View 1 2 1 chunk +2 lines, -0 lines 0 comments Download

Messages

Total messages: 30 (15 generated)
mpawlowski
4 years, 7 months ago (2016-05-23 10:01:41 UTC) #4
Nico
lgtm
4 years, 7 months ago (2016-05-23 14:05:46 UTC) #5
commit-bot: I haz the power
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/2003973002/1 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/2003973002/1
4 years, 7 months ago (2016-05-23 14:06:23 UTC) #7
commit-bot: I haz the power
Dry run: Try jobs failed on following builders: cast_shell_linux on tryserver.chromium.linux (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.linux/builders/cast_shell_linux/builds/164735)
4 years, 7 months ago (2016-05-23 14:15:12 UTC) #9
Nico
looks like cast needs a const overload of insert()
4 years, 7 months ago (2016-05-23 14:16:04 UTC) #10
mmenke
On 2016/05/23 14:16:04, Nico wrote: > looks like cast needs a const overload of insert() ...
4 years, 7 months ago (2016-05-23 15:03:44 UTC) #11
commit-bot: I haz the power
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/2003973002/20001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/2003973002/20001
4 years, 7 months ago (2016-05-23 15:15:26 UTC) #13
commit-bot: I haz the power
Dry run: Try jobs failed on following builders: ios-simulator-gn on tryserver.chromium.mac (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.mac/builders/ios-simulator-gn/builds/9996) mac_chromium_compile_dbg_ng on ...
4 years, 7 months ago (2016-05-23 15:23:36 UTC) #15
Avi (use Gerrit)
LGTM, but you have the review covered by the owners so that's all I'll say. ...
4 years, 7 months ago (2016-05-23 15:29:21 UTC) #16
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/2003973002/40001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/2003973002/40001
4 years, 7 months ago (2016-05-24 08:40:50 UTC) #21
commit-bot: I haz the power
Try jobs failed on following builders: chromium_presubmit on tryserver.chromium.linux (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.linux/builders/chromium_presubmit/builds/188692)
4 years, 7 months ago (2016-05-24 08:46:59 UTC) #23
mmenke
LGTM (That windows failure is unrelated to this CL)
4 years, 7 months ago (2016-05-24 14:45:59 UTC) #24
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/2003973002/40001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/2003973002/40001
4 years, 7 months ago (2016-05-24 14:47:07 UTC) #26
commit-bot: I haz the power
Committed patchset #3 (id:40001)
4 years, 7 months ago (2016-05-24 15:45:50 UTC) #28
commit-bot: I haz the power
4 years, 7 months ago (2016-05-24 15:47:05 UTC) #30
Message was sent while issue was closed.
Patchset 3 (id:??) landed as
https://crrev.com/74eaaac1d94b0151b70aac90e34d48c74f7d6e11
Cr-Commit-Position: refs/heads/master@{#395605}

Powered by Google App Engine
This is Rietveld 408576698