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

Delta Between Two Patch Sets: include/AdblockPlus/FilterEngine.h

Issue 5163715573841920: Issue 768 - Switch from TR1 to C++11 (Closed)
Left Patch Set: rebase Created Aug. 5, 2015, 10:38 a.m.
Right Patch Set: fix including of <memory> Created Aug. 7, 2015, 6:07 a.m.
Left:
Right:
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
Left: Side by side diff | Download
Right: Side by side diff | Download
« no previous file with change/comment | « include/AdblockPlus/FileSystem.h ('k') | include/AdblockPlus/JsEngine.h » ('j') | no next file with change/comment »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
LEFTRIGHT
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-2015 Eyeo GmbH 3 * Copyright (C) 2006-2015 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 19 matching lines...) Expand all
30 { 30 {
31 class FilterEngine; 31 class FilterEngine;
32 32
33 /** 33 /**
34 * Wrapper for an Adblock Plus filter object. 34 * Wrapper for an Adblock Plus filter object.
35 * There are no accessors for most 35 * There are no accessors for most
36 * [filter properties](https://adblockplus.org/jsdoc/adblockplus/symbols/Filte r.html), 36 * [filter properties](https://adblockplus.org/jsdoc/adblockplus/symbols/Filte r.html),
37 * use `GetProperty()` to retrieve them by name. 37 * use `GetProperty()` to retrieve them by name.
38 */ 38 */
39 class Filter : public JsValue, 39 class Filter : public JsValue,
40 public std::enable_shared_from_this<Filter> 40 public std::enable_shared_from_this<Filter>
Felix Dahlke 2015/08/05 21:28:04 Nit: This was wrapped because it didn't fit in 80
Wladimir Palant 2015/08/06 12:24:54 Sergei didn't address this nit and I think he is r
Felix Dahlke 2015/08/06 18:19:01 Oh, I wasn't aware of that, fair enough.
41 { 41 {
42 public: 42 public:
43 /** 43 /**
44 * Filter types, see https://adblockplus.org/en/filters. 44 * Filter types, see https://adblockplus.org/en/filters.
45 */ 45 */
46 enum Type {TYPE_BLOCKING, TYPE_EXCEPTION, 46 enum Type {TYPE_BLOCKING, TYPE_EXCEPTION,
47 TYPE_ELEMHIDE, TYPE_ELEMHIDE_EXCEPTION, 47 TYPE_ELEMHIDE, TYPE_ELEMHIDE_EXCEPTION,
48 TYPE_COMMENT, TYPE_INVALID}; 48 TYPE_COMMENT, TYPE_INVALID};
49 49
50 /** 50 /**
(...skipping 106 matching lines...) Expand 10 before | Expand all | Expand 10 after
157 CONTENT_TYPE_IMAGE, CONTENT_TYPE_STYLESHEET, 157 CONTENT_TYPE_IMAGE, CONTENT_TYPE_STYLESHEET,
158 CONTENT_TYPE_OBJECT, CONTENT_TYPE_SUBDOCUMENT, 158 CONTENT_TYPE_OBJECT, CONTENT_TYPE_SUBDOCUMENT,
159 CONTENT_TYPE_DOCUMENT, CONTENT_TYPE_XMLHTTPREQUEST, 159 CONTENT_TYPE_DOCUMENT, CONTENT_TYPE_XMLHTTPREQUEST,
160 CONTENT_TYPE_OBJECT_SUBREQUEST, CONTENT_TYPE_FONT, 160 CONTENT_TYPE_OBJECT_SUBREQUEST, CONTENT_TYPE_FONT,
161 CONTENT_TYPE_MEDIA, CONTENT_TYPE_ELEMHIDE}; 161 CONTENT_TYPE_MEDIA, CONTENT_TYPE_ELEMHIDE};
162 162
163 /** 163 /**
164 * Callback type invoked when an update becomes available. 164 * Callback type invoked when an update becomes available.
165 * The parameter is the download URL of the update. 165 * The parameter is the download URL of the update.
166 */ 166 */
167 typedef std::function<void(const std::string&)> 167 typedef std::function<void(const std::string&)> UpdateAvailableCallback;
Felix Dahlke 2015/08/05 21:28:04 Nit: This was wrapped because it didn't fit in 80
sergei 2015/08/06 07:35:26 Fixed.
168 UpdateAvailableCallback;
169 168
170 /** 169 /**
171 * Callback type invoked when a manually triggered update check finishes. 170 * Callback type invoked when a manually triggered update check finishes.
172 * The parameter is an optional error message. 171 * The parameter is an optional error message.
173 */ 172 */
174 typedef std::function<void(const std::string&)> 173 typedef std::function<void(const std::string&)> UpdateCheckDoneCallback;
Felix Dahlke 2015/08/05 21:28:04 Nit: This was wrapped because it didn't fit in 80
sergei 2015/08/06 07:35:29 Fixed.
175 UpdateCheckDoneCallback;
176 174
177 /** 175 /**
178 * Callback type invoked when the filters change. 176 * Callback type invoked when the filters change.
179 * The first parameter is the action event code (see 177 * The first parameter is the action event code (see
180 * [FilterNotifier.triggerListeners](https://adblockplus.org/jsdoc/adblockpl us/symbols/FilterNotifier.html#.triggerListeners) 178 * [FilterNotifier.triggerListeners](https://adblockplus.org/jsdoc/adblockpl us/symbols/FilterNotifier.html#.triggerListeners)
181 * for the full list). 179 * for the full list).
182 * The second parameter is the filter/subscription object affected, if any. 180 * The second parameter is the filter/subscription object affected, if any.
183 */ 181 */
184 typedef std::function<void(const std::string&, const JsValuePtr)> FilterChan geCallback; 182 typedef std::function<void(const std::string&, const JsValuePtr)> FilterChan geCallback;
185 183
(...skipping 222 matching lines...) Expand 10 before | Expand all | Expand 10 after
408 void UpdateAvailable(UpdateAvailableCallback callback, JsValueList& params); 406 void UpdateAvailable(UpdateAvailableCallback callback, JsValueList& params);
409 void UpdateCheckDone(const std::string& eventName, 407 void UpdateCheckDone(const std::string& eventName,
410 UpdateCheckDoneCallback callback, JsValueList& params); 408 UpdateCheckDoneCallback callback, JsValueList& params);
411 void FilterChanged(FilterChangeCallback callback, JsValueList& params); 409 void FilterChanged(FilterChangeCallback callback, JsValueList& params);
412 void ShowNotification(const ShowNotificationCallback& callback, 410 void ShowNotification(const ShowNotificationCallback& callback,
413 const JsValueList& params); 411 const JsValueList& params);
414 }; 412 };
415 } 413 }
416 414
417 #endif 415 #endif
LEFTRIGHT

Powered by Google App Engine
This is Rietveld