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

Unified Diff: src/plugin/AdblockPlusClient.cpp

Issue 5316782940225536: Issue 1557 - Update to the recent libadblockplus to reduce additional updates in the logic later. (Closed)
Patch Set: fix accoring to comments Created Jan. 13, 2015, 12:59 p.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/plugin/AdblockPlusClient.cpp
diff --git a/src/plugin/AdblockPlusClient.cpp b/src/plugin/AdblockPlusClient.cpp
index 922f3451e6979f4e60d3fdc6d4df02762465d28c..3784b6748ef052b8c3042f808609d8f57fc155c0 100644
--- a/src/plugin/AdblockPlusClient.cpp
+++ b/src/plugin/AdblockPlusClient.cpp
@@ -208,7 +208,7 @@ CAdblockPlusClient* CAdblockPlusClient::GetInstance()
return instance;
}
-bool CAdblockPlusClient::ShouldBlock(const std::wstring& src, int contentType, const std::wstring& domain, bool addDebug)
+bool CAdblockPlusClient::ShouldBlock(const std::wstring& src, AdblockPlus::FilterEngine::ContentType contentType, const std::wstring& domain, bool addDebug)
{
bool isBlocked = false;
bool isCached = false;
@@ -233,7 +233,7 @@ bool CAdblockPlusClient::ShouldBlock(const std::wstring& src, int contentType, c
m_criticalSectionFilter.Unlock();
// Cache result, if content type is defined
- if (contentType != CFilter::contentTypeAny)
+ if (contentType != AdblockPlus::FilterEngine::ContentType::CONTENT_TYPE_OTHER)
{
m_criticalSectionCache.Lock();
{
@@ -287,10 +287,10 @@ bool CAdblockPlusClient::IsElemhideWhitelistedOnDomain(const std::wstring& url)
return isWhitelisted;
}
-bool CAdblockPlusClient::Matches(const std::wstring& url, const std::wstring& contentType, const std::wstring& domain)
+bool CAdblockPlusClient::Matches(const std::wstring& url, AdblockPlus::FilterEngine::ContentType contentType, const std::wstring& domain)
{
Communication::OutputBuffer request;
- request << Communication::PROC_MATCHES << ToUtf8String(url) << ToUtf8String(contentType) << ToUtf8String(domain);
+ request << Communication::PROC_MATCHES << ToUtf8String(url) << static_cast<int32_t>(contentType) << ToUtf8String(domain);
Eric 2015/01/13 17:29:36 I still think it would be good to define operator<
sergei 2015/01/28 13:44:45 done.
Communication::InputBuffer response;
if (!CallEngine(request, response))

Powered by Google App Engine
This is Rietveld