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

Side by Side Diff: remoting/protocol/webrtc_video_stream.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/webrtc_transport.cc ('k') | 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 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 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_video_stream.h" 5 #include "remoting/protocol/webrtc_video_stream.h"
6 6
7 #include <utility> 7 #include <utility>
8 8
9 #include "base/logging.h" 9 #include "base/logging.h"
10 #include "base/single_thread_task_runner.h" 10 #include "base/single_thread_task_runner.h"
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after
44 44
45 struct WebrtcVideoStream::EncodedFrameWithStats { 45 struct WebrtcVideoStream::EncodedFrameWithStats {
46 std::unique_ptr<WebrtcVideoEncoder::EncodedFrame> frame; 46 std::unique_ptr<WebrtcVideoEncoder::EncodedFrame> frame;
47 std::unique_ptr<FrameStats> stats; 47 std::unique_ptr<FrameStats> stats;
48 }; 48 };
49 49
50 WebrtcVideoStream::WebrtcVideoStream() 50 WebrtcVideoStream::WebrtcVideoStream()
51 : video_stats_dispatcher_(kStreamLabel), weak_factory_(this) {} 51 : video_stats_dispatcher_(kStreamLabel), weak_factory_(this) {}
52 52
53 WebrtcVideoStream::~WebrtcVideoStream() { 53 WebrtcVideoStream::~WebrtcVideoStream() {
54 DCHECK(thread_checker_.CalledOnValidThread());
54 if (stream_) { 55 if (stream_) {
55 for (const auto& track : stream_->GetVideoTracks()) { 56 for (const auto& track : stream_->GetVideoTracks()) {
56 stream_->RemoveTrack(track.get()); 57 stream_->RemoveTrack(track.get());
57 } 58 }
58 peer_connection_->RemoveStream(stream_.get()); 59 peer_connection_->RemoveStream(stream_.get());
59 } 60 }
60 encode_task_runner_->DeleteSoon(FROM_HERE, encoder_.release()); 61 encode_task_runner_->DeleteSoon(FROM_HERE, encoder_.release());
61 } 62 }
62 63
63 void WebrtcVideoStream::Start( 64 void WebrtcVideoStream::Start(
(...skipping 210 matching lines...) Expand 10 before | Expand all | Expand 10 after
274 encoder_ = WebrtcVideoEncoderVpx::CreateForVP8(); 275 encoder_ = WebrtcVideoEncoderVpx::CreateForVP8();
275 } else if (codec_type == webrtc::kVideoCodecVP9) { 276 } else if (codec_type == webrtc::kVideoCodecVP9) {
276 encoder_ = WebrtcVideoEncoderVpx::CreateForVP9(); 277 encoder_ = WebrtcVideoEncoderVpx::CreateForVP9();
277 } else { 278 } else {
278 LOG(FATAL) << "Unknown codec type: " << codec_type; 279 LOG(FATAL) << "Unknown codec type: " << codec_type;
279 } 280 }
280 } 281 }
281 282
282 } // namespace protocol 283 } // namespace protocol
283 } // namespace remoting 284 } // namespace remoting
OLDNEW
« no previous file with comments | « remoting/protocol/webrtc_transport.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698