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

Side by Side Diff: remoting/client/software_video_renderer.cc

Issue 2886453004: Adding ThreadChecker validation to d'tors for client 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
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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/client/software_video_renderer.h" 5 #include "remoting/client/software_video_renderer.h"
6 6
7 #include <utility> 7 #include <utility>
8 8
9 #include "base/bind.h" 9 #include "base/bind.h"
10 #include "base/callback.h" 10 #include "base/callback.h"
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after
50 thread_checker_.DetachFromThread(); 50 thread_checker_.DetachFromThread();
51 } 51 }
52 52
53 SoftwareVideoRenderer::SoftwareVideoRenderer( 53 SoftwareVideoRenderer::SoftwareVideoRenderer(
54 std::unique_ptr<protocol::FrameConsumer> consumer) 54 std::unique_ptr<protocol::FrameConsumer> consumer)
55 : SoftwareVideoRenderer(consumer.get()) { 55 : SoftwareVideoRenderer(consumer.get()) {
56 owned_consumer_ = std::move(consumer); 56 owned_consumer_ = std::move(consumer);
57 } 57 }
58 58
59 SoftwareVideoRenderer::~SoftwareVideoRenderer() { 59 SoftwareVideoRenderer::~SoftwareVideoRenderer() {
60 DCHECK(thread_checker_.CalledOnValidThread());
61
60 if (decoder_) 62 if (decoder_)
61 decode_task_runner_->DeleteSoon(FROM_HERE, decoder_.release()); 63 decode_task_runner_->DeleteSoon(FROM_HERE, decoder_.release());
62 } 64 }
63 65
64 bool SoftwareVideoRenderer::Initialize( 66 bool SoftwareVideoRenderer::Initialize(
65 const ClientContext& client_context, 67 const ClientContext& client_context,
66 protocol::FrameStatsConsumer* stats_consumer) { 68 protocol::FrameStatsConsumer* stats_consumer) {
67 DCHECK(thread_checker_.CalledOnValidThread()); 69 DCHECK(thread_checker_.CalledOnValidThread());
68 decode_task_runner_ = client_context.decode_task_runner(); 70 decode_task_runner_ = client_context.decode_task_runner();
69 stats_consumer_ = stats_consumer; 71 stats_consumer_ = stats_consumer;
(...skipping 114 matching lines...) Expand 10 before | Expand all | Expand 10 after
184 186
185 stats->client_stats.time_rendered = base::TimeTicks::Now(); 187 stats->client_stats.time_rendered = base::TimeTicks::Now();
186 if (stats_consumer_) 188 if (stats_consumer_)
187 stats_consumer_->OnVideoFrameStats(*stats); 189 stats_consumer_->OnVideoFrameStats(*stats);
188 190
189 if (!done.is_null()) 191 if (!done.is_null())
190 done.Run(); 192 done.Run();
191 } 193 }
192 194
193 } // namespace remoting 195 } // namespace remoting
OLDNEW
« no previous file with comments | « remoting/client/plugin/pepper_video_renderer_2d.cc ('k') | remoting/ios/display/gl_demo_screen.mm » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698