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

Delta Between Two Patch Sets: src/FilterEngine.cpp

Issue 29449592: Issue 5183 - Provide async interface for FileSystem (Closed) Base URL: https://hg.adblockplus.org/libadblockplus/
Left Patch Set: Updated patch after review. Created June 16, 2017, 9:52 p.m.
Right Patch Set: Rebase on master. Last changes. Created July 7, 2017, 1:36 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 | « src/FileSystemJsObject.cpp ('k') | src/JsEngine.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-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
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
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 }
LEFTRIGHT

Powered by Google App Engine
This is Rietveld