summaryrefslogtreecommitdiffstats
path: root/net/socket
diff options
context:
space:
mode:
authorrsleevi@chromium.org <rsleevi@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-04-28 09:29:28 +0000
committerrsleevi@chromium.org <rsleevi@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-04-28 09:29:28 +0000
commita981330295415845ef13cd85afeff42032d782df (patch)
tree46ad72c4cabd094a5f4dea2faa1bde6fb7d3677f /net/socket
parent20eef6d14fce11a57949d052db064e56242c4c82 (diff)
downloadchromium_src-a981330295415845ef13cd85afeff42032d782df.zip
chromium_src-a981330295415845ef13cd85afeff42032d782df.tar.gz
chromium_src-a981330295415845ef13cd85afeff42032d782df.tar.bz2
RefCounted types should not have public destructors, net/
BUG=123295 TEST=none Review URL: http://codereview.chromium.org/10066045 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@134460 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'net/socket')
-rw-r--r--net/socket/nss_ssl_util.cc3
-rw-r--r--net/socket/socket_test_util.cc7
-rw-r--r--net/socket/socket_test_util.h14
-rw-r--r--net/socket/ssl_error_params.cc10
-rw-r--r--net/socket/ssl_error_params.h6
5 files changed, 26 insertions, 14 deletions
diff --git a/net/socket/nss_ssl_util.cc b/net/socket/nss_ssl_util.cc
index fc94004..4f6b3ac 100644
--- a/net/socket/nss_ssl_util.cc
+++ b/net/socket/nss_ssl_util.cc
@@ -249,6 +249,9 @@ class SSLFailedNSSFunctionParams : public NetLog::EventParameters {
return dict;
}
+ protected:
+ virtual ~SSLFailedNSSFunctionParams() {}
+
private:
const std::string function_;
const std::string param_;
diff --git a/net/socket/socket_test_util.cc b/net/socket/socket_test_util.cc
index 0e9ea78..929514f 100644
--- a/net/socket/socket_test_util.cc
+++ b/net/socket/socket_test_util.cc
@@ -424,9 +424,8 @@ DeterministicSocketData::DeterministicSocketData(MockRead* reads,
current_write_(),
stopping_sequence_number_(0),
stopped_(false),
- print_debug_(false) {}
-
-DeterministicSocketData::~DeterministicSocketData() {}
+ print_debug_(false) {
+}
void DeterministicSocketData::Run() {
SetStopped(false);
@@ -554,6 +553,8 @@ void DeterministicSocketData::Reset() {
NOTREACHED();
}
+DeterministicSocketData::~DeterministicSocketData() {}
+
void DeterministicSocketData::InvokeCallbacks() {
if (socket_ && socket_->write_pending() &&
(current_write().sequence_number == sequence_number())) {
diff --git a/net/socket/socket_test_util.h b/net/socket/socket_test_util.h
index 350e0b4..d54e2ac 100644
--- a/net/socket/socket_test_util.h
+++ b/net/socket/socket_test_util.h
@@ -433,14 +433,14 @@ class DeterministicMockTCPClientSocket;
//
// For examples of how to use this class, see:
// deterministic_socket_data_unittests.cc
-class DeterministicSocketData : public StaticSocketDataProvider,
- public base::RefCounted<DeterministicSocketData> {
+class DeterministicSocketData
+ : public StaticSocketDataProvider,
+ public base::RefCounted<DeterministicSocketData> {
public:
// |reads| the list of MockRead completions.
// |writes| the list of MockWrite completions.
DeterministicSocketData(MockRead* reads, size_t reads_count,
MockWrite* writes, size_t writes_count);
- virtual ~DeterministicSocketData();
// Consume all the data up to the give stop point (via SetStop()).
void Run();
@@ -475,7 +475,12 @@ class DeterministicSocketData : public StaticSocketDataProvider,
virtual void Reset() OVERRIDE;
virtual void CompleteRead() OVERRIDE {}
+ protected:
+ virtual ~DeterministicSocketData();
+
private:
+ friend class base::RefCounted<DeterministicSocketData>;
+
// Invoke the read and write callbacks, if the timing is appropriate.
void InvokeCallbacks();
@@ -496,8 +501,7 @@ class DeterministicSocketData : public StaticSocketDataProvider,
template<typename T>
class SocketDataProviderArray {
public:
- SocketDataProviderArray() : next_index_(0) {
- }
+ SocketDataProviderArray() : next_index_(0) {}
T* GetNext() {
DCHECK_LT(next_index_, data_providers_.size());
diff --git a/net/socket/ssl_error_params.cc b/net/socket/ssl_error_params.cc
index c77cbec..fc2a0f3 100644
--- a/net/socket/ssl_error_params.cc
+++ b/net/socket/ssl_error_params.cc
@@ -1,4 +1,4 @@
-// Copyright (c) 2010 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.
@@ -9,9 +9,9 @@
namespace net {
SSLErrorParams::SSLErrorParams(int net_error, int ssl_lib_error)
- : net_error_(net_error), ssl_lib_error_(ssl_lib_error) {}
-
-SSLErrorParams::~SSLErrorParams() {}
+ : net_error_(net_error),
+ ssl_lib_error_(ssl_lib_error) {
+}
Value* SSLErrorParams::ToValue() const {
DictionaryValue* dict = new DictionaryValue();
@@ -21,4 +21,6 @@ Value* SSLErrorParams::ToValue() const {
return dict;
}
+SSLErrorParams::~SSLErrorParams() {}
+
} // namespace net
diff --git a/net/socket/ssl_error_params.h b/net/socket/ssl_error_params.h
index 434d8bc..a623b3fd 100644
--- a/net/socket/ssl_error_params.h
+++ b/net/socket/ssl_error_params.h
@@ -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.
@@ -14,10 +14,12 @@ namespace net {
class SSLErrorParams : public NetLog::EventParameters {
public:
SSLErrorParams(int net_error, int ssl_lib_error);
- virtual ~SSLErrorParams();
virtual base::Value* ToValue() const OVERRIDE;
+ protected:
+ virtual ~SSLErrorParams();
+
private:
const int net_error_;
const int ssl_lib_error_;