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

Side by Side Diff: remoting/protocol/webrtc_audio_source_adapter.cc

Issue 2890833002: Adding ThreadChecker validation to d'tors for protocol classes (Closed)
Patch Set: Created 3 years, 7 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 | « remoting/protocol/video_frame_pump.cc ('k') | remoting/protocol/webrtc_connection_to_client.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 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 "remoting/protocol/webrtc_audio_source_adapter.h" 5 #include "remoting/protocol/webrtc_audio_source_adapter.h"
6 6
7 #include <utility> 7 #include <utility>
8 8
9 #include "base/bind.h" 9 #include "base/bind.h"
10 #include "base/logging.h" 10 #include "base/logging.h"
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after
52 base::ObserverList<webrtc::AudioTrackSinkInterface> audio_sinks_; 52 base::ObserverList<webrtc::AudioTrackSinkInterface> audio_sinks_;
53 base::Lock audio_sinks_lock_; 53 base::Lock audio_sinks_lock_;
54 54
55 base::ThreadChecker thread_checker_; 55 base::ThreadChecker thread_checker_;
56 }; 56 };
57 57
58 WebrtcAudioSourceAdapter::Core::Core() { 58 WebrtcAudioSourceAdapter::Core::Core() {
59 thread_checker_.DetachFromThread(); 59 thread_checker_.DetachFromThread();
60 } 60 }
61 61
62 WebrtcAudioSourceAdapter::Core::~Core() {} 62 WebrtcAudioSourceAdapter::Core::~Core() {
63 DCHECK(thread_checker_.CalledOnValidThread());
64 }
63 65
64 void WebrtcAudioSourceAdapter::Core::Start( 66 void WebrtcAudioSourceAdapter::Core::Start(
65 std::unique_ptr<AudioSource> audio_source) { 67 std::unique_ptr<AudioSource> audio_source) {
66 DCHECK(thread_checker_.CalledOnValidThread()); 68 DCHECK(thread_checker_.CalledOnValidThread());
67 audio_source_ = std::move(audio_source); 69 audio_source_ = std::move(audio_source);
68 audio_source_->Start( 70 audio_source_->Start(
69 base::Bind(&Core::OnAudioPacket, base::Unretained(this))); 71 base::Bind(&Core::OnAudioPacket, base::Unretained(this)));
70 } 72 }
71 73
72 void WebrtcAudioSourceAdapter::Core::Pause(bool pause) { 74 void WebrtcAudioSourceAdapter::Core::Pause(bool pause) {
(...skipping 113 matching lines...) Expand 10 before | Expand all | Expand 10 after
186 core_->RemoveSink(sink); 188 core_->RemoveSink(sink);
187 } 189 }
188 190
189 void WebrtcAudioSourceAdapter::RegisterObserver( 191 void WebrtcAudioSourceAdapter::RegisterObserver(
190 webrtc::ObserverInterface* observer) {} 192 webrtc::ObserverInterface* observer) {}
191 void WebrtcAudioSourceAdapter::UnregisterObserver( 193 void WebrtcAudioSourceAdapter::UnregisterObserver(
192 webrtc::ObserverInterface* observer) {} 194 webrtc::ObserverInterface* observer) {}
193 195
194 } // namespace protocol 196 } // namespace protocol
195 } // namespace remoting 197 } // namespace remoting
OLDNEW
« no previous file with comments | « remoting/protocol/video_frame_pump.cc ('k') | remoting/protocol/webrtc_connection_to_client.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698