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

Side by Side Diff: gpu/command_buffer/service/query_manager.h

Issue 10067035: RefCounted types should not have public destructors, media/ and gpu/ edition (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 8 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
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 GPU_COMMAND_BUFFER_SERVICE_QUERY_MANAGER_H_ 5 #ifndef GPU_COMMAND_BUFFER_SERVICE_QUERY_MANAGER_H_
6 #define GPU_COMMAND_BUFFER_SERVICE_QUERY_MANAGER_H_ 6 #define GPU_COMMAND_BUFFER_SERVICE_QUERY_MANAGER_H_
7 7
8 #include <deque> 8 #include <deque>
9 #include "base/basictypes.h" 9 #include "base/basictypes.h"
10 #include "base/hash_tables.h" 10 #include "base/hash_tables.h"
(...skipping 11 matching lines...) Expand all
22 22
23 // This class keeps track of the queries and their state 23 // This class keeps track of the queries and their state
24 // As Queries are not shared there is one QueryManager per context. 24 // As Queries are not shared there is one QueryManager per context.
25 class GPU_EXPORT QueryManager { 25 class GPU_EXPORT QueryManager {
26 public: 26 public:
27 class GPU_EXPORT Query : public base::RefCounted<Query> { 27 class GPU_EXPORT Query : public base::RefCounted<Query> {
28 public: 28 public:
29 typedef scoped_refptr<Query> Ref; 29 typedef scoped_refptr<Query> Ref;
30 30
31 Query( 31 Query(
32 QueryManager* manager, GLenum target, int32 shm_id, uint32 shm_offset); 32 QueryManager* manager, GLenum target, int32 shm_id, uint32 shm_offset);
33 virtual ~Query();
34 33
35 GLenum target() const { 34 GLenum target() const {
36 return target_; 35 return target_;
37 } 36 }
38 37
39 bool IsDeleted() const { 38 bool IsDeleted() const {
40 return deleted_; 39 return deleted_;
41 } 40 }
42 41
43 bool IsValid() const { 42 bool IsValid() const {
(...skipping 17 matching lines...) Expand all
61 60
62 // Returns false if shared memory for sync is invalid. 61 // Returns false if shared memory for sync is invalid.
63 virtual bool End(uint32 submit_count) = 0; 62 virtual bool End(uint32 submit_count) = 0;
64 63
65 // Returns false if shared memory for sync is invalid. 64 // Returns false if shared memory for sync is invalid.
66 virtual bool Process() = 0; 65 virtual bool Process() = 0;
67 66
68 virtual void Destroy(bool have_context) = 0; 67 virtual void Destroy(bool have_context) = 0;
69 68
70 protected: 69 protected:
70 virtual ~Query();
71
71 QueryManager* manager() const { 72 QueryManager* manager() const {
72 return manager_; 73 return manager_;
73 } 74 }
74 75
75 void MarkAsDeleted() { 76 void MarkAsDeleted() {
76 deleted_ = true; 77 deleted_ = true;
77 } 78 }
78 79
79 // Returns false if shared memory for sync is invalid. 80 // Returns false if shared memory for sync is invalid.
80 bool MarkAsCompleted(GLuint result); 81 bool MarkAsCompleted(GLuint result);
(...skipping 111 matching lines...) Expand 10 before | Expand all | Expand 10 after
192 typedef std::deque<Query::Ref> QueryQueue; 193 typedef std::deque<Query::Ref> QueryQueue;
193 QueryQueue pending_queries_; 194 QueryQueue pending_queries_;
194 195
195 DISALLOW_COPY_AND_ASSIGN(QueryManager); 196 DISALLOW_COPY_AND_ASSIGN(QueryManager);
196 }; 197 };
197 198
198 } // namespace gles2 199 } // namespace gles2
199 } // namespace gpu 200 } // namespace gpu
200 201
201 #endif // GPU_COMMAND_BUFFER_SERVICE_QUERY_MANAGER_H_ 202 #endif // GPU_COMMAND_BUFFER_SERVICE_QUERY_MANAGER_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698