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

Side by Side Diff: src/FilterEngine.cpp

Issue 29512648: Issue 5475 - Update adblockpluscore dependency to revision hg:b935a0402215 (Closed) Base URL: https://github.com/adblockplus/libadblockplus.git
Patch Set: Created Aug. 11, 2017, 12:36 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
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 54 matching lines...) Expand 10 before | Expand all | Expand 10 after
65 { 65 {
66 std::string className = GetClass(); 66 std::string className = GetClass();
67 if (className == "BlockingFilter") 67 if (className == "BlockingFilter")
68 return TYPE_BLOCKING; 68 return TYPE_BLOCKING;
69 else if (className == "WhitelistFilter") 69 else if (className == "WhitelistFilter")
70 return TYPE_EXCEPTION; 70 return TYPE_EXCEPTION;
71 else if (className == "ElemHideFilter") 71 else if (className == "ElemHideFilter")
72 return TYPE_ELEMHIDE; 72 return TYPE_ELEMHIDE;
73 else if (className == "ElemHideException") 73 else if (className == "ElemHideException")
74 return TYPE_ELEMHIDE_EXCEPTION; 74 return TYPE_ELEMHIDE_EXCEPTION;
75 else if (className == "ElemHideEmulationFilter")
76 return TYPE_TYPE_ELEMHIDE_EMULATION;
75 else if (className == "CommentFilter") 77 else if (className == "CommentFilter")
76 return TYPE_COMMENT; 78 return TYPE_COMMENT;
77 else 79 else
78 return TYPE_INVALID; 80 return TYPE_INVALID;
79 } 81 }
80 82
81 bool Filter::IsListed() const 83 bool Filter::IsListed() const
82 { 84 {
83 JsValue func = jsEngine->Evaluate("API.isListedFilter"); 85 JsValue func = jsEngine->Evaluate("API.isListedFilter");
84 return func.Call(*this).AsBool(); 86 return func.Call(*this).AsBool();
(...skipping 181 matching lines...) Expand 10 before | Expand all | Expand 10 after
266 ContentTypeMap CreateContentTypeMap() 268 ContentTypeMap CreateContentTypeMap()
267 { 269 {
268 ContentTypeMap contentTypes; 270 ContentTypeMap contentTypes;
269 contentTypes[FilterEngine::CONTENT_TYPE_OTHER] = "OTHER"; 271 contentTypes[FilterEngine::CONTENT_TYPE_OTHER] = "OTHER";
270 contentTypes[FilterEngine::CONTENT_TYPE_SCRIPT] = "SCRIPT"; 272 contentTypes[FilterEngine::CONTENT_TYPE_SCRIPT] = "SCRIPT";
271 contentTypes[FilterEngine::CONTENT_TYPE_IMAGE] = "IMAGE"; 273 contentTypes[FilterEngine::CONTENT_TYPE_IMAGE] = "IMAGE";
272 contentTypes[FilterEngine::CONTENT_TYPE_STYLESHEET] = "STYLESHEET"; 274 contentTypes[FilterEngine::CONTENT_TYPE_STYLESHEET] = "STYLESHEET";
273 contentTypes[FilterEngine::CONTENT_TYPE_OBJECT] = "OBJECT"; 275 contentTypes[FilterEngine::CONTENT_TYPE_OBJECT] = "OBJECT";
274 contentTypes[FilterEngine::CONTENT_TYPE_SUBDOCUMENT] = "SUBDOCUMENT"; 276 contentTypes[FilterEngine::CONTENT_TYPE_SUBDOCUMENT] = "SUBDOCUMENT";
275 contentTypes[FilterEngine::CONTENT_TYPE_DOCUMENT] = "DOCUMENT"; 277 contentTypes[FilterEngine::CONTENT_TYPE_DOCUMENT] = "DOCUMENT";
278 contentTypes[FilterEngine::CONTENT_TYPE_WEBSOCKET] = "WEBSOCKET";
279 contentTypes[FilterEngine::CONTENT_TYPE_WEBRTC] = "WEBRTC";
276 contentTypes[FilterEngine::CONTENT_TYPE_PING] = "PING"; 280 contentTypes[FilterEngine::CONTENT_TYPE_PING] = "PING";
277 contentTypes[FilterEngine::CONTENT_TYPE_XMLHTTPREQUEST] = "XMLHTTPREQUEST"; 281 contentTypes[FilterEngine::CONTENT_TYPE_XMLHTTPREQUEST] = "XMLHTTPREQUEST";
278 contentTypes[FilterEngine::CONTENT_TYPE_OBJECT_SUBREQUEST] = "OBJECT_SUBREQU EST"; 282 contentTypes[FilterEngine::CONTENT_TYPE_OBJECT_SUBREQUEST] = "OBJECT_SUBREQU EST";
279 contentTypes[FilterEngine::CONTENT_TYPE_FONT] = "FONT"; 283 contentTypes[FilterEngine::CONTENT_TYPE_FONT] = "FONT";
280 contentTypes[FilterEngine::CONTENT_TYPE_MEDIA] = "MEDIA"; 284 contentTypes[FilterEngine::CONTENT_TYPE_MEDIA] = "MEDIA";
281 contentTypes[FilterEngine::CONTENT_TYPE_ELEMHIDE] = "ELEMHIDE"; 285 contentTypes[FilterEngine::CONTENT_TYPE_ELEMHIDE] = "ELEMHIDE";
282 contentTypes[FilterEngine::CONTENT_TYPE_GENERICBLOCK] = "GENERICBLOCK"; 286 contentTypes[FilterEngine::CONTENT_TYPE_GENERICBLOCK] = "GENERICBLOCK";
283 contentTypes[FilterEngine::CONTENT_TYPE_GENERICHIDE] = "GENERICHIDE"; 287 contentTypes[FilterEngine::CONTENT_TYPE_GENERICHIDE] = "GENERICHIDE";
284 return contentTypes; 288 return contentTypes;
285 } 289 }
(...skipping 305 matching lines...) Expand 10 before | Expand all | Expand 10 after
591 FilterPtr filter = GetWhitelistingFilter(currentUrl, contentTypeMask, parent Url); 595 FilterPtr filter = GetWhitelistingFilter(currentUrl, contentTypeMask, parent Url);
592 if (filter) 596 if (filter)
593 { 597 {
594 return filter; 598 return filter;
595 } 599 }
596 currentUrl = parentUrl; 600 currentUrl = parentUrl;
597 } 601 }
598 while (urlIterator != documentUrls.end()); 602 while (urlIterator != documentUrls.end());
599 return FilterPtr(); 603 return FilterPtr();
600 } 604 }
OLDNEW
« libadblockplus.gyp ('K') | « src/FileSystemJsObject.cpp ('k') | src/Notification.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld