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

Unified Diff: net/dns/host_resolver.h

Issue 238433003: Provide Shill IP Address to myIpAddress() (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Non proxy specific implementation Created 6 years, 8 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
Index: net/dns/host_resolver.h
diff --git a/net/dns/host_resolver.h b/net/dns/host_resolver.h
index 2964fe600df6284e852cd7cdf29db72d9bd2c9e7..e2400ed46b458a23d5b85a0677ec75c51ae8adf9 100644
--- a/net/dns/host_resolver.h
+++ b/net/dns/host_resolver.h
@@ -177,6 +177,14 @@ class NET_EXPORT HostResolver {
// ownership of the returned Value.
virtual base::Value* GetDnsConfigAsValue() const;
+ // Sets an IP address to use instead of the one provided by doing a lookup
+ // on gethostname() for operating systems where gethostname() returns
+ // localhost (e.g. Chrome OS).
+ void set_my_ip_address(const std::string& ip_address) {
+ my_ip_address_ = ip_address;
+ }
+ const std::string& my_ip_address() const { return my_ip_address_; }
+
// Creates a HostResolver implementation that queries the underlying system.
// (Except if a unit-test has changed the global HostResolverProc using
// ScopedHostResolverProc to intercept requests to the system).
@@ -190,7 +198,9 @@ class NET_EXPORT HostResolver {
protected:
HostResolver();
- private:
+private:
+ std::string my_ip_address_;
+
DISALLOW_COPY_AND_ASSIGN(HostResolver);
};

Powered by Google App Engine
This is Rietveld 408576698