Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(141)

Side by Side Diff: chrome/tools/service_discovery_sniffer/service_discovery_sniffer.cc

Issue 2963613002: Remove the (broken and unneeded) 'force_update' option from ServiceWatcher::DiscoverNewDevices. (Closed)
Patch Set: Fixup yet another mac site revealed by CQ Created 3 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « chrome/browser/ui/webui/local_discovery/local_discovery_ui_handler.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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"
(...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after
67 ServiceTypePrinter::ServiceTypePrinter(ServiceDiscoveryClient* client, 67 ServiceTypePrinter::ServiceTypePrinter(ServiceDiscoveryClient* client,
68 const std::string& service_type) 68 const std::string& service_type)
69 : client_(client) { 69 : client_(client) {
70 watcher_ = client_->CreateServiceWatcher( 70 watcher_ = client_->CreateServiceWatcher(
71 service_type, base::Bind(&ServiceTypePrinter::OnServiceUpdated, 71 service_type, base::Bind(&ServiceTypePrinter::OnServiceUpdated,
72 base::Unretained(this))); 72 base::Unretained(this)));
73 } 73 }
74 74
75 void ServiceTypePrinter::Start() { 75 void ServiceTypePrinter::Start() {
76 watcher_->Start(); 76 watcher_->Start();
77 watcher_->DiscoverNewServices(false); 77 watcher_->DiscoverNewServices();
78 } 78 }
79 79
80 ServiceTypePrinter::~ServiceTypePrinter() { 80 ServiceTypePrinter::~ServiceTypePrinter() {
81 } 81 }
82 82
83 void ServiceTypePrinter::OnServiceUpdated(ServiceWatcher::UpdateType update, 83 void ServiceTypePrinter::OnServiceUpdated(ServiceWatcher::UpdateType update,
84 const std::string& service_name) { 84 const std::string& service_name) {
85 if (update == ServiceWatcher::UPDATE_ADDED) { 85 if (update == ServiceWatcher::UPDATE_ADDED) {
86 services_[service_name].reset(new ServicePrinter(client_, service_name)); 86 services_[service_name].reset(new ServicePrinter(client_, service_name));
87 services_[service_name]->Added(); 87 services_[service_name]->Added();
(...skipping 28 matching lines...) Expand all
116 { 116 {
117 // To guarantee/make explicit the ordering constraint. 117 // To guarantee/make explicit the ordering constraint.
118 local_discovery::ServiceTypePrinter print_changes( 118 local_discovery::ServiceTypePrinter print_changes(
119 service_discovery_client.get(), 119 service_discovery_client.get(),
120 std::string(argv[1]) + "._tcp.local"); 120 std::string(argv[1]) + "._tcp.local");
121 121
122 print_changes.Start(); 122 print_changes.Start();
123 base::RunLoop().Run(); 123 base::RunLoop().Run();
124 } 124 }
125 } 125 }
OLDNEW
« no previous file with comments | « chrome/browser/ui/webui/local_discovery/local_discovery_ui_handler.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698