From e11cd75ff506e8dcbfc990d70baeec821f1f0563 Mon Sep 17 00:00:00 2001 From: Andras Becsi Date: Fri, 10 Jul 2015 17:27:45 +0200 Subject: Add API for intercepting url requests This patch is adding a QWebEngineUrlRequestInterceptor interface that can be subclassed to observe or intercept all resource requests making it possible to implement browser features like adblocking and setting custom request headers for url requests. The interceptRequest virtual function is executed on the IO thread. This patch also includes a unit test for the testable API parts. Change-Id: Ibe740fc55551a9a5da40794088ccb6d03d913631 Reviewed-by: Joerg Bornemann Reviewed-by: Martin Rotter Reviewed-by: Andras Becsi --- src/core/url_request_context_getter_qt.h | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'src/core/url_request_context_getter_qt.h') diff --git a/src/core/url_request_context_getter_qt.h b/src/core/url_request_context_getter_qt.h index 78fb5a1ab..be9567f4b 100644 --- a/src/core/url_request_context_getter_qt.h +++ b/src/core/url_request_context_getter_qt.h @@ -49,13 +49,13 @@ #include "net/url_request/url_request_job_factory_impl.h" #include "cookie_monster_delegate_qt.h" +#include "network_delegate_qt.h" #include "qglobal.h" #include namespace net { class MappedHostResolver; -class NetworkDelegate; class ProxyConfigService; } @@ -94,11 +94,12 @@ private: QAtomicPointer m_proxyConfigService; scoped_ptr m_urlRequestContext; - scoped_ptr m_networkDelegate; + scoped_ptr m_networkDelegate; scoped_ptr m_storage; scoped_ptr m_jobFactory; scoped_refptr m_cookieDelegate; + friend class NetworkDelegateQt; }; } // namespace QtWebEngineCore -- cgit v1.2.3