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

Side by Side Diff: remoting/client/display/gl_cursor_feedback.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
« no previous file with comments | « remoting/client/display/gl_cursor.cc ('k') | remoting/client/display/gl_desktop.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/client/display/gl_cursor_feedback.h" 5 #include "remoting/client/display/gl_cursor_feedback.h"
6 6
7 #include <math.h> 7 #include <math.h>
8 8
9 #include <array> 9 #include <array>
10 10
(...skipping 27 matching lines...) Expand all
38 static const float kExpansionNormalization = get_unnormalized_coeff(1); 38 static const float kExpansionNormalization = get_unnormalized_coeff(1);
39 return get_unnormalized_coeff(progress) / kExpansionNormalization; 39 return get_unnormalized_coeff(progress) / kExpansionNormalization;
40 } 40 }
41 41
42 } // namespace 42 } // namespace
43 43
44 namespace remoting { 44 namespace remoting {
45 45
46 GlCursorFeedback::GlCursorFeedback() : weak_factory_(this) {} 46 GlCursorFeedback::GlCursorFeedback() : weak_factory_(this) {}
47 47
48 GlCursorFeedback::~GlCursorFeedback() {} 48 GlCursorFeedback::~GlCursorFeedback() {
49 DCHECK(thread_checker_.CalledOnValidThread());
50 }
49 51
50 void GlCursorFeedback::SetCanvas(base::WeakPtr<Canvas> canvas) { 52 void GlCursorFeedback::SetCanvas(base::WeakPtr<Canvas> canvas) {
51 if (!canvas) { 53 if (!canvas) {
52 layer_.reset(); 54 layer_.reset();
53 return; 55 return;
54 } 56 }
55 layer_.reset(new GlRenderLayer(kGlCursorFeedbackTextureId, canvas)); 57 layer_.reset(new GlRenderLayer(kGlCursorFeedbackTextureId, canvas));
56 GlCursorFeedbackTexture* texture = GlCursorFeedbackTexture::GetInstance(); 58 GlCursorFeedbackTexture* texture = GlCursorFeedbackTexture::GetInstance();
57 layer_->SetTexture(texture->GetTexture().data(), 59 layer_->SetTexture(texture->GetTexture().data(),
58 GlCursorFeedbackTexture::kTextureWidth, 60 GlCursorFeedbackTexture::kTextureWidth,
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after
93 int GlCursorFeedback::GetZIndex() { 95 int GlCursorFeedback::GetZIndex() {
94 return Drawable::ZIndex::CURSOR_FEEDBACK; 96 return Drawable::ZIndex::CURSOR_FEEDBACK;
95 } 97 }
96 98
97 base::WeakPtr<Drawable> GlCursorFeedback::GetWeakPtr() { 99 base::WeakPtr<Drawable> GlCursorFeedback::GetWeakPtr() {
98 DCHECK(thread_checker_.CalledOnValidThread()); 100 DCHECK(thread_checker_.CalledOnValidThread());
99 return weak_factory_.GetWeakPtr(); 101 return weak_factory_.GetWeakPtr();
100 } 102 }
101 103
102 } // namespace remoting 104 } // namespace remoting
OLDNEW
« no previous file with comments | « remoting/client/display/gl_cursor.cc ('k') | remoting/client/display/gl_desktop.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698