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

Issue 2620303003: Replace ASSERT by RTC_DCHECK in all non-test code. (Closed)

Created:
3 years, 11 months ago by nisse-webrtc
Modified:
3 years, 11 months ago
Reviewers:
kwiberg-webrtc
CC:
webrtc-reviews_webrtc.org, zhengzhonghou_agora.io, tterriberry_mozilla.com, sdk-team_agora.io, the sun, perkj_webrtc, mflodman
Target Ref:
refs/heads/master
Project:
webrtc
Visibility:
Public.

Description

Replace ASSERT by RTC_DCHECK in all non-test code. Bulk of the changes were produced using git grep -l ' ASSERT(' | grep -v test | grep -v 'common\.h' |\ xargs -n1 sed -i 's/ ASSERT(/ RTC_DCHECK(/' followed by additional includes of base/checks.h in affected files, and git cl format. Also had to do some tweaks to #if !defined(NDEBUG) logic in the taskrunner code (webrtc/base/task.cc, webrtc/base/taskparent.cc, webrtc/base/taskparent.h, webrtc/base/taskrunner.cc), replaced to consistently use RTC_DCHECK_IS_ON, and some of the checks needed additional #if protection. Test code was excluded, because it should probably use RTC_CHECK rather than RTC_DCHECK. BUG=webrtc:6424 Review-Url: https://codereview.webrtc.org/2620303003 Cr-Commit-Position: refs/heads/master@{#16030} Committed: https://chromium.googlesource.com/external/webrtc/+/ede5da49606bf57888755058f354df240d37ef3c

Patch Set 1 #

Patch Set 2 : Also replace NDEBUG checks in taskrunner.h. #

Total comments: 16

Patch Set 3 : Rebased. #

Patch Set 4 : Change RTC_CHECK(false && "msg") to RTC_NOTREACHED() << "msg" #

Patch Set 5 : Use RTC_DCHECK with <<. Replace ENABLE_DEBUG --> RTC_DCHECK_IS_ON. #

Patch Set 6 : Address final nits. #

Unified diffs Side-by-side diffs Delta from patch set Stats (+686 lines, -631 lines) Patch
M webrtc/api/datachannel.cc View 10 chunks +13 lines, -13 lines 0 comments Download
M webrtc/api/dtmfsender.cc View 4 chunks +6 lines, -6 lines 0 comments Download
M webrtc/api/mediastream.cc View 2 chunks +2 lines, -1 line 0 comments Download
M webrtc/api/notifier.h View 2 chunks +2 lines, -1 line 0 comments Download
M webrtc/api/peerconnection.cc View 1 2 3 1 chunk +1 line, -1 line 0 comments Download
M webrtc/api/peerconnectionfactory.cc View 3 chunks +3 lines, -2 lines 0 comments Download
M webrtc/api/rtpsender.cc View 1 2 2 chunks +2 lines, -1 line 0 comments Download
M webrtc/api/videocapturertracksource.cc View 1 2 3 4 chunks +4 lines, -3 lines 0 comments Download
M webrtc/api/webrtcsdp.cc View 17 chunks +24 lines, -24 lines 0 comments Download
M webrtc/api/webrtcsession.cc View 1 2 3 16 chunks +18 lines, -18 lines 0 comments Download
M webrtc/api/webrtcsessiondescriptionfactory.cc View 7 chunks +9 lines, -9 lines 0 comments Download
M webrtc/base/applefilesystem.mm View 2 chunks +2 lines, -1 line 0 comments Download
M webrtc/base/asyncsocket.cc View 2 chunks +2 lines, -1 line 0 comments Download
M webrtc/base/asyncudpsocket.cc View 2 chunks +2 lines, -1 line 0 comments Download
M webrtc/base/diskcache.cc View 5 chunks +5 lines, -5 lines 0 comments Download
M webrtc/base/httpbase.cc View 19 chunks +23 lines, -22 lines 0 comments Download
M webrtc/base/httpclient.h View 2 chunks +5 lines, -1 line 0 comments Download
M webrtc/base/httpclient.cc View 9 chunks +11 lines, -11 lines 0 comments Download
M webrtc/base/httpcommon.cc View 6 chunks +8 lines, -7 lines 0 comments Download
M webrtc/base/httpcommon-inl.h View 2 chunks +2 lines, -1 line 0 comments Download
M webrtc/base/httpserver.cc View 6 chunks +6 lines, -6 lines 0 comments Download
M webrtc/base/macutils.cc View 1 chunk +1 line, -1 line 0 comments Download
M webrtc/base/messagequeue.cc View 2 chunks +2 lines, -2 lines 0 comments Download
M webrtc/base/natserver.cc View 4 chunks +4 lines, -3 lines 0 comments Download
M webrtc/base/natsocketfactory.cc View 10 chunks +15 lines, -14 lines 0 comments Download
M webrtc/base/network.cc View 1 2 5 chunks +7 lines, -7 lines 0 comments Download
M webrtc/base/networkmonitor.cc View 2 chunks +2 lines, -1 line 0 comments Download
M webrtc/base/openssladapter.cc View 5 chunks +5 lines, -4 lines 0 comments Download
M webrtc/base/openssldigest.cc View 4 chunks +5 lines, -5 lines 0 comments Download
M webrtc/base/opensslidentity.h View 2 chunks +2 lines, -1 line 0 comments Download
M webrtc/base/opensslidentity.cc View 2 chunks +3 lines, -3 lines 0 comments Download
M webrtc/base/physicalsocketserver.cc View 11 chunks +12 lines, -12 lines 0 comments Download
M webrtc/base/proxydetect.cc View 2 chunks +2 lines, -1 line 0 comments Download
M webrtc/base/proxyserver.cc View 7 chunks +9 lines, -7 lines 0 comments Download
M webrtc/base/rollingaccumulator.h View 1 2 3 4 3 chunks +5 lines, -4 lines 0 comments Download
M webrtc/base/signalthread.h View 2 chunks +2 lines, -1 line 0 comments Download
M webrtc/base/signalthread.cc View 4 chunks +8 lines, -8 lines 0 comments Download
M webrtc/base/socketadapters.cc View 5 chunks +5 lines, -5 lines 0 comments Download
M webrtc/base/socketaddress.cc View 2 chunks +2 lines, -1 line 0 comments Download
M webrtc/base/socketpool.cc View 5 chunks +8 lines, -8 lines 0 comments Download
M webrtc/base/socketstream.cc View 5 chunks +10 lines, -8 lines 0 comments Download
M webrtc/base/sslidentity.cc View 1 chunk +1 line, -1 line 0 comments Download
M webrtc/base/sslsocketfactory.cc View 3 chunks +4 lines, -3 lines 0 comments Download
M webrtc/base/stream.cc View 7 chunks +7 lines, -7 lines 0 comments Download
M webrtc/base/task.cc View 6 chunks +15 lines, -12 lines 0 comments Download
M webrtc/base/taskparent.h View 2 chunks +2 lines, -1 line 0 comments Download
M webrtc/base/taskparent.cc View 6 chunks +8 lines, -7 lines 0 comments Download
M webrtc/base/taskrunner.h View 1 2 3 4 5 3 chunks +7 lines, -6 lines 0 comments Download
M webrtc/base/taskrunner.cc View 1 2 3 4 5 5 chunks +9 lines, -14 lines 0 comments Download
M webrtc/base/thread.cc View 8 chunks +10 lines, -9 lines 0 comments Download
M webrtc/base/transformadapter.cc View 2 chunks +2 lines, -2 lines 0 comments Download
M webrtc/base/unixfilesystem.cc View 10 chunks +13 lines, -12 lines 0 comments Download
M webrtc/base/win32.cc View 4 chunks +5 lines, -4 lines 0 comments Download
M webrtc/base/win32filesystem.cc View 5 chunks +6 lines, -6 lines 0 comments Download
M webrtc/base/win32socketserver.cc View 5 chunks +6 lines, -6 lines 0 comments Download
M webrtc/base/win32window.cc View 2 chunks +2 lines, -1 line 0 comments Download
M webrtc/examples/peerconnection/client/conductor.cc View 8 chunks +13 lines, -13 lines 0 comments Download
M webrtc/examples/peerconnection/client/linux/main_wnd.cc View 6 chunks +7 lines, -6 lines 0 comments Download
M webrtc/examples/peerconnection/client/main_wnd.cc View 6 chunks +7 lines, -6 lines 0 comments Download
M webrtc/examples/peerconnection/client/peer_connection_client.cc View 15 chunks +24 lines, -23 lines 0 comments Download
M webrtc/media/base/fakemediaengine.h View 2 chunks +2 lines, -1 line 0 comments Download
M webrtc/media/engine/fakewebrtcvoiceengine.h View 2 chunks +3 lines, -2 lines 0 comments Download
M webrtc/modules/video_capture/windows/sink_filter_ds.cc View 2 chunks +2 lines, -1 line 0 comments Download
M webrtc/p2p/base/asyncstuntcpsocket.cc View 2 chunks +2 lines, -1 line 0 comments Download
M webrtc/p2p/base/basicpacketsocketfactory.cc View 4 chunks +4 lines, -3 lines 0 comments Download
M webrtc/p2p/base/candidate.h View 2 chunks +2 lines, -1 line 0 comments Download
M webrtc/p2p/base/dtlstransportchannel.cc View 1 2 10 chunks +17 lines, -17 lines 0 comments Download
M webrtc/p2p/base/jseptransport.cc View 1 chunk +1 line, -1 line 0 comments Download
M webrtc/p2p/base/p2ptransportchannel.cc View 1 2 26 chunks +29 lines, -29 lines 0 comments Download
M webrtc/p2p/base/port.cc View 13 chunks +15 lines, -15 lines 0 comments Download
M webrtc/p2p/base/pseudotcp.cc View 13 chunks +15 lines, -15 lines 0 comments Download
M webrtc/p2p/base/relayport.cc View 7 chunks +7 lines, -6 lines 0 comments Download
M webrtc/p2p/base/relayserver.cc View 1 2 3 4 5 17 chunks +26 lines, -26 lines 0 comments Download
M webrtc/p2p/base/stun.cc View 9 chunks +13 lines, -12 lines 0 comments Download
M webrtc/p2p/base/stunport.cc View 5 chunks +6 lines, -6 lines 0 comments Download
M webrtc/p2p/base/stunrequest.cc View 6 chunks +10 lines, -9 lines 0 comments Download
M webrtc/p2p/base/tcpport.cc View 6 chunks +9 lines, -8 lines 0 comments Download
M webrtc/p2p/base/turnport.cc View 13 chunks +16 lines, -15 lines 0 comments Download
M webrtc/p2p/base/turnserver.cc View 12 chunks +17 lines, -15 lines 0 comments Download
M webrtc/p2p/client/basicportallocator.h View 3 chunks +3 lines, -2 lines 0 comments Download
M webrtc/p2p/client/basicportallocator.cc View 1 2 16 chunks +26 lines, -26 lines 0 comments Download
M webrtc/p2p/client/socketmonitor.cc View 5 chunks +6 lines, -5 lines 0 comments Download
M webrtc/p2p/quic/quictransport.cc View 2 chunks +2 lines, -1 line 0 comments Download
M webrtc/p2p/quic/quictransportchannel.cc View 7 chunks +15 lines, -15 lines 0 comments Download
M webrtc/pc/channelmanager.cc View 10 chunks +22 lines, -21 lines 0 comments Download
M webrtc/pc/mediamonitor.cc View 5 chunks +6 lines, -5 lines 0 comments Download
M webrtc/pc/mediasession.cc View 2 chunks +2 lines, -2 lines 0 comments Download
M webrtc/sdk/android/src/jni/androidnetworkmonitor_jni.cc View 1 2 1 chunk +1 line, -1 line 0 comments Download

Messages

Total messages: 19 (11 generated)
nisse-webrtc
Next step...
3 years, 11 months ago (2017-01-11 15:15:19 UTC) #2
kwiberg-webrtc
https://codereview.webrtc.org/2620303003/diff/20001/webrtc/api/peerconnection.cc File webrtc/api/peerconnection.cc (right): https://codereview.webrtc.org/2620303003/diff/20001/webrtc/api/peerconnection.cc#newcode1947 webrtc/api/peerconnection.cc:1947: RTC_DCHECK(false && "Invalid media type"); RTC_NOTREACHED with a message? ...
3 years, 11 months ago (2017-01-12 02:10:41 UTC) #7
nisse-webrtc
Comments addressed. Thanks for the review. https://codereview.webrtc.org/2620303003/diff/20001/webrtc/api/webrtcsession.cc File webrtc/api/webrtcsession.cc (right): https://codereview.webrtc.org/2620303003/diff/20001/webrtc/api/webrtcsession.cc#newcode947 webrtc/api/webrtcsession.cc:947: RTC_DCHECK(false && "unknown ...
3 years, 11 months ago (2017-01-12 10:53:24 UTC) #8
kwiberg-webrtc
lgtm https://codereview.webrtc.org/2620303003/diff/20001/webrtc/base/taskrunner.cc File webrtc/base/taskrunner.cc (right): https://codereview.webrtc.org/2620303003/diff/20001/webrtc/base/taskrunner.cc#newcode27 webrtc/base/taskrunner.cc:27: , On 2017/01/12 10:53:24, nisse-webrtc wrote: > On ...
3 years, 11 months ago (2017-01-12 11:00:38 UTC) #11
nisse-webrtc
https://codereview.webrtc.org/2620303003/diff/20001/webrtc/base/taskrunner.cc File webrtc/base/taskrunner.cc (right): https://codereview.webrtc.org/2620303003/diff/20001/webrtc/base/taskrunner.cc#newcode27 webrtc/base/taskrunner.cc:27: , On 2017/01/12 11:00:38, kwiberg-webrtc wrote: > On 2017/01/12 ...
3 years, 11 months ago (2017-01-12 11:09:42 UTC) #12
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.webrtc.org/2620303003/100001
3 years, 11 months ago (2017-01-12 11:10:08 UTC) #15
kwiberg-webrtc
https://codereview.webrtc.org/2620303003/diff/20001/webrtc/base/taskrunner.cc File webrtc/base/taskrunner.cc (right): https://codereview.webrtc.org/2620303003/diff/20001/webrtc/base/taskrunner.cc#newcode27 webrtc/base/taskrunner.cc:27: , On 2017/01/12 11:09:42, nisse-webrtc wrote: > On 2017/01/12 ...
3 years, 11 months ago (2017-01-12 12:54:31 UTC) #16
commit-bot: I haz the power
3 years, 11 months ago (2017-01-12 13:15:44 UTC) #19
Message was sent while issue was closed.
Committed patchset #6 (id:100001) as
https://chromium.googlesource.com/external/webrtc/+/ede5da49606bf57888755058f...

Powered by Google App Engine
This is Rietveld 408576698