diff options
Diffstat (limited to 'remoting')
-rw-r--r-- | remoting/base/tracer.h | 4 | ||||
-rw-r--r-- | remoting/host/capturer.cc | 8 | ||||
-rw-r--r-- | remoting/host/capturer.h | 4 | ||||
-rw-r--r-- | remoting/host/chromoting_host.cc | 6 | ||||
-rw-r--r-- | remoting/host/chromoting_host.h | 2 | ||||
-rw-r--r-- | remoting/host/in_memory_host_config.cc | 8 | ||||
-rw-r--r-- | remoting/host/in_memory_host_config.h | 4 | ||||
-rw-r--r-- | remoting/host/json_host_config.cc | 5 | ||||
-rw-r--r-- | remoting/host/json_host_config.h | 1 | ||||
-rw-r--r-- | remoting/jingle_glue/jingle_client.cc | 12 | ||||
-rw-r--r-- | remoting/jingle_glue/jingle_client.h | 7 | ||||
-rw-r--r-- | remoting/protocol/buffered_socket_writer.cc | 20 | ||||
-rw-r--r-- | remoting/protocol/buffered_socket_writer.h | 4 | ||||
-rw-r--r-- | remoting/protocol/jingle_session.h | 1 | ||||
-rw-r--r-- | remoting/protocol/jingle_session_manager.h | 1 | ||||
-rw-r--r-- | remoting/protocol/protocol_test_client.cc | 8 |
16 files changed, 47 insertions, 48 deletions
diff --git a/remoting/base/tracer.h b/remoting/base/tracer.h index 95d4e9c..70698c2 100644 --- a/remoting/base/tracer.h +++ b/remoting/base/tracer.h @@ -53,9 +53,9 @@ #include <string> -#include "base/lock.h" #include "base/ref_counted.h" #include "base/singleton.h" +#include "base/synchronization/lock.h" #include "base/task.h" #include "base/scoped_ptr.h" #include "remoting/proto/trace.pb.h" @@ -82,7 +82,7 @@ class Tracer : public base::RefCountedThreadSafe<Tracer> { friend class base::RefCountedThreadSafe<Tracer>; virtual ~Tracer(); - Lock lock_; + base::Lock lock_; scoped_ptr<TraceBuffer> buffer_; DISALLOW_COPY_AND_ASSIGN(Tracer); diff --git a/remoting/host/capturer.cc b/remoting/host/capturer.cc index 3e32070..cf1bac7 100644 --- a/remoting/host/capturer.cc +++ b/remoting/host/capturer.cc @@ -38,7 +38,7 @@ media::VideoFrame::Format Capturer::pixel_format() const { } void Capturer::ClearInvalidRects() { - AutoLock auto_inval_rects_lock(inval_rects_lock_); + base::AutoLock auto_inval_rects_lock(inval_rects_lock_); inval_rects_.clear(); } @@ -48,13 +48,13 @@ void Capturer::InvalidateRects(const InvalidRects& inval_rects) { inval_rects.begin(), inval_rects.end(), std::inserter(temp_rects, temp_rects.begin())); { - AutoLock auto_inval_rects_lock(inval_rects_lock_); + base::AutoLock auto_inval_rects_lock(inval_rects_lock_); inval_rects_.swap(temp_rects); } } void Capturer::InvalidateFullScreen() { - AutoLock auto_inval_rects_lock(inval_rects_lock_); + base::AutoLock auto_inval_rects_lock(inval_rects_lock_); inval_rects_.clear(); inval_rects_.insert(gfx::Rect(0, 0, width_, height_)); } @@ -68,7 +68,7 @@ void Capturer::CaptureInvalidRects(CaptureCompletedCallback* callback) { // Braced to scope the lock. InvalidRects local_rects; { - AutoLock auto_inval_rects_lock(inval_rects_lock_); + base::AutoLock auto_inval_rects_lock(inval_rects_lock_); local_rects.swap(inval_rects_); } diff --git a/remoting/host/capturer.h b/remoting/host/capturer.h index 548b685..1282ebe 100644 --- a/remoting/host/capturer.h +++ b/remoting/host/capturer.h @@ -7,7 +7,7 @@ #include "base/basictypes.h" #include "base/callback.h" -#include "base/lock.h" +#include "base/synchronization/lock.h" #include "base/task.h" #include "remoting/base/capture_data.h" #include "remoting/base/types.h" @@ -138,7 +138,7 @@ class Capturer { InvalidRects inval_rects_; // A lock protecting |inval_rects_| across threads. - Lock inval_rects_lock_; + base::Lock inval_rects_lock_; }; } // namespace remoting diff --git a/remoting/host/chromoting_host.cc b/remoting/host/chromoting_host.cc index a06098c..45be613 100644 --- a/remoting/host/chromoting_host.cc +++ b/remoting/host/chromoting_host.cc @@ -70,7 +70,7 @@ void ChromotingHost::Start(Task* shutdown_task) { // Make sure this object is not started. { - AutoLock auto_lock(lock_); + base::AutoLock auto_lock(lock_); if (state_ != kInitial) return; state_ = kStarted; @@ -113,7 +113,7 @@ void ChromotingHost::Shutdown() { // No-op if this object is not started yet. { - AutoLock auto_lock(lock_); + base::AutoLock auto_lock(lock_); if (state_ != kStarted) { state_ = kStopped; return; @@ -264,7 +264,7 @@ void ChromotingHost::OnStateChange(JingleClient* jingle_client, void ChromotingHost::OnNewClientSession( protocol::Session* session, protocol::SessionManager::IncomingSessionResponse* response) { - AutoLock auto_lock(lock_); + base::AutoLock auto_lock(lock_); // TODO(hclam): Allow multiple clients to connect to the host. if (connection_.get() || state_ != kStarted) { *response = protocol::SessionManager::DECLINE; diff --git a/remoting/host/chromoting_host.h b/remoting/host/chromoting_host.h index bc470e7..33680a6 100644 --- a/remoting/host/chromoting_host.h +++ b/remoting/host/chromoting_host.h @@ -174,7 +174,7 @@ class ChromotingHost : public base::RefCountedThreadSafe<ChromotingHost>, State state_; // Lock is to lock the access to |state_|. - Lock lock_; + base::Lock lock_; // Configuration of the protocol. scoped_ptr<protocol::CandidateSessionConfig> protocol_config_; diff --git a/remoting/host/in_memory_host_config.cc b/remoting/host/in_memory_host_config.cc index 7827b8f..253b563 100644 --- a/remoting/host/in_memory_host_config.cc +++ b/remoting/host/in_memory_host_config.cc @@ -17,12 +17,12 @@ InMemoryHostConfig::~InMemoryHostConfig() {} bool InMemoryHostConfig::GetString(const std::string& path, std::string* out_value) { - AutoLock auto_lock(lock_); + base::AutoLock auto_lock(lock_); return values_->GetString(path, out_value); } bool InMemoryHostConfig::GetBoolean(const std::string& path, bool* out_value) { - AutoLock auto_lock(lock_); + base::AutoLock auto_lock(lock_); return values_->GetBoolean(path, out_value); } @@ -32,12 +32,12 @@ void InMemoryHostConfig::Save() { void InMemoryHostConfig::SetString(const std::string& path, const std::string& in_value) { - AutoLock auto_lock(lock_); + base::AutoLock auto_lock(lock_); values_->SetString(path, in_value); } void InMemoryHostConfig::SetBoolean(const std::string& path, bool in_value) { - AutoLock auto_lock(lock_); + base::AutoLock auto_lock(lock_); values_->SetBoolean(path, in_value); } diff --git a/remoting/host/in_memory_host_config.h b/remoting/host/in_memory_host_config.h index 1078c50..998580a 100644 --- a/remoting/host/in_memory_host_config.h +++ b/remoting/host/in_memory_host_config.h @@ -7,9 +7,9 @@ #include <string> -#include "base/lock.h" #include "base/ref_counted.h" #include "base/scoped_ptr.h" +#include "base/synchronization/lock.h" #include "remoting/host/host_config.h" class DictionaryValue; @@ -34,7 +34,7 @@ class InMemoryHostConfig : public MutableHostConfig { protected: // |lock_| must be locked whenever |values_| is used. - Lock lock_; + base::Lock lock_; scoped_ptr<DictionaryValue> values_; private: diff --git a/remoting/host/json_host_config.cc b/remoting/host/json_host_config.cc index ab639f0..36b39f2e 100644 --- a/remoting/host/json_host_config.cc +++ b/remoting/host/json_host_config.cc @@ -8,6 +8,7 @@ #include "base/json/json_reader.h" #include "base/json/json_writer.h" #include "base/message_loop_proxy.h" +#include "base/synchronization/lock.h" #include "base/task.h" #include "base/values.h" @@ -35,7 +36,7 @@ bool JsonHostConfig::Read() { } DictionaryValue* dictionary = static_cast<DictionaryValue*>(value.release()); - AutoLock auto_lock(lock_); + base::AutoLock auto_lock(lock_); values_.reset(dictionary); return true; } @@ -47,7 +48,7 @@ void JsonHostConfig::Save() { void JsonHostConfig::DoWrite() { std::string file_content; - AutoLock auto_lock(lock_); + base::AutoLock auto_lock(lock_); base::JSONWriter::Write(values_.get(), true, &file_content); // TODO(sergeyu): Move ImportantFileWriter to base and use it here. file_util::WriteFile(filename_, file_content.c_str(), file_content.size()); diff --git a/remoting/host/json_host_config.h b/remoting/host/json_host_config.h index b4e2912..d9f233b 100644 --- a/remoting/host/json_host_config.h +++ b/remoting/host/json_host_config.h @@ -8,7 +8,6 @@ #include <string> #include "base/file_path.h" -#include "base/lock.h" #include "base/ref_counted.h" #include "base/scoped_ptr.h" #include "remoting/host/in_memory_host_config.h" diff --git a/remoting/jingle_glue/jingle_client.cc b/remoting/jingle_glue/jingle_client.cc index 6484e5a..7b00d79 100644 --- a/remoting/jingle_glue/jingle_client.cc +++ b/remoting/jingle_glue/jingle_client.cc @@ -32,7 +32,7 @@ JingleClient::JingleClient(JingleThread* thread) } JingleClient::~JingleClient() { - AutoLock auto_lock(state_lock_); + base::AutoLock auto_lock(state_lock_); DCHECK(!initialized_ || closed_); } @@ -42,7 +42,7 @@ void JingleClient::Init( DCHECK_NE(username, ""); { - AutoLock auto_lock(state_lock_); + base::AutoLock auto_lock(state_lock_); DCHECK(!initialized_ && !closed_); initialized_ = true; @@ -101,7 +101,7 @@ void JingleClient::Close() { void JingleClient::Close(Task* closed_task) { { - AutoLock auto_lock(state_lock_); + base::AutoLock auto_lock(state_lock_); // If the client is already closed then don't close again. if (closed_) { if (closed_task) @@ -137,7 +137,7 @@ void JingleClient::DoClose() { } std::string JingleClient::GetFullJid() { - AutoLock auto_lock(full_jid_lock_); + base::AutoLock auto_lock(full_jid_lock_); return full_jid_; } @@ -179,7 +179,7 @@ void JingleClient::OnConnectionStateChanged(buzz::XmppEngine::State state) { } void JingleClient::SetFullJid(const std::string& full_jid) { - AutoLock auto_lock(full_jid_lock_); + base::AutoLock auto_lock(full_jid_lock_); full_jid_ = full_jid; } @@ -189,7 +189,7 @@ void JingleClient::UpdateState(State new_state) { { // We have to have the lock held, otherwise we cannot be sure that // the client hasn't been closed when we call the callback. - AutoLock auto_lock(state_lock_); + base::AutoLock auto_lock(state_lock_); if (!closed_) callback_->OnStateChange(this, new_state); } diff --git a/remoting/jingle_glue/jingle_client.h b/remoting/jingle_glue/jingle_client.h index 1d0920a..173e90e 100644 --- a/remoting/jingle_glue/jingle_client.h +++ b/remoting/jingle_glue/jingle_client.h @@ -7,8 +7,8 @@ #include <string> -#include "base/lock.h" #include "base/ref_counted.h" +#include "base/synchronization/lock.h" #include "third_party/libjingle/source/talk/xmpp/xmppclient.h" class MessageLoop; @@ -123,11 +123,12 @@ class JingleClient : public base::RefCountedThreadSafe<JingleClient>, // The XmppClient and its state and jid. buzz::XmppClient* client_; State state_; - Lock full_jid_lock_; + base::Lock full_jid_lock_; std::string full_jid_; // Current state of the object. - Lock state_lock_; // Must be locked when accessing initialized_ or closed_. + // Must be locked when accessing initialized_ or closed_. + base::Lock state_lock_; bool initialized_; bool closed_; scoped_ptr<Task> closed_task_; 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<net::IOBufferWithSize> 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 <list> -#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 <list> #include <string> -#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<JingleClient> client_; scoped_refptr<JingleSessionManager> 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<ProtocolTestConnection> 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) { |