1// Copyright 2014 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_MAC_H_ 6#define CHROME_BROWSER_LOCAL_DISCOVERY_PRIVET_HTTP_ASYNCHRONOUS_FACTORY_MAC_H_ 7 8#include "chrome/browser/local_discovery/privet_http.h" 9#include "chrome/browser/local_discovery/privet_http_asynchronous_factory.h" 10 11namespace local_discovery { 12 13class PrivetHTTPAsynchronousFactoryMac : public PrivetHTTPAsynchronousFactory { 14 public: 15 explicit PrivetHTTPAsynchronousFactoryMac( 16 net::URLRequestContextGetter* request_context); 17 virtual ~PrivetHTTPAsynchronousFactoryMac(); 18 19 virtual scoped_ptr<PrivetHTTPResolution> CreatePrivetHTTP( 20 const std::string& name, 21 const net::HostPortPair& address, 22 const ResultCallback& callback) OVERRIDE; 23 24 private: 25 class ResolutionMac : public PrivetHTTPResolution { 26 public: 27 ResolutionMac(net::URLRequestContextGetter* request_context, 28 const std::string& name, 29 const net::HostPortPair& host_port, 30 const ResultCallback& callback); 31 virtual ~ResolutionMac(); 32 33 virtual void Start() OVERRIDE; 34 virtual const std::string& GetName() OVERRIDE; 35 36 private: 37 net::URLRequestContextGetter* request_context_; 38 std::string name_; 39 net::HostPortPair host_port_; 40 ResultCallback callback_; 41 }; 42 43 net::URLRequestContextGetter* request_context_; 44}; 45 46} // namespace local_discovery 47 48#endif // CHROME_BROWSER_LOCAL_DISCOVERY_PRIVET_HTTP_ASYNCHRONOUS_FACTORY_MAC_H_ 49