| Index: extensions/browser/api/socket/socket_api.cc
|
| diff --git a/extensions/browser/api/socket/socket_api.cc b/extensions/browser/api/socket/socket_api.cc
|
| index f325d0a252b4434b7b674b766b704c325e5ec257..72a86baaf8c5f692fe269d7680ef323de12f84e5 100644
|
| --- a/extensions/browser/api/socket/socket_api.cc
|
| +++ b/extensions/browser/api/socket/socket_api.cc
|
| @@ -90,9 +90,10 @@ void SocketAsyncApiFunction::RemoveSocket(int api_resource_id) {
|
| }
|
|
|
| SocketExtensionWithDnsLookupFunction::SocketExtensionWithDnsLookupFunction()
|
| - : resource_context_(NULL),
|
| + : resource_context_(nullptr),
|
| request_handle_(new net::HostResolver::RequestHandle),
|
| - addresses_(new net::AddressList) {}
|
| + addresses_(new net::AddressList) {
|
| +}
|
|
|
| SocketExtensionWithDnsLookupFunction::~SocketExtensionWithDnsLookupFunction() {}
|
|
|
| @@ -100,7 +101,7 @@ bool SocketExtensionWithDnsLookupFunction::PrePrepare() {
|
| if (!SocketAsyncApiFunction::PrePrepare())
|
| return false;
|
| resource_context_ = browser_context()->GetResourceContext();
|
| - return resource_context_ != NULL;
|
| + return resource_context_ != nullptr;
|
| }
|
|
|
| void SocketExtensionWithDnsLookupFunction::StartDnsLookup(
|
| @@ -163,7 +164,7 @@ bool SocketCreateFunction::Prepare() {
|
| }
|
|
|
| void SocketCreateFunction::Work() {
|
| - Socket* socket = NULL;
|
| + Socket* socket = nullptr;
|
| if (socket_type_ == kSocketTypeTCP) {
|
| socket = new TCPSocket(extension_->id());
|
| } else if (socket_type_ == kSocketTypeUDP) {
|
| @@ -184,7 +185,8 @@ bool SocketDestroyFunction::Prepare() {
|
| void SocketDestroyFunction::Work() { RemoveSocket(socket_id_); }
|
|
|
| SocketConnectFunction::SocketConnectFunction()
|
| - : socket_id_(0), hostname_(), port_(0), socket_(NULL) {}
|
| + : socket_id_(0), hostname_(), port_(0), socket_(nullptr) {
|
| +}
|
|
|
| SocketConnectFunction::~SocketConnectFunction() {}
|
|
|
| @@ -354,7 +356,7 @@ void SocketAcceptFunction::AsyncWorkStart() {
|
| socket->Accept(base::Bind(&SocketAcceptFunction::OnAccept, this));
|
| } else {
|
| error_ = kSocketNotFoundError;
|
| - OnAccept(-1, NULL);
|
| + OnAccept(-1, nullptr);
|
| }
|
| }
|
|
|
| @@ -385,7 +387,7 @@ void SocketReadFunction::AsyncWorkStart() {
|
| Socket* socket = GetSocket(params_->socket_id);
|
| if (!socket) {
|
| error_ = kSocketNotFoundError;
|
| - OnCompleted(-1, NULL);
|
| + OnCompleted(-1, nullptr);
|
| return;
|
| }
|
|
|
| @@ -410,13 +412,14 @@ void SocketReadFunction::OnCompleted(int bytes_read,
|
| }
|
|
|
| SocketWriteFunction::SocketWriteFunction()
|
| - : socket_id_(0), io_buffer_(NULL), io_buffer_size_(0) {}
|
| + : socket_id_(0), io_buffer_(nullptr), io_buffer_size_(0) {
|
| +}
|
|
|
| SocketWriteFunction::~SocketWriteFunction() {}
|
|
|
| bool SocketWriteFunction::Prepare() {
|
| EXTENSION_FUNCTION_VALIDATE(args_->GetInteger(0, &socket_id_));
|
| - base::BinaryValue* data = NULL;
|
| + base::BinaryValue* data = nullptr;
|
| EXTENSION_FUNCTION_VALIDATE(args_->GetBinary(1, &data));
|
|
|
| io_buffer_size_ = data->GetSize();
|
| @@ -460,7 +463,7 @@ void SocketRecvFromFunction::AsyncWorkStart() {
|
| Socket* socket = GetSocket(params_->socket_id);
|
| if (!socket) {
|
| error_ = kSocketNotFoundError;
|
| - OnCompleted(-1, NULL, std::string(), 0);
|
| + OnCompleted(-1, nullptr, std::string(), 0);
|
| return;
|
| }
|
|
|
| @@ -490,16 +493,17 @@ void SocketRecvFromFunction::OnCompleted(int bytes_read,
|
|
|
| SocketSendToFunction::SocketSendToFunction()
|
| : socket_id_(0),
|
| - io_buffer_(NULL),
|
| + io_buffer_(nullptr),
|
| io_buffer_size_(0),
|
| port_(0),
|
| - socket_(NULL) {}
|
| + socket_(nullptr) {
|
| +}
|
|
|
| SocketSendToFunction::~SocketSendToFunction() {}
|
|
|
| bool SocketSendToFunction::Prepare() {
|
| EXTENSION_FUNCTION_VALIDATE(args_->GetInteger(0, &socket_id_));
|
| - base::BinaryValue* data = NULL;
|
| + base::BinaryValue* data = nullptr;
|
| EXTENSION_FUNCTION_VALIDATE(args_->GetBinary(1, &data));
|
| EXTENSION_FUNCTION_VALIDATE(args_->GetString(2, &hostname_));
|
| EXTENSION_FUNCTION_VALIDATE(args_->GetInteger(3, &port_));
|
| @@ -928,7 +932,7 @@ void SocketSecureFunction::AsyncWorkStart() {
|
|
|
| // Make sure that the socket is a TCP client socket.
|
| if (socket->GetSocketType() != Socket::TYPE_TCP ||
|
| - static_cast<TCPSocket*>(socket)->ClientStream() == NULL) {
|
| + static_cast<TCPSocket*>(socket)->ClientStream() == nullptr) {
|
| SetResult(new base::FundamentalValue(net::ERR_INVALID_ARGUMENT));
|
| error_ = kSecureSocketTypeError;
|
| AsyncWorkCompleted();
|
| @@ -958,7 +962,7 @@ void SocketSecureFunction::AsyncWorkStart() {
|
| void SocketSecureFunction::TlsConnectDone(scoped_ptr<TLSSocket> socket,
|
| int result) {
|
| // if an error occurred, socket MUST be NULL.
|
| - DCHECK(result == net::OK || socket == NULL);
|
| + DCHECK(result == net::OK || socket == nullptr);
|
|
|
| if (socket && result == net::OK) {
|
| ReplaceSocket(params_->socket_id, socket.release());
|
|
|