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

Issue 2772283002: Destroy WebRTCStatsReportCallbackResolver on main thread, fixes crash. (Closed)

Created:
3 years, 9 months ago by hbos_chromium
Modified:
3 years, 9 months ago
Reviewers:
Guido Urdaneta, sof
CC:
chromium-reviews, posciak+watch_chromium.org, mlamouri+watch-content_chromium.org, jam, darin-cc_chromium.org, feature-media-reviews_chromium.org
Target Ref:
refs/heads/master
Project:
chromium
Visibility:
Public.

Description

Destroy WebRTCStatsReportCallbackResolver on main thread, fixes crash. The WebRTCStatsReportCallbackResolver has a Persistent<ScriptPromiseResolver> and needs to be destroyed on the main thread (blink/javascript thread). The callback resolver is an implementation of WebRTCStatsReportCallback which is referenced and owned by GetRTCStatsCallback::callback_. callback_.reset() added to OnStatsDeliveredOnMainThread. Previously it was implicitly reset by the destructor, which could occur either on the webrtc signaling thread or the main thread depending on which thread held the last reference to the GetRTCStatsCallback (race). BUG=700068 Review-Url: https://codereview.chromium.org/2772283002 Cr-Commit-Position: refs/heads/master@{#459784} Committed: https://chromium.googlesource.com/chromium/src/+/b39b8d6fb03d46dff5556e7a5c428ac9302f5579

Patch Set 1 #

Total comments: 2

Patch Set 2 : callback_.reset(), not release() #

Patch Set 3 : DCHECK that the callback is invoked and destroyed on the expected thread #

Unified diffs Side-by-side diffs Delta from patch set Stats (+18 lines, -9 lines) Patch
M content/renderer/media/rtc_peer_connection_handler.cc View 1 2 chunks +12 lines, -8 lines 0 comments Download
M third_party/WebKit/Source/modules/peerconnection/RTCPeerConnection.cpp View 1 2 1 chunk +6 lines, -1 line 0 comments Download

Messages

Total messages: 22 (14 generated)
hbos_chromium
Please take a look, guidou.
3 years, 9 months ago (2017-03-27 12:15:44 UTC) #4
Guido Urdaneta
https://codereview.chromium.org/2772283002/diff/1/content/renderer/media/rtc_peer_connection_handler.cc File content/renderer/media/rtc_peer_connection_handler.cc (right): https://codereview.chromium.org/2772283002/diff/1/content/renderer/media/rtc_peer_connection_handler.cc#newcode757 content/renderer/media/rtc_peer_connection_handler.cc:757: callback_.release(); I think you want .reset() here. release() does ...
3 years, 9 months ago (2017-03-27 12:19:46 UTC) #5
hbos_chromium
PTAL guidou https://codereview.chromium.org/2772283002/diff/1/content/renderer/media/rtc_peer_connection_handler.cc File content/renderer/media/rtc_peer_connection_handler.cc (right): https://codereview.chromium.org/2772283002/diff/1/content/renderer/media/rtc_peer_connection_handler.cc#newcode757 content/renderer/media/rtc_peer_connection_handler.cc:757: callback_.release(); On 2017/03/27 12:19:46, Guido Urdaneta wrote: ...
3 years, 9 months ago (2017-03-27 12:22:45 UTC) #9
Guido Urdaneta
lgtm
3 years, 9 months ago (2017-03-27 12:23:55 UTC) #10
Guido Urdaneta
still lgtm
3 years, 9 months ago (2017-03-27 14:56:44 UTC) #15
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.org/2772283002/40001
3 years, 9 months ago (2017-03-27 14:57:45 UTC) #17
commit-bot: I haz the power
Committed patchset #3 (id:40001) as https://chromium.googlesource.com/chromium/src/+/b39b8d6fb03d46dff5556e7a5c428ac9302f5579
3 years, 9 months ago (2017-03-27 15:05:56 UTC) #20
sof
3 years, 9 months ago (2017-03-28 06:40:55 UTC) #22
Message was sent while issue was closed.
that heads off any finalization complexity, good fix.

Powered by Google App Engine
This is Rietveld 408576698