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 86 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
97 * | 97 * |
98 * @param appInfo Information about the app, if jsEngine is already present | 98 * @param appInfo Information about the app, if jsEngine is already present |
99 * then the value is ignored. | 99 * then the value is ignored. |
100 */ | 100 */ |
101 void SetUpJsEngine(const AppInfo& appInfo = AppInfo()); | 101 void SetUpJsEngine(const AppInfo& appInfo = AppInfo()); |
102 | 102 |
103 /** | 103 /** |
104 * Retrieves the `JsEngine` instance. It calls SetUpJsEngine if JsEngine is | 104 * Retrieves the `JsEngine` instance. It calls SetUpJsEngine if JsEngine is |
105 * not initialized yet. | 105 * not initialized yet. |
106 */ | 106 */ |
107 std::shared_ptr<JsEngine> GetJsEngine(); | 107 JsEngine& GetJsEngine(); |
108 | 108 |
109 /** | 109 /** |
110 * Ensures that FilterEngine is constructed. Only the first call is effectiv
e. | 110 * Ensures that FilterEngine is constructed. Only the first call is effectiv
e. |
111 * | 111 * |
112 * @param parameters optional creation parameters. | 112 * @param parameters optional creation parameters. |
113 * @param onCreated A callback which is called when FilterEngine is ready | 113 * @param onCreated A callback which is called when FilterEngine is ready |
114 * for use. | 114 * for use. |
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()); |
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after 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 |