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

Unified Diff: src/DefaultWebRequest.cpp

Issue 29497591: Issue 5180 - remove synchronous WebRequest interface and stop exposing of DefaultWebRequest (Closed) Base URL: https://github.com/adblockplus/libadblockplus.git
Patch Set: Created July 25, 2017, 2:31 p.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/DefaultWebRequestCurl.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 c5cb7320c22f2c80d4061026bab314bffb4e4b0f..50af59ae9dd74c92f0a150b61dab721dd60ac786 100644
--- a/src/DefaultWebRequest.cpp
+++ b/src/DefaultWebRequest.cpp
@@ -15,13 +15,13 @@
* along with Adblock Plus. If not, see <http://www.gnu.org/licenses/>.
*/
-#include <AdblockPlus/DefaultWebRequest.h>
+#include "DefaultWebRequest.h"
#include <thread>
using namespace AdblockPlus;
-DefaultWebRequest::DefaultWebRequest(const WebRequestSharedPtr& syncImpl)
- : syncImpl(syncImpl)
+DefaultWebRequest::DefaultWebRequest(std::unique_ptr<DefaultWebRequestSync>&& syncImpl)
+ : syncImpl(std::move(syncImpl))
{
}
@@ -33,9 +33,8 @@ DefaultWebRequest::~DefaultWebRequest()
void DefaultWebRequest::GET(const std::string& url, const HeaderList& requestHeaders, const GetCallback& getCallback)
{
- auto syncImplCapture = syncImpl;
- std::thread([syncImplCapture, url, requestHeaders, getCallback]
+ std::thread([this, url, requestHeaders, getCallback]
{
- getCallback(syncImplCapture->GET(url, requestHeaders));
+ getCallback(this->syncImpl->GET(url, requestHeaders));
}).detach();
}
« no previous file with comments | « src/DefaultWebRequest.h ('k') | src/DefaultWebRequestCurl.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld