| Index: include/AdblockPlus/Platform.h |
| =================================================================== |
| --- a/include/AdblockPlus/Platform.h |
| +++ b/include/AdblockPlus/Platform.h |
| @@ -102,41 +102,34 @@ |
| /** |
| * 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; |
| + virtual void WithTimer(const WithTimerCallback&); |
| - /** |
| - * @return The asynchronous IFileSystem implementation. |
| - */ |
| - IFileSystem& GetFileSystem(); |
| + typedef std::function<void(IFileSystem&)> WithFileSystemCallback; |
| + virtual void WithFileSystem(const WithFileSystemCallback&); |
| - /** |
| - * @return The asynchronous IWebRequest implementation. |
| - */ |
| - IWebRequest& GetWebRequest(); |
| + typedef std::function<void(IWebRequest&)> WithWebRequestCallback; |
| + virtual void WithWebRequest(const WithWebRequestCallback&); |
| - /** |
| - * @return The LogSystem implementation. |
| - */ |
| - LogSystem& GetLogSystem(); |
| + typedef std::function<void(LogSystem&)> WithLogSystemCallback; |
| + virtual void WithLogSystem(const WithLogSystemCallback&); |
| - private: |
| + protected: |
| LogSystemPtr logSystem; |
| TimerPtr timer; |
| FileSystemPtr fileSystem; |
| WebRequestPtr webRequest; |
| + private: |
| // used for creation and deletion of modules. |
| std::mutex modulesMutex; |
| std::shared_ptr<JsEngine> jsEngine; |
| std::shared_future<FilterEnginePtr> filterEngine; |
| }; |
| /** |
| * A helper class allowing to construct a default Platform and to obtain |