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

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

Issue 29331737: Issue 3363 - Implement IsDocumentWhitelisted and IsElemhideWhitelisted (Closed)
Left Patch Set: Created Dec. 2, 2015, 1:27 p.m.
Right Patch Set: Reverted a whitespace removal Created Dec. 3, 2015, 8:39 p.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 | « no previous file | src/FilterEngine.cpp » ('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 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. 302 * Checks whether the document at the supplied URL is whitelisted.
303 * @param url URL to match. 303 * @param url URL of the document.
304 * @param documentUrls Chain of documents requesting the resource, starting 304 * @param documentUrls Chain of document URLs requesting the document,
305 * with the current resource's parent frame, ending with the 305 * starting with the current document's parent frame, ending with
306 * top-level frame. 306 * the top-level frame.
307 * If the application is not capable of identifying the 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 308 * structure, e.g. because it is a proxy, it can be approximated
309 * using `ReferrerMapping`. 309 * using `ReferrerMapping`.
310 * @return `true` if the URL is whitelisted. 310 * @return `true` if the URL is whitelisted.
311 * @throw `std::invalid_argument`, if an invalid `contentType` was supplied.
312 */ 311 */
313 bool IsDocumentWhitelisted(const std::string& url, 312 bool IsDocumentWhitelisted(const std::string& url,
314 const std::vector<std::string>& documentUrls) const; 313 const std::vector<std::string>& documentUrls) const;
315 314
316 /** 315 /**
317 * Checks if the element hidiing is whitelisted for the supplied URL. 316 * Checks whether element hiding is disabled at the supplied URL.
318 * @param url URL to match. 317 * @param url URL of the document.
319 * @param documentUrls Chain of documents requesting the resource, starting 318 * @param documentUrls Chain of document URLs requesting the document,
320 * with the current resource's parent frame, ending with the 319 * starting with the current document's parent frame, ending with
321 * top-level frame. 320 * the top-level frame.
322 * If the application is not capable of identifying the frame 321 * If the application is not capable of identifying the frame
323 * structure, e.g. because it is a proxy, it can be approximated 322 * structure, e.g. because it is a proxy, it can be approximated
324 * using `ReferrerMapping`. 323 * using `ReferrerMapping`.
325 * @return `true` if element hiding is whitelisted for the supplied URL. 324 * @return `true` if element hiding is whitelisted for the supplied URL.
326 * @throw `std::invalid_argument`, if an invalid `contentType` was supplied.
327 */ 325 */
328 bool IsElemhideWhitelisted(const std::string& url, 326 bool IsElemhideWhitelisted(const std::string& url,
329 const std::vector<std::string>& documentUrls) const; 327 const std::vector<std::string>& documentUrls) const;
330 328
331 /** 329 /**
332 * Retrieves CSS selectors for all element hiding filters active on the 330 * Retrieves CSS selectors for all element hiding filters active on the
333 * supplied domain. 331 * supplied domain.
334 * @param domain Domain to retrieve CSS selectors for. 332 * @param domain Domain to retrieve CSS selectors for.
335 * @return List of CSS selectors. 333 * @return List of CSS selectors.
336 */ 334 */
(...skipping 95 matching lines...) Expand 10 before | Expand all | Expand 10 after
432 void InitDone(JsValueList& params); 430 void InitDone(JsValueList& params);
433 FilterPtr CheckFilterMatch(const std::string& url, 431 FilterPtr CheckFilterMatch(const std::string& url,
434 ContentType contentType, 432 ContentType contentType,
435 const std::string& documentUrl) const; 433 const std::string& documentUrl) const;
436 void UpdateAvailable(UpdateAvailableCallback callback, JsValueList& params); 434 void UpdateAvailable(UpdateAvailableCallback callback, JsValueList& params);
437 void UpdateCheckDone(const std::string& eventName, 435 void UpdateCheckDone(const std::string& eventName,
438 UpdateCheckDoneCallback callback, JsValueList& params); 436 UpdateCheckDoneCallback callback, JsValueList& params);
439 void FilterChanged(FilterChangeCallback callback, JsValueList& params); 437 void FilterChanged(FilterChangeCallback callback, JsValueList& params);
440 void ShowNotification(const ShowNotificationCallback& callback, 438 void ShowNotification(const ShowNotificationCallback& callback,
441 const JsValueList& params); 439 const JsValueList& params);
442 std::string GetWhitelistingFilter(const std::string& url, 440 FilterPtr GetWhitelistingFilter(const std::string& url,
443 const std::string& parent, ContentType contentType) const; 441 ContentType contentType, const std::string& documentUrl) const;
444 std::string GetWhitelistingFilter(const std::string& urlArg, 442 FilterPtr GetWhitelistingFilter(const std::string& url,
445 const std::vector<std::string>& documentUrls, 443 ContentType contentType,
446 ContentType contentType) const; 444 const std::vector<std::string>& documentUrls) const;
447 }; 445 };
448 } 446 }
449 447
450 #endif 448 #endif
LEFTRIGHT

Powered by Google App Engine
This is Rietveld