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); |
}; |