diff options
author | anujk.sharma <anujk.sharma@samsung.com> | 2014-08-27 23:49:02 -0700 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2014-08-28 06:50:11 +0000 |
commit | 0184ced8d904d202ad7ab392ef8eca55d83d2937 (patch) | |
tree | 215ff2bda703e71a35d960a74e05f1213444cabe /ipc | |
parent | 884ad197db2dd93253957c089cd583b8fca4802d (diff) | |
download | chromium_src-0184ced8d904d202ad7ab392ef8eca55d83d2937.zip chromium_src-0184ced8d904d202ad7ab392ef8eca55d83d2937.tar.gz chromium_src-0184ced8d904d202ad7ab392ef8eca55d83d2937.tar.bz2 |
Declaring the weak_ptr_factory in proper order.
Cleaning up weak_ptr_factory destruction order in "src/ipc" module.
WeakPtrFactory should remain the last member so it'll be destroyed and
invalidate its weak pointers before any other members are destroyed.
BUG=303818
Review URL: https://codereview.chromium.org/508903002
Cr-Commit-Position: refs/heads/master@{#292334}
Diffstat (limited to 'ipc')
-rw-r--r-- | ipc/ipc_channel_win.h | 4 | ||||
-rw-r--r-- | ipc/mojo/ipc_channel_mojo.cc | 6 | ||||
-rw-r--r-- | ipc/mojo/ipc_channel_mojo.h | 3 |
3 files changed, 6 insertions, 7 deletions
diff --git a/ipc/ipc_channel_win.h b/ipc/ipc_channel_win.h index 2bbb294..e976aa3 100644 --- a/ipc/ipc_channel_win.h +++ b/ipc/ipc_channel_win.h @@ -106,10 +106,8 @@ class ChannelWin : public Channel, // compatability with existing clients that don't validate the channel.) int32 client_secret_; - - base::WeakPtrFactory<ChannelWin> weak_factory_; - scoped_ptr<base::ThreadChecker> thread_check_; + base::WeakPtrFactory<ChannelWin> weak_factory_; DISALLOW_COPY_AND_ASSIGN(ChannelWin); }; diff --git a/ipc/mojo/ipc_channel_mojo.cc b/ipc/mojo/ipc_channel_mojo.cc index 2ec9945..88034f1 100644 --- a/ipc/mojo/ipc_channel_mojo.cc +++ b/ipc/mojo/ipc_channel_mojo.cc @@ -484,10 +484,10 @@ scoped_ptr<ChannelFactory> ChannelMojo::CreateFactory( ChannelMojo::ChannelMojo( scoped_ptr<Channel> bootstrap, Mode mode, Listener* listener, scoped_refptr<base::TaskRunner> io_thread_task_runner) - : weak_factory_(this), - bootstrap_(bootstrap.Pass()), + : bootstrap_(bootstrap.Pass()), mode_(mode), listener_(listener), - peer_pid_(base::kNullProcessId) { + peer_pid_(base::kNullProcessId), + weak_factory_(this) { if (base::MessageLoopProxy::current() == io_thread_task_runner.get()) { InitOnIOThread(); } else { diff --git a/ipc/mojo/ipc_channel_mojo.h b/ipc/mojo/ipc_channel_mojo.h index a2fa587..4d4df63 100644 --- a/ipc/mojo/ipc_channel_mojo.h +++ b/ipc/mojo/ipc_channel_mojo.h @@ -108,7 +108,6 @@ class IPC_MOJO_EXPORT ChannelMojo : public Channel { void InitOnIOThread(); - base::WeakPtrFactory<ChannelMojo> weak_factory_; scoped_ptr<Channel> bootstrap_; Mode mode_; Listener* listener_; @@ -120,6 +119,8 @@ class IPC_MOJO_EXPORT ChannelMojo : public Channel { scoped_ptr<MessageReader, ReaderDeleter> message_reader_; ScopedVector<Message> pending_messages_; + base::WeakPtrFactory<ChannelMojo> weak_factory_; + DISALLOW_COPY_AND_ASSIGN(ChannelMojo); }; |