summaryrefslogtreecommitdiffstats
path: root/ipc
diff options
context:
space:
mode:
authorbrettw@chromium.org <brettw@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-01-21 04:55:52 +0000
committerbrettw@chromium.org <brettw@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-01-21 04:55:52 +0000
commit20305ec6f1acf21392c2f3938a14a96f1e28e76d (patch)
tree6eff1f7be4bad1a1362d3466f0ac59292dc51acc /ipc
parentc6e8346b56ab61b35845aefcf9b241c654fe1253 (diff)
downloadchromium_src-20305ec6f1acf21392c2f3938a14a96f1e28e76d.zip
chromium_src-20305ec6f1acf21392c2f3938a14a96f1e28e76d.tar.gz
chromium_src-20305ec6f1acf21392c2f3938a14a96f1e28e76d.tar.bz2
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
Diffstat (limited to 'ipc')
-rw-r--r--ipc/ipc_channel_posix.cc10
-rw-r--r--ipc/ipc_channel_proxy.cc4
-rw-r--r--ipc/ipc_channel_proxy.h4
-rw-r--r--ipc/ipc_sync_channel.cc22
-rw-r--r--ipc/ipc_sync_channel.h4
-rw-r--r--ipc/ipc_sync_message_filter.cc12
-rw-r--r--ipc/ipc_sync_message_filter.h4
7 files changed, 30 insertions, 30 deletions
diff --git a/ipc/ipc_channel_posix.cc b/ipc/ipc_channel_posix.cc
index 34fbca9..f1aa048 100644
--- a/ipc/ipc_channel_posix.cc
+++ b/ipc/ipc_channel_posix.cc
@@ -20,12 +20,12 @@
#include "base/file_path.h"
#include "base/file_util.h"
#include "base/global_descriptors_posix.h"
-#include "base/lock.h"
#include "base/logging.h"
#include "base/process_util.h"
#include "base/scoped_ptr.h"
#include "base/singleton.h"
#include "base/string_util.h"
+#include "base/synchronization/lock.h"
#include "ipc/ipc_descriptors.h"
#include "ipc/ipc_switches.h"
#include "ipc/file_descriptor_set_posix.h"
@@ -91,7 +91,7 @@ class PipeMap {
// Lookup a given channel id. Return -1 if not found.
int Lookup(const std::string& channel_id) {
- AutoLock locked(lock_);
+ base::AutoLock locked(lock_);
ChannelToFDMap::const_iterator i = map_.find(channel_id);
if (i == map_.end())
@@ -102,7 +102,7 @@ class PipeMap {
// Remove the mapping for the given channel id. No error is signaled if the
// channel_id doesn't exist
void RemoveAndClose(const std::string& channel_id) {
- AutoLock locked(lock_);
+ base::AutoLock locked(lock_);
ChannelToFDMap::iterator i = map_.find(channel_id);
if (i != map_.end()) {
@@ -115,7 +115,7 @@ class PipeMap {
// Insert a mapping from @channel_id to @fd. It's a fatal error to insert a
// mapping if one already exists for the given channel_id
void Insert(const std::string& channel_id, int fd) {
- AutoLock locked(lock_);
+ base::AutoLock locked(lock_);
DCHECK(fd != -1);
ChannelToFDMap::const_iterator i = map_.find(channel_id);
@@ -126,7 +126,7 @@ class PipeMap {
}
private:
- Lock lock_;
+ base::Lock lock_;
typedef std::map<std::string, int> ChannelToFDMap;
ChannelToFDMap map_;
diff --git a/ipc/ipc_channel_proxy.cc b/ipc/ipc_channel_proxy.cc
index 6d3fdeb..5d23e7a 100644
--- a/ipc/ipc_channel_proxy.cc
+++ b/ipc/ipc_channel_proxy.cc
@@ -195,7 +195,7 @@ void ChannelProxy::Context::OnSendMessage(Message* message) {
void ChannelProxy::Context::OnAddFilter() {
std::vector<scoped_refptr<MessageFilter> > filters;
{
- AutoLock auto_lock(pending_filters_lock_);
+ base::AutoLock auto_lock(pending_filters_lock_);
filters.swap(pending_filters_);
}
@@ -227,7 +227,7 @@ void ChannelProxy::Context::OnRemoveFilter(MessageFilter* filter) {
// Called on the listener's thread
void ChannelProxy::Context::AddFilter(MessageFilter* filter) {
- AutoLock auto_lock(pending_filters_lock_);
+ base::AutoLock auto_lock(pending_filters_lock_);
pending_filters_.push_back(make_scoped_refptr(filter));
ipc_message_loop_->PostTask(
FROM_HERE,
diff --git a/ipc/ipc_channel_proxy.h b/ipc/ipc_channel_proxy.h
index 82a243b..8683891 100644
--- a/ipc/ipc_channel_proxy.h
+++ b/ipc/ipc_channel_proxy.h
@@ -8,9 +8,9 @@
#include <vector>
-#include "base/lock.h"
#include "base/ref_counted.h"
#include "base/scoped_ptr.h"
+#include "base/synchronization/lock.h"
#include "ipc/ipc_channel.h"
#include "ipc/ipc_channel_handle.h"
@@ -229,7 +229,7 @@ class ChannelProxy : public Message::Sender {
// IPC thread when they're added to filters_.
std::vector<scoped_refptr<MessageFilter> > pending_filters_;
// Lock for pending_filters_.
- Lock pending_filters_lock_;
+ base::Lock pending_filters_lock_;
};
Context* context() { return context_; }
diff --git a/ipc/ipc_sync_channel.cc b/ipc/ipc_sync_channel.cc
index fbad0f6..1c7edfa 100644
--- a/ipc/ipc_sync_channel.cc
+++ b/ipc/ipc_sync_channel.cc
@@ -55,7 +55,7 @@ class SyncChannel::ReceivedSyncMsgQueue :
void QueueMessage(const Message& msg, SyncChannel::SyncContext* context) {
bool was_task_pending;
{
- AutoLock auto_lock(message_lock_);
+ base::AutoLock auto_lock(message_lock_);
was_task_pending = task_pending_;
task_pending_ = true;
@@ -80,7 +80,7 @@ class SyncChannel::ReceivedSyncMsgQueue :
// messages.
void DispatchMessagesTask() {
{
- AutoLock auto_lock(message_lock_);
+ base::AutoLock auto_lock(message_lock_);
task_pending_ = false;
}
DispatchMessages();
@@ -91,7 +91,7 @@ class SyncChannel::ReceivedSyncMsgQueue :
Message* message;
scoped_refptr<SyncChannel::SyncContext> context;
{
- AutoLock auto_lock(message_lock_);
+ base::AutoLock auto_lock(message_lock_);
if (message_queue_.empty())
break;
@@ -107,7 +107,7 @@ class SyncChannel::ReceivedSyncMsgQueue :
// SyncChannel calls this in its destructor.
void RemoveContext(SyncContext* context) {
- AutoLock auto_lock(message_lock_);
+ base::AutoLock auto_lock(message_lock_);
SyncMessageQueue::iterator iter = message_queue_.begin();
while (iter != message_queue_.end()) {
@@ -185,7 +185,7 @@ class SyncChannel::ReceivedSyncMsgQueue :
// message.
WaitableEvent dispatch_event_;
MessageLoop* listener_message_loop_;
- Lock message_lock_;
+ base::Lock message_lock_;
bool task_pending_;
int listener_count_;
@@ -223,14 +223,14 @@ void SyncChannel::SyncContext::Push(SyncMessage* sync_msg) {
PendingSyncMsg pending(SyncMessage::GetMessageId(*sync_msg),
sync_msg->GetReplyDeserializer(),
new WaitableEvent(true, false));
- AutoLock auto_lock(deserializers_lock_);
+ base::AutoLock auto_lock(deserializers_lock_);
deserializers_.push_back(pending);
}
bool SyncChannel::SyncContext::Pop() {
bool result;
{
- AutoLock auto_lock(deserializers_lock_);
+ base::AutoLock auto_lock(deserializers_lock_);
PendingSyncMsg msg = deserializers_.back();
delete msg.deserializer;
delete msg.done_event;
@@ -251,7 +251,7 @@ bool SyncChannel::SyncContext::Pop() {
}
WaitableEvent* SyncChannel::SyncContext::GetSendDoneEvent() {
- AutoLock auto_lock(deserializers_lock_);
+ base::AutoLock auto_lock(deserializers_lock_);
return deserializers_.back().done_event;
}
@@ -264,7 +264,7 @@ void SyncChannel::SyncContext::DispatchMessages() {
}
bool SyncChannel::SyncContext::TryToUnblockListener(const Message* msg) {
- AutoLock auto_lock(deserializers_lock_);
+ base::AutoLock auto_lock(deserializers_lock_);
if (deserializers_.empty() ||
!SyncMessage::IsMessageReplyTo(*msg, deserializers_.back().id)) {
return false;
@@ -324,7 +324,7 @@ void SyncChannel::SyncContext::OnChannelClosed() {
}
void SyncChannel::SyncContext::OnSendTimeout(int message_id) {
- AutoLock auto_lock(deserializers_lock_);
+ base::AutoLock auto_lock(deserializers_lock_);
PendingSyncMessageQueue::iterator iter;
for (iter = deserializers_.begin(); iter != deserializers_.end(); iter++) {
if (iter->id == message_id) {
@@ -335,7 +335,7 @@ void SyncChannel::SyncContext::OnSendTimeout(int message_id) {
}
void SyncChannel::SyncContext::CancelPendingSends() {
- AutoLock auto_lock(deserializers_lock_);
+ base::AutoLock auto_lock(deserializers_lock_);
PendingSyncMessageQueue::iterator iter;
for (iter = deserializers_.begin(); iter != deserializers_.end(); iter++)
iter->done_event->Signal();
diff --git a/ipc/ipc_sync_channel.h b/ipc/ipc_sync_channel.h
index 7f2f7f4..e2d571a 100644
--- a/ipc/ipc_sync_channel.h
+++ b/ipc/ipc_sync_channel.h
@@ -10,8 +10,8 @@
#include <deque>
#include "base/basictypes.h"
-#include "base/lock.h"
#include "base/ref_counted.h"
+#include "base/synchronization/lock.h"
#include "base/synchronization/waitable_event_watcher.h"
#include "ipc/ipc_channel_handle.h"
#include "ipc/ipc_channel_proxy.h"
@@ -119,7 +119,7 @@ class SyncChannel : public ChannelProxy,
typedef std::deque<PendingSyncMsg> PendingSyncMessageQueue;
PendingSyncMessageQueue deserializers_;
- Lock deserializers_lock_;
+ base::Lock deserializers_lock_;
scoped_refptr<ReceivedSyncMsgQueue> received_sync_msgs_;
diff --git a/ipc/ipc_sync_message_filter.cc b/ipc/ipc_sync_message_filter.cc
index 17a4093..cffbaa6 100644
--- a/ipc/ipc_sync_message_filter.cc
+++ b/ipc/ipc_sync_message_filter.cc
@@ -23,7 +23,7 @@ SyncMessageFilter::~SyncMessageFilter() {
bool SyncMessageFilter::Send(Message* message) {
{
- AutoLock auto_lock(lock_);
+ base::AutoLock auto_lock(lock_);
if (!io_loop_) {
delete message;
return false;
@@ -44,7 +44,7 @@ bool SyncMessageFilter::Send(Message* message) {
&done_event);
{
- AutoLock auto_lock(lock_);
+ base::AutoLock auto_lock(lock_);
// Can't use this class on the main thread or else it can lead to deadlocks.
// Also by definition, can't use this on IO thread since we're blocking it.
DCHECK(MessageLoop::current() != listener_loop_);
@@ -60,7 +60,7 @@ bool SyncMessageFilter::Send(Message* message) {
base::WaitableEvent::WaitMany(events, 2);
{
- AutoLock auto_lock(lock_);
+ base::AutoLock auto_lock(lock_);
delete pending_message.deserializer;
pending_sync_messages_.erase(&pending_message);
}
@@ -84,7 +84,7 @@ void SyncMessageFilter::SendOnIOThread(Message* message) {
}
void SyncMessageFilter::SignalAllEvents() {
- AutoLock auto_lock(lock_);
+ base::AutoLock auto_lock(lock_);
for (PendingSyncMessages::iterator iter = pending_sync_messages_.begin();
iter != pending_sync_messages_.end(); ++iter) {
(*iter)->done_event->Signal();
@@ -93,7 +93,7 @@ void SyncMessageFilter::SignalAllEvents() {
void SyncMessageFilter::OnFilterAdded(Channel* channel) {
channel_ = channel;
- AutoLock auto_lock(lock_);
+ base::AutoLock auto_lock(lock_);
io_loop_ = MessageLoop::current();
}
@@ -108,7 +108,7 @@ void SyncMessageFilter::OnChannelClosing() {
}
bool SyncMessageFilter::OnMessageReceived(const Message& message) {
- AutoLock auto_lock(lock_);
+ base::AutoLock auto_lock(lock_);
for (PendingSyncMessages::iterator iter = pending_sync_messages_.begin();
iter != pending_sync_messages_.end(); ++iter) {
if (SyncMessage::IsMessageReplyTo(message, (*iter)->id)) {
diff --git a/ipc/ipc_sync_message_filter.h b/ipc/ipc_sync_message_filter.h
index 96e2435..5215be6 100644
--- a/ipc/ipc_sync_message_filter.h
+++ b/ipc/ipc_sync_message_filter.h
@@ -7,8 +7,8 @@
#pragma once
#include "base/basictypes.h"
-#include "base/lock.h"
#include "base/ref_counted.h"
+#include "base/synchronization/lock.h"
#include "ipc/ipc_channel_proxy.h"
#include "ipc/ipc_sync_message.h"
#include <set>
@@ -58,7 +58,7 @@ class SyncMessageFilter : public ChannelProxy::MessageFilter,
PendingSyncMessages pending_sync_messages_;
// Locks data members above.
- Lock lock_;
+ base::Lock lock_;
base::WaitableEvent* shutdown_event_;