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

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

Issue 29419607: Issue 5163 - Reduce the use of FilterPtr (Closed) Base URL: https://hg.adblockplus.org/libadblockplus/
Patch Set: Created April 21, 2017, 1:04 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/FiltersCommand.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 121 matching lines...) Expand 10 before | Expand all | Expand 10 after
132 * Normally you shouldn't call this directly, but use 132 * Normally you shouldn't call this directly, but use
133 * FilterEngine::GetSubscription() instead. 133 * FilterEngine::GetSubscription() instead.
134 * @param value JavaScript subscription object. 134 * @param value JavaScript subscription object.
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::shared_ptr<Filter> FilterPtr; 142 typedef std::unique_ptr<Filter> FilterPtr;
143 143
144 /** 144 /**
145 * Shared smart pointer to a `Subscription` instance. 145 * Shared smart pointer to a `Subscription` instance.
146 */ 146 */
147 typedef std::shared_ptr<Subscription> SubscriptionPtr; 147 typedef std::shared_ptr<Subscription> SubscriptionPtr;
148 148
149 /** 149 /**
150 * Main component of libadblockplus. 150 * Main component of libadblockplus.
151 * It handles: 151 * It handles:
152 * - Filter management and matching. 152 * - Filter management and matching.
(...skipping 125 matching lines...) Expand 10 before | Expand all | Expand 10 after
278 * @return `true` if the application is running for the first time. 278 * @return `true` if the application is running for the first time.
279 */ 279 */
280 bool IsFirstRun() const; 280 bool IsFirstRun() const;
281 281
282 /** 282 /**
283 * Retrieves a filter object from its text representation. 283 * Retrieves a filter object from its text representation.
284 * @param text Text representation of the filter, 284 * @param text Text representation of the filter,
285 * see https://adblockplus.org/en/filters. 285 * see https://adblockplus.org/en/filters.
286 * @return New `Filter` instance. 286 * @return New `Filter` instance.
287 */ 287 */
288 FilterPtr GetFilter(const std::string& text) const; 288 Filter GetFilter(const std::string& text) const;
289 289
290 /** 290 /**
291 * Retrieves a subscription object for the supplied URL. 291 * Retrieves a subscription object for the supplied URL.
292 * @param url Subscription URL. 292 * @param url Subscription URL.
293 * @return New `Subscription` instance. 293 * @return New `Subscription` instance.
294 */ 294 */
295 SubscriptionPtr GetSubscription(const std::string& url) const; 295 SubscriptionPtr GetSubscription(const std::string& url) const;
296 296
297 /** 297 /**
298 * Retrieves the list of custom filters. 298 * Retrieves the list of custom filters.
299 * @return List of custom filters. 299 * @return List of custom filters.
300 */ 300 */
301 std::vector<FilterPtr> GetListedFilters() const; 301 std::vector<Filter> GetListedFilters() const;
302 302
303 /** 303 /**
304 * Retrieves all subscriptions. 304 * Retrieves all subscriptions.
305 * @return List of subscriptions. 305 * @return List of subscriptions.
306 */ 306 */
307 std::vector<SubscriptionPtr> GetListedSubscriptions() const; 307 std::vector<SubscriptionPtr> GetListedSubscriptions() const;
308 308
309 /** 309 /**
310 * Retrieves all recommended subscriptions. 310 * Retrieves all recommended subscriptions.
311 * @return List of recommended subscriptions. 311 * @return List of recommended subscriptions.
(...skipping 230 matching lines...) Expand 10 before | Expand all | Expand 10 after
542 const JsValueList& param) const; 542 const JsValueList& param) const;
543 FilterPtr GetWhitelistingFilter(const std::string& url, 543 FilterPtr GetWhitelistingFilter(const std::string& url,
544 ContentTypeMask contentTypeMask, const std::string& documentUrl) const; 544 ContentTypeMask contentTypeMask, const std::string& documentUrl) const;
545 FilterPtr GetWhitelistingFilter(const std::string& url, 545 FilterPtr GetWhitelistingFilter(const std::string& url,
546 ContentTypeMask contentTypeMask, 546 ContentTypeMask contentTypeMask,
547 const std::vector<std::string>& documentUrls) const; 547 const std::vector<std::string>& documentUrls) const;
548 }; 548 };
549 } 549 }
550 550
551 #endif 551 #endif
OLDNEW
« no previous file with comments | « no previous file | shell/src/FiltersCommand.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld