diff options
Diffstat (limited to 'components/network_hints/renderer')
4 files changed, 15 insertions, 7 deletions
diff --git a/components/network_hints/renderer/prescient_networking_dispatcher.cc b/components/network_hints/renderer/prescient_networking_dispatcher.cc index a5599c9..223af31 100644 --- a/components/network_hints/renderer/prescient_networking_dispatcher.cc +++ b/components/network_hints/renderer/prescient_networking_dispatcher.cc @@ -25,8 +25,13 @@ void PrescientNetworkingDispatcher::prefetchDNS( } void PrescientNetworkingDispatcher::preconnect(const blink::WebURL& url) { + preconnect_.Preconnect(url, true); +} + +void PrescientNetworkingDispatcher::preconnect(const blink::WebURL& url, + bool allow_credentials) { VLOG(2) << "Preconnect: " << url.string().utf8(); - preconnect_.Preconnect(url); + preconnect_.Preconnect(url, allow_credentials); } } // namespace network_hints diff --git a/components/network_hints/renderer/prescient_networking_dispatcher.h b/components/network_hints/renderer/prescient_networking_dispatcher.h index 3b2219e..1810aa0 100644 --- a/components/network_hints/renderer/prescient_networking_dispatcher.h +++ b/components/network_hints/renderer/prescient_networking_dispatcher.h @@ -19,8 +19,11 @@ class PrescientNetworkingDispatcher : public blink::WebPrescientNetworking { PrescientNetworkingDispatcher(); ~PrescientNetworkingDispatcher() override; - void prefetchDNS(const blink::WebString& hostname) override; - void preconnect(const blink::WebURL& url) override; + virtual void prefetchDNS(const blink::WebString& hostname) override; + // TODO(yoav): Remove the old version of the API + virtual void preconnect(const blink::WebURL& url); + virtual void preconnect(const blink::WebURL& url, + const bool allow_credentials) override; private: network_hints::RendererDnsPrefetch dns_prefetch_; diff --git a/components/network_hints/renderer/renderer_preconnect.cc b/components/network_hints/renderer/renderer_preconnect.cc index 41d8033..b353cb1 100644 --- a/components/network_hints/renderer/renderer_preconnect.cc +++ b/components/network_hints/renderer/renderer_preconnect.cc @@ -20,12 +20,12 @@ RendererPreconnect::RendererPreconnect() { RendererPreconnect::~RendererPreconnect() { } -void RendererPreconnect::Preconnect(const GURL &url) { +void RendererPreconnect::Preconnect(const GURL& url, bool allow_credentials) { if (!url.is_valid()) return; RenderThread::Get()->Send( - new NetworkHintsMsg_Preconnect(url, 1)); + new NetworkHintsMsg_Preconnect(url, allow_credentials, 1)); } } // namespace network_hints diff --git a/components/network_hints/renderer/renderer_preconnect.h b/components/network_hints/renderer/renderer_preconnect.h index adc0143..53a8e3d 100644 --- a/components/network_hints/renderer/renderer_preconnect.h +++ b/components/network_hints/renderer/renderer_preconnect.h @@ -22,14 +22,14 @@ namespace network_hints { // An internal interface to the network_hints component for efficiently sending -// DNS prefetch requests to the net stack. +// preconnect requests to the net stack. class RendererPreconnect { public: RendererPreconnect(); ~RendererPreconnect(); // Submit a preconnect request for a single connection. - void Preconnect(const GURL &url); + void Preconnect(const GURL& url, bool allow_credentials); private: |