net: Delete UrlInfo after DNS resolution

The Predictor keeps in memory a UrlInfo object for all hosts that it tries to
preresolve and never discards them (except if the user clears the browsing
data). This causes memory leaks.

After resolution is complete the map of UrlInfos is used to deduplicate DNS
requests to already seen hosts that we beleive are still in the browser DNS
cache. The another consumer of the information is about:dns.

The additional layer of caching for DNS requests is unnecessary so this CL
simply sets the DnsProcessingState::ASSIGNED_BUT_MARKED state instead of
DnsProcessingState::ASSIGNED to ensure deletion in Predictor::LookupFinished().

Bug: 752954, 757458
Change-Id: I8a6734b071f19ab289a7be5dedc7794266854e6d
Reviewed-on: https://chromium-review.googlesource.com/612380
Commit-Queue: Alexandr Ilin <[email protected]>
Reviewed-by: Charlie Harrison <[email protected]>
Reviewed-by: Helen Li <[email protected]>
Cr-Commit-Position: refs/heads/master@{#496315}
diff --git a/chrome/browser/net/predictor.h b/chrome/browser/net/predictor.h
index 9862fee7..b0ffba47 100644
--- a/chrome/browser/net/predictor.h
+++ b/chrome/browser/net/predictor.h
@@ -379,12 +379,11 @@
   // Underlying method for both async and synchronous lookup to update state.
   void LookupFinished(const GURL& url, bool found);
 
-  // Queues hostname for resolution.  If queueing was done, return the pointer
-  // to the queued instance, otherwise return nullptr. If the proxy advisor is
-  // enabled, and |url| is likely to be proxied, the hostname will not be
-  // queued as the browser is not expected to fetch it directly.
-  UrlInfo* AppendToResolutionQueue(const GURL& url,
-                                   UrlInfo::ResolutionMotivation motivation);
+  // Queues hostname for resolution. If the proxy advisor is enabled, and
+  // |url| is likely to be proxied, the hostname will not be queued as the
+  // browser is not expected to fetch it directly.
+  void AppendToResolutionQueue(const GURL& url,
+                               UrlInfo::ResolutionMotivation motivation);
 
   // Check to see if too much queuing delay has been noted for the given info,
   // which indicates that there is "congestion" or growing delay in handling the