| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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/tools/service_discovery_sniffer/service_discovery_sniffer.h" | 5 #include "chrome/tools/service_discovery_sniffer/service_discovery_sniffer.h" |
| 6 | 6 |
| 7 #include <memory> | 7 #include <memory> |
| 8 #include <vector> | 8 #include <vector> |
| 9 | 9 |
| 10 #include "base/at_exit.h" | 10 #include "base/at_exit.h" |
| 11 #include "base/bind.h" | 11 #include "base/bind.h" |
| 12 #include "base/message_loop/message_loop.h" | 12 #include "base/message_loop/message_loop.h" |
| 13 #include "base/run_loop.h" |
| 13 #include "chrome/browser/local_discovery/service_discovery_client_impl.h" | 14 #include "chrome/browser/local_discovery/service_discovery_client_impl.h" |
| 14 #include "net/dns/mdns_client.h" | 15 #include "net/dns/mdns_client.h" |
| 15 | 16 |
| 16 namespace local_discovery { | 17 namespace local_discovery { |
| 17 | 18 |
| 18 ServicePrinter::ServicePrinter(ServiceDiscoveryClient* client, | 19 ServicePrinter::ServicePrinter(ServiceDiscoveryClient* client, |
| 19 const std::string& service_name) | 20 const std::string& service_name) |
| 20 : changed_(false) { | 21 : changed_(false) { |
| 21 service_resolver_ = | 22 service_resolver_ = |
| 22 client->CreateServiceResolver( | 23 client->CreateServiceResolver( |
| (...skipping 89 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 112 service_discovery_client; | 113 service_discovery_client; |
| 113 service_discovery_client.reset( | 114 service_discovery_client.reset( |
| 114 new local_discovery::ServiceDiscoveryClientImpl(mdns_client.get())); | 115 new local_discovery::ServiceDiscoveryClientImpl(mdns_client.get())); |
| 115 { | 116 { |
| 116 // To guarantee/make explicit the ordering constraint. | 117 // To guarantee/make explicit the ordering constraint. |
| 117 local_discovery::ServiceTypePrinter print_changes( | 118 local_discovery::ServiceTypePrinter print_changes( |
| 118 service_discovery_client.get(), | 119 service_discovery_client.get(), |
| 119 std::string(argv[1]) + "._tcp.local"); | 120 std::string(argv[1]) + "._tcp.local"); |
| 120 | 121 |
| 121 print_changes.Start(); | 122 print_changes.Start(); |
| 122 message_loop.Run(); | 123 base::RunLoop().Run(); |
| 123 } | 124 } |
| 124 } | 125 } |
| OLD | NEW |