Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(457)

Unified Diff: net/dns/dns_client.cc

Issue 992733002: Remove //net (except for Android test stuff) and sdch (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: Created 5 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « net/dns/dns_client.h ('k') | net/dns/dns_config_service.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/dns/dns_client.cc
diff --git a/net/dns/dns_client.cc b/net/dns/dns_client.cc
deleted file mode 100644
index f3980dfc5cc9567679ea36abd53947a26af43d99..0000000000000000000000000000000000000000
--- a/net/dns/dns_client.cc
+++ /dev/null
@@ -1,69 +0,0 @@
-// Copyright (c) 2012 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 "net/dns/dns_client.h"
-
-#include "base/bind.h"
-#include "base/rand_util.h"
-#include "net/base/net_log.h"
-#include "net/dns/address_sorter.h"
-#include "net/dns/dns_config_service.h"
-#include "net/dns/dns_session.h"
-#include "net/dns/dns_socket_pool.h"
-#include "net/dns/dns_transaction.h"
-#include "net/socket/client_socket_factory.h"
-
-namespace net {
-
-namespace {
-
-class DnsClientImpl : public DnsClient {
- public:
- explicit DnsClientImpl(NetLog* net_log)
- : address_sorter_(AddressSorter::CreateAddressSorter()),
- net_log_(net_log) {}
-
- void SetConfig(const DnsConfig& config) override {
- factory_.reset();
- session_ = NULL;
- if (config.IsValid() && !config.unhandled_options) {
- ClientSocketFactory* factory = ClientSocketFactory::GetDefaultFactory();
- scoped_ptr<DnsSocketPool> socket_pool(
- config.randomize_ports ? DnsSocketPool::CreateDefault(factory)
- : DnsSocketPool::CreateNull(factory));
- session_ = new DnsSession(config,
- socket_pool.Pass(),
- base::Bind(&base::RandInt),
- net_log_);
- factory_ = DnsTransactionFactory::CreateFactory(session_.get());
- }
- }
-
- const DnsConfig* GetConfig() const override {
- return session_.get() ? &session_->config() : NULL;
- }
-
- DnsTransactionFactory* GetTransactionFactory() override {
- return session_.get() ? factory_.get() : NULL;
- }
-
- AddressSorter* GetAddressSorter() override { return address_sorter_.get(); }
-
- private:
- scoped_refptr<DnsSession> session_;
- scoped_ptr<DnsTransactionFactory> factory_;
- scoped_ptr<AddressSorter> address_sorter_;
-
- NetLog* net_log_;
-};
-
-} // namespace
-
-// static
-scoped_ptr<DnsClient> DnsClient::CreateClient(NetLog* net_log) {
- return scoped_ptr<DnsClient>(new DnsClientImpl(net_log));
-}
-
-} // namespace net
-
« no previous file with comments | « net/dns/dns_client.h ('k') | net/dns/dns_config_service.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698