From 20305ec6f1acf21392c2f3938a14a96f1e28e76d Mon Sep 17 00:00:00 2001 From: "brettw@chromium.org" Date: Fri, 21 Jan 2011 04:55:52 +0000 Subject: Remove obsolete base/lock.h and fix up callers to use the new header file and the base namespace. Fix several files including lock.h unnecessarily. BUG=none TEST=none Original review=http://codereview.chromium.org/6142009/ Patch by leviw@chromium.org git-svn-id: svn://svn.chromium.org/chrome/trunk/src@72106 0039d316-1c4b-4281-b951-d872f2087c98 --- remoting/protocol/buffered_socket_writer.cc | 20 ++++++++++---------- remoting/protocol/buffered_socket_writer.h | 4 ++-- remoting/protocol/jingle_session.h | 1 - remoting/protocol/jingle_session_manager.h | 1 - remoting/protocol/protocol_test_client.cc | 8 ++++---- 5 files changed, 16 insertions(+), 18 deletions(-) (limited to 'remoting/protocol') diff --git a/remoting/protocol/buffered_socket_writer.cc b/remoting/protocol/buffered_socket_writer.cc index 11b8395..db069b2 100644 --- a/remoting/protocol/buffered_socket_writer.cc +++ b/remoting/protocol/buffered_socket_writer.cc @@ -48,7 +48,7 @@ BufferedSocketWriterBase::~BufferedSocketWriterBase() { } void BufferedSocketWriterBase::Init(net::Socket* socket, WriteFailedCallback* callback) { // TODO(garykac) Save copy of WriteFailedCallback. - AutoLock auto_lock(lock_); + base::AutoLock auto_lock(lock_); message_loop_ = MessageLoop::current(); socket_ = socket; DCHECK(socket_); @@ -56,7 +56,7 @@ void BufferedSocketWriterBase::Init(net::Socket* socket, bool BufferedSocketWriterBase::Write( scoped_refptr data, Task* done_task) { - AutoLock auto_lock(lock_); + base::AutoLock auto_lock(lock_); if (!socket_) return false; queue_.push_back(new PendingPacket(data, done_task)); @@ -76,7 +76,7 @@ void BufferedSocketWriterBase::DoWrite() { // Don't write after Close(). { - AutoLock auto_lock(lock_); + base::AutoLock auto_lock(lock_); if (closed_) return; } @@ -85,7 +85,7 @@ void BufferedSocketWriterBase::DoWrite() { net::IOBuffer* current_packet; int current_packet_size; { - AutoLock auto_lock(lock_); + base::AutoLock auto_lock(lock_); GetNextPacket_Locked(¤t_packet, ¤t_packet_size); } @@ -96,7 +96,7 @@ void BufferedSocketWriterBase::DoWrite() { int result = socket_->Write(current_packet, current_packet_size, &written_callback_); if (result >= 0) { - AutoLock auto_lock(lock_); + base::AutoLock auto_lock(lock_); AdvanceBufferPosition_Locked(result); } else { if (result == net::ERR_IO_PENDING) { @@ -123,7 +123,7 @@ void BufferedSocketWriterBase::OnWritten(int result) { } { - AutoLock auto_lock(lock_); + base::AutoLock auto_lock(lock_); AdvanceBufferPosition_Locked(result); } @@ -133,7 +133,7 @@ void BufferedSocketWriterBase::OnWritten(int result) { } void BufferedSocketWriterBase::HandleError(int result) { - AutoLock auto_lock(lock_); + base::AutoLock auto_lock(lock_); closed_ = true; STLDeleteElements(&queue_); @@ -142,17 +142,17 @@ void BufferedSocketWriterBase::HandleError(int result) { } int BufferedSocketWriterBase::GetBufferSize() { - AutoLock auto_lock(lock_); + base::AutoLock auto_lock(lock_); return buffer_size_; } int BufferedSocketWriterBase::GetBufferChunks() { - AutoLock auto_lock(lock_); + base::AutoLock auto_lock(lock_); return queue_.size(); } void BufferedSocketWriterBase::Close() { - AutoLock auto_lock(lock_); + base::AutoLock auto_lock(lock_); closed_ = true; } diff --git a/remoting/protocol/buffered_socket_writer.h b/remoting/protocol/buffered_socket_writer.h index 3ea127e..1560b0f 100644 --- a/remoting/protocol/buffered_socket_writer.h +++ b/remoting/protocol/buffered_socket_writer.h @@ -7,8 +7,8 @@ #include -#include "base/lock.h" #include "base/ref_counted.h" +#include "base/synchronization/lock.h" #include "net/base/io_buffer.h" #include "net/socket/socket.h" @@ -86,7 +86,7 @@ class BufferedSocketWriterBase void HandleError(int result); // Must be locked when accessing |socket_|, |queue_| and |buffer_size_|; - Lock lock_; + base::Lock lock_; net::Socket* socket_; MessageLoop* message_loop_; diff --git a/remoting/protocol/jingle_session.h b/remoting/protocol/jingle_session.h index f8689cc..94c28f6 100644 --- a/remoting/protocol/jingle_session.h +++ b/remoting/protocol/jingle_session.h @@ -6,7 +6,6 @@ #define REMOTING_PROTOCOL_JINGLE_SESSION_H_ #include "base/crypto/rsa_private_key.h" -#include "base/lock.h" #include "base/ref_counted.h" #include "net/base/completion_callback.h" #include "remoting/protocol/session.h" diff --git a/remoting/protocol/jingle_session_manager.h b/remoting/protocol/jingle_session_manager.h index 3656e05..344095b 100644 --- a/remoting/protocol/jingle_session_manager.h +++ b/remoting/protocol/jingle_session_manager.h @@ -8,7 +8,6 @@ #include #include -#include "base/lock.h" #include "base/ref_counted.h" #include "net/base/x509_certificate.h" #include "remoting/protocol/jingle_session.h" diff --git a/remoting/protocol/protocol_test_client.cc b/remoting/protocol/protocol_test_client.cc index 6486331..5f64aa4 100644 --- a/remoting/protocol/protocol_test_client.cc +++ b/remoting/protocol/protocol_test_client.cc @@ -114,7 +114,7 @@ class ProtocolTestClient scoped_refptr client_; scoped_refptr session_manager_; ConnectionsList connections_; - Lock connections_lock_; + base::Lock connections_lock_; base::WaitableEvent closed_event_; }; @@ -236,7 +236,7 @@ void ProtocolTestClient::Run(const std::string& username, std::getline(std::cin, line); { - AutoLock auto_lock(connections_lock_); + base::AutoLock auto_lock(connections_lock_); // Broadcast message to all clients. for (ConnectionsList::iterator it = connections_.begin(); @@ -309,7 +309,7 @@ void ProtocolTestClient::OnNewSession( session->SetStateChangeCallback( NewCallback(test_connection, &ProtocolTestConnection::OnStateChange)); test_connection->Init(session); - AutoLock auto_lock(connections_lock_); + base::AutoLock auto_lock(connections_lock_); connections_.push_back(make_scoped_refptr(test_connection)); } @@ -320,7 +320,7 @@ void ProtocolTestClient::OnFinishedClosing() { void ProtocolTestClient::DestroyConnection( scoped_refptr connection) { connection->Close(); - AutoLock auto_lock(connections_lock_); + base::AutoLock auto_lock(connections_lock_); for (ConnectionsList::iterator it = connections_.begin(); it != connections_.end(); ++it) { if ((*it) == connection) { -- cgit v1.1