@@ -187,7 +187,6 @@ namespace AdblockPlus
187187 * It handles:
188188 * - Filter management and matching.
189189 * - Subscription management and synchronization.
190- * - Update checks for the application.
191190 */
192191 class FilterEngine
193192 {
@@ -225,18 +224,6 @@ namespace AdblockPlus
225224 */
226225 typedef int32_t ContentTypeMask;
227226
228- /* *
229- * Callback type invoked when an update becomes available.
230- * The parameter is the download URL of the update.
231- */
232- typedef std::function<void (const std::string&)> UpdateAvailableCallback;
233-
234- /* *
235- * Callback type invoked when a manually triggered update check finishes.
236- * The parameter is an optional error message.
237- */
238- typedef std::function<void (const std::string&)> UpdateCheckDoneCallback;
239-
240227 /* *
241228 * Callback type invoked when the filters change.
242229 * The first parameter is the action event code (see
@@ -287,6 +274,12 @@ namespace AdblockPlus
287274 */
288275 typedef std::function<void (const FilterEnginePtr&)> OnCreatedCallback;
289276
277+ /* *
278+ * Callback type for evaluating JS expression.
279+ * The parameter is the JS file name containing the expression.
280+ */
281+ typedef std::function<void (const std::string&)> EvaluateCallback;
282+
290283 /* *
291284 * Asynchronously constructs FilterEngine.
292285 * @param jsEngine `JsEngine` instance used to run JavaScript code
@@ -296,6 +289,7 @@ namespace AdblockPlus
296289 * @param parameters optional creation parameters.
297290 */
298291 static void CreateAsync (const JsEnginePtr& jsEngine,
292+ const EvaluateCallback& evaluateCallback,
299293 const OnCreatedCallback& onCreated,
300294 const CreationParameters& parameters = CreationParameters());
301295
@@ -476,32 +470,6 @@ namespace AdblockPlus
476470 */
477471 std::string GetHostFromURL (const std::string& url) const ;
478472
479- /* *
480- * Sets the callback invoked when an application update becomes available.
481- * @param callback Callback to invoke.
482- */
483- void SetUpdateAvailableCallback (const UpdateAvailableCallback& callback);
484-
485- /* *
486- * Removes the callback invoked when an application update becomes
487- * available.
488- */
489- void RemoveUpdateAvailableCallback ();
490-
491- /* *
492- * Forces an immediate update check.
493- * `FilterEngine` will automatically check for updates in regular intervals,
494- * so applications should only call this when the user triggers an update
495- * check manually.
496- * @param callback Optional callback to invoke when the update check is
497- * finished. The string parameter will be empty when the update check
498- * succeeded, or contain an error message if it failed.
499- * Note that the callback will be invoked whether updates are
500- * available or not - to react to updates being available, use
501- * `FilterEngine::SetUpdateAvailableCallback()`.
502- */
503- void ForceUpdateCheck (const UpdateCheckDoneCallback& callback = UpdateCheckDoneCallback());
504-
505473 /* *
506474 * Sets the callback invoked when the filters change.
507475 * @param callback Callback to invoke.
@@ -558,7 +526,6 @@ namespace AdblockPlus
558526 private:
559527 JsEnginePtr jsEngine;
560528 bool firstRun;
561- int updateCheckId;
562529 static const std::map<ContentType, std::string> contentTypes;
563530
564531 explicit FilterEngine (const JsEnginePtr& jsEngine);
0 commit comments