Skip to content

Commit

Permalink
Update ipc/ to use scoped_refptr<T>::get() rather than implicit "oper…
Browse files Browse the repository at this point in the history
…ator T*"

Linux fixes

BUG=110610
TBR=darin

Review URL: https://chromiumcodereview.appspot.com/15703006

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@203562 0039d316-1c4b-4281-b951-d872f2087c98
  • Loading branch information
rsleevi@chromium.org committed Jun 1, 2013
1 parent c7abcfd commit 1757164
Show file tree
Hide file tree
Showing 6 changed files with 11 additions and 11 deletions.
2 changes: 1 addition & 1 deletion ipc/ipc_channel_proxy.cc
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ ChannelProxy::Context::Context(Listener* listener,
ipc_task_runner_(ipc_task_runner),
channel_connected_called_(false),
peer_pid_(base::kNullProcessId) {
DCHECK(ipc_task_runner_);
DCHECK(ipc_task_runner_.get());
}

ChannelProxy::Context::~Context() {
Expand Down
4 changes: 2 additions & 2 deletions ipc/ipc_channel_proxy.h
Original file line number Diff line number Diff line change
Expand Up @@ -197,7 +197,7 @@ class IPC_EXPORT ChannelProxy : public Sender, public base::NonThreadSafe {
Context(Listener* listener, base::SingleThreadTaskRunner* ipc_thread);
void ClearIPCTaskRunner();
base::SingleThreadTaskRunner* ipc_task_runner() const {
return ipc_task_runner_;
return ipc_task_runner_.get();
}
const std::string& channel_id() const { return channel_id_; }

Expand Down Expand Up @@ -268,7 +268,7 @@ class IPC_EXPORT ChannelProxy : public Sender, public base::NonThreadSafe {
base::ProcessId peer_pid_;
};

Context* context() { return context_; }
Context* context() { return context_.get(); }

OutgoingMessageFilter* outgoing_message_filter() {
return outgoing_message_filter_;
Expand Down
2 changes: 1 addition & 1 deletion ipc/ipc_forwarding_message_filter.cc
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ ForwardingMessageFilter::ForwardingMessageFilter(
size_t num_message_ids_to_filter,
base::TaskRunner* target_task_runner)
: target_task_runner_(target_task_runner) {
DCHECK(target_task_runner_);
DCHECK(target_task_runner_.get());
for (size_t i = 0; i < num_message_ids_to_filter; i++)
message_ids_to_filter_.insert(message_ids_to_filter[i]);
}
Expand Down
6 changes: 3 additions & 3 deletions ipc/ipc_sync_channel.cc
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,7 @@ class SyncChannel::ReceivedSyncMsgQueue :

SyncMessageQueue::iterator iter = message_queue_.begin();
while (iter != message_queue_.end()) {
if (iter->context == context) {
if (iter->context.get() == context) {
delete iter->message;
iter = message_queue_.erase(iter);
message_queue_version_++;
Expand All @@ -150,7 +150,7 @@ class SyncChannel::ReceivedSyncMsgQueue :

WaitableEvent* dispatch_event() { return &dispatch_event_; }
base::SingleThreadTaskRunner* listener_task_runner() {
return listener_task_runner_;
return listener_task_runner_.get();
}

// Holds a pointer to the per-thread ReceivedSyncMsgQueue object.
Expand Down Expand Up @@ -483,7 +483,7 @@ bool SyncChannel::SendWithTimeout(Message* message, int timeout_ms) {

// Wait for reply, or for any other incoming synchronous messages.
// *this* might get deleted, so only call static functions at this point.
WaitForReply(context, pump_messages_event);
WaitForReply(context.get(), pump_messages_event);

return context->Pop();
}
Expand Down
2 changes: 1 addition & 1 deletion ipc/ipc_sync_channel.h
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,7 @@ class IPC_EXPORT SyncChannel : public ChannelProxy {
base::WaitableEvent* shutdown_event() { return shutdown_event_; }

ReceivedSyncMsgQueue* received_sync_msgs() {
return received_sync_msgs_;
return received_sync_msgs_.get();
}

void set_restrict_dispatch_group(int group) {
Expand Down
6 changes: 3 additions & 3 deletions ipc/ipc_sync_message_filter.cc
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ SyncMessageFilter::SyncMessageFilter(base::WaitableEvent* shutdown_event)
bool SyncMessageFilter::Send(Message* message) {
{
base::AutoLock auto_lock(lock_);
if (!io_loop_) {
if (!io_loop_.get()) {
delete message;
return false;
}
Expand All @@ -46,8 +46,8 @@ bool SyncMessageFilter::Send(Message* message) {
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(MessageLoopProxy::current() != listener_loop_);
DCHECK(MessageLoopProxy::current() != io_loop_);
DCHECK(MessageLoopProxy::current() != listener_loop_.get());
DCHECK(MessageLoopProxy::current() != io_loop_.get());
pending_sync_messages_.insert(&pending_message);
}

Expand Down

0 comments on commit 1757164

Please sign in to comment.