diff options
author | vitalybuka <vitalybuka@chromium.org> | 2015-02-25 10:45:57 -0800 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2015-02-25 18:47:12 +0000 |
commit | 830ccc4c45969c05684bb8e6919197706859d0ec (patch) | |
tree | 5810c6c82b9e3716dc1504e21799e47366884650 | |
parent | 1ef617bbcc2ebfc22415a08aadf6df52eb3a0405 (diff) | |
download | chromium_src-830ccc4c45969c05684bb8e6919197706859d0ec.zip chromium_src-830ccc4c45969c05684bb8e6919197706859d0ec.tar.gz chromium_src-830ccc4c45969c05684bb8e6919197706859d0ec.tar.bz2 |
Remove privet_http_asynchronous_factory_mac.*
Mac implementation just one line, and it probably should
gone after MAC implementation of LocalDomainResolver is done.
BUG=461504
Review URL: https://codereview.chromium.org/954883003
Cr-Commit-Position: refs/heads/master@{#318082}
5 files changed, 8 insertions, 113 deletions
diff --git a/chrome/browser/local_discovery/privet_http_asynchronous_factory.cc b/chrome/browser/local_discovery/privet_http_asynchronous_factory.cc index ab2ade2..3434344 100644 --- a/chrome/browser/local_discovery/privet_http_asynchronous_factory.cc +++ b/chrome/browser/local_discovery/privet_http_asynchronous_factory.cc @@ -4,11 +4,7 @@ #include "chrome/browser/local_discovery/privet_http_asynchronous_factory.h" -#if defined(OS_MACOSX) -#include "chrome/browser/local_discovery/privet_http_asynchronous_factory_mac.h" -#else #include "chrome/browser/local_discovery/privet_http_asynchronous_factory_impl.h" -#endif namespace local_discovery { @@ -16,14 +12,8 @@ namespace local_discovery { scoped_ptr<PrivetHTTPAsynchronousFactory> PrivetHTTPAsynchronousFactory::CreateInstance( net::URLRequestContextGetter* request_context) { -#if defined(OS_MACOSX) - return make_scoped_ptr<PrivetHTTPAsynchronousFactory>( - new PrivetHTTPAsynchronousFactoryMac(request_context)); - -#else return make_scoped_ptr<PrivetHTTPAsynchronousFactory>( new PrivetHTTPAsynchronousFactoryImpl(request_context)); -#endif } } // namespace local_discovery diff --git a/chrome/browser/local_discovery/privet_http_asynchronous_factory_impl.cc b/chrome/browser/local_discovery/privet_http_asynchronous_factory_impl.cc index 8a961aa..67f25f3 100644 --- a/chrome/browser/local_discovery/privet_http_asynchronous_factory_impl.cc +++ b/chrome/browser/local_discovery/privet_http_asynchronous_factory_impl.cc @@ -71,7 +71,13 @@ PrivetHTTPAsynchronousFactoryImpl::ResolutionImpl::~ResolutionImpl() { } void PrivetHTTPAsynchronousFactoryImpl::ResolutionImpl::Start() { +#if defined(OS_MACOSX) + // MAC already has IP there. + callback_.Run(scoped_ptr<PrivetHTTPClient>( + new PrivetHTTPClientImpl(name_, hostport_, request_context_.get()))); +#else resolver_->Start(); +#endif } const std::string& diff --git a/chrome/browser/local_discovery/privet_http_asynchronous_factory_mac.cc b/chrome/browser/local_discovery/privet_http_asynchronous_factory_mac.cc deleted file mode 100644 index c3014cb..0000000 --- a/chrome/browser/local_discovery/privet_http_asynchronous_factory_mac.cc +++ /dev/null @@ -1,51 +0,0 @@ -// Copyright 2014 The Chromium Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -#include "chrome/browser/local_discovery/privet_http_asynchronous_factory_mac.h" - -#include "chrome/browser/local_discovery/privet_http_impl.h" - -namespace local_discovery { - -PrivetHTTPAsynchronousFactoryMac::PrivetHTTPAsynchronousFactoryMac( - net::URLRequestContextGetter* request_context) - : request_context_(request_context) { -} - -PrivetHTTPAsynchronousFactoryMac::~PrivetHTTPAsynchronousFactoryMac() { -} - -scoped_ptr<PrivetHTTPResolution> -PrivetHTTPAsynchronousFactoryMac::CreatePrivetHTTP( - const std::string& name, - const net::HostPortPair& address, - const ResultCallback& callback) { - return scoped_ptr<PrivetHTTPResolution>( - new ResolutionMac(request_context_, name, address, callback)); -} - -PrivetHTTPAsynchronousFactoryMac::ResolutionMac::ResolutionMac( - net::URLRequestContextGetter* request_context, - const std::string& name, - const net::HostPortPair& host_port, - const ResultCallback& callback) - : request_context_(request_context), - name_(name), - host_port_(host_port), - callback_(callback) { -} - -PrivetHTTPAsynchronousFactoryMac::ResolutionMac::~ResolutionMac() { -} - -void PrivetHTTPAsynchronousFactoryMac::ResolutionMac::Start() { - callback_.Run(scoped_ptr<PrivetHTTPClient>( - new PrivetHTTPClientImpl(name_, host_port_, request_context_))); -} - -const std::string& PrivetHTTPAsynchronousFactoryMac::ResolutionMac::GetName() { - return name_; -} - -} // namespace local_discovery diff --git a/chrome/browser/local_discovery/privet_http_asynchronous_factory_mac.h b/chrome/browser/local_discovery/privet_http_asynchronous_factory_mac.h deleted file mode 100644 index ba7c96b..0000000 --- a/chrome/browser/local_discovery/privet_http_asynchronous_factory_mac.h +++ /dev/null @@ -1,48 +0,0 @@ -// Copyright 2014 The Chromium Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -#ifndef CHROME_BROWSER_LOCAL_DISCOVERY_PRIVET_HTTP_ASYNCHRONOUS_FACTORY_MAC_H_ -#define CHROME_BROWSER_LOCAL_DISCOVERY_PRIVET_HTTP_ASYNCHRONOUS_FACTORY_MAC_H_ - -#include "chrome/browser/local_discovery/privet_http.h" -#include "chrome/browser/local_discovery/privet_http_asynchronous_factory.h" - -namespace local_discovery { - -class PrivetHTTPAsynchronousFactoryMac : public PrivetHTTPAsynchronousFactory { - public: - explicit PrivetHTTPAsynchronousFactoryMac( - net::URLRequestContextGetter* request_context); - ~PrivetHTTPAsynchronousFactoryMac() override; - - scoped_ptr<PrivetHTTPResolution> CreatePrivetHTTP( - const std::string& name, - const net::HostPortPair& address, - const ResultCallback& callback) override; - - private: - class ResolutionMac : public PrivetHTTPResolution { - public: - ResolutionMac(net::URLRequestContextGetter* request_context, - const std::string& name, - const net::HostPortPair& host_port, - const ResultCallback& callback); - ~ResolutionMac() override; - - void Start() override; - const std::string& GetName() override; - - private: - net::URLRequestContextGetter* request_context_; - std::string name_; - net::HostPortPair host_port_; - ResultCallback callback_; - }; - - net::URLRequestContextGetter* request_context_; -}; - -} // namespace local_discovery - -#endif // CHROME_BROWSER_LOCAL_DISCOVERY_PRIVET_HTTP_ASYNCHRONOUS_FACTORY_MAC_H_ diff --git a/chrome/chrome_browser.gypi b/chrome/chrome_browser.gypi index 0c5f64a..550ede1 100644 --- a/chrome/chrome_browser.gypi +++ b/chrome/chrome_browser.gypi @@ -1648,8 +1648,6 @@ 'android/java/src/org/chromium/chrome/browser/toolbar/ToolbarModel.java' ], 'chrome_browser_mdns_sources': [ - 'browser/local_discovery/privet_http_asynchronous_factory_impl.cc', - 'browser/local_discovery/privet_http_asynchronous_factory_impl.h', 'browser/local_discovery/privet_traffic_detector.cc', 'browser/local_discovery/privet_traffic_detector.h', 'browser/local_discovery/service_discovery_client_mdns.cc', @@ -2431,8 +2429,8 @@ 'browser/local_discovery/privet_http.h', 'browser/local_discovery/privet_http_asynchronous_factory.cc', 'browser/local_discovery/privet_http_asynchronous_factory.h', - 'browser/local_discovery/privet_http_asynchronous_factory_mac.cc', - 'browser/local_discovery/privet_http_asynchronous_factory_mac.h', + 'browser/local_discovery/privet_http_asynchronous_factory_impl.cc', + 'browser/local_discovery/privet_http_asynchronous_factory_impl.h', 'browser/local_discovery/privet_http_impl.cc', 'browser/local_discovery/privet_http_impl.h', 'browser/local_discovery/privet_local_printer_lister.cc', |