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

Unified Diff: ui/gl/gl_context.h

Issue 2347383002: X11: Use better visuals for OpenGL (Closed)
Patch Set: Fix various tests Created 4 years, 3 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: ui/gl/gl_context.h
diff --git a/ui/gl/gl_context.h b/ui/gl/gl_context.h
index ebc98faa88667c0317ab0bcb8f8bf107d3458b3d..f9fbcf8482ae072a5e9b943f1b489d5410671f13 100644
--- a/ui/gl/gl_context.h
+++ b/ui/gl/gl_context.h
@@ -12,6 +12,7 @@
#include "base/cancelable_callback.h"
#include "base/macros.h"
#include "base/memory/ref_counted.h"
+#include "base/memory/weak_ptr.h"
#include "base/synchronization/cancellation_flag.h"
#include "ui/gl/gl_export.h"
#include "ui/gl/gl_share_group.h"
@@ -131,6 +132,8 @@ class GL_EXPORT GLContext : public base::RefCounted<GLContext> {
// Returns a helper structure to convert YUV textures to RGB textures.
virtual YUVToRGBConverter* GetYUVToRGBConverter();
+ base::WeakPtr<GLContext> GetWeakPtr() { return weak_factory_.GetWeakPtr(); }
piman 2016/09/22 21:24:55 The contexts already tell their GLShareGroup when
Tom (Use chromium acct) 2016/09/23 20:00:37 Done.
+
protected:
virtual ~GLContext();
@@ -175,6 +178,8 @@ class GL_EXPORT GLContext : public base::RefCounted<GLContext> {
int swap_interval_;
bool force_swap_interval_zero_;
+ base::WeakPtrFactory<GLContext> weak_factory_;
+
DISALLOW_COPY_AND_ASSIGN(GLContext);
};

Powered by Google App Engine
This is Rietveld 408576698