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

Issue 1560028: Adding extra argument DCHECKs to AddressList methods. (Closed)

Created:
10 years, 8 months ago by cbentzel
Modified:
9 years, 7 months ago
Reviewers:
eroman, wtc, ahendrickson
CC:
chromium-reviews_googlegroups.com, darin-cc_chromium.org, cbentzel+watch_chromium.org
Visibility:
Public.

Description

Adding extra argument DCHECKs to AddressList methods. BUG=40796 TEST=net_unittests.exe --gtest_filter="*AddressList*" Committed: http://src.chromium.org/viewvc/chrome?view=rev&revision=44772

Patch Set 1 #

Patch Set 2 : Merge with trunk. #

Total comments: 5

Patch Set 3 : Remove data_ check from head #

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

Messages

Total messages: 5 (0 generated)
cbentzel
10 years, 8 months ago (2010-04-15 12:52:58 UTC) #1
eroman
LGTM http://codereview.chromium.org/1560028/diff/2001/3002 File net/base/address_list.h (right): http://codereview.chromium.org/1560028/diff/2001/3002#newcode66 net/base/address_list.h:66: const struct addrinfo* head() const { return data_ ...
10 years, 8 months ago (2010-04-15 17:33:58 UTC) #2
cbentzel
http://codereview.chromium.org/1560028/diff/2001/3002 File net/base/address_list.h (right): http://codereview.chromium.org/1560028/diff/2001/3002#newcode66 net/base/address_list.h:66: const struct addrinfo* head() const { return data_ ? ...
10 years, 8 months ago (2010-04-15 20:50:55 UTC) #3
wtc
LGTM. http://codereview.chromium.org/1560028/diff/2001/3001 File net/base/address_list.cc (right): http://codereview.chromium.org/1560028/diff/2001/3001#newcode125 net/base/address_list.cc:125: DCHECK(!head->ai_canonname); I think only this DCHECK and the ...
10 years, 8 months ago (2010-04-16 00:54:25 UTC) #4
cbentzel
10 years, 8 months ago (2010-04-16 14:54:25 UTC) #5
http://codereview.chromium.org/1560028/diff/2001/3001
File net/base/address_list.cc (right):

http://codereview.chromium.org/1560028/diff/2001/3001#newcode125
net/base/address_list.cc:125: DCHECK(!head->ai_canonname);
On 2010/04/16 00:54:25, wtc wrote:
> I think only this DCHECK and the DCHECK you added to the
> AddressList::Data constructor are useful.

I agree that those are the two most useful ones. In the past I've used
DCHECK's/assert style approaches for arguments to act as additional
documentation for what the preconditions are as well as to give clearer error
messages than just segfaults, unless they make the debug build unbearably slow.

Powered by Google App Engine
This is Rietveld 408576698