| 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 262 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 273 Prefs preconfiguredPrefs; | 273 Prefs preconfiguredPrefs; |
| 274 /** | 274 /** |
| 275 * A callback of `AdblockPlus::FilterEngine::IsConnectionAllowedAsyncCallb
ack` type | 275 * A callback of `AdblockPlus::FilterEngine::IsConnectionAllowedAsyncCallb
ack` type |
| 276 * checking whether the request to download a subscription from Adblock Pl
us may be performed | 276 * checking whether the request to download a subscription from Adblock Pl
us may be performed |
| 277 * on the current connection. | 277 * on the current connection. |
| 278 */ | 278 */ |
| 279 IsConnectionAllowedAsyncCallback isSubscriptionDownloadAllowedCallback; | 279 IsConnectionAllowedAsyncCallback isSubscriptionDownloadAllowedCallback; |
| 280 }; | 280 }; |
| 281 | 281 |
| 282 /** | 282 /** |
| 283 * Callback type invoked when FilterEngine is created. | 283 * Callback type invoked when FilterEngine is created. |
| 284 */ | 284 */ |
| 285 typedef std::function<void(const FilterEnginePtr&)> OnCreatedCallback; | 285 typedef std::function<void(const FilterEnginePtr&)> OnCreatedCallback; |
| 286 | 286 |
| 287 /** | 287 /** |
| 288 * Asynchronously constructs FilterEngine. | 288 * Asynchronously constructs FilterEngine. |
| 289 * @param jsEngine `JsEngine` instance used to run JavaScript code | 289 * @param jsEngine `JsEngine` instance used to run JavaScript code |
| 290 * internally. | 290 * internally. |
| 291 * @param onCreated A callback which is called when FilterEngine is ready | 291 * @param onCreated A callback which is called when FilterEngine is ready |
| 292 * for use. | 292 * for use. |
| 293 * @param parameters optional creation parameters. | 293 * @param parameters optional creation parameters. |
| 294 */ | 294 */ |
| 295 static void CreateAsync(const JsEnginePtr& jsEngine, | 295 static void CreateAsync(const JsEnginePtr& jsEngine, |
| 296 const OnCreatedCallback& onCreated, | 296 const OnCreatedCallback& onCreated, |
| 297 const CreationParameters& parameters = CreationParameters()); | 297 const CreationParameters& parameters = CreationParameters()); |
| 298 | 298 |
| 299 /** | 299 /** |
| 300 * Synchronous interface to construct FilterEngine. For details see | |
| 301 * asynchronous version CreateAsync. | |
| 302 */ | |
| 303 static FilterEnginePtr Create(const JsEnginePtr& jsEngine, | |
| 304 const CreationParameters& params = CreationParameters()); | |
| 305 | |
| 306 /** | |
| 307 * Retrieves the `JsEngine` instance associated with this `FilterEngine` | 300 * Retrieves the `JsEngine` instance associated with this `FilterEngine` |
| 308 * instance. | 301 * instance. |
| 309 */ | 302 */ |
| 310 JsEnginePtr GetJsEngine() const { return jsEngine; } | 303 JsEnginePtr GetJsEngine() const { return jsEngine; } |
| 311 | 304 |
| 312 /** | 305 /** |
| 313 * Checks if this is the first run of the application. | 306 * Checks if this is the first run of the application. |
| 314 * @return `true` if the application is running for the first time. | 307 * @return `true` if the application is running for the first time. |
| 315 */ | 308 */ |
| 316 bool IsFirstRun() const; | 309 bool IsFirstRun() const; |
| (...skipping 256 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 573 void FilterChanged(const FilterChangeCallback& callback, JsValueList&& param
s) const; | 566 void FilterChanged(const FilterChangeCallback& callback, JsValueList&& param
s) const; |
| 574 FilterPtr GetWhitelistingFilter(const std::string& url, | 567 FilterPtr GetWhitelistingFilter(const std::string& url, |
| 575 ContentTypeMask contentTypeMask, const std::string& documentUrl) const; | 568 ContentTypeMask contentTypeMask, const std::string& documentUrl) const; |
| 576 FilterPtr GetWhitelistingFilter(const std::string& url, | 569 FilterPtr GetWhitelistingFilter(const std::string& url, |
| 577 ContentTypeMask contentTypeMask, | 570 ContentTypeMask contentTypeMask, |
| 578 const std::vector<std::string>& documentUrls) const; | 571 const std::vector<std::string>& documentUrls) const; |
| 579 }; | 572 }; |
| 580 } | 573 } |
| 581 | 574 |
| 582 #endif | 575 #endif |
| OLD | NEW |