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

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: . 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..13883ec3adc4a8a0f60d9846cf791d350c0acd66 100644
--- a/net/dns/host_resolver.h
+++ b/net/dns/host_resolver.h
@@ -177,6 +177,16 @@ class NET_EXPORT HostResolver {
// ownership of the returned Value.
virtual base::Value* GetDnsConfigAsValue() const;
+ // Sets the IP addresss 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 SetMyIpAddresses(const std::string& ipv4_address,
+ const std::string& ipv6_address);
+
+ // Fills in |addresses| from my_ip*_addresses and returns true if set.
+ bool ResolveFromMyIpAddress(bool include_ipv6,
eroman 2014/05/02 01:48:18 I am still unhappy with this design. Adding string
stevenjb 2014/05/02 16:56:13 I could certainly make the name more clear and wou
+ AddressList* addresses) const;
+
// 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 +200,10 @@ class NET_EXPORT HostResolver {
protected:
HostResolver();
- private:
+private:
+ std::string my_ipv4_address_;
eroman 2014/05/02 01:48:18 Please store these instead as IpAddressNumber
+ std::string my_ipv6_address_;
+
DISALLOW_COPY_AND_ASSIGN(HostResolver);
};

Powered by Google App Engine
This is Rietveld 408576698