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

Unified Diff: src/JsEngine.cpp

Issue 29424786: Issue 5182 - fix IsConnectionAllowed (Closed) Base URL: https://github.com/adblockplus/libadblockplus.git
Patch Set: Created April 28, 2017, 2:42 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/FilterEngine.cpp ('k') | src/WebRequestJsObject.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/JsEngine.cpp
diff --git a/src/JsEngine.cpp b/src/JsEngine.cpp
index 88c7d375a12bd60eaf7ff1589a9d2e963270a5f7..2e67495c50cc77524990eaed6e03e7af7a9648ec 100644
--- a/src/JsEngine.cpp
+++ b/src/JsEngine.cpp
@@ -322,26 +322,6 @@ void AdblockPlus::JsEngine::SetWebRequest(const AdblockPlus::WebRequestPtr& val)
webRequest = val;
}
-void AdblockPlus::JsEngine::SetIsConnectionAllowedCallback(const IsConnectionAllowedCallback& callback)
-{
- std::lock_guard<std::mutex> lock(isConnectionAllowedMutex);
- isConnectionAllowed = callback;
-}
-
-bool AdblockPlus::JsEngine::IsConnectionAllowed() const
-{
- // The call of isConnectionAllowed can be very expensive and it makes a
- // little sense to block execution of JavaScript for it. Currently this
- // method is called from a thread of web request, so let only this thread be
- // blocked by the call of the callback.
- IsConnectionAllowedCallback localCopy;
- {
- std::lock_guard<std::mutex> lock(isConnectionAllowedMutex);
- localCopy = isConnectionAllowed;
- }
- return !localCopy || localCopy();
-}
-
AdblockPlus::LogSystemPtr AdblockPlus::JsEngine::GetLogSystem() const
{
return logSystem;
« no previous file with comments | « src/FilterEngine.cpp ('k') | src/WebRequestJsObject.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld