OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 CONTENT_COMMON_GPU_CLIENT_WEBGRAPHICSCONTEXT3D_COMMAND_BUFFER_IMPL_H_ | 5 #ifndef CONTENT_COMMON_GPU_CLIENT_WEBGRAPHICSCONTEXT3D_COMMAND_BUFFER_IMPL_H_ |
6 #define CONTENT_COMMON_GPU_CLIENT_WEBGRAPHICSCONTEXT3D_COMMAND_BUFFER_IMPL_H_ | 6 #define CONTENT_COMMON_GPU_CLIENT_WEBGRAPHICSCONTEXT3D_COMMAND_BUFFER_IMPL_H_ |
7 | 7 |
8 #include <string> | 8 #include <string> |
9 #include <vector> | 9 #include <vector> |
10 | 10 |
(...skipping 127 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
138 const GURL& active_url, | 138 const GURL& active_url, |
139 const SharedMemoryLimits& limits, | 139 const SharedMemoryLimits& limits, |
140 WebGraphicsContext3DCommandBufferImpl* share_context); | 140 WebGraphicsContext3DCommandBufferImpl* share_context); |
141 | 141 |
142 size_t GetMappedMemoryLimit() { | 142 size_t GetMappedMemoryLimit() { |
143 return mem_limits_.mapped_memory_reclaim_limit; | 143 return mem_limits_.mapped_memory_reclaim_limit; |
144 } | 144 } |
145 | 145 |
146 CONTENT_EXPORT bool InitializeOnCurrentThread(); | 146 CONTENT_EXPORT bool InitializeOnCurrentThread(); |
147 | 147 |
| 148 void InvalidateWeakPtrsOnCurrentThread(); |
| 149 |
148 void SetContextType(CommandBufferContextType type) { | 150 void SetContextType(CommandBufferContextType type) { |
149 context_type_ = type; | 151 context_type_ = type; |
150 } | 152 } |
151 private: | 153 private: |
152 // These are the same error codes as used by EGL. | 154 // These are the same error codes as used by EGL. |
153 enum Error { | 155 enum Error { |
154 SUCCESS = 0x3000, | 156 SUCCESS = 0x3000, |
155 BAD_ATTRIBUTE = 0x3004, | 157 BAD_ATTRIBUTE = 0x3004, |
156 CONTEXT_LOST = 0x300E | 158 CONTEXT_LOST = 0x300E |
157 }; | 159 }; |
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
208 | 210 |
209 // Member variables should appear before the WeakPtrFactory, to ensure | 211 // Member variables should appear before the WeakPtrFactory, to ensure |
210 // that any WeakPtrs to Controller are invalidated before its members | 212 // that any WeakPtrs to Controller are invalidated before its members |
211 // variable's destructors are executed, rendering them invalid. | 213 // variable's destructors are executed, rendering them invalid. |
212 base::WeakPtrFactory<WebGraphicsContext3DCommandBufferImpl> weak_ptr_factory_; | 214 base::WeakPtrFactory<WebGraphicsContext3DCommandBufferImpl> weak_ptr_factory_; |
213 }; | 215 }; |
214 | 216 |
215 } // namespace content | 217 } // namespace content |
216 | 218 |
217 #endif // CONTENT_COMMON_GPU_CLIENT_WEBGRAPHICSCONTEXT3D_COMMAND_BUFFER_IMPL_H_ | 219 #endif // CONTENT_COMMON_GPU_CLIENT_WEBGRAPHICSCONTEXT3D_COMMAND_BUFFER_IMPL_H_ |
OLD | NEW |