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 #ifndef CHROME_COMMON_LOCAL_DISCOVERY_SERVICE_DISCOVERY_CLIENT_H_ | 5 #ifndef CHROME_COMMON_LOCAL_DISCOVERY_SERVICE_DISCOVERY_CLIENT_H_ |
6 #define CHROME_COMMON_LOCAL_DISCOVERY_SERVICE_DISCOVERY_CLIENT_H_ | 6 #define CHROME_COMMON_LOCAL_DISCOVERY_SERVICE_DISCOVERY_CLIENT_H_ |
7 | 7 |
8 #include <string> | 8 #include <string> |
9 #include <vector> | 9 #include <vector> |
10 | 10 |
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
44 }; | 44 }; |
45 | 45 |
46 // Lets users browse the network for services of interest or listen for changes | 46 // Lets users browse the network for services of interest or listen for changes |
47 // in the services they are interested in. See | 47 // in the services they are interested in. See |
48 // |ServiceDiscoveryClient::CreateServiceWatcher|. | 48 // |ServiceDiscoveryClient::CreateServiceWatcher|. |
49 class ServiceWatcher { | 49 class ServiceWatcher { |
50 public: | 50 public: |
51 enum UpdateType { | 51 enum UpdateType { |
52 UPDATE_ADDED, | 52 UPDATE_ADDED, |
53 UPDATE_CHANGED, | 53 UPDATE_CHANGED, |
54 UPDATE_REMOVED | 54 UPDATE_REMOVED, |
| 55 UPDATE_INVALIDATED |
55 }; | 56 }; |
56 | 57 |
57 // Called when a service has been added or removed for a certain service name. | 58 // Called when a service has been added or removed for a certain service name. |
58 typedef base::Callback<void(UpdateType, const std::string&)> UpdatedCallback; | 59 typedef base::Callback<void(UpdateType, const std::string&)> UpdatedCallback; |
59 | 60 |
60 // Listening will automatically stop when the destructor is called. | 61 // Listening will automatically stop when the destructor is called. |
61 virtual ~ServiceWatcher() {} | 62 virtual ~ServiceWatcher() {} |
62 | 63 |
63 // Start the service type watcher. | 64 // Start the service type watcher. |
64 virtual void Start() = 0; | 65 virtual void Start() = 0; |
(...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
123 // Create a resolver for local domain, both ipv4 or ipv6. | 124 // Create a resolver for local domain, both ipv4 or ipv6. |
124 virtual scoped_ptr<LocalDomainResolver> CreateLocalDomainResolver( | 125 virtual scoped_ptr<LocalDomainResolver> CreateLocalDomainResolver( |
125 const std::string& domain, | 126 const std::string& domain, |
126 net::AddressFamily address_family, | 127 net::AddressFamily address_family, |
127 const LocalDomainResolver::IPAddressCallback& callback) = 0; | 128 const LocalDomainResolver::IPAddressCallback& callback) = 0; |
128 }; | 129 }; |
129 | 130 |
130 } // namespace local_discovery | 131 } // namespace local_discovery |
131 | 132 |
132 #endif // CHROME_COMMON_LOCAL_DISCOVERY_SERVICE_DISCOVERY_CLIENT_H_ | 133 #endif // CHROME_COMMON_LOCAL_DISCOVERY_SERVICE_DISCOVERY_CLIENT_H_ |
OLD | NEW |