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

Unified Diff: gpu/command_buffer/service/query_manager.cc

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: Rebased Created 8 years, 7 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « gpu/command_buffer/service/query_manager.h ('k') | media/audio/audio_input_controller.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: gpu/command_buffer/service/query_manager.cc
diff --git a/gpu/command_buffer/service/query_manager.cc b/gpu/command_buffer/service/query_manager.cc
index 81ac83e09349223c9f89f6c3ccf14f7f6cff7a36..14a4ab4858178d32066f96253bca458621f31813 100644
--- a/gpu/command_buffer/service/query_manager.cc
+++ b/gpu/command_buffer/service/query_manager.cc
@@ -18,12 +18,14 @@ class AllSamplesPassedQuery : public QueryManager::Query {
AllSamplesPassedQuery(
QueryManager* manager, GLenum target, int32 shm_id, uint32 shm_offset,
GLuint service_id);
- virtual ~AllSamplesPassedQuery();
virtual bool Begin() OVERRIDE;
virtual bool End(uint32 submit_count) OVERRIDE;
virtual bool Process() OVERRIDE;
virtual void Destroy(bool have_context) OVERRIDE;
+ protected:
+ virtual ~AllSamplesPassedQuery();
+
private:
// Service side query id.
GLuint service_id_;
@@ -36,16 +38,6 @@ AllSamplesPassedQuery::AllSamplesPassedQuery(
service_id_(service_id) {
}
-AllSamplesPassedQuery::~AllSamplesPassedQuery() {
-}
-
-void AllSamplesPassedQuery::Destroy(bool have_context) {
- if (have_context && !IsDeleted()) {
- glDeleteQueriesARB(1, &service_id_);
- MarkAsDeleted();
- }
-}
-
bool AllSamplesPassedQuery::Begin() {
BeginQueryHelper(target(), service_id_);
return true;
@@ -70,17 +62,29 @@ bool AllSamplesPassedQuery::Process() {
return MarkAsCompleted(result != 0);
}
+void AllSamplesPassedQuery::Destroy(bool have_context) {
+ if (have_context && !IsDeleted()) {
+ glDeleteQueriesARB(1, &service_id_);
+ MarkAsDeleted();
+ }
+}
+
+AllSamplesPassedQuery::~AllSamplesPassedQuery() {
+}
+
class CommandsIssuedQuery : public QueryManager::Query {
public:
CommandsIssuedQuery(
QueryManager* manager, GLenum target, int32 shm_id, uint32 shm_offset);
- virtual ~CommandsIssuedQuery();
virtual bool Begin() OVERRIDE;
virtual bool End(uint32 submit_count) OVERRIDE;
virtual bool Process() OVERRIDE;
virtual void Destroy(bool have_context) OVERRIDE;
+ protected:
+ virtual ~CommandsIssuedQuery();
+
private:
base::TimeTicks begin_time_;
};
@@ -90,14 +94,6 @@ CommandsIssuedQuery::CommandsIssuedQuery(
: Query(manager, target, shm_id, shm_offset) {
}
-CommandsIssuedQuery::~CommandsIssuedQuery() {
-}
-
-bool CommandsIssuedQuery::Process() {
- NOTREACHED();
- return true;
-}
-
bool CommandsIssuedQuery::Begin() {
begin_time_ = base::TimeTicks::HighResNow();
return true;
@@ -110,12 +106,20 @@ bool CommandsIssuedQuery::End(uint32 submit_count) {
std::min(elapsed.InMicroseconds(), static_cast<int64>(0xFFFFFFFFL)));
}
+bool CommandsIssuedQuery::Process() {
+ NOTREACHED();
+ return true;
+}
+
void CommandsIssuedQuery::Destroy(bool /* have_context */) {
if (!IsDeleted()) {
MarkAsDeleted();
}
}
+CommandsIssuedQuery::~CommandsIssuedQuery() {
+}
+
QueryManager::QueryManager(
CommonDecoder* decoder,
FeatureInfo* feature_info)
« no previous file with comments | « gpu/command_buffer/service/query_manager.h ('k') | media/audio/audio_input_controller.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698