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

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

Issue 29419623: Issue 5165 - Remove SubscriptionPtr (Closed) Base URL: https://hg.adblockplus.org/libadblockplus/
Patch Set: Created April 21, 2017, 2:08 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 | shell/src/SubscriptionsCommand.cpp » ('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 124 matching lines...) Expand 10 before | Expand all | Expand 10 after
135 */ 135 */
136 Subscription(JsValue&& value); 136 Subscription(JsValue&& value);
137 }; 137 };
138 138
139 /** 139 /**
140 * Shared smart pointer to a `Filter` instance. 140 * Shared smart pointer to a `Filter` instance.
141 */ 141 */
142 typedef std::unique_ptr<Filter> FilterPtr; 142 typedef std::unique_ptr<Filter> FilterPtr;
143 143
144 /** 144 /**
145 * Shared smart pointer to a `Subscription` instance.
146 */
147 typedef std::shared_ptr<Subscription> SubscriptionPtr;
148
149 /**
150 * Main component of libadblockplus. 145 * Main component of libadblockplus.
151 * It handles: 146 * It handles:
152 * - Filter management and matching. 147 * - Filter management and matching.
153 * - Subscription management and synchronization. 148 * - Subscription management and synchronization.
154 * - Update checks for the application. 149 * - Update checks for the application.
155 */ 150 */
156 class FilterEngine 151 class FilterEngine
157 { 152 {
158 public: 153 public:
159 // Make sure to keep ContentType in sync with FilterEngine::contentTypes 154 // Make sure to keep ContentType in sync with FilterEngine::contentTypes
(...skipping 125 matching lines...) Expand 10 before | Expand all | Expand 10 after
285 * see https://adblockplus.org/en/filters. 280 * see https://adblockplus.org/en/filters.
286 * @return New `Filter` instance. 281 * @return New `Filter` instance.
287 */ 282 */
288 Filter GetFilter(const std::string& text) const; 283 Filter GetFilter(const std::string& text) const;
289 284
290 /** 285 /**
291 * Retrieves a subscription object for the supplied URL. 286 * Retrieves a subscription object for the supplied URL.
292 * @param url Subscription URL. 287 * @param url Subscription URL.
293 * @return New `Subscription` instance. 288 * @return New `Subscription` instance.
294 */ 289 */
295 SubscriptionPtr GetSubscription(const std::string& url) const; 290 Subscription GetSubscription(const std::string& url) const;
296 291
297 /** 292 /**
298 * Retrieves the list of custom filters. 293 * Retrieves the list of custom filters.
299 * @return List of custom filters. 294 * @return List of custom filters.
300 */ 295 */
301 std::vector<Filter> GetListedFilters() const; 296 std::vector<Filter> GetListedFilters() const;
302 297
303 /** 298 /**
304 * Retrieves all subscriptions. 299 * Retrieves all subscriptions.
305 * @return List of subscriptions. 300 * @return List of subscriptions.
306 */ 301 */
307 std::vector<SubscriptionPtr> GetListedSubscriptions() const; 302 std::vector<Subscription> GetListedSubscriptions() const;
308 303
309 /** 304 /**
310 * Retrieves all recommended subscriptions. 305 * Retrieves all recommended subscriptions.
311 * @return List of recommended subscriptions. 306 * @return List of recommended subscriptions.
312 */ 307 */
313 std::vector<SubscriptionPtr> FetchAvailableSubscriptions() const; 308 std::vector<Subscription> FetchAvailableSubscriptions() const;
314 309
315 /** 310 /**
316 * Ensures that the Acceptable Ads subscription is enabled or disabled. 311 * Ensures that the Acceptable Ads subscription is enabled or disabled.
317 * @param enabled 312 * @param enabled
318 * - if the value is `true` 313 * - if the value is `true`
319 * - ensure that the filter set includes an enabled AA subscription, 314 * - ensure that the filter set includes an enabled AA subscription,
320 * adding it if needed and enabling it if disabled. 315 * adding it if needed and enabling it if disabled.
321 * - if the value is `false` 316 * - if the value is `false`
322 * - if an AA subscription is present, disable it. 317 * - if an AA subscription is present, disable it.
323 * - if absent, do nothing. 318 * - if absent, do nothing.
(...skipping 218 matching lines...) Expand 10 before | Expand all | Expand 10 after
542 const JsValueList& param) const; 537 const JsValueList& param) const;
543 FilterPtr GetWhitelistingFilter(const std::string& url, 538 FilterPtr GetWhitelistingFilter(const std::string& url,
544 ContentTypeMask contentTypeMask, const std::string& documentUrl) const; 539 ContentTypeMask contentTypeMask, const std::string& documentUrl) const;
545 FilterPtr GetWhitelistingFilter(const std::string& url, 540 FilterPtr GetWhitelistingFilter(const std::string& url,
546 ContentTypeMask contentTypeMask, 541 ContentTypeMask contentTypeMask,
547 const std::vector<std::string>& documentUrls) const; 542 const std::vector<std::string>& documentUrls) const;
548 }; 543 };
549 } 544 }
550 545
551 #endif 546 #endif
OLDNEW
« no previous file with comments | « no previous file | shell/src/SubscriptionsCommand.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld