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: sky/compositor/layer_host.h

Issue 761503004: Fix several leaks in the Sky compositor (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: Fix typo Created 6 years, 1 month 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: sky/compositor/layer_host.h
diff --git a/sky/compositor/layer_host.h b/sky/compositor/layer_host.h
index 2f8ccdbeeeaf828bb2973745422f50125b405f3a..0b9616c7ce476311be7c84b0a358fba396fdbebb 100644
--- a/sky/compositor/layer_host.h
+++ b/sky/compositor/layer_host.h
@@ -8,6 +8,7 @@
#include "base/memory/ref_counted.h"
#include "base/memory/scoped_ptr.h"
#include "base/memory/weak_ptr.h"
+#include "mojo/gpu/gl_context_owner.h"
#include "mojo/skia/ganesh_context.h"
#include "sky/compositor/layer_host_client.h"
#include "sky/compositor/resource_manager.h"
@@ -26,7 +27,7 @@ class LayerHost : public SurfaceHolder::Client {
LayerHostClient* client() const { return client_; }
const base::WeakPtr<mojo::GLContext>& gl_context() const {
- return gl_context_;
+ return gl_context_owner_.context();
}
mojo::GaneshContext* ganesh_context() const {
@@ -63,7 +64,7 @@ class LayerHost : public SurfaceHolder::Client {
State state_;
bool frame_requested_;
SurfaceHolder surface_holder_;
- base::WeakPtr<mojo::GLContext> gl_context_;
+ mojo::GLContextOwner gl_context_owner_;
mojo::GaneshContext ganesh_context_;
ResourceManager resource_manager_;
scoped_refptr<Layer> root_layer_;

Powered by Google App Engine
This is Rietveld 408576698