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

Unified Diff: src/plugin/AdblockPlusClient.cpp

Issue 5447868882092032: Issue 1793 - check whether the frame is whitelisted before injecting CSS (Closed)
Patch Set: reduce the amount of code Created Nov. 18, 2015, 3:03 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 a68e149c3abedc990f40d194984f9012af980834..7e5314104ca61b01fa595322c0ddd1e81d1f72f9 100644
--- a/src/plugin/AdblockPlusClient.cpp
+++ b/src/plugin/AdblockPlusClient.cpp
@@ -224,16 +224,16 @@ bool CAdblockPlusClient::IsElementHidden(const std::wstring& tag, IHTMLElement*
return isHidden;
}
-bool CAdblockPlusClient::IsWhitelistedUrl(const std::wstring& url)
+bool CAdblockPlusClient::IsWhitelistedUrl(const std::wstring& url, const std::vector<std::string>& frameHierarchy)
{
- return !GetWhitelistingFilter(url).empty();
+ return !GetWhitelistingFilter(url, frameHierarchy).empty();
}
-std::string CAdblockPlusClient::GetWhitelistingFilter(const std::wstring& url)
+std::string CAdblockPlusClient::GetWhitelistingFilter(const std::wstring& url, const std::vector<std::string>& frameHierarchy)
{
DEBUG_GENERAL((L"IsWhitelistedUrl: " + url + L" start").c_str());
Communication::OutputBuffer request;
- request << Communication::PROC_GET_WHITELISTING_FITER << ToUtf8String(url);
+ request << Communication::PROC_GET_WHITELISTING_FITER << ToUtf8String(url) << frameHierarchy;
Communication::InputBuffer response;
if (!CallEngine(request, response))
@@ -246,10 +246,10 @@ std::string CAdblockPlusClient::GetWhitelistingFilter(const std::wstring& url)
return filterText;
}
-bool CAdblockPlusClient::IsElemhideWhitelistedOnDomain(const std::wstring& url)
+bool CAdblockPlusClient::IsElemhideWhitelistedOnDomain(const std::wstring& url, const std::vector<std::string>& frameHierarchy)
{
Communication::OutputBuffer request;
- request << Communication::PROC_IS_ELEMHIDE_WHITELISTED_ON_URL << ToUtf8String(url);
+ request << Communication::PROC_IS_ELEMHIDE_WHITELISTED_ON_URL << ToUtf8String(url) << frameHierarchy;
Communication::InputBuffer response;
if (!CallEngine(request, response))

Powered by Google App Engine
This is Rietveld