summaryrefslogtreecommitdiffstats
path: root/src/core/url_request_context_getter_qt.h
diff options
context:
space:
mode:
authorAndras Becsi <andras.becsi@theqtcompany.com>2015-07-10 17:27:45 +0200
committerAndras Becsi <andras.becsi@theqtcompany.com>2015-08-03 20:46:55 +0000
commite11cd75ff506e8dcbfc990d70baeec821f1f0563 (patch)
treedb4e58d9b0c66656e5eccb368dd61cdb36034c75 /src/core/url_request_context_getter_qt.h
parent853d5867644fd53f2d779c3c7b39a34803a3e566 (diff)
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 <joerg.bornemann@theqtcompany.com> Reviewed-by: Martin Rotter <rotter.martinos@gmail.com> Reviewed-by: Andras Becsi <andras.becsi@theqtcompany.com>
Diffstat (limited to 'src/core/url_request_context_getter_qt.h')
-rw-r--r--src/core/url_request_context_getter_qt.h5
1 files changed, 3 insertions, 2 deletions
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 <qatomic.h>
namespace net {
class MappedHostResolver;
-class NetworkDelegate;
class ProxyConfigService;
}
@@ -94,11 +94,12 @@ private:
QAtomicPointer<net::ProxyConfigService> m_proxyConfigService;
scoped_ptr<net::URLRequestContext> m_urlRequestContext;
- scoped_ptr<net::NetworkDelegate> m_networkDelegate;
+ scoped_ptr<NetworkDelegateQt> m_networkDelegate;
scoped_ptr<net::URLRequestContextStorage> m_storage;
scoped_ptr<net::URLRequestJobFactoryImpl> m_jobFactory;
scoped_refptr<CookieMonsterDelegateQt> m_cookieDelegate;
+ friend class NetworkDelegateQt;
};
} // namespace QtWebEngineCore