diff options
Diffstat (limited to 'net/base')
-rw-r--r-- | net/base/client_socket.cc | 22 | ||||
-rw-r--r-- | net/base/client_socket.h | 14 | ||||
-rw-r--r-- | net/base/io_buffer.cc | 16 | ||||
-rw-r--r-- | net/base/io_buffer.h | 6 | ||||
-rw-r--r-- | net/base/upload_data.h | 8 |
5 files changed, 49 insertions, 17 deletions
diff --git a/net/base/client_socket.cc b/net/base/client_socket.cc new file mode 100644 index 0000000..4c607fa --- /dev/null +++ b/net/base/client_socket.cc @@ -0,0 +1,22 @@ +// Copyright (c) 2009 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. + +#include "net/base/client_socket.h" + +#include "base/logging.h" +#include "net/base/net_errors.h" + +namespace net { + +#if defined(OS_LINUX) +// Identical to posix system call getpeername(). +// Needed by ssl_client_socket_nss. +int ClientSocket::GetPeerName(struct sockaddr *name, socklen_t *namelen) { + // Default implementation just permits some unit tests to link. + NOTREACHED(); + return ERR_UNEXPECTED; +} +#endif + +} // namespace net diff --git a/net/base/client_socket.h b/net/base/client_socket.h index 97495dd..b96f07b 100644 --- a/net/base/client_socket.h +++ b/net/base/client_socket.h @@ -5,9 +5,13 @@ #ifndef NET_BASE_CLIENT_SOCKET_H_ #define NET_BASE_CLIENT_SOCKET_H_ -#include "base/logging.h" +#include "build/build_config.h" + +#if defined(OS_LINUX) +#include <sys/socket.h> +#endif + #include "net/base/socket.h" -#include "net/base/net_errors.h" namespace net { @@ -46,11 +50,7 @@ class ClientSocket : public Socket { #if defined(OS_LINUX) // Identical to posix system call getpeername(). // Needed by ssl_client_socket_nss. - virtual int GetPeerName(struct sockaddr *name, socklen_t *namelen) { - // Default implementation just permits some unit tests to link. - NOTREACHED(); - return ERR_UNEXPECTED; - } + virtual int GetPeerName(struct sockaddr *name, socklen_t *namelen); #endif }; diff --git a/net/base/io_buffer.cc b/net/base/io_buffer.cc new file mode 100644 index 0000000..c9b4532 --- /dev/null +++ b/net/base/io_buffer.cc @@ -0,0 +1,16 @@ +// Copyright (c) 2009 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. + +#include "net/base/io_buffer.h" + +#include "base/logging.h" + +namespace net { + +IOBuffer::IOBuffer(int buffer_size) { + DCHECK(buffer_size); + data_ = new char[buffer_size]; +} + +} // namespace net diff --git a/net/base/io_buffer.h b/net/base/io_buffer.h index 88066c2..48d69d6 100644 --- a/net/base/io_buffer.h +++ b/net/base/io_buffer.h @@ -5,7 +5,6 @@ #ifndef NET_BASE_IO_BUFFER_H_ #define NET_BASE_IO_BUFFER_H_ -#include "base/logging.h" #include "base/ref_counted.h" namespace net { @@ -15,10 +14,7 @@ namespace net { class IOBuffer : public base::RefCountedThreadSafe<IOBuffer> { public: IOBuffer() : data_(NULL) {} - explicit IOBuffer(int buffer_size) { - DCHECK(buffer_size); - data_ = new char[buffer_size]; - } + explicit IOBuffer(int buffer_size); explicit IOBuffer(char* data) : data_(data) {} virtual ~IOBuffer() { delete[] data_; diff --git a/net/base/upload_data.h b/net/base/upload_data.h index 04e1529..3174b77 100644 --- a/net/base/upload_data.h +++ b/net/base/upload_data.h @@ -2,13 +2,12 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#ifndef NET_BASE_UPLOAD_DATA_H__ -#define NET_BASE_UPLOAD_DATA_H__ +#ifndef NET_BASE_UPLOAD_DATA_H_ +#define NET_BASE_UPLOAD_DATA_H_ #include <string> #include <vector> -#include "base/basictypes.h" #include "base/ref_counted.h" namespace net { @@ -98,5 +97,4 @@ class UploadData : public base::RefCounted<UploadData> { } // namespace net -#endif // NET_BASE_UPLOAD_DATA_H__ - +#endif // NET_BASE_UPLOAD_DATA_H_ |