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

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

Issue 29331737: Issue 3363 - Implement IsDocumentWhitelisted and IsElemhideWhitelisted (Closed)
Patch Set: Removed unnecessary @throw doc param. Created Dec. 2, 2015, 2:01 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 | src/FilterEngine.cpp » ('j') | src/FilterEngine.cpp » ('J')
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-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 281 matching lines...) Expand 10 before | Expand all | Expand 10 after
292 * structure, e.g. because it is a proxy, it can be approximated 292 * structure, e.g. because it is a proxy, it can be approximated
293 * using `ReferrerMapping`. 293 * using `ReferrerMapping`.
294 * @return Matching filter, or a `null` if there was no match. 294 * @return Matching filter, or a `null` if there was no match.
295 * @throw `std::invalid_argument`, if an invalid `contentType` was supplied. 295 * @throw `std::invalid_argument`, if an invalid `contentType` was supplied.
296 */ 296 */
297 FilterPtr Matches(const std::string& url, 297 FilterPtr Matches(const std::string& url,
298 ContentType contentType, 298 ContentType contentType,
299 const std::vector<std::string>& documentUrls) const; 299 const std::vector<std::string>& documentUrls) const;
300 300
301 /** 301 /**
302 * Checks if the supplied URL is whitelisted.
Felix Dahlke 2015/12/02 17:17:29 "Checks whether the document at the supplied URL i
René Jeschke 2015/12/02 17:38:40 Done.
303 * @param url URL to match.
Felix Dahlke 2015/12/02 17:17:29 I'd vote for: "URL of the document" instead, "matc
René Jeschke 2015/12/02 17:38:40 Done.
304 * @param documentUrls Chain of documents requesting the resource, starting
Felix Dahlke 2015/12/02 17:17:29 If you decide to go for "URL of the document" abov
René Jeschke 2015/12/02 17:38:40 Done.
305 * with the current resource's parent frame, ending with the
306 * top-level frame.
307 * If the application is not capable of identifying the frame
308 * structure, e.g. because it is a proxy, it can be approximated
309 * using `ReferrerMapping`.
310 * @return `true` if the URL is whitelisted.
311 */
312 bool IsDocumentWhitelisted(const std::string& url,
313 const std::vector<std::string>& documentUrls) const;
314
315 /**
316 * Checks if the element hiding is whitelisted for the supplied URL.
Felix Dahlke 2015/12/02 17:17:29 Doesn't sound entirely right to me, how about: "Ch
René Jeschke 2015/12/02 17:38:39 Done.
317 * @param url URL to match.
318 * @param documentUrls Chain of documents requesting the resource, starting
319 * with the current resource's parent frame, ending with the
320 * top-level frame.
321 * If the application is not capable of identifying the frame
322 * structure, e.g. because it is a proxy, it can be approximated
323 * using `ReferrerMapping`.
324 * @return `true` if element hiding is whitelisted for the supplied URL.
325 */
326 bool IsElemhideWhitelisted(const std::string& url,
327 const std::vector<std::string>& documentUrls) const;
328
329 /**
302 * Retrieves CSS selectors for all element hiding filters active on the 330 * Retrieves CSS selectors for all element hiding filters active on the
303 * supplied domain. 331 * supplied domain.
304 * @param domain Domain to retrieve CSS selectors for. 332 * @param domain Domain to retrieve CSS selectors for.
305 * @return List of CSS selectors. 333 * @return List of CSS selectors.
306 */ 334 */
307 std::vector<std::string> GetElementHidingSelectors(const std::string& domain ) const; 335 std::vector<std::string> GetElementHidingSelectors(const std::string& domain ) const;
308 336
309 /** 337 /**
310 * Retrieves a preference value. 338 * Retrieves a preference value.
311 * @param pref Preference name. 339 * @param pref Preference name.
(...skipping 90 matching lines...) Expand 10 before | Expand all | Expand 10 after
402 void InitDone(JsValueList& params); 430 void InitDone(JsValueList& params);
403 FilterPtr CheckFilterMatch(const std::string& url, 431 FilterPtr CheckFilterMatch(const std::string& url,
404 ContentType contentType, 432 ContentType contentType,
405 const std::string& documentUrl) const; 433 const std::string& documentUrl) const;
406 void UpdateAvailable(UpdateAvailableCallback callback, JsValueList& params); 434 void UpdateAvailable(UpdateAvailableCallback callback, JsValueList& params);
407 void UpdateCheckDone(const std::string& eventName, 435 void UpdateCheckDone(const std::string& eventName,
408 UpdateCheckDoneCallback callback, JsValueList& params); 436 UpdateCheckDoneCallback callback, JsValueList& params);
409 void FilterChanged(FilterChangeCallback callback, JsValueList& params); 437 void FilterChanged(FilterChangeCallback callback, JsValueList& params);
410 void ShowNotification(const ShowNotificationCallback& callback, 438 void ShowNotification(const ShowNotificationCallback& callback,
411 const JsValueList& params); 439 const JsValueList& params);
440 std::string GetWhitelistingFilter(const std::string& url,
441 const std::string& parent, ContentType contentType) const;
Felix Dahlke 2015/12/02 17:17:29 Nit: s/parent/documentUrl/, analogous to the two M
Felix Dahlke 2015/12/02 17:17:29 Nit: Switch parent/documentUrl and contentType, an
René Jeschke 2015/12/02 17:38:40 Done.
René Jeschke 2015/12/02 17:38:40 Done.
442 std::string GetWhitelistingFilter(const std::string& urlArg,
Felix Dahlke 2015/12/02 17:17:29 Nit: s/urlArg/url/?
René Jeschke 2015/12/02 17:38:40 Done.
443 const std::vector<std::string>& documentUrls,
444 ContentType contentType) const;
412 }; 445 };
413 } 446 }
414 447
415 #endif 448 #endif
OLDNEW
« no previous file with comments | « no previous file | src/FilterEngine.cpp » ('j') | src/FilterEngine.cpp » ('J')

Powered by Google App Engine
This is Rietveld