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

Unified Diff: remoting/client/display/gl_cursor.cc

Issue 2623413004: [Remoting Android] Fix thread issue with OpenGL drawable (Closed)
Patch Set: PTAL Point Created 3 years, 11 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 side-by-side diff with in-line comments
Download patch
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

Powered by Google App Engine
This is Rietveld 408576698