Index: src/plugin/PluginFilter.cpp |
diff --git a/src/plugin/PluginFilter.cpp b/src/plugin/PluginFilter.cpp |
index edcdbe607d5d5732ee900da8db3ab8349cf74f60..28208cb78b93ade7a62f75c3b584516518df0794 100644 |
--- a/src/plugin/PluginFilter.cpp |
+++ b/src/plugin/PluginFilter.cpp |
@@ -605,9 +605,10 @@ bool CPluginFilter::IsElementHidden(const std::wstring& tag, IHTMLElement* pEl, |
return false; |
} |
-bool CPluginFilter::LoadHideFilters(std::vector<std::wstring> filters) |
+bool CPluginFilter::LoadHideFilters(const std::vector<std::wstring>& filters) |
{ |
ClearFilters(); |
+ m_hideFilters = filters; |
bool isRead = false; |
CPluginClient* client = CPluginClient::GetInstance(); |
@@ -615,7 +616,7 @@ bool CPluginFilter::LoadHideFilters(std::vector<std::wstring> filters) |
int pos = 0; |
CriticalSection::Lock filterEngineLock(s_criticalSectionFilterMap); |
{ |
- for (std::vector<std::wstring>::iterator it = filters.begin(); it < filters.end(); ++it) |
+ for (auto it = filters.begin(); it < filters.end(); ++it) |
{ |
CString filter((*it).c_str()); |
// If the line is not commented out |
@@ -649,6 +650,7 @@ void CPluginFilter::ClearFilters() |
m_elementHideTags.clear(); |
m_elementHideTagsId.clear(); |
m_elementHideTagsClass.clear(); |
+ m_hideFilters.clear(); |
} |
bool CPluginFilter::ShouldBlock(const std::wstring& src, AdblockPlus::FilterEngine::ContentType contentType, const std::wstring& domain, bool addDebug) const |
@@ -683,3 +685,9 @@ bool CPluginFilter::ShouldBlock(const std::wstring& src, AdblockPlus::FilterEngi |
#endif |
return result; |
} |
+ |
+const std::vector<std::wstring>& CPluginFilter::GetHideFilters() const |
+{ |
+ DWORD res = WaitForSingleObject(hideFiltersLoadedEvent, ENGINE_STARTUP_TIMEOUT); |
+ return m_hideFilters; |
+} |