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

Side by Side 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: Comment addressed 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 unified diff | Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "content/renderer/media/rtc_peer_connection_handler.h" 5 #include "content/renderer/media/rtc_peer_connection_handler.h"
6 6
7 #include <string.h> 7 #include <string.h>
8 8
9 #include <string> 9 #include <string>
10 #include <utility> 10 #include <utility>
(...skipping 374 matching lines...) Expand 10 before | Expand all | Expand 10 after
385 return; 385 return;
386 } 386 }
387 387
388 tracker_.TrackOnFailure(error); 388 tracker_.TrackOnFailure(error);
389 webkit_request_.requestFailed(base::UTF8ToUTF16(error)); 389 webkit_request_.requestFailed(base::UTF8ToUTF16(error));
390 webkit_request_.reset(); 390 webkit_request_.reset();
391 } 391 }
392 392
393 protected: 393 protected:
394 ~CreateSessionDescriptionRequest() override { 394 ~CreateSessionDescriptionRequest() override {
395 DCHECK(main_thread_->BelongsToCurrentThread()); 395 // This object is reference counted and its callback methods |OnSuccess| and
396 // |OnFailure| will be invoked on libjingle's signaling thread and posted to
397 // the main thread. Since the main thread may complete before the signaling
398 // thread has deferenced this object there is no guarantee that this object
399 // is destructed on the main thread.
396 DLOG_IF(ERROR, !webkit_request_.isNull()) 400 DLOG_IF(ERROR, !webkit_request_.isNull())
397 << "CreateSessionDescriptionRequest not completed. Shutting down?"; 401 << "CreateSessionDescriptionRequest not completed. Shutting down?";
398 } 402 }
399 403
400 const scoped_refptr<base::SingleThreadTaskRunner> main_thread_; 404 const scoped_refptr<base::SingleThreadTaskRunner> main_thread_;
401 blink::WebRTCSessionDescriptionRequest webkit_request_; 405 blink::WebRTCSessionDescriptionRequest webkit_request_;
402 SessionDescriptionRequestTracker tracker_; 406 SessionDescriptionRequestTracker tracker_;
403 }; 407 };
404 408
405 // Class mapping responses from calls to libjingle 409 // Class mapping responses from calls to libjingle
(...skipping 28 matching lines...) Expand all
434 base::Bind(&SetSessionDescriptionRequest::OnFailure, this, error)); 438 base::Bind(&SetSessionDescriptionRequest::OnFailure, this, error));
435 return; 439 return;
436 } 440 }
437 tracker_.TrackOnFailure(error); 441 tracker_.TrackOnFailure(error);
438 webkit_request_.requestFailed(base::UTF8ToUTF16(error)); 442 webkit_request_.requestFailed(base::UTF8ToUTF16(error));
439 webkit_request_.reset(); 443 webkit_request_.reset();
440 } 444 }
441 445
442 protected: 446 protected:
443 ~SetSessionDescriptionRequest() override { 447 ~SetSessionDescriptionRequest() override {
444 DCHECK(main_thread_->BelongsToCurrentThread()); 448 // This object is reference counted and its callback methods |OnSuccess| and
449 // |OnFailure| will be invoked on libjingle's signaling thread and posted to
450 // the main thread. Since the main thread may complete before the signaling
451 // thread has deferenced this object there is no guarantee that this object
452 // is destructed on the main thread.
445 DLOG_IF(ERROR, !webkit_request_.isNull()) 453 DLOG_IF(ERROR, !webkit_request_.isNull())
446 << "SetSessionDescriptionRequest not completed. Shutting down?"; 454 << "SetSessionDescriptionRequest not completed. Shutting down?";
447 } 455 }
448 456
449 private: 457 private:
450 const scoped_refptr<base::SingleThreadTaskRunner> main_thread_; 458 const scoped_refptr<base::SingleThreadTaskRunner> main_thread_;
451 blink::WebRTCVoidRequest webkit_request_; 459 blink::WebRTCVoidRequest webkit_request_;
452 SessionDescriptionRequestTracker tracker_; 460 SessionDescriptionRequestTracker tracker_;
453 }; 461 };
454 462
(...skipping 1439 matching lines...) Expand 10 before | Expand all | Expand 10 after
1894 } 1902 }
1895 1903
1896 void RTCPeerConnectionHandler::ResetUMAStats() { 1904 void RTCPeerConnectionHandler::ResetUMAStats() {
1897 DCHECK(thread_checker_.CalledOnValidThread()); 1905 DCHECK(thread_checker_.CalledOnValidThread());
1898 num_local_candidates_ipv6_ = 0; 1906 num_local_candidates_ipv6_ = 0;
1899 num_local_candidates_ipv4_ = 0; 1907 num_local_candidates_ipv4_ = 0;
1900 ice_connection_checking_start_ = base::TimeTicks(); 1908 ice_connection_checking_start_ = base::TimeTicks();
1901 memset(ice_state_seen_, 0, sizeof(ice_state_seen_)); 1909 memset(ice_state_seen_, 0, sizeof(ice_state_seen_));
1902 } 1910 }
1903 } // namespace content 1911 } // namespace content
OLDNEW
« 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