Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code

Unified Diff: src/engine/Main.cpp

Issue 5316782940225536: Issue 1557 - Update to the recent libadblockplus to reduce additional updates in the logic later. (Closed)
Patch Set: remove debugging code Created Nov. 24, 2014, 11:09 a.m.
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: src/engine/Main.cpp
===================================================================
--- a/src/engine/Main.cpp
+++ b/src/engine/Main.cpp
@@ -88,11 +88,12 @@
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));
+ referrerMapping.Add(url, documentUrl);
+ auto contentType = static_cast<AdblockPlus::FilterEngine::ContentType>(type);
+ AdblockPlus::FilterPtr filter = filterEngine->Matches(url, contentType, referrerMapping.BuildReferrerChain(documentUrl));
response << (filter && filter->GetType() != AdblockPlus::Filter::TYPE_EXCEPTION);
break;
}
@@ -192,7 +193,8 @@
{
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;
}
@@ -200,7 +202,8 @@
{
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;
}

Powered by Google App Engine
This is Rietveld