blob: 8e82bf9034d8fa0c89518c2c512142f323fbc899 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
|
// Copyright 2014 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#ifndef CHROME_BROWSER_LOCAL_DISCOVERY_PRIVET_DEVICE_RESOLVER_H_
#define CHROME_BROWSER_LOCAL_DISCOVERY_PRIVET_DEVICE_RESOLVER_H_
#include <string>
#include "base/callback.h"
#include "chrome/browser/local_discovery/device_description.h"
#include "chrome/common/local_discovery/service_discovery_client.h"
namespace local_discovery {
class PrivetDeviceResolver {
public:
typedef base::Callback<void(bool /*success*/,
const DeviceDescription& /*description*/)>
ResultCallback;
PrivetDeviceResolver(
ServiceDiscoveryClient* service_discovery_client,
const std::string& service_name,
const ResultCallback& callback);
~PrivetDeviceResolver();
void Start();
private:
void OnServiceResolved(
ServiceResolver::RequestStatus request_status,
const ServiceDescription& service_description);
ServiceDiscoveryClient* service_discovery_client_;
scoped_ptr<ServiceResolver> service_resolver_;
std::string service_name_;
ResultCallback callback_;
};
} // namespace local_discovery
#endif // CHROME_BROWSER_LOCAL_DISCOVERY_PRIVET_DEVICE_RESOLVER_H_
|