Index: src/engine/Main.cpp |
diff --git a/src/engine/Main.cpp b/src/engine/Main.cpp |
index 11ddf7eb13f0837c5bfeba071d9f3c9af1480bb8..064d58224c0a835db2073bfcf0b657c1e22dec1f 100644 |
--- a/src/engine/Main.cpp |
+++ b/src/engine/Main.cpp |
@@ -89,11 +89,17 @@ namespace |
case Communication::PROC_MATCHES: |
{ |
std::string url; |
- std::string type; |
+ int32_t type; |
std::string documentUrl; |
request >> url >> type >> documentUrl; |
- referrerMapping.Add(url, documentUrl); |
- AdblockPlus::FilterPtr filter = filterEngine->Matches(url, type, referrerMapping.BuildReferrerChain(documentUrl)); |
+ using namespace AdblockPlus; |
+ auto contentType = static_cast<FilterEngine::ContentType>(type); |
+ auto isFrame = contentType == FilterEngine::ContentType::CONTENT_TYPE_SUBDOCUMENT ? |
+ ReferrerMapping::FrameIndicator::FRAME_INDICATOR_FRAME: |
+ ReferrerMapping::FrameIndicator::FRAME_INDICATOR_NOT_FRAME; |
Eric
2015/01/13 17:29:36
The indentation is off.
Also, the expression woul
sergei
2015/01/28 13:44:45
Indentation is fixed.
I don't find it easier to re
|
+ |
+ referrerMapping.Add(url, documentUrl, isFrame); |
Eric
2015/01/13 17:29:36
ReferrerMapping::Add() is declared with only two a
sergei
2015/01/28 13:44:45
Sure, the main aim of the whole change is to updat
|
+ AdblockPlus::FilterPtr filter = filterEngine->Matches(url, contentType, referrerMapping.BuildFrameStructure(documentUrl)); |
response << (filter && filter->GetType() != AdblockPlus::Filter::TYPE_EXCEPTION); |
break; |
} |
@@ -193,7 +199,8 @@ namespace |
{ |
std::string url; |
request >> url; |
- AdblockPlus::FilterPtr match = filterEngine->Matches(url, "DOCUMENT", url); |
+ AdblockPlus::FilterPtr match = filterEngine->Matches(url, |
+ AdblockPlus::FilterEngine::ContentType::CONTENT_TYPE_DOCUMENT, url); |
response << (match && match->GetType() == AdblockPlus::Filter::TYPE_EXCEPTION); |
break; |
} |
@@ -201,7 +208,8 @@ namespace |
{ |
std::string url; |
request >> url; |
- AdblockPlus::FilterPtr match = filterEngine->Matches(url, "ELEMHIDE", url); |
+ AdblockPlus::FilterPtr match = filterEngine->Matches(url, |
+ AdblockPlus::FilterEngine::ContentType::CONTENT_TYPE_ELEMHIDE, url); |
response << (match && match->GetType() == AdblockPlus::Filter::TYPE_EXCEPTION); |
break; |
} |