Change the mojo ProxyResolver to use ProxyResolverV8Tracing.

This allows a much simpler implementation of GetLoadState and forwarding
errors to a ProxyResolverErrorObserver as well as enabling a
straightforward implementation of NetLog event reporting.

BUG=467832

Committed: https://crrev.com/9f5bf59b57e6b0662d9b9e0f6715ef7b5af092c0
Cr-Commit-Position: refs/heads/master@{#337993}

Review URL: https://codereview.chromium.org/1166523003

Cr-Commit-Position: refs/heads/master@{#338214}
diff --git a/net/dns/host_resolver_mojo.h b/net/dns/host_resolver_mojo.h
index 373cb9e..23fb0ff 100644
--- a/net/dns/host_resolver_mojo.h
+++ b/net/dns/host_resolver_mojo.h
@@ -5,7 +5,6 @@
 #ifndef NET_DNS_HOST_RESOLVER_MOJO_H_
 #define NET_DNS_HOST_RESOLVER_MOJO_H_
 
-#include "base/callback.h"
 #include "base/memory/weak_ptr.h"
 #include "base/threading/thread_checker.h"
 #include "net/dns/host_cache.h"
@@ -16,12 +15,19 @@
 class AddressList;
 class BoundNetLog;
 
-// A HostResolver implementation that delegates to an interfaces::HostResolver
-// mojo interface.
+// A HostResolver implementation that converts requests to mojo types and
+// forwards them to a mojo Impl interface.
 class HostResolverMojo : public HostResolver {
  public:
-  HostResolverMojo(interfaces::HostResolverPtr resolver,
-                   const base::Closure& disconnect_callback);
+  class Impl {
+   public:
+    virtual ~Impl() = default;
+    virtual void ResolveDns(interfaces::HostResolverRequestInfoPtr,
+                            interfaces::HostResolverRequestClientPtr) = 0;
+  };
+
+  // |impl| must outlive |this|.
+  explicit HostResolverMojo(Impl* impl);
   ~HostResolverMojo() override;
 
   // HostResolver overrides.
@@ -37,23 +43,14 @@
   void CancelRequest(RequestHandle req) override;
   HostCache* GetHostCache() override;
 
-  void set_disconnect_callback(const base::Closure& disconnect_callback) {
-    disconnect_callback_ = disconnect_callback;
-  }
-
  private:
   class Job;
 
-  // Mojo error handler.
-  void OnConnectionError();
-
   int ResolveFromCacheInternal(const RequestInfo& info,
                                const HostCache::Key& key,
                                AddressList* addresses);
 
-  interfaces::HostResolverPtr resolver_;
-
-  base::Closure disconnect_callback_;
+  Impl* const impl_;
 
   scoped_ptr<HostCache> host_cache_;
   base::WeakPtrFactory<HostCache> host_cache_weak_factory_;