diff options
author | wez@chromium.org <wez@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-11-10 00:42:55 +0000 |
---|---|---|
committer | wez@chromium.org <wez@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-11-10 00:42:55 +0000 |
commit | 9fa21479a3f6cd141cc75e7b51505e4ac24fb735 (patch) | |
tree | 031f613f51f646e69efd9647210bbf0a790e374f | |
parent | cf0d311968ff74c7c8a114189ad948e5c0e8c3c5 (diff) | |
download | chromium_src-9fa21479a3f6cd141cc75e7b51505e4ac24fb735.zip chromium_src-9fa21479a3f6cd141cc75e7b51505e4ac24fb735.tar.gz chromium_src-9fa21479a3f6cd141cc75e7b51505e4ac24fb735.tar.bz2 |
Move WeakPtrFactory members in jingle/ classes to the correct locations.
BUG=303818
Review URL: https://codereview.chromium.org/67673003
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@234152 0039d316-1c4b-4281-b951-d872f2087c98
-rw-r--r-- | jingle/glue/chrome_async_socket.cc | 6 | ||||
-rw-r--r-- | jingle/glue/chrome_async_socket.h | 3 | ||||
-rw-r--r-- | jingle/glue/proxy_resolving_client_socket.h | 5 | ||||
-rw-r--r-- | jingle/glue/task_pump.cc | 7 | ||||
-rw-r--r-- | jingle/glue/task_pump.h | 3 | ||||
-rw-r--r-- | jingle/glue/thread_wrapper.cc | 4 | ||||
-rw-r--r-- | jingle/glue/thread_wrapper.h | 2 | ||||
-rw-r--r-- | jingle/notifier/listener/non_blocking_push_client.cc | 7 | ||||
-rw-r--r-- | jingle/notifier/listener/non_blocking_push_client.h | 5 |
9 files changed, 24 insertions, 18 deletions
diff --git a/jingle/glue/chrome_async_socket.cc b/jingle/glue/chrome_async_socket.cc index c14fb99..2c9812c 100644 --- a/jingle/glue/chrome_async_socket.cc +++ b/jingle/glue/chrome_async_socket.cc @@ -30,8 +30,7 @@ ChromeAsyncSocket::ChromeAsyncSocket( ResolvingClientSocketFactory* resolving_client_socket_factory, size_t read_buf_size, size_t write_buf_size) - : weak_ptr_factory_(this), - resolving_client_socket_factory_(resolving_client_socket_factory), + : resolving_client_socket_factory_(resolving_client_socket_factory), state_(STATE_CLOSED), error_(ERROR_NONE), net_error_(net::OK), @@ -41,7 +40,8 @@ ChromeAsyncSocket::ChromeAsyncSocket( read_end_(0U), write_state_(IDLE), write_buf_(new net::IOBufferWithSize(write_buf_size)), - write_end_(0U) { + write_end_(0U), + weak_ptr_factory_(this) { DCHECK(resolving_client_socket_factory_.get()); DCHECK_GT(read_buf_size, 0U); DCHECK_GT(write_buf_size, 0U); diff --git a/jingle/glue/chrome_async_socket.h b/jingle/glue/chrome_async_socket.h index 1037d24..7253ded 100644 --- a/jingle/glue/chrome_async_socket.h +++ b/jingle/glue/chrome_async_socket.h @@ -180,7 +180,6 @@ class ChromeAsyncSocket : public buzz::AsyncSocket { // Close functions. void DoClose(); - base::WeakPtrFactory<ChromeAsyncSocket> weak_ptr_factory_; scoped_ptr<ResolvingClientSocketFactory> resolving_client_socket_factory_; // buzz::AsyncSocket state. @@ -205,6 +204,8 @@ class ChromeAsyncSocket : public buzz::AsyncSocket { scoped_refptr<net::IOBufferWithSize> write_buf_; size_t write_end_; + base::WeakPtrFactory<ChromeAsyncSocket> weak_ptr_factory_; + DISALLOW_COPY_AND_ASSIGN(ChromeAsyncSocket); }; diff --git a/jingle/glue/proxy_resolving_client_socket.h b/jingle/glue/proxy_resolving_client_socket.h index b920591..99824d0 100644 --- a/jingle/glue/proxy_resolving_client_socket.h +++ b/jingle/glue/proxy_resolving_client_socket.h @@ -95,10 +95,13 @@ class ProxyResolvingClientSocket : public net::StreamSocket { const GURL proxy_url_; bool tried_direct_connect_fallback_; net::BoundNetLog bound_net_log_; - base::WeakPtrFactory<ProxyResolvingClientSocket> weak_factory_; // The callback passed to Connect(). net::CompletionCallback user_connect_callback_; + + base::WeakPtrFactory<ProxyResolvingClientSocket> weak_factory_; + + DISALLOW_COPY_AND_ASSIGN(ProxyResolvingClientSocket); }; } // namespace jingle_glue diff --git a/jingle/glue/task_pump.cc b/jingle/glue/task_pump.cc index be5f25b..3c0ddaa 100644 --- a/jingle/glue/task_pump.cc +++ b/jingle/glue/task_pump.cc @@ -9,9 +9,10 @@ namespace jingle_glue { TaskPump::TaskPump() - : weak_factory_(this), - posted_wake_(false), - stopped_(false) {} + : posted_wake_(false), + stopped_(false), + weak_factory_(this) { +} TaskPump::~TaskPump() { DCHECK(CalledOnValidThread()); diff --git a/jingle/glue/task_pump.h b/jingle/glue/task_pump.h index 17ce689..a90cab6 100644 --- a/jingle/glue/task_pump.h +++ b/jingle/glue/task_pump.h @@ -30,10 +30,11 @@ class TaskPump : public talk_base::TaskRunner, public base::NonThreadSafe { private: void CheckAndRunTasks(); - base::WeakPtrFactory<TaskPump> weak_factory_; bool posted_wake_; bool stopped_; + base::WeakPtrFactory<TaskPump> weak_factory_; + DISALLOW_COPY_AND_ASSIGN(TaskPump); }; diff --git a/jingle/glue/thread_wrapper.cc b/jingle/glue/thread_wrapper.cc index ab5120d..e2109fe 100644 --- a/jingle/glue/thread_wrapper.cc +++ b/jingle/glue/thread_wrapper.cc @@ -52,10 +52,10 @@ JingleThreadWrapper::JingleThreadWrapper( send_allowed_(false), last_task_id_(0), pending_send_event_(true, false), - weak_ptr_factory_(this), - weak_ptr_(weak_ptr_factory_.GetWeakPtr()) { + weak_ptr_factory_(this) { DCHECK(task_runner->BelongsToCurrentThread()); DCHECK(!talk_base::Thread::Current()); + weak_ptr_ = weak_ptr_factory_.GetWeakPtr(); talk_base::MessageQueueManager::Add(this); WrapCurrent(); } diff --git a/jingle/glue/thread_wrapper.h b/jingle/glue/thread_wrapper.h index 2969308..97e8588 100644 --- a/jingle/glue/thread_wrapper.h +++ b/jingle/glue/thread_wrapper.h @@ -116,8 +116,8 @@ class JingleThreadWrapper : public base::MessageLoop::DestructionObserver, std::list<PendingSend*> pending_send_messages_; base::WaitableEvent pending_send_event_; - base::WeakPtrFactory<JingleThreadWrapper> weak_ptr_factory_; base::WeakPtr<JingleThreadWrapper> weak_ptr_; + base::WeakPtrFactory<JingleThreadWrapper> weak_ptr_factory_; DISALLOW_COPY_AND_ASSIGN(JingleThreadWrapper); }; diff --git a/jingle/notifier/listener/non_blocking_push_client.cc b/jingle/notifier/listener/non_blocking_push_client.cc index 277cf49..ba89a2c3 100644 --- a/jingle/notifier/listener/non_blocking_push_client.cc +++ b/jingle/notifier/listener/non_blocking_push_client.cc @@ -156,10 +156,9 @@ NonBlockingPushClient::NonBlockingPushClient( const scoped_refptr<base::SingleThreadTaskRunner>& delegate_task_runner, const CreateBlockingPushClientCallback& create_blocking_push_client_callback) - : weak_ptr_factory_(this), - delegate_task_runner_(delegate_task_runner), - core_(new Core(delegate_task_runner_, - weak_ptr_factory_.GetWeakPtr())) { + : delegate_task_runner_(delegate_task_runner), + weak_ptr_factory_(this) { + core_ = new Core(delegate_task_runner_, weak_ptr_factory_.GetWeakPtr()); delegate_task_runner_->PostTask( FROM_HERE, base::Bind(&NonBlockingPushClient::Core::CreateOnDelegateThread, diff --git a/jingle/notifier/listener/non_blocking_push_client.h b/jingle/notifier/listener/non_blocking_push_client.h index f5c6bc4..b49ae03 100644 --- a/jingle/notifier/listener/non_blocking_push_client.h +++ b/jingle/notifier/listener/non_blocking_push_client.h @@ -60,12 +60,13 @@ class NonBlockingPushClient : public PushClient { void OnPingResponse(); base::ThreadChecker thread_checker_; - base::WeakPtrFactory<NonBlockingPushClient> weak_ptr_factory_; const scoped_refptr<base::SingleThreadTaskRunner> delegate_task_runner_; - const scoped_refptr<Core> core_; + scoped_refptr<Core> core_; ObserverList<PushClientObserver> observers_; + base::WeakPtrFactory<NonBlockingPushClient> weak_ptr_factory_; + DISALLOW_COPY_AND_ASSIGN(NonBlockingPushClient); }; |