privet_http_asynchronous_factory.h revision 46d4c2bc3267f3f028f39e7e311b0f89aba2e4fd
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 virtual const std::string& GetName() = 0; 28}; 29 30class PrivetHTTPAsynchronousFactory { 31 public: 32 typedef base::Callback<void(scoped_ptr<PrivetHTTPClient>)> ResultCallback; 33 34 virtual ~PrivetHTTPAsynchronousFactory() {} 35 36 static scoped_ptr<PrivetHTTPAsynchronousFactory> CreateInstance( 37 ServiceDiscoveryClient* service_discovery_client, 38 net::URLRequestContextGetter* request_context); 39 40 virtual scoped_ptr<PrivetHTTPResolution> CreatePrivetHTTP( 41 const std::string& name, 42 const net::HostPortPair& address, 43 const ResultCallback& callback) = 0; 44}; 45 46} // namespace local_discovery 47 48#endif // CHROME_BROWSER_LOCAL_DISCOVERY_PRIVET_HTTP_ASYNCHRONOUS_FACTORY_H_ 49