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.
5 #include "chrome/browser/local_discovery/privet_http_asynchronous_factory_mac.h"
7 #include "chrome/browser/local_discovery/privet_http_impl.h"
9 namespace local_discovery
{
11 PrivetHTTPAsynchronousFactoryMac::PrivetHTTPAsynchronousFactoryMac(
12 net::URLRequestContextGetter
* request_context
)
13 : request_context_(request_context
) {
16 PrivetHTTPAsynchronousFactoryMac::~PrivetHTTPAsynchronousFactoryMac() {
19 scoped_ptr
<PrivetHTTPResolution
>
20 PrivetHTTPAsynchronousFactoryMac::CreatePrivetHTTP(
21 const std::string
& name
,
22 const net::HostPortPair
& address
,
23 const ResultCallback
& callback
) {
24 return scoped_ptr
<PrivetHTTPResolution
>(
25 new ResolutionMac(request_context_
, name
, address
, callback
));
28 PrivetHTTPAsynchronousFactoryMac::ResolutionMac::ResolutionMac(
29 net::URLRequestContextGetter
* request_context
,
30 const std::string
& name
,
31 const net::HostPortPair
& host_port
,
32 const ResultCallback
& callback
)
33 : request_context_(request_context
),
35 host_port_(host_port
),
39 PrivetHTTPAsynchronousFactoryMac::ResolutionMac::~ResolutionMac() {
42 void PrivetHTTPAsynchronousFactoryMac::ResolutionMac::Start() {
43 callback_
.Run(scoped_ptr
<PrivetHTTPClient
>(
44 new PrivetHTTPClientImpl(name_
, host_port_
, request_context_
)));
47 const std::string
& PrivetHTTPAsynchronousFactoryMac::ResolutionMac::GetName() {
51 } // namespace local_discovery