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

Unified Diff: third_party/WebKit/Source/modules/peerconnection/RTCPeerConnection.cpp

Issue 2772283002: Destroy WebRTCStatsReportCallbackResolver on main thread, fixes crash. (Closed)
Patch Set: DCHECK that the callback is invoked and destroyed on the expected thread Created 3 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « content/renderer/media/rtc_peer_connection_handler.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/Source/modules/peerconnection/RTCPeerConnection.cpp
diff --git a/third_party/WebKit/Source/modules/peerconnection/RTCPeerConnection.cpp b/third_party/WebKit/Source/modules/peerconnection/RTCPeerConnection.cpp
index 3ea3bc9602f0858f6c6515a79691b81cefd55fb2..fcea99b69faf1737293ee78a5592fd1dcd3292d2 100644
--- a/third_party/WebKit/Source/modules/peerconnection/RTCPeerConnection.cpp
+++ b/third_party/WebKit/Source/modules/peerconnection/RTCPeerConnection.cpp
@@ -393,13 +393,18 @@ class WebRTCStatsReportCallbackResolver : public WebRTCStatsReportCallback {
new WebRTCStatsReportCallbackResolver(resolver));
}
- ~WebRTCStatsReportCallbackResolver() override {}
+ ~WebRTCStatsReportCallbackResolver() override {
+ DCHECK(
+ m_resolver->getScriptState()->getExecutionContext()->isContextThread());
+ }
private:
WebRTCStatsReportCallbackResolver(ScriptPromiseResolver* resolver)
: m_resolver(resolver) {}
void OnStatsDelivered(std::unique_ptr<WebRTCStatsReport> report) override {
+ DCHECK(
+ m_resolver->getScriptState()->getExecutionContext()->isContextThread());
m_resolver->resolve(new RTCStatsReport(std::move(report)));
}
« no previous file with comments | « content/renderer/media/rtc_peer_connection_handler.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698