Index: include/AdblockPlus/Platform.h |
=================================================================== |
--- a/include/AdblockPlus/Platform.h |
+++ b/include/AdblockPlus/Platform.h |
@@ -102,43 +102,38 @@ |
/** |
* Synchronous equivalent of `CreateFilterEngineAsync`. |
* Internally it blocks and waits for finishing of certain asynchronous |
* operations, please ensure that provided implementation does not lead to |
* a dead lock. |
*/ |
FilterEngine& GetFilterEngine(); |
- /** |
- * @return The asynchronous ITimer implementation. |
- */ |
- ITimer& GetTimer(); |
+ typedef std::function<void(ITimer&)> WithTimerCallback; |
+ void WithTimer(const WithTimerCallback&); |
- /** |
- * @return The asynchronous IFileSystem implementation. |
- */ |
- IFileSystem& GetFileSystem(); |
+ typedef std::function<void(IFileSystem&)> WithFileSystemCallback; |
+ void WithFileSystem(const WithFileSystemCallback&); |
- /** |
- * @return The asynchronous IWebRequest implementation. |
- */ |
- IWebRequest& GetWebRequest(); |
+ typedef std::function<void(IWebRequest&)> WithWebRequestCallback; |
+ void WithWebRequest(const WithWebRequestCallback&); |
/** |
* @return The LogSystem implementation. |
*/ |
LogSystem& GetLogSystem(); |
private: |
LogSystemPtr logSystem; |
TimerPtr timer; |
FileSystemPtr fileSystem; |
WebRequestPtr webRequest; |
// used for creation and deletion of modules. |
std::mutex modulesMutex; |
+ std::recursive_mutex interfacesMutex; |
std::shared_ptr<JsEngine> jsEngine; |
std::shared_future<FilterEnginePtr> filterEngine; |
}; |
/** |
* A helper class allowing to construct a default Platform and to obtain |
* the Scheduler used by Platform before the latter is constructed. |
*/ |