OLD | NEW |
1 /* | 1 /* |
2 * This file is part of Adblock Plus <http://adblockplus.org/>, | 2 * This file is part of Adblock Plus <http://adblockplus.org/>, |
3 * Copyright (C) 2006-2014 Eyeo GmbH | 3 * Copyright (C) 2006-2014 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 153 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
164 contentTypes[FilterEngine::CONTENT_TYPE_SCRIPT] = "SCRIPT"; | 164 contentTypes[FilterEngine::CONTENT_TYPE_SCRIPT] = "SCRIPT"; |
165 contentTypes[FilterEngine::CONTENT_TYPE_IMAGE] = "IMAGE"; | 165 contentTypes[FilterEngine::CONTENT_TYPE_IMAGE] = "IMAGE"; |
166 contentTypes[FilterEngine::CONTENT_TYPE_STYLESHEET] = "STYLESHEET"; | 166 contentTypes[FilterEngine::CONTENT_TYPE_STYLESHEET] = "STYLESHEET"; |
167 contentTypes[FilterEngine::CONTENT_TYPE_OBJECT] = "OBJECT"; | 167 contentTypes[FilterEngine::CONTENT_TYPE_OBJECT] = "OBJECT"; |
168 contentTypes[FilterEngine::CONTENT_TYPE_SUBDOCUMENT] = "SUBDOCUMENT"; | 168 contentTypes[FilterEngine::CONTENT_TYPE_SUBDOCUMENT] = "SUBDOCUMENT"; |
169 contentTypes[FilterEngine::CONTENT_TYPE_DOCUMENT] = "DOCUMENT"; | 169 contentTypes[FilterEngine::CONTENT_TYPE_DOCUMENT] = "DOCUMENT"; |
170 contentTypes[FilterEngine::CONTENT_TYPE_XMLHTTPREQUEST] = "XMLHTTPREQUEST"; | 170 contentTypes[FilterEngine::CONTENT_TYPE_XMLHTTPREQUEST] = "XMLHTTPREQUEST"; |
171 contentTypes[FilterEngine::CONTENT_TYPE_OBJECT_SUBREQUEST] = "OBJECT_SUBREQU
EST"; | 171 contentTypes[FilterEngine::CONTENT_TYPE_OBJECT_SUBREQUEST] = "OBJECT_SUBREQU
EST"; |
172 contentTypes[FilterEngine::CONTENT_TYPE_FONT] = "FONT"; | 172 contentTypes[FilterEngine::CONTENT_TYPE_FONT] = "FONT"; |
173 contentTypes[FilterEngine::CONTENT_TYPE_MEDIA] = "MEDIA"; | 173 contentTypes[FilterEngine::CONTENT_TYPE_MEDIA] = "MEDIA"; |
| 174 contentTypes[FilterEngine::CONTENT_TYPE_ELEMHIDE] = "ELEMHIDE"; |
174 return contentTypes; | 175 return contentTypes; |
175 } | 176 } |
176 } | 177 } |
177 | 178 |
178 const ContentTypeMap FilterEngine::contentTypes = CreateContentTypeMap(); | 179 const ContentTypeMap FilterEngine::contentTypes = CreateContentTypeMap(); |
179 | 180 |
180 std::string FilterEngine::ContentTypeToString(ContentType contentType) | 181 std::string FilterEngine::ContentTypeToString(ContentType contentType) |
181 { | 182 { |
182 ContentTypeMap::const_iterator it = contentTypes.find(contentType); | 183 ContentTypeMap::const_iterator it = contentTypes.find(contentType); |
183 if (it != contentTypes.end()) | 184 if (it != contentTypes.end()) |
(...skipping 219 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
403 } | 404 } |
404 | 405 |
405 int FilterEngine::CompareVersions(const std::string& v1, const std::string& v2) | 406 int FilterEngine::CompareVersions(const std::string& v1, const std::string& v2) |
406 { | 407 { |
407 JsValueList params; | 408 JsValueList params; |
408 params.push_back(jsEngine->NewValue(v1)); | 409 params.push_back(jsEngine->NewValue(v1)); |
409 params.push_back(jsEngine->NewValue(v2)); | 410 params.push_back(jsEngine->NewValue(v2)); |
410 JsValuePtr func = jsEngine->Evaluate("API.compareVersions"); | 411 JsValuePtr func = jsEngine->Evaluate("API.compareVersions"); |
411 return func->Call(params)->AsInt(); | 412 return func->Call(params)->AsInt(); |
412 } | 413 } |
OLD | NEW |