Index: components/network_hints/renderer/renderer_dns_prefetch.cc |
diff --git a/components/network_hints/renderer/renderer_dns_prefetch.cc b/components/network_hints/renderer/renderer_dns_prefetch.cc |
index ec2d6f38a2896fb3115969da8b548bee01dede90..9f05c85c14e779dfc042c1030ec5cc0cd0f5c116 100644 |
--- a/components/network_hints/renderer/renderer_dns_prefetch.cc |
+++ b/components/network_hints/renderer/renderer_dns_prefetch.cc |
@@ -14,9 +14,10 @@ |
#include "base/message_loop/message_loop.h" |
#include "base/threading/thread_task_runner_handle.h" |
#include "components/network_hints/common/network_hints_common.h" |
-#include "components/network_hints/common/network_hints_messages.h" |
+#include "components/network_hints/common/network_hints_param_traits.h" |
Sam McNally
2016/07/12 05:25:30
Remove.
tibell
2016/07/12 07:14:24
Done.
|
#include "components/network_hints/renderer/dns_prefetch_queue.h" |
#include "content/public/renderer/render_thread.h" |
+#include "services/shell/public/cpp/interface_provider.h" |
using content::RenderThread; |
@@ -39,6 +40,14 @@ void RendererDnsPrefetch::Reset() { |
new_name_count_ = 0; |
} |
+void RendererDnsPrefetch::EnsureConnected() { |
+ DCHECK(content::RenderThread::Get()); |
+ if (!network_hints_.is_bound()) { |
+ RenderThread::Get()->GetRemoteInterfaces()->GetInterface( |
+ mojo::GetProxy(&network_hints_)); |
+ } |
+} |
+ |
// Push names into queue quickly! |
void RendererDnsPrefetch::Resolve(const char* name, size_t length) { |
DCHECK(content::RenderThread::Get()); |
@@ -153,7 +162,8 @@ void RendererDnsPrefetch::DnsPrefetchNames(size_t max_count) { |
network_hints::LookupRequest request; |
request.hostname_list = names; |
- RenderThread::Get()->Send(new NetworkHintsMsg_DNSPrefetch(request)); |
+ EnsureConnected(); |
+ network_hints_->DNSPrefetch(request); |
} |
// is_numeric_ip() checks to see if all characters in name are either numeric, |