Index: src/engine/Main.cpp |
=================================================================== |
--- a/src/engine/Main.cpp |
+++ b/src/engine/Main.cpp |
@@ -1,20 +1,20 @@ |
-/* |
- * This file is part of Adblock Plus <https://adblockplus.org/>, |
- * Copyright (C) 2006-2015 Eyeo GmbH |
- * |
- * Adblock Plus is free software: you can redistribute it and/or modify |
- * it under the terms of the GNU General Public License version 3 as |
- * published by the Free Software Foundation. |
- * |
- * Adblock Plus is distributed in the hope that it will be useful, |
- * but WITHOUT ANY WARRANTY; without even the implied warranty of |
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
- * GNU General Public License for more details. |
- * |
- * You should have received a copy of the GNU General Public License |
- * along with Adblock Plus. If not, see <http://www.gnu.org/licenses/>. |
- */ |
- |
+/* |
+ * This file is part of Adblock Plus <https://adblockplus.org/>, |
+ * Copyright (C) 2006-2015 Eyeo GmbH |
+ * |
+ * Adblock Plus is free software: you can redistribute it and/or modify |
+ * it under the terms of the GNU General Public License version 3 as |
+ * published by the Free Software Foundation. |
+ * |
+ * Adblock Plus is distributed in the hope that it will be useful, |
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of |
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
+ * GNU General Public License for more details. |
+ * |
+ * You should have received a copy of the GNU General Public License |
+ * along with Adblock Plus. If not, see <http://www.gnu.org/licenses/>. |
+ */ |
+ |
#include <AdblockPlus.h> |
#include <functional> |
#include <vector> |
@@ -106,12 +106,14 @@ |
case Communication::PROC_MATCHES: |
{ |
std::string url; |
- std::string type; |
+ using namespace AdblockPlus; |
std::string documentUrl; |
+ int32_t type; |
request >> url >> type >> documentUrl; |
- referrerMapping.Add(url, documentUrl); |
- AdblockPlus::FilterPtr filter = filterEngine->Matches(url, type, referrerMapping.BuildReferrerChain(documentUrl)); |
- response << (filter && filter->GetType() != AdblockPlus::Filter::TYPE_EXCEPTION); |
+ referrerMapping.Add(url, documentUrl); |
+ auto contentType = static_cast<FilterEngine::ContentType>(type); |
+ FilterPtr filter = filterEngine->Matches(url, contentType, referrerMapping.BuildReferrerChain(documentUrl)); |
+ response << (filter && filter->GetType() != Filter::TYPE_EXCEPTION); |
break; |
} |
case Communication::PROC_GET_ELEMHIDE_SELECTORS: |
@@ -210,7 +212,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; |
} |
@@ -218,7 +221,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; |
} |