Chromium Code Reviews| Index: remoting/client/display/gl_cursor.cc |
| diff --git a/remoting/client/display/gl_cursor.cc b/remoting/client/display/gl_cursor.cc |
| index 113de2566533260551eaa8a19fdf55053f091cd8..07f7a014ecea3fee512156e2926f42ca6bb3f03f 100644 |
| --- a/remoting/client/display/gl_cursor.cc |
| +++ b/remoting/client/display/gl_cursor.cc |
| @@ -18,7 +18,9 @@ namespace { |
| const int kDefaultCursorDataSize = 32 * 32 * GlRenderLayer::kBytesPerPixel; |
| } // namespace |
| -GlCursor::GlCursor() : weak_factory_(this) {} |
| +GlCursor::GlCursor() : weak_factory_(this) { |
| + weak_ptr_ = weak_factory_.GetWeakPtr(); |
|
Sergey Ulanov
2017/01/13 02:03:10
With the current implementation of WeakFactory to
|
| +} |
| GlCursor::~GlCursor() {} |
| @@ -81,7 +83,6 @@ void GlCursor::SetCanvas(base::WeakPtr<Canvas> canvas) { |
| } |
| bool GlCursor::Draw() { |
| - DCHECK(thread_checker_.CalledOnValidThread()); |
| if (layer_ && current_cursor_data_ && visible_) { |
| layer_->Draw(1.f); |
| } |
| @@ -105,8 +106,7 @@ void GlCursor::SetCurrentCursorShape(bool size_changed) { |
| } |
| base::WeakPtr<Drawable> GlCursor::GetWeakPtr() { |
|
Sergey Ulanov
2017/01/13 02:03:10
Does this function really need to be thread-safe?
nicholss
2017/01/13 16:45:00
I think in the future it will be accessed via many
|
| - DCHECK(thread_checker_.CalledOnValidThread()); |
| - return weak_factory_.GetWeakPtr(); |
| + return weak_ptr_; |
| } |
| } // namespace remoting |