summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorrsleevi@chromium.org <rsleevi@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-04-28 08:16:04 +0000
committerrsleevi@chromium.org <rsleevi@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-04-28 08:16:04 +0000
commit60e60dd3c997d406461f3f56f97937544f2120dd (patch)
tree7195f67c85c4906cd45701f7eca6f3adab6bead5
parent215605c46baa9cf76d5293bac0fbb9ee0914ae4f (diff)
downloadchromium_src-60e60dd3c997d406461f3f56f97937544f2120dd.zip
chromium_src-60e60dd3c997d406461f3f56f97937544f2120dd.tar.gz
chromium_src-60e60dd3c997d406461f3f56f97937544f2120dd.tar.bz2
RefCounted types should not have public destructors, sql/ and jingle/ edition
BUG=123295 TEST=none Review URL: http://codereview.chromium.org/10038045 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@134456 0039d316-1c4b-4281-b951-d872f2087c98
-rw-r--r--jingle/glue/pseudotcp_adapter.cc4
-rw-r--r--jingle/glue/pseudotcp_adapter_unittest.cc6
-rw-r--r--sql/sqlite_features_unittest.cc7
-rw-r--r--sql/statement_unittest.cc5
4 files changed, 16 insertions, 6 deletions
diff --git a/jingle/glue/pseudotcp_adapter.cc b/jingle/glue/pseudotcp_adapter.cc
index 7458f89..40e99e3 100644
--- a/jingle/glue/pseudotcp_adapter.cc
+++ b/jingle/glue/pseudotcp_adapter.cc
@@ -26,7 +26,6 @@ class PseudoTcpAdapter::Core : public cricket::IPseudoTcpNotify,
public base::RefCounted<Core> {
public:
Core(net::Socket* socket);
- virtual ~Core();
// Functions used to implement net::StreamSocket.
int Read(net::IOBuffer* buffer, int buffer_size,
@@ -57,6 +56,9 @@ class PseudoTcpAdapter::Core : public cricket::IPseudoTcpNotify,
void DeleteSocket();
private:
+ friend class base::RefCounted<Core>;
+ virtual ~Core();
+
// These are invoked by the underlying Socket, and may trigger callbacks.
// They hold a reference to |this| while running, to protect from deletion.
void OnRead(int result);
diff --git a/jingle/glue/pseudotcp_adapter_unittest.cc b/jingle/glue/pseudotcp_adapter_unittest.cc
index 4b4431e..3ff69c7 100644
--- a/jingle/glue/pseudotcp_adapter_unittest.cc
+++ b/jingle/glue/pseudotcp_adapter_unittest.cc
@@ -181,8 +181,6 @@ class TCPChannelTester : public base::RefCountedThreadSafe<TCPChannelTester> {
read_errors_(0) {
}
- virtual ~TCPChannelTester() { }
-
void Start() {
message_loop_->PostTask(
FROM_HERE, base::Bind(&TCPChannelTester::DoStart, this));
@@ -202,6 +200,8 @@ class TCPChannelTester : public base::RefCountedThreadSafe<TCPChannelTester> {
}
protected:
+ virtual ~TCPChannelTester() {}
+
void Done() {
done_ = true;
message_loop_->PostTask(FROM_HERE, MessageLoop::QuitClosure());
@@ -286,6 +286,8 @@ class TCPChannelTester : public base::RefCountedThreadSafe<TCPChannelTester> {
}
private:
+ friend class base::RefCountedThreadSafe<TCPChannelTester>;
+
MessageLoop* message_loop_;
net::Socket* host_socket_;
net::Socket* client_socket_;
diff --git a/sql/sqlite_features_unittest.cc b/sql/sqlite_features_unittest.cc
index e5cca49..2ae8dd7 100644
--- a/sql/sqlite_features_unittest.cc
+++ b/sql/sqlite_features_unittest.cc
@@ -1,4 +1,4 @@
-// Copyright (c) 2011 The Chromium Authors. All rights reserved.
+// Copyright (c) 2012 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
@@ -22,7 +22,7 @@ class StatementErrorHandler : public sql::ErrorDelegate {
StatementErrorHandler() : error_(SQLITE_OK) {}
virtual int OnError(int error, sql::Connection* connection,
- sql::Statement* stmt) {
+ sql::Statement* stmt) OVERRIDE {
error_ = error;
const char* sql_txt = stmt ? stmt->GetSQLStatement() : NULL;
sql_text_ = sql_txt ? sql_txt : "no statement available";
@@ -38,6 +38,9 @@ class StatementErrorHandler : public sql::ErrorDelegate {
const char* sql_statement() const { return sql_text_.c_str(); }
+ protected:
+ virtual ~StatementErrorHandler() {}
+
private:
int error_;
std::string sql_text_;
diff --git a/sql/statement_unittest.cc b/sql/statement_unittest.cc
index 0028b9d..963c45e 100644
--- a/sql/statement_unittest.cc
+++ b/sql/statement_unittest.cc
@@ -16,7 +16,7 @@ class StatementErrorHandler : public sql::ErrorDelegate {
StatementErrorHandler() : error_(SQLITE_OK) {}
virtual int OnError(int error, sql::Connection* connection,
- sql::Statement* stmt) {
+ sql::Statement* stmt) OVERRIDE {
error_ = error;
const char* sql_txt = stmt ? stmt->GetSQLStatement() : NULL;
sql_text_ = sql_txt ? sql_txt : "no statement available";
@@ -32,6 +32,9 @@ class StatementErrorHandler : public sql::ErrorDelegate {
const char* sql_statement() const { return sql_text_.c_str(); }
+ protected:
+ virtual ~StatementErrorHandler() {}
+
private:
int error_;
std::string sql_text_;