OLD | NEW |
---|---|
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 Loading... | |
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| 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.
| |
397 // callback is posted to the main thread. Since the post may complete before | |
398 // the non-main thread has dereferenced this object there is no guarantee | |
399 // that this object 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 Loading... | |
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| may be invoked on any thread, for non-main threads the | |
450 // callback is posted to the main thread. Since the post may complete before | |
451 // the non-main thread has dereferenced this object there is no guarantee | |
452 // that this object 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 Loading... | |
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 |
OLD | NEW |