privet_http_asynchronous_factory.h revision d0247b1b59f9c528cb6df88b4f2b9afaf80d181e
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. 4 5#ifndef CHROME_BROWSER_LOCAL_DISCOVERY_PRIVET_HTTP_ASYNCHRONOUS_FACTORY_H_ 6#define CHROME_BROWSER_LOCAL_DISCOVERY_PRIVET_HTTP_ASYNCHRONOUS_FACTORY_H_ 7 8#include <string> 9 10#include "base/callback.h" 11#include "base/memory/scoped_ptr.h" 12 13namespace net { 14class HostPortPair; 15class URLRequestContextGetter; 16} 17 18namespace local_discovery { 19 20class PrivetHTTPClient; 21class ServiceDiscoveryClient; 22 23class PrivetHTTPResolution { 24 public: 25 virtual ~PrivetHTTPResolution() {} 26 virtual void Start() = 0; 27}; 28 29class PrivetHTTPAsynchronousFactory { 30 public: 31 typedef base::Callback<void(scoped_ptr<PrivetHTTPClient>)> ResultCallback; 32 33 virtual ~PrivetHTTPAsynchronousFactory() {} 34 35 static scoped_ptr<PrivetHTTPAsynchronousFactory> CreateInstance( 36 ServiceDiscoveryClient* service_discovery_client, 37 net::URLRequestContextGetter* request_context); 38 39 virtual scoped_ptr<PrivetHTTPResolution> CreatePrivetHTTP( 40 const std::string& name, 41 const net::HostPortPair& address, 42 const ResultCallback& callback) = 0; 43}; 44 45} // namespace local_discovery 46 47#endif // CHROME_BROWSER_LOCAL_DISCOVERY_PRIVET_HTTP_ASYNCHRONOUS_FACTORY_H_ 48