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

Unified Diff: src/DefaultWebRequest.cpp

Issue 29499621: Issue 4983 - Get rid of Sleep() in the WebRequest test (Closed) Base URL: https://github.com/adblockplus/libadblockplus.git
Patch Set: Created July 27, 2017, 10:18 a.m.
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/DefaultWebRequest.h ('k') | src/JsEngine.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/DefaultWebRequest.cpp
diff --git a/src/DefaultWebRequest.cpp b/src/DefaultWebRequest.cpp
index 50af59ae9dd74c92f0a150b61dab721dd60ac786..57bc8f2d65eb423caee98d66ee2a649d259960ae 100644
--- a/src/DefaultWebRequest.cpp
+++ b/src/DefaultWebRequest.cpp
@@ -20,8 +20,8 @@
using namespace AdblockPlus;
-DefaultWebRequest::DefaultWebRequest(std::unique_ptr<DefaultWebRequestSync>&& syncImpl)
- : syncImpl(std::move(syncImpl))
+DefaultWebRequest::DefaultWebRequest(const Scheduler& scheduler, std::unique_ptr<DefaultWebRequestSync>&& syncImpl)
+ : scheduler(scheduler), syncImpl(std::move(syncImpl))
{
}
@@ -33,8 +33,8 @@ DefaultWebRequest::~DefaultWebRequest()
void DefaultWebRequest::GET(const std::string& url, const HeaderList& requestHeaders, const GetCallback& getCallback)
{
- std::thread([this, url, requestHeaders, getCallback]
+ scheduler([this, url, requestHeaders, getCallback]
{
getCallback(this->syncImpl->GET(url, requestHeaders));
- }).detach();
+ });
}
« no previous file with comments | « src/DefaultWebRequest.h ('k') | src/JsEngine.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld