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

Unified Diff: chrome/browser/io_thread.cc

Issue 215623003: Revert "Support replacement of IP address resolutions via command line flag" (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 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 | « no previous file | content/public/common/content_switches.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/io_thread.cc
diff --git a/chrome/browser/io_thread.cc b/chrome/browser/io_thread.cc
index 5e40680860744a7e79384ab8a923a445f7019ec6..46e04bfbbbd3da0529c42c71cd8653bd01ffc63a 100644
--- a/chrome/browser/io_thread.cc
+++ b/chrome/browser/io_thread.cc
@@ -48,7 +48,6 @@
#include "content/public/browser/browser_thread.h"
#include "content/public/browser/cookie_store_factory.h"
#include "net/base/host_mapping_rules.h"
-#include "net/base/ip_mapping_rules.h"
#include "net/base/net_util.h"
#include "net/base/network_time_notifier.h"
#include "net/base/sdch_manager.h"
@@ -61,7 +60,6 @@
#include "net/dns/host_cache.h"
#include "net/dns/host_resolver.h"
#include "net/dns/mapped_host_resolver.h"
-#include "net/dns/mapped_ip_resolver.h"
#include "net/ftp/ftp_network_layer.h"
#include "net/http/http_auth_filter.h"
#include "net/http/http_auth_handler_factory.h"
@@ -201,28 +199,17 @@ scoped_ptr<net::HostResolver> CreateGlobalHostResolver(net::NetLog* net_log) {
global_host_resolver->SetDefaultAddressFamily(net::ADDRESS_FAMILY_IPV4);
}
- // If hostname or IP remappings were specified on the command-line, layer
- // these rules on top of the real host resolver. Hostname remapping allows
- // forwarding of all requests to hosts (matching a pattern) through a
- // designated test server. IP remapping allows for all IP resolutions that
- // match a given pattern, such as those destined for a specific CDN, to be
- // instead directed to a specific/alternate IP address.
- if (command_line.HasSwitch(switches::kHostResolverRules)) {
- scoped_ptr<net::MappedHostResolver> remapped_resolver(
- new net::MappedHostResolver(global_host_resolver.Pass()));
- remapped_resolver->SetRulesFromString(
- command_line.GetSwitchValueASCII(switches::kHostResolverRules));
- global_host_resolver = remapped_resolver.Pass();
- }
-
- if (command_line.HasSwitch(switches::kIpResolverRules)) {
- scoped_ptr<net::MappedIPResolver> remapped_resolver(
- new net::MappedIPResolver(global_host_resolver.Pass()));
- remapped_resolver->SetRulesFromString(
- command_line.GetSwitchValueASCII(switches::kIpResolverRules));
- global_host_resolver = remapped_resolver.Pass();
- }
- return global_host_resolver.Pass();
+ // If hostname remappings were specified on the command-line, layer these
+ // rules on top of the real host resolver. This allows forwarding all requests
+ // through a designated test server.
+ if (!command_line.HasSwitch(switches::kHostResolverRules))
+ return global_host_resolver.PassAs<net::HostResolver>();
+
+ scoped_ptr<net::MappedHostResolver> remapped_resolver(
+ new net::MappedHostResolver(global_host_resolver.Pass()));
+ remapped_resolver->SetRulesFromString(
+ command_line.GetSwitchValueASCII(switches::kHostResolverRules));
+ return remapped_resolver.PassAs<net::HostResolver>();
}
// TODO(willchan): Remove proxy script fetcher context since it's not necessary
« no previous file with comments | « no previous file | content/public/common/content_switches.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698