aboutsummaryrefslogtreecommitdiff
path: root/src/webengine/urlinterceptor.cpp
diff options
context:
space:
mode:
authorAqua-sama <aqua@iserlohn-fortress.net>2017-05-25 20:59:43 +0200
committerAqua-sama <aqua@iserlohn-fortress.net>2017-05-25 20:59:43 +0200
commit1143429887f61d8b3c74a4c3a1fafca632eb4b87 (patch)
tree87e03b38241afb33c1e7dc70c299bfb824533429 /src/webengine/urlinterceptor.cpp
parentMerged FilterRule into FilterNode (diff)
downloadsmolbote-1143429887f61d8b3c74a4c3a1fafca632eb4b87.tar.xz
Filter code refactoring
Diffstat (limited to 'src/webengine/urlinterceptor.cpp')
-rw-r--r--src/webengine/urlinterceptor.cpp14
1 files changed, 12 insertions, 2 deletions
diff --git a/src/webengine/urlinterceptor.cpp b/src/webengine/urlinterceptor.cpp
index da2925c..3ffcb44 100644
--- a/src/webengine/urlinterceptor.cpp
+++ b/src/webengine/urlinterceptor.cpp
@@ -19,7 +19,11 @@
******************************************************************************/
#include "urlinterceptor.h"
-#include "blocker/filtercollection.h"
+#include "filter/filtercollection.h"
+
+#ifdef DEBUG_VERBOSE
+#include <QTime>
+#endif
UrlRequestInterceptor::UrlRequestInterceptor(QObject *parent) :
QWebEngineUrlRequestInterceptor(parent)
@@ -29,7 +33,9 @@ UrlRequestInterceptor::UrlRequestInterceptor(QObject *parent) :
void UrlRequestInterceptor::interceptRequest(QWebEngineUrlRequestInfo &info)
{
#ifdef DEBUG_VERBOSE
+ QTime time;
qDebug("%s --> [%i] %s", qUtf8Printable(info.firstPartyUrl().toString()), info.resourceType(), qUtf8Printable(info.requestUrl().toString()));
+ time.start();
#endif
for(auto s : m_manager->subscriptions()) {
@@ -37,11 +43,15 @@ void UrlRequestInterceptor::interceptRequest(QWebEngineUrlRequestInfo &info)
if(r.match) {
info.block(r.block);
#ifdef DEBUG_VERBOSE
- qDebug(">> matched [%s] [%s]", r.block ? "blocked" : "allowed", qUtf8Printable(r.pattern));
+ qDebug(">> matched [%s] [%s] in %i ms", r.block ? "blocked" : "allowed", qUtf8Printable(r.pattern), time.elapsed());
#endif
return;
}
}
+
+#ifdef DEBUG_VERBOSE
+ qDebug(">> passed in %i ms", time.elapsed());
+#endif
}
void UrlRequestInterceptor::setSubscription(BlockerManager *manager)