Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code

Side by Side Diff: include/AdblockPlus/FilterEngine.h

Issue 29422625: Issue 5189 - use r-value references when objects should be transferred (Closed) Base URL: https://github.com/adblockplus/libadblockplus.git
Patch Set: Created April 26, 2017, 2:14 p.m.
Left:
Right:
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | include/AdblockPlus/JsEngine.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 210 matching lines...) Expand 10 before | Expand all | Expand 10 after
221 */ 221 */
222 typedef std::function<void(const std::string&)> UpdateCheckDoneCallback; 222 typedef std::function<void(const std::string&)> UpdateCheckDoneCallback;
223 223
224 /** 224 /**
225 * Callback type invoked when the filters change. 225 * Callback type invoked when the filters change.
226 * The first parameter is the action event code (see 226 * The first parameter is the action event code (see
227 * [FilterNotifier.triggerListeners](https://adblockplus.org/jsdoc/adblockpl uscore/FilterNotifier.html#.triggerListeners) 227 * [FilterNotifier.triggerListeners](https://adblockplus.org/jsdoc/adblockpl uscore/FilterNotifier.html#.triggerListeners)
228 * for the full list). 228 * for the full list).
229 * The second parameter is the filter/subscription object affected, if any. 229 * The second parameter is the filter/subscription object affected, if any.
230 */ 230 */
231 typedef std::function<void(const std::string&, const JsValue&)> FilterChange Callback; 231 typedef std::function<void(const std::string&, JsValue&&)> FilterChangeCallb ack;
232 232
233 /** 233 /**
234 * Container of name-value pairs representing a set of preferences. 234 * Container of name-value pairs representing a set of preferences.
235 */ 235 */
236 typedef std::map<std::string, AdblockPlus::JsValue> Prefs; 236 typedef std::map<std::string, AdblockPlus::JsValue> Prefs;
237 237
238 /** 238 /**
239 * Callback type invoked when a new notification should be shown. 239 * Callback type invoked when a new notification should be shown.
240 * The parameter is the Notification object to be shown. 240 * The parameter is the Notification object to be shown.
241 */ 241 */
242 typedef std::function<void(Notification&)> ShowNotificationCallback; 242 typedef std::function<void(Notification&&)> ShowNotificationCallback;
243 243
244 /** 244 /**
245 * Callback function returning false when current connection is not 245 * Callback function returning false when current connection is not
246 * allowedConnectionType, e.g. because it is a metered connection. 246 * allowedConnectionType, e.g. because it is a metered connection.
247 */ 247 */
248 typedef std::function<bool(const std::string* allowedConnectionType)> IsConn ectionAllowedCallback; 248 typedef std::function<bool(const std::string* allowedConnectionType)> IsConn ectionAllowedCallback;
249 249
250 /** 250 /**
251 * FilterEngine creation parameters. 251 * FilterEngine creation parameters.
252 */ 252 */
(...skipping 296 matching lines...) Expand 10 before | Expand all | Expand 10 after
549 JsEnginePtr jsEngine; 549 JsEnginePtr jsEngine;
550 bool firstRun; 550 bool firstRun;
551 int updateCheckId; 551 int updateCheckId;
552 static const std::map<ContentType, std::string> contentTypes; 552 static const std::map<ContentType, std::string> contentTypes;
553 553
554 explicit FilterEngine(const JsEnginePtr& jsEngine); 554 explicit FilterEngine(const JsEnginePtr& jsEngine);
555 555
556 FilterPtr CheckFilterMatch(const std::string& url, 556 FilterPtr CheckFilterMatch(const std::string& url,
557 ContentTypeMask contentTypeMask, 557 ContentTypeMask contentTypeMask,
558 const std::string& documentUrl) const; 558 const std::string& documentUrl) const;
559 void UpdateAvailable(const UpdateAvailableCallback& callback, const JsValueL ist& params) const; 559 void FilterChanged(const FilterChangeCallback& callback, JsValueList&& param s) const;
560 void UpdateCheckDone(const std::string& eventName,
561 const UpdateCheckDoneCallback& callback, const JsValueL ist& params);
562 void FilterChanged(const FilterChangeCallback& callback, const JsValueList& params) const;
563 void ShowNotification(const ShowNotificationCallback& callback,
564 const JsValueList& param) const;
565 FilterPtr GetWhitelistingFilter(const std::string& url, 560 FilterPtr GetWhitelistingFilter(const std::string& url,
566 ContentTypeMask contentTypeMask, const std::string& documentUrl) const; 561 ContentTypeMask contentTypeMask, const std::string& documentUrl) const;
567 FilterPtr GetWhitelistingFilter(const std::string& url, 562 FilterPtr GetWhitelistingFilter(const std::string& url,
568 ContentTypeMask contentTypeMask, 563 ContentTypeMask contentTypeMask,
569 const std::vector<std::string>& documentUrls) const; 564 const std::vector<std::string>& documentUrls) const;
570 }; 565 };
571 } 566 }
572 567
573 #endif 568 #endif
OLDNEW
« no previous file with comments | « no previous file | include/AdblockPlus/JsEngine.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld