LEFT | RIGHT |
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 251 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
262 FilterEnginePtr FilterEngine::Create(const JsEnginePtr& jsEngine, | 262 FilterEnginePtr FilterEngine::Create(const JsEnginePtr& jsEngine, |
263 const FilterEngine::CreationParameters& params) | 263 const FilterEngine::CreationParameters& params) |
264 { | 264 { |
265 FilterEnginePtr retValue; | 265 FilterEnginePtr retValue; |
266 Sync sync; | 266 Sync sync; |
267 CreateAsync(jsEngine, [&retValue, &sync](const FilterEnginePtr& filterEngine) | 267 CreateAsync(jsEngine, [&retValue, &sync](const FilterEnginePtr& filterEngine) |
268 { | 268 { |
269 retValue = filterEngine; | 269 retValue = filterEngine; |
270 sync.Set(); | 270 sync.Set(); |
271 }, params); | 271 }, params); |
272 sync.Wait(std::chrono::milliseconds::zero()); | 272 sync.Wait(); |
273 return retValue; | 273 return retValue; |
274 } | 274 } |
275 | 275 |
276 namespace | 276 namespace |
277 { | 277 { |
278 typedef std::map<FilterEngine::ContentType, std::string> ContentTypeMap; | 278 typedef std::map<FilterEngine::ContentType, std::string> ContentTypeMap; |
279 | 279 |
280 ContentTypeMap CreateContentTypeMap() | 280 ContentTypeMap CreateContentTypeMap() |
281 { | 281 { |
282 ContentTypeMap contentTypes; | 282 ContentTypeMap contentTypes; |
(...skipping 322 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
605 FilterPtr filter = GetWhitelistingFilter(currentUrl, contentTypeMask, parent
Url); | 605 FilterPtr filter = GetWhitelistingFilter(currentUrl, contentTypeMask, parent
Url); |
606 if (filter) | 606 if (filter) |
607 { | 607 { |
608 return filter; | 608 return filter; |
609 } | 609 } |
610 currentUrl = parentUrl; | 610 currentUrl = parentUrl; |
611 } | 611 } |
612 while (urlIterator != documentUrls.end()); | 612 while (urlIterator != documentUrls.end()); |
613 return FilterPtr(); | 613 return FilterPtr(); |
614 } | 614 } |
LEFT | RIGHT |