From 70dbb9d514ede60e146acaba8296e7c8fb4abf50 Mon Sep 17 00:00:00 2001 From: "dmichael@chromium.org" Date: Thu, 10 Oct 2013 09:58:54 +0000 Subject: Remoting: Move WeakPtrFactory members to be last BUG=303818 R=wez@chromium.org Review URL: https://codereview.chromium.org/26539006 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@227908 0039d316-1c4b-4281-b951-d872f2087c98 --- remoting/host/plugin/host_script_object.cc | 5 +++-- remoting/host/plugin/host_script_object.h | 2 +- remoting/host/setup/host_starter.cc | 4 ++-- remoting/host/setup/host_starter.h | 2 +- 4 files changed, 7 insertions(+), 6 deletions(-) (limited to 'remoting/host') diff --git a/remoting/host/plugin/host_script_object.cc b/remoting/host/plugin/host_script_object.cc index c4572e2..ddcb1cb 100644 --- a/remoting/host/plugin/host_script_object.cc +++ b/remoting/host/plugin/host_script_object.cc @@ -642,10 +642,11 @@ HostNPScriptObject::HostNPScriptObject( plugin_task_runner_(plugin_task_runner), am_currently_logging_(false), state_(kDisconnected), - weak_factory_(this), - weak_ptr_(weak_factory_.GetWeakPtr()) { + weak_factory_(this) { DCHECK(plugin_task_runner_->BelongsToCurrentThread()); + weak_ptr_ = weak_factory_.GetWeakPtr(); + // Set the thread task runner for the plugin thread so that timers and other // code using |base::ThreadTaskRunnerHandle| could be used on the plugin // thread. diff --git a/remoting/host/plugin/host_script_object.h b/remoting/host/plugin/host_script_object.h index 0516efc..91b9a0d 100644 --- a/remoting/host/plugin/host_script_object.h +++ b/remoting/host/plugin/host_script_object.h @@ -331,8 +331,8 @@ class HostNPScriptObject { // Plugin state used for both Ir2Me and Me2Me. // Used to cancel pending tasks for this object when it is destroyed. - base::WeakPtrFactory weak_factory_; base::WeakPtr weak_ptr_; + base::WeakPtrFactory weak_factory_; DISALLOW_COPY_AND_ASSIGN(HostNPScriptObject); }; diff --git a/remoting/host/setup/host_starter.cc b/remoting/host/setup/host_starter.cc index 1fd3c17..298be8e 100644 --- a/remoting/host/setup/host_starter.cc +++ b/remoting/host/setup/host_starter.cc @@ -26,8 +26,8 @@ HostStarter::HostStarter( daemon_controller_(daemon_controller), consent_to_data_collection_(false), unregistering_host_(false), - weak_ptr_factory_(this), - weak_ptr_(weak_ptr_factory_.GetWeakPtr()) { + weak_ptr_factory_(this) { + weak_ptr_ = weak_ptr_factory_.GetWeakPtr(); main_task_runner_ = base::ThreadTaskRunnerHandle::Get(); } diff --git a/remoting/host/setup/host_starter.h b/remoting/host/setup/host_starter.h index 4758293..60a28acb 100644 --- a/remoting/host/setup/host_starter.h +++ b/remoting/host/setup/host_starter.h @@ -97,8 +97,8 @@ class HostStarter : public gaia::GaiaOAuthClient::Delegate, // be logged, but the error will still be reported as START_ERROR. bool unregistering_host_; - base::WeakPtrFactory weak_ptr_factory_; base::WeakPtr weak_ptr_; + base::WeakPtrFactory weak_ptr_factory_; DISALLOW_COPY_AND_ASSIGN(HostStarter); }; -- cgit v1.1