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

Unified Diff: remoting/client/display/gl_desktop.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_desktop.cc
diff --git a/remoting/client/display/gl_desktop.cc b/remoting/client/display/gl_desktop.cc
index 41cb463209dfc4f1dbf716008bfebbd14eebb21b..946e7105000c3c7918cd6e751bf173de717d60cd 100644
--- a/remoting/client/display/gl_desktop.cc
+++ b/remoting/client/display/gl_desktop.cc
@@ -57,7 +57,9 @@ struct GlDesktop::GlDesktopTextureContainer {
webrtc::DesktopRect rect;
};
-GlDesktop::GlDesktop() : weak_factory_(this) {}
+GlDesktop::GlDesktop() : weak_factory_(this) {
+ weak_ptr_ = weak_factory_.GetWeakPtr();
+}
GlDesktop::~GlDesktop() {}
@@ -84,7 +86,6 @@ void GlDesktop::SetVideoFrame(const webrtc::DesktopFrame& frame) {
}
bool GlDesktop::Draw() {
- DCHECK(thread_checker_.CalledOnValidThread());
if (!textures_.empty() && !last_desktop_size_.is_empty()) {
for (std::unique_ptr<GlDesktopTextureContainer>& texture : textures_) {
texture->layer->Draw(1.0f);
@@ -132,8 +133,7 @@ void GlDesktop::ReallocateTextures(const webrtc::DesktopSize& size) {
}
base::WeakPtr<Drawable> GlDesktop::GetWeakPtr() {
- DCHECK(thread_checker_.CalledOnValidThread());
- return weak_factory_.GetWeakPtr();
+ return weak_ptr_;
}
} // namespace remoting

Powered by Google App Engine
This is Rietveld 408576698