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

Issue 1957523006: Fixed a crash in Objective-C clients when data channel becomes closed. (Closed)

Created:
4 years, 7 months ago by skvlad
Modified:
4 years, 7 months ago
Reviewers:
tkchin_webrtc, Chuck
CC:
webrtc-reviews_webrtc.org, tterriberry_mozilla.com
Base URL:
https://chromium.googlesource.com/external/webrtc.git@master
Target Ref:
refs/pending/heads/master
Project:
webrtc
Visibility:
Public.

Description

Fixed a crash in Objective-C clients when data channel becomes closed. Objective-C applications using the data channel could crash when the following conditions were met: - The application creates a data channel and sets a data channel delegate - The delegate is deallocated but the application never clears it When this happens, the dealloc method in RTCDataChannel would reset the delegate to nil. The setDelegate: method immediately returns if the new delegate value is the same as the old one. Since the old one is a weak reference, it becomes nil, and the DataChannelDelegateAdapter is not unsubscribed from the native channel before it gets deleted. The fix removes the two optimizations, and instead subscribes the adapter to the native data channel at creation time - and unsubscribes it at dealloc time. This makes it very easy to reason about the lifetime of the subscription. Removing the optimization should have little effect on performance, as applications typically set the delegate when the channel is created. BUG= Committed: https://crrev.com/630d9ba364db875ee5a4b78a6e7f1fbaa0719b10 Cr-Commit-Position: refs/heads/master@{#12649}

Patch Set 1 #

Unified diffs Side-by-side diffs Delta from patch set Stats (+2 lines, -16 lines) Patch
M webrtc/sdk/objc/Framework/Classes/RTCDataChannel.mm View 3 chunks +2 lines, -16 lines 0 comments Download

Messages

Total messages: 8 (3 generated)
skvlad
4 years, 7 months ago (2016-05-06 20:55:09 UTC) #2
tkchin_webrtc
On 2016/05/06 20:55:09, skvlad wrote: good work lgtm
4 years, 7 months ago (2016-05-06 21:13:28 UTC) #3
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1957523006/1 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1957523006/1
4 years, 7 months ago (2016-05-06 22:10:32 UTC) #5
commit-bot: I haz the power
Committed patchset #1 (id:1)
4 years, 7 months ago (2016-05-06 23:10:49 UTC) #6
commit-bot: I haz the power
4 years, 7 months ago (2016-05-06 23:11:00 UTC) #8
Message was sent while issue was closed.
Patchset 1 (id:??) landed as
https://crrev.com/630d9ba364db875ee5a4b78a6e7f1fbaa0719b10
Cr-Commit-Position: refs/heads/master@{#12649}

Powered by Google App Engine
This is Rietveld 408576698