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
3 // found in the LICENSE file.
5 #ifndef CHROME_BROWSER_LOCAL_DISCOVERY_PRIVET_HTTP_ASYNCHRONOUS_FACTORY_H_
6 #define CHROME_BROWSER_LOCAL_DISCOVERY_PRIVET_HTTP_ASYNCHRONOUS_FACTORY_H_
10 #include "base/callback.h"
11 #include "base/memory/scoped_ptr.h"
15 class URLRequestContextGetter
;
18 namespace local_discovery
{
20 class PrivetHTTPClient
;
22 class PrivetHTTPResolution
{
24 using ResultCallback
= base::Callback
<void(scoped_ptr
<PrivetHTTPClient
>)>;
26 virtual ~PrivetHTTPResolution() {}
28 virtual void Start(const ResultCallback
& callback
) = 0;
30 virtual void Start(const net::HostPortPair
& address
,
31 const ResultCallback
& callback
) = 0;
33 virtual const std::string
& GetName() = 0;
36 class PrivetHTTPAsynchronousFactory
{
38 using ResultCallback
= PrivetHTTPResolution::ResultCallback
;
40 virtual ~PrivetHTTPAsynchronousFactory() {}
42 static scoped_ptr
<PrivetHTTPAsynchronousFactory
> CreateInstance(
43 net::URLRequestContextGetter
* request_context
);
45 virtual scoped_ptr
<PrivetHTTPResolution
> CreatePrivetHTTP(
46 const std::string
& service_name
) = 0;
49 } // namespace local_discovery
51 #endif // CHROME_BROWSER_LOCAL_DISCOVERY_PRIVET_HTTP_ASYNCHRONOUS_FACTORY_H_