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

Issue 2571683004: Fixing possible crash due to RefCountedChannel assignment operator. (Closed)

Created:
4 years ago by Taylor Brandstetter
Modified:
4 years ago
Reviewers:
pthatcher1, honghaiz3
CC:
webrtc-reviews_webrtc.org, tterriberry_mozilla.com
Target Ref:
refs/pending/heads/master
Project:
webrtc
Visibility:
Public.

Description

Fixing possible crash due to RefCountedChannel assignment operator. We relied on the default destructor of RefCountedChannel to destroy its members in reverse initialization order (deleting the DTLS wrapper before the underlying ICE channel). However, std::vector also may use the default assignment operator, which performs a member-wise copy in initialization order. Which results in deleting the ICE channel before the DTLS one. This CL fixes this by using a vector of pointers instead of structures, and uses RefCountedObject to handle ref-counting. BUG=chromium:672951 Committed: https://crrev.com/62802a1b0e668a279268b5f2d3d1ea9c10869961 Cr-Commit-Position: refs/heads/master@{#15583}

Patch Set 1 #

Total comments: 6

Patch Set 2 : Use RefCountedObject instead of custom class. #

Total comments: 2

Patch Set 3 : Merge with master #

Total comments: 1
Unified diffs Side-by-side diffs Delta from patch set Stats (+81 lines, -69 lines) Patch
M webrtc/p2p/base/transportcontroller.h View 1 2 4 chunks +9 lines, -34 lines 0 comments Download
M webrtc/p2p/base/transportcontroller.cc View 1 2 15 chunks +72 lines, -35 lines 1 comment Download

Messages

Total messages: 25 (14 generated)
Taylor Brandstetter
4 years ago (2016-12-13 02:22:42 UTC) #6
honghaiz3
https://codereview.webrtc.org/2571683004/diff/1/webrtc/p2p/base/transportcontroller.h File webrtc/p2p/base/transportcontroller.h (right): https://codereview.webrtc.org/2571683004/diff/1/webrtc/p2p/base/transportcontroller.h#newcode174 webrtc/p2p/base/transportcontroller.h:174: RefCountedChannel(TransportChannelImpl* dtls, TransportChannelImpl* ice) Why do we implement our ...
4 years ago (2016-12-13 19:02:20 UTC) #8
Taylor Brandstetter
Please take a look again. I'm using RefCountedObject now, and am just using raw pointers ...
4 years ago (2016-12-13 22:42:36 UTC) #10
pthatcher1
lgtm, with nit https://codereview.webrtc.org/2571683004/diff/20001/webrtc/p2p/base/transportcontroller.cc File webrtc/p2p/base/transportcontroller.cc (right): https://codereview.webrtc.org/2571683004/diff/20001/webrtc/p2p/base/transportcontroller.cc#newcode447 webrtc/p2p/base/transportcontroller.cc:447: } Look at at refcountedobject.h, that ...
4 years ago (2016-12-13 23:36:56 UTC) #11
Taylor Brandstetter
https://codereview.webrtc.org/2571683004/diff/20001/webrtc/p2p/base/transportcontroller.cc File webrtc/p2p/base/transportcontroller.cc (right): https://codereview.webrtc.org/2571683004/diff/20001/webrtc/p2p/base/transportcontroller.cc#newcode447 webrtc/p2p/base/transportcontroller.cc:447: } On 2016/12/13 23:36:56, pthatcher1 wrote: > Look at ...
4 years ago (2016-12-13 23:50:50 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/2571683004/20001
4 years ago (2016-12-13 23:50:58 UTC) #14
commit-bot: I haz the power
Failed to apply patch for webrtc/p2p/base/transportcontroller.cc: While running git apply --index -p1; error: patch failed: ...
4 years ago (2016-12-14 00:08:11 UTC) #16
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/2571683004/40001
4 years ago (2016-12-14 00:12:15 UTC) #19
commit-bot: I haz the power
Committed patchset #3 (id:40001)
4 years ago (2016-12-14 00:38:41 UTC) #22
commit-bot: I haz the power
Patchset 3 (id:??) landed as https://crrev.com/62802a1b0e668a279268b5f2d3d1ea9c10869961 Cr-Commit-Position: refs/heads/master@{#15583}
4 years ago (2016-12-14 00:38:51 UTC) #24
honghaiz3
4 years ago (2016-12-14 01:20:00 UTC) #25
Message was sent while issue was closed.
lgtm

https://codereview.webrtc.org/2571683004/diff/40001/webrtc/p2p/base/transport...
File webrtc/p2p/base/transportcontroller.cc (right):

https://codereview.webrtc.org/2571683004/diff/40001/webrtc/p2p/base/transport...
webrtc/p2p/base/transportcontroller.cc:39: }  // namespace {
No left bracket.

Powered by Google App Engine
This is Rietveld 408576698