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

Unified Diff: content/renderer/media/rtc_peer_connection_handler.cc

Issue 2222553002: Removed invalid thread DCHECKs in rtc_peer_connection_handler.cc (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Removed destructor DCHECKs and added a comment Created 4 years, 4 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 | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/renderer/media/rtc_peer_connection_handler.cc
diff --git a/content/renderer/media/rtc_peer_connection_handler.cc b/content/renderer/media/rtc_peer_connection_handler.cc
index 37b9d05cf8ecaee67b048bbefe03ff8a552d94b4..bf872633b2ab5dc1800c0ad9aa5abf1d296710d3 100644
--- a/content/renderer/media/rtc_peer_connection_handler.cc
+++ b/content/renderer/media/rtc_peer_connection_handler.cc
@@ -392,7 +392,11 @@ class CreateSessionDescriptionRequest
protected:
~CreateSessionDescriptionRequest() override {
- DCHECK(main_thread_->BelongsToCurrentThread());
+ // This object is reference counted and its callback methods |OnSuccess| and
+ // |OnFailure| may be invoked on any thread, for non-main threads the
perkj_chrome 2016/08/17 11:16:14 I had problem reading the sentence "This object
hbos_chromium 2016/08/17 13:53:26 Done.
+ // callback is posted to the main thread. Since the post may complete before
+ // the non-main thread has dereferenced this object there is no guarantee
+ // that this object is destructed on the main thread.
DLOG_IF(ERROR, !webkit_request_.isNull())
<< "CreateSessionDescriptionRequest not completed. Shutting down?";
}
@@ -441,7 +445,11 @@ class SetSessionDescriptionRequest
protected:
~SetSessionDescriptionRequest() override {
- DCHECK(main_thread_->BelongsToCurrentThread());
+ // This object is reference counted and its callback methods |OnSuccess| and
+ // |OnFailure| may be invoked on any thread, for non-main threads the
+ // callback is posted to the main thread. Since the post may complete before
+ // the non-main thread has dereferenced this object there is no guarantee
+ // that this object is destructed on the main thread.
DLOG_IF(ERROR, !webkit_request_.isNull())
<< "SetSessionDescriptionRequest not completed. Shutting down?";
}
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698