From 6d22a976f77187252164baa27100e472d5a924b5 Mon Sep 17 00:00:00 2001 From: "davemoore@chromium.org" Date: Wed, 21 Jul 2010 15:47:19 +0000 Subject: Reduce static initializers by removing inline constructors and destructors from classes with instance members of type scoped_ptr_malloc<> Also remove #include of iostream from remaining header file. Review URL: http://codereview.chromium.org/2861065 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@53190 0039d316-1c4b-4281-b951-d872f2087c98 --- net/socket_stream/socket_stream.cc | 4 ++++ net/socket_stream/socket_stream.h | 4 ++-- 2 files changed, 6 insertions(+), 2 deletions(-) (limited to 'net/socket_stream') diff --git a/net/socket_stream/socket_stream.cc b/net/socket_stream/socket_stream.cc index d4ad1f9..d1ead09 100644 --- a/net/socket_stream/socket_stream.cc +++ b/net/socket_stream/socket_stream.cc @@ -35,6 +35,9 @@ static const int kReadBufferSize = 4096; namespace net { +SocketStream::ResponseHeaders::ResponseHeaders() : IOBuffer() {} +SocketStream::ResponseHeaders::~ResponseHeaders() { data_ = NULL; } + void SocketStream::ResponseHeaders::Realloc(size_t new_size) { headers_.reset(static_cast(realloc(headers_.release(), new_size))); } @@ -987,3 +990,4 @@ ProxyService* SocketStream::proxy_service() const { } } // namespace net + diff --git a/net/socket_stream/socket_stream.h b/net/socket_stream/socket_stream.h index fcedc0d..d0e8b2e 100644 --- a/net/socket_stream/socket_stream.h +++ b/net/socket_stream/socket_stream.h @@ -170,7 +170,7 @@ class SocketStream : public base::RefCountedThreadSafe { class ResponseHeaders : public IOBuffer { public: - ResponseHeaders() : IOBuffer() {} + ResponseHeaders(); void SetDataOffset(size_t offset) { data_ = headers_.get() + offset; } char* headers() const { return headers_.get(); } @@ -178,7 +178,7 @@ class SocketStream : public base::RefCountedThreadSafe { void Realloc(size_t new_size); private: - ~ResponseHeaders() { data_ = NULL; } + ~ResponseHeaders(); scoped_ptr_malloc headers_; }; -- cgit v1.1