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

Unified Diff: src/plugin/AdblockPlusDomTraverser.cpp

Issue 29334386: Issue #2230 - Refactor filter life cycle and use
Patch Set: Created Jan. 22, 2016, 5:57 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
« no previous file with comments | « src/plugin/AdblockPlusDomTraverser.h ('k') | src/plugin/PluginDomTraverserBase.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/plugin/AdblockPlusDomTraverser.cpp
===================================================================
--- a/src/plugin/AdblockPlusDomTraverser.cpp
+++ b/src/plugin/AdblockPlusDomTraverser.cpp
@@ -23,7 +23,7 @@
#include "..\shared\Utils.h"
-CPluginDomTraverser::CPluginDomTraverser(CPluginTab* tab) : CPluginDomTraverserBase(tab)
+CPluginDomTraverser::CPluginDomTraverser(CPluginFilter* filterSet) : CPluginDomTraverserBase(filterSet)
{
}
@@ -52,9 +52,7 @@
}
// Check if element is hidden
- CPluginClient* client = CPluginClient::GetInstance();
-
- cache->m_isHidden = client->IsElementHidden(tag, pEl, m_domain, indent, &(m_tab->m_filter));
+ cache->m_isHidden = filterSet->IsElementHidden(tag, pEl, m_domain, indent);
if (cache->m_isHidden)
{
HideElement(pEl, tag, L"", false, indent);
@@ -71,6 +69,7 @@
if (!src.empty())
{
// If src should be blocked, set style display:none on image
+ CPluginClient* client = CPluginClient::GetInstance();
cache->m_isHidden = client->ShouldBlock(src,
AdblockPlus::FilterEngine::ContentType::CONTENT_TYPE_IMAGE, m_documentUrl);
if (cache->m_isHidden)
« no previous file with comments | « src/plugin/AdblockPlusDomTraverser.h ('k') | src/plugin/PluginDomTraverserBase.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld