Commit fd033701 authored by dcheng's avatar dcheng Committed by Commit bot

Manual fixups for scoped_refptr operator T* removal in ipc/

BUG=110610

Review URL: https://codereview.chromium.org/512153002

Cr-Commit-Position: refs/heads/master@{#292404}
parent 43890436
...@@ -22,8 +22,9 @@ namespace IPC { ...@@ -22,8 +22,9 @@ namespace IPC {
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
ChannelProxy::Context::Context(Listener* listener, ChannelProxy::Context::Context(
base::SingleThreadTaskRunner* ipc_task_runner) Listener* listener,
const scoped_refptr<base::SingleThreadTaskRunner>& ipc_task_runner)
: listener_task_runner_(base::ThreadTaskRunnerHandle::Get()), : listener_task_runner_(base::ThreadTaskRunnerHandle::Get()),
listener_(listener), listener_(listener),
ipc_task_runner_(ipc_task_runner), ipc_task_runner_(ipc_task_runner),
...@@ -309,7 +310,7 @@ scoped_ptr<ChannelProxy> ChannelProxy::Create( ...@@ -309,7 +310,7 @@ scoped_ptr<ChannelProxy> ChannelProxy::Create(
const IPC::ChannelHandle& channel_handle, const IPC::ChannelHandle& channel_handle,
Channel::Mode mode, Channel::Mode mode,
Listener* listener, Listener* listener,
base::SingleThreadTaskRunner* ipc_task_runner) { const scoped_refptr<base::SingleThreadTaskRunner>& ipc_task_runner) {
scoped_ptr<ChannelProxy> channel(new ChannelProxy(listener, ipc_task_runner)); scoped_ptr<ChannelProxy> channel(new ChannelProxy(listener, ipc_task_runner));
channel->Init(channel_handle, mode, true); channel->Init(channel_handle, mode, true);
return channel.Pass(); return channel.Pass();
...@@ -319,7 +320,7 @@ scoped_ptr<ChannelProxy> ChannelProxy::Create( ...@@ -319,7 +320,7 @@ scoped_ptr<ChannelProxy> ChannelProxy::Create(
scoped_ptr<ChannelProxy> ChannelProxy::Create( scoped_ptr<ChannelProxy> ChannelProxy::Create(
scoped_ptr<ChannelFactory> factory, scoped_ptr<ChannelFactory> factory,
Listener* listener, Listener* listener,
base::SingleThreadTaskRunner* ipc_task_runner) { const scoped_refptr<base::SingleThreadTaskRunner>& ipc_task_runner) {
scoped_ptr<ChannelProxy> channel(new ChannelProxy(listener, ipc_task_runner)); scoped_ptr<ChannelProxy> channel(new ChannelProxy(listener, ipc_task_runner));
channel->Init(factory.Pass(), true); channel->Init(factory.Pass(), true);
return channel.Pass(); return channel.Pass();
...@@ -330,8 +331,9 @@ ChannelProxy::ChannelProxy(Context* context) ...@@ -330,8 +331,9 @@ ChannelProxy::ChannelProxy(Context* context)
did_init_(false) { did_init_(false) {
} }
ChannelProxy::ChannelProxy(Listener* listener, ChannelProxy::ChannelProxy(
base::SingleThreadTaskRunner* ipc_task_runner) Listener* listener,
const scoped_refptr<base::SingleThreadTaskRunner>& ipc_task_runner)
: context_(new Context(listener, ipc_task_runner)), did_init_(false) { : context_(new Context(listener, ipc_task_runner)), did_init_(false) {
} }
......
...@@ -69,12 +69,12 @@ class IPC_EXPORT ChannelProxy : public Sender, public base::NonThreadSafe { ...@@ -69,12 +69,12 @@ class IPC_EXPORT ChannelProxy : public Sender, public base::NonThreadSafe {
const IPC::ChannelHandle& channel_handle, const IPC::ChannelHandle& channel_handle,
Channel::Mode mode, Channel::Mode mode,
Listener* listener, Listener* listener,
base::SingleThreadTaskRunner* ipc_task_runner); const scoped_refptr<base::SingleThreadTaskRunner>& ipc_task_runner);
static scoped_ptr<ChannelProxy> Create( static scoped_ptr<ChannelProxy> Create(
scoped_ptr<ChannelFactory> factory, scoped_ptr<ChannelFactory> factory,
Listener* listener, Listener* listener,
base::SingleThreadTaskRunner* ipc_task_runner); const scoped_refptr<base::SingleThreadTaskRunner>& ipc_task_runner);
virtual ~ChannelProxy(); virtual ~ChannelProxy();
...@@ -131,14 +131,16 @@ class IPC_EXPORT ChannelProxy : public Sender, public base::NonThreadSafe { ...@@ -131,14 +131,16 @@ class IPC_EXPORT ChannelProxy : public Sender, public base::NonThreadSafe {
// to the internal state. // to the internal state.
ChannelProxy(Context* context); ChannelProxy(Context* context);
ChannelProxy(Listener* listener, ChannelProxy(
base::SingleThreadTaskRunner* ipc_task_runner); Listener* listener,
const scoped_refptr<base::SingleThreadTaskRunner>& ipc_task_runner);
// Used internally to hold state that is referenced on the IPC thread. // Used internally to hold state that is referenced on the IPC thread.
class Context : public base::RefCountedThreadSafe<Context>, class Context : public base::RefCountedThreadSafe<Context>,
public Listener { public Listener {
public: public:
Context(Listener* listener, base::SingleThreadTaskRunner* ipc_thread); Context(Listener* listener,
const scoped_refptr<base::SingleThreadTaskRunner>& ipc_thread);
void ClearIPCTaskRunner(); void ClearIPCTaskRunner();
base::SingleThreadTaskRunner* ipc_task_runner() const { base::SingleThreadTaskRunner* ipc_task_runner() const {
return ipc_task_runner_.get(); return ipc_task_runner_.get();
......
...@@ -229,7 +229,7 @@ base::LazyInstance<base::ThreadLocalPointer<SyncChannel::ReceivedSyncMsgQueue> > ...@@ -229,7 +229,7 @@ base::LazyInstance<base::ThreadLocalPointer<SyncChannel::ReceivedSyncMsgQueue> >
SyncChannel::SyncContext::SyncContext( SyncChannel::SyncContext::SyncContext(
Listener* listener, Listener* listener,
base::SingleThreadTaskRunner* ipc_task_runner, const scoped_refptr<base::SingleThreadTaskRunner>& ipc_task_runner,
WaitableEvent* shutdown_event) WaitableEvent* shutdown_event)
: ChannelProxy::Context(listener, ipc_task_runner), : ChannelProxy::Context(listener, ipc_task_runner),
received_sync_msgs_(ReceivedSyncMsgQueue::AddContext()), received_sync_msgs_(ReceivedSyncMsgQueue::AddContext()),
...@@ -410,7 +410,7 @@ scoped_ptr<SyncChannel> SyncChannel::Create( ...@@ -410,7 +410,7 @@ scoped_ptr<SyncChannel> SyncChannel::Create(
const IPC::ChannelHandle& channel_handle, const IPC::ChannelHandle& channel_handle,
Channel::Mode mode, Channel::Mode mode,
Listener* listener, Listener* listener,
base::SingleThreadTaskRunner* ipc_task_runner, const scoped_refptr<base::SingleThreadTaskRunner>& ipc_task_runner,
bool create_pipe_now, bool create_pipe_now,
base::WaitableEvent* shutdown_event) { base::WaitableEvent* shutdown_event) {
scoped_ptr<SyncChannel> channel = scoped_ptr<SyncChannel> channel =
...@@ -423,7 +423,7 @@ scoped_ptr<SyncChannel> SyncChannel::Create( ...@@ -423,7 +423,7 @@ scoped_ptr<SyncChannel> SyncChannel::Create(
scoped_ptr<SyncChannel> SyncChannel::Create( scoped_ptr<SyncChannel> SyncChannel::Create(
scoped_ptr<ChannelFactory> factory, scoped_ptr<ChannelFactory> factory,
Listener* listener, Listener* listener,
base::SingleThreadTaskRunner* ipc_task_runner, const scoped_refptr<base::SingleThreadTaskRunner>& ipc_task_runner,
bool create_pipe_now, bool create_pipe_now,
base::WaitableEvent* shutdown_event) { base::WaitableEvent* shutdown_event) {
scoped_ptr<SyncChannel> channel = scoped_ptr<SyncChannel> channel =
...@@ -435,7 +435,7 @@ scoped_ptr<SyncChannel> SyncChannel::Create( ...@@ -435,7 +435,7 @@ scoped_ptr<SyncChannel> SyncChannel::Create(
// static // static
scoped_ptr<SyncChannel> SyncChannel::Create( scoped_ptr<SyncChannel> SyncChannel::Create(
Listener* listener, Listener* listener,
base::SingleThreadTaskRunner* ipc_task_runner, const scoped_refptr<base::SingleThreadTaskRunner>& ipc_task_runner,
WaitableEvent* shutdown_event) { WaitableEvent* shutdown_event) {
return make_scoped_ptr( return make_scoped_ptr(
new SyncChannel(listener, ipc_task_runner, shutdown_event)); new SyncChannel(listener, ipc_task_runner, shutdown_event));
...@@ -443,7 +443,7 @@ scoped_ptr<SyncChannel> SyncChannel::Create( ...@@ -443,7 +443,7 @@ scoped_ptr<SyncChannel> SyncChannel::Create(
SyncChannel::SyncChannel( SyncChannel::SyncChannel(
Listener* listener, Listener* listener,
base::SingleThreadTaskRunner* ipc_task_runner, const scoped_refptr<base::SingleThreadTaskRunner>& ipc_task_runner,
WaitableEvent* shutdown_event) WaitableEvent* shutdown_event)
: ChannelProxy(new SyncContext(listener, ipc_task_runner, shutdown_event)) { : ChannelProxy(new SyncContext(listener, ipc_task_runner, shutdown_event)) {
// The current (listener) thread must be distinct from the IPC thread, or else // The current (listener) thread must be distinct from the IPC thread, or else
......
...@@ -72,14 +72,14 @@ class IPC_EXPORT SyncChannel : public ChannelProxy { ...@@ -72,14 +72,14 @@ class IPC_EXPORT SyncChannel : public ChannelProxy {
const IPC::ChannelHandle& channel_handle, const IPC::ChannelHandle& channel_handle,
IPC::Channel::Mode mode, IPC::Channel::Mode mode,
Listener* listener, Listener* listener,
base::SingleThreadTaskRunner* ipc_task_runner, const scoped_refptr<base::SingleThreadTaskRunner>& ipc_task_runner,
bool create_pipe_now, bool create_pipe_now,
base::WaitableEvent* shutdown_event); base::WaitableEvent* shutdown_event);
static scoped_ptr<SyncChannel> Create( static scoped_ptr<SyncChannel> Create(
scoped_ptr<ChannelFactory> factory, scoped_ptr<ChannelFactory> factory,
Listener* listener, Listener* listener,
base::SingleThreadTaskRunner* ipc_task_runner, const scoped_refptr<base::SingleThreadTaskRunner>& ipc_task_runner,
bool create_pipe_now, bool create_pipe_now,
base::WaitableEvent* shutdown_event); base::WaitableEvent* shutdown_event);
...@@ -88,7 +88,7 @@ class IPC_EXPORT SyncChannel : public ChannelProxy { ...@@ -88,7 +88,7 @@ class IPC_EXPORT SyncChannel : public ChannelProxy {
// added before any messages are sent or received. // added before any messages are sent or received.
static scoped_ptr<SyncChannel> Create( static scoped_ptr<SyncChannel> Create(
Listener* listener, Listener* listener,
base::SingleThreadTaskRunner* ipc_task_runner, const scoped_refptr<base::SingleThreadTaskRunner>& ipc_task_runner,
base::WaitableEvent* shutdown_event); base::WaitableEvent* shutdown_event);
virtual ~SyncChannel(); virtual ~SyncChannel();
...@@ -121,9 +121,10 @@ class IPC_EXPORT SyncChannel : public ChannelProxy { ...@@ -121,9 +121,10 @@ class IPC_EXPORT SyncChannel : public ChannelProxy {
// ChannelProxy::Context for more information. // ChannelProxy::Context for more information.
class SyncContext : public Context { class SyncContext : public Context {
public: public:
SyncContext(Listener* listener, SyncContext(
base::SingleThreadTaskRunner* ipc_task_runner, Listener* listener,
base::WaitableEvent* shutdown_event); const scoped_refptr<base::SingleThreadTaskRunner>& ipc_task_runner,
base::WaitableEvent* shutdown_event);
// Adds information about an outgoing sync message to the context so that // Adds information about an outgoing sync message to the context so that
// we know how to deserialize the reply. // we know how to deserialize the reply.
...@@ -199,9 +200,10 @@ class IPC_EXPORT SyncChannel : public ChannelProxy { ...@@ -199,9 +200,10 @@ class IPC_EXPORT SyncChannel : public ChannelProxy {
}; };
private: private:
SyncChannel(Listener* listener, SyncChannel(
base::SingleThreadTaskRunner* ipc_task_runner, Listener* listener,
base::WaitableEvent* shutdown_event); const scoped_refptr<base::SingleThreadTaskRunner>& ipc_task_runner,
base::WaitableEvent* shutdown_event);
void OnWaitableEventSignaled(base::WaitableEvent* arg); void OnWaitableEventSignaled(base::WaitableEvent* arg);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment