| Index: src/plugin/PluginFilter.cpp |
| diff --git a/src/plugin/PluginFilter.cpp b/src/plugin/PluginFilter.cpp |
| index 86217c9f8fd0b7ffd4e3f6757176942c9179f057..73ca318b99999e41b1299bf9f21a02b5fd5cc23e 100644 |
| --- a/src/plugin/PluginFilter.cpp |
| +++ b/src/plugin/PluginFilter.cpp |
| @@ -651,9 +651,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(); |
| @@ -661,7 +662,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 |
| @@ -695,6 +696,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 |
| @@ -729,3 +731,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; |
| +} |