OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #ifndef MOJO_GPU_GL_CONTEXT_OWNER_H_ | 5 #ifndef MOJO_GPU_GL_CONTEXT_OWNER_H_ |
6 #define MOJO_GPU_GL_CONTEXT_OWNER_H_ | 6 #define MOJO_GPU_GL_CONTEXT_OWNER_H_ |
7 | 7 |
8 #include "base/memory/weak_ptr.h" | 8 #include "base/memory/weak_ptr.h" |
9 | 9 |
10 namespace mojo { | 10 namespace mojo { |
11 class GLContext; | 11 class GLContext; |
12 class Shell; | 12 class Shell; |
13 | 13 |
14 class GLContextOwner { | 14 class GLContextOwner { |
15 public: | 15 public: |
16 explicit GLContextOwner(mojo::Shell* shell); | 16 explicit GLContextOwner(mojo::Shell* shell); |
17 ~GLContextOwner(); | 17 ~GLContextOwner(); |
18 | 18 |
19 const base::WeakPtr<mojo::GLContext>& context() const { | 19 const base::WeakPtr<mojo::GLContext>& context() const { return context_; } |
20 return context_; | |
21 } | |
22 | 20 |
23 private: | 21 private: |
24 base::WeakPtr<mojo::GLContext> context_; | 22 base::WeakPtr<mojo::GLContext> context_; |
25 | 23 |
26 DISALLOW_COPY_AND_ASSIGN(GLContextOwner); | 24 DISALLOW_COPY_AND_ASSIGN(GLContextOwner); |
27 }; | 25 }; |
28 | 26 |
29 } // namespace mojo | 27 } // namespace mojo |
30 | 28 |
31 #endif // MOJO_GPU_GL_CONTEXT_OWNER_H_ | 29 #endif // MOJO_GPU_GL_CONTEXT_OWNER_H_ |
OLD | NEW |