Index: components/network_hints/renderer/renderer_dns_prefetch.h |
diff --git a/components/network_hints/renderer/renderer_dns_prefetch.h b/components/network_hints/renderer/renderer_dns_prefetch.h |
index 9df9e5b9e00bdca1e54cac5b72fb531d2c34d2d1..5c409b2e010f1536e0c093af809ecbed434d0237 100644 |
--- a/components/network_hints/renderer/renderer_dns_prefetch.h |
+++ b/components/network_hints/renderer/renderer_dns_prefetch.h |
@@ -28,10 +28,13 @@ |
#include "base/macros.h" |
#include "base/memory/weak_ptr.h" |
+#include "components/network_hints/common/network_hints.mojom.h" |
#include "components/network_hints/renderer/dns_prefetch_queue.h" |
namespace network_hints { |
+class NetworkHints; |
+ |
// An internal interface to the network_hints component for efficiently sending |
// DNS prefetch requests to the net stack. |
class RendererDnsPrefetch { |
@@ -77,6 +80,9 @@ class RendererDnsPrefetch { |
// This discards ALL queue entries, and map entries. |
void Reset(); |
+ // Ensure that the Mojo connection to NetworkHints has been created. |
+ void EnsureConnected(); |
Sam McNally
2016/07/12 05:25:30
I would prefer a getter that returns a mojom::Netw
tibell
2016/07/12 07:14:24
Done.
|
+ |
// We use c_string_queue_ to hold lists of names supplied typically) by the |
// renderer. It queues the names, at minimal cost to the renderer's thread, |
// and allows this class to process them when time permits (in a later task). |
@@ -101,6 +107,10 @@ class RendererDnsPrefetch { |
int buffer_full_discard_count_; |
int numeric_ip_discard_count_; |
+ // |EnsureConnected()| must be called before sending messages using |
+ // |network_hints_|. |
+ mojom::NetworkHintsPtr network_hints_; |
+ |
base::WeakPtrFactory<RendererDnsPrefetch> weak_factory_; |
DISALLOW_COPY_AND_ASSIGN(RendererDnsPrefetch); |