diff options
author | dmichael@chromium.org <dmichael@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-10-10 09:58:54 +0000 |
---|---|---|
committer | dmichael@chromium.org <dmichael@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-10-10 09:58:54 +0000 |
commit | 70dbb9d514ede60e146acaba8296e7c8fb4abf50 (patch) | |
tree | a70afa186b7728a487e210eea8616c73ce5c5898 | |
parent | 420ec523a48d0c86045f44c93ab4343225edbad8 (diff) | |
download | chromium_src-70dbb9d514ede60e146acaba8296e7c8fb4abf50.zip chromium_src-70dbb9d514ede60e146acaba8296e7c8fb4abf50.tar.gz chromium_src-70dbb9d514ede60e146acaba8296e7c8fb4abf50.tar.bz2 |
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
-rw-r--r-- | remoting/client/chromoting_client.h | 2 | ||||
-rw-r--r-- | remoting/host/plugin/host_script_object.cc | 5 | ||||
-rw-r--r-- | remoting/host/plugin/host_script_object.h | 2 | ||||
-rw-r--r-- | remoting/host/setup/host_starter.cc | 4 | ||||
-rw-r--r-- | remoting/host/setup/host_starter.h | 2 |
5 files changed, 8 insertions, 7 deletions
diff --git a/remoting/client/chromoting_client.h b/remoting/client/chromoting_client.h index 58c8050..fda616b 100644 --- a/remoting/client/chromoting_client.h +++ b/remoting/client/chromoting_client.h @@ -113,8 +113,8 @@ class ChromotingClient : public protocol::ConnectionToHost::HostEventCallback, ChromotingStats stats_; // WeakPtr used to avoid tasks accessing the client after it is deleted. - base::WeakPtrFactory<ChromotingClient> weak_factory_; base::WeakPtr<ChromotingClient> weak_ptr_; + base::WeakPtrFactory<ChromotingClient> weak_factory_; DISALLOW_COPY_AND_ASSIGN(ChromotingClient); }; 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<HostNPScriptObject> weak_factory_; base::WeakPtr<HostNPScriptObject> weak_ptr_; + base::WeakPtrFactory<HostNPScriptObject> 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<HostStarter> weak_ptr_factory_; base::WeakPtr<HostStarter> weak_ptr_; + base::WeakPtrFactory<HostStarter> weak_ptr_factory_; DISALLOW_COPY_AND_ASSIGN(HostStarter); }; |