| OLD | NEW |
| 1 /* | 1 /* |
| 2 * This file is part of Adblock Plus <https://adblockplus.org/>, | 2 * This file is part of Adblock Plus <https://adblockplus.org/>, |
| 3 * Copyright (C) 2006-2017 eyeo GmbH | 3 * Copyright (C) 2006-2017 eyeo GmbH |
| 4 * | 4 * |
| 5 * Adblock Plus is free software: you can redistribute it and/or modify | 5 * Adblock Plus is free software: you can redistribute it and/or modify |
| 6 * it under the terms of the GNU General Public License version 3 as | 6 * it under the terms of the GNU General Public License version 3 as |
| 7 * published by the Free Software Foundation. | 7 * published by the Free Software Foundation. |
| 8 * | 8 * |
| 9 * Adblock Plus is distributed in the hope that it will be useful, | 9 * Adblock Plus is distributed in the hope that it will be useful, |
| 10 * but WITHOUT ANY WARRANTY; without even the implied warranty of | 10 * but WITHOUT ANY WARRANTY; without even the implied warranty of |
| (...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 74 { | 74 { |
| 75 LogSystemPtr logSystem; | 75 LogSystemPtr logSystem; |
| 76 TimerPtr timer; | 76 TimerPtr timer; |
| 77 WebRequestPtr webRequest; | 77 WebRequestPtr webRequest; |
| 78 FileSystemPtr fileSystem; | 78 FileSystemPtr fileSystem; |
| 79 }; | 79 }; |
| 80 | 80 |
| 81 /** | 81 /** |
| 82 * Callback type invoked when FilterEngine is created. | 82 * Callback type invoked when FilterEngine is created. |
| 83 */ | 83 */ |
| 84 typedef std::function<void(const FilterEnginePtr&)> OnFilterEngineCreatedCal
lback; | 84 typedef std::function<void(const FilterEngine&)> OnFilterEngineCreatedCallba
ck; |
| 85 | 85 |
| 86 /** | 86 /** |
| 87 * Platform constructor. | 87 * Platform constructor. |
| 88 * | 88 * |
| 89 * When a parameter value is nullptr the corresponding default | 89 * When a parameter value is nullptr the corresponding default |
| 90 * implementation is chosen. | 90 * implementation is chosen. |
| 91 */ | 91 */ |
| 92 explicit Platform(CreationParameters&& creationParameters = CreationParamete
rs()); | 92 explicit Platform(CreationParameters&& creationParameters = CreationParamete
rs()); |
| 93 ~Platform(); | 93 ~Platform(); |
| 94 | 94 |
| (...skipping 20 matching lines...) Expand all Loading... |
| 115 */ | 115 */ |
| 116 void CreateFilterEngineAsync(const FilterEngine::CreationParameters& paramet
ers = FilterEngine::CreationParameters(), | 116 void CreateFilterEngineAsync(const FilterEngine::CreationParameters& paramet
ers = FilterEngine::CreationParameters(), |
| 117 const OnFilterEngineCreatedCallback& onCreated = OnFilterEngineCreatedCall
back()); | 117 const OnFilterEngineCreatedCallback& onCreated = OnFilterEngineCreatedCall
back()); |
| 118 | 118 |
| 119 /** | 119 /** |
| 120 * Synchronous equivalent of `CreateFilterEngineAsync`. | 120 * Synchronous equivalent of `CreateFilterEngineAsync`. |
| 121 * Internally it blocks and waits for finishing of certain asynchronous | 121 * Internally it blocks and waits for finishing of certain asynchronous |
| 122 * operations, please ensure that provided implementation does not lead to | 122 * operations, please ensure that provided implementation does not lead to |
| 123 * a dead lock. | 123 * a dead lock. |
| 124 */ | 124 */ |
| 125 FilterEnginePtr GetFilterEngine(); | 125 FilterEngine& GetFilterEngine(); |
| 126 | 126 |
| 127 /** | 127 /** |
| 128 * @return The asynchronous ITimer implementation. | 128 * @return The asynchronous ITimer implementation. |
| 129 */ | 129 */ |
| 130 ITimer& GetTimer(); | 130 ITimer& GetTimer(); |
| 131 | 131 |
| 132 /** | 132 /** |
| 133 * @return The asynchronous IFileSystem implementation. | 133 * @return The asynchronous IFileSystem implementation. |
| 134 */ | 134 */ |
| 135 IFileSystem& GetFileSystem(); | 135 IFileSystem& GetFileSystem(); |
| (...skipping 14 matching lines...) Expand all Loading... |
| 150 FileSystemPtr fileSystem; | 150 FileSystemPtr fileSystem; |
| 151 WebRequestPtr webRequest; | 151 WebRequestPtr webRequest; |
| 152 // used for creation and deletion of modules. | 152 // used for creation and deletion of modules. |
| 153 std::mutex modulesMutex; | 153 std::mutex modulesMutex; |
| 154 std::shared_ptr<JsEngine> jsEngine; | 154 std::shared_ptr<JsEngine> jsEngine; |
| 155 std::shared_future<FilterEnginePtr> filterEngine; | 155 std::shared_future<FilterEnginePtr> filterEngine; |
| 156 }; | 156 }; |
| 157 } | 157 } |
| 158 | 158 |
| 159 #endif // ADBLOCK_PLUS_PLATFORM_H | 159 #endif // ADBLOCK_PLUS_PLATFORM_H |
| OLD | NEW |