| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "chrome/browser/local_discovery/service_discovery_client_mdns.h" | 5 #include "chrome/browser/local_discovery/service_discovery_client_mdns.h" |
| 6 | 6 |
| 7 #include <stddef.h> | 7 #include <stddef.h> |
| 8 | 8 |
| 9 #include <memory> | 9 #include <memory> |
| 10 #include <utility> | 10 #include <utility> |
| (...skipping 189 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 200 } | 200 } |
| 201 | 201 |
| 202 // ServiceWatcher methods. | 202 // ServiceWatcher methods. |
| 203 void Start() override { | 203 void Start() override { |
| 204 if (implementation()) { | 204 if (implementation()) { |
| 205 PostToMdnsThread(base::Bind(&ServiceWatcher::Start, | 205 PostToMdnsThread(base::Bind(&ServiceWatcher::Start, |
| 206 base::Unretained(implementation()))); | 206 base::Unretained(implementation()))); |
| 207 } | 207 } |
| 208 } | 208 } |
| 209 | 209 |
| 210 void DiscoverNewServices(bool force_update) override { | 210 void DiscoverNewServices() override { |
| 211 if (implementation()) { | 211 if (implementation()) { |
| 212 PostToMdnsThread(base::Bind(&ServiceWatcher::DiscoverNewServices, | 212 PostToMdnsThread(base::Bind(&ServiceWatcher::DiscoverNewServices, |
| 213 base::Unretained(implementation()), | 213 base::Unretained(implementation()))); |
| 214 force_update)); | |
| 215 } | 214 } |
| 216 } | 215 } |
| 217 | 216 |
| 218 void SetActivelyRefreshServices(bool actively_refresh_services) override { | 217 void SetActivelyRefreshServices(bool actively_refresh_services) override { |
| 219 if (implementation()) { | 218 if (implementation()) { |
| 220 PostToMdnsThread(base::Bind(&ServiceWatcher::SetActivelyRefreshServices, | 219 PostToMdnsThread(base::Bind(&ServiceWatcher::SetActivelyRefreshServices, |
| 221 base::Unretained(implementation()), | 220 base::Unretained(implementation()), |
| 222 actively_refresh_services)); | 221 actively_refresh_services)); |
| 223 } | 222 } |
| 224 } | 223 } |
| (...skipping 222 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 447 OnBeforeMdnsDestroy(); | 446 OnBeforeMdnsDestroy(); |
| 448 // After calling |Proxy::OnMdnsDestroy| all references to client_ and mdns_ | 447 // After calling |Proxy::OnMdnsDestroy| all references to client_ and mdns_ |
| 449 // should be destroyed. | 448 // should be destroyed. |
| 450 if (client_) | 449 if (client_) |
| 451 mdns_runner_->DeleteSoon(FROM_HERE, client_.release()); | 450 mdns_runner_->DeleteSoon(FROM_HERE, client_.release()); |
| 452 if (mdns_) | 451 if (mdns_) |
| 453 mdns_runner_->DeleteSoon(FROM_HERE, mdns_.release()); | 452 mdns_runner_->DeleteSoon(FROM_HERE, mdns_.release()); |
| 454 } | 453 } |
| 455 | 454 |
| 456 } // namespace local_discovery | 455 } // namespace local_discovery |
| OLD | NEW |