Index: src/plugin/AdblockPlusClient.cpp |
=================================================================== |
--- a/src/plugin/AdblockPlusClient.cpp |
+++ b/src/plugin/AdblockPlusClient.cpp |
@@ -96,6 +96,20 @@ |
} |
return result; |
} |
+ |
+ Communication::InputBuffer CallAdblockPlusEngineProcedure(Communication::OutputBuffer& message) |
+ { |
+ std::auto_ptr<Communication::Pipe> pipe = OpenAdblockPlusEnginePipe(); |
+ pipe->WriteMessage(message); |
+ return pipe->ReadMessage(); |
+ } |
+ |
+ Communication::InputBuffer CallAdblockPlusEngineProcedure(Communication::ProcType proc) |
+ { |
+ Communication::OutputBuffer message; |
+ message << proc; |
+ return CallAdblockPlusEngineProcedure(message); |
+ } |
} |
CAdblockPlusClient* CAdblockPlusClient::s_instance = NULL; |
@@ -189,17 +203,22 @@ |
bool CAdblockPlusClient::IsUrlWhiteListed(const CString& url) |
{ |
- bool isWhitelisted = CPluginClientBase::IsUrlWhiteListed(url); |
- if (isWhitelisted == false && !url.IsEmpty()) |
+ Communication::OutputBuffer request; |
+ request << Communication::PROC_IS_WHITELISTED_URL << ToUtf8String(std::wstring(url)); |
+ |
+ try |
{ |
- m_criticalSectionFilter.Lock(); |
- { |
- isWhitelisted = m_filter.get() && m_filter->ShouldWhiteList(url); |
- } |
- m_criticalSectionFilter.Unlock(); |
+ Communication::InputBuffer response = CallAdblockPlusEngineProcedure(request); |
+ |
+ bool isWhitelisted; |
+ response >> isWhitelisted; |
+ return isWhitelisted; |
} |
- |
- return isWhitelisted; |
+ catch (const std::exception& e) |
+ { |
+ DEBUG_GENERAL(e.what()); |
+ return false; |
+ } |
} |
int CAdblockPlusClient::GetIEVersion() |
@@ -223,20 +242,6 @@ |
return (int)(version[0] - 48); |
} |
-Communication::InputBuffer CallAdblockPlusEngineProcedure(Communication::OutputBuffer& message) |
-{ |
- std::auto_ptr<Communication::Pipe> pipe = OpenAdblockPlusEnginePipe(); |
- pipe->WriteMessage(message); |
- return pipe->ReadMessage(); |
-} |
- |
-Communication::InputBuffer CallAdblockPlusEngineProcedure(Communication::ProcType proc) |
-{ |
- Communication::OutputBuffer message; |
- message << proc; |
- return CallAdblockPlusEngineProcedure(message); |
-} |
- |
bool CAdblockPlusClient::Matches(const std::string& url, const std::string& contentType, const std::string& domain) |
{ |
Communication::OutputBuffer request; |