Chromium Code Reviews| Index: remoting/host/remoting_me2me_host.cc |
| diff --git a/remoting/host/remoting_me2me_host.cc b/remoting/host/remoting_me2me_host.cc |
| index 3f90b65ddcef0c03d0de8bc2864c0f21974aa3ec..8fcc1161a7702224dd47a28af0bbb68fda958e73 100644 |
| --- a/remoting/host/remoting_me2me_host.cc |
| +++ b/remoting/host/remoting_me2me_host.cc |
| @@ -133,7 +133,6 @@ class HostProcess |
| } |
| void ConfigUpdated() { |
| - // The timer should be set and cleaned up on the same thread. |
| DCHECK(message_loop_.message_loop_proxy()->BelongsToCurrentThread()); |
| // Call ConfigUpdatedDelayed after a short delay, so that this object won't |
| @@ -145,7 +144,10 @@ class HostProcess |
| } |
| void ConfigUpdatedDelayed() { |
| - if (LoadConfig()) { |
| + DCHECK(message_loop_.message_loop_proxy()->BelongsToCurrentThread()); |
| + |
| + if (config_.Reload() && LoadConfig()) { |
|
simonmorris
2012/08/07 00:43:35
I think it's more natural to include the call to R
Sergey Ulanov
2012/08/07 00:57:03
Done. Also changed CompositeHostConfig::AddConfigP
|
| + // PostTask to create new authenticator factory in case PIN has changed. |
| context_->network_task_runner()->PostTask( |
| FROM_HERE, |
| base::Bind(&HostProcess::CreateAuthenticatorFactory, |
| @@ -197,6 +199,7 @@ class HostProcess |
| } |
| void CreateAuthenticatorFactory() { |
| + DCHECK(context_->network_task_runner()->BelongsToCurrentThread()); |
| scoped_ptr<protocol::AuthenticatorFactory> factory( |
| new protocol::Me2MeHostAuthenticatorFactory( |
| key_pair_.GenerateCertificate(), |
| @@ -251,6 +254,12 @@ class HostProcess |
| // Read host config, returning true if successful. |
| bool LoadConfig() { |
| + DCHECK(message_loop_.message_loop_proxy()->BelongsToCurrentThread()); |
| + |
| + // TODO(sergeyu): There is a potential race condition: this function is |
| + // called on the main thread while the class members it mutates are used on |
| + // the network thread. Fix it. http://crbug.com/140986 . |
| + |
| if (!config_.GetString(kHostIdConfigPath, &host_id_)) { |
| LOG(ERROR) << "host_id is not defined in the config."; |
| return false; |