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

Unified Diff: test/UpdateCheck.cpp

Issue 29422625: Issue 5189 - use r-value references when objects should be transferred (Closed) Base URL: https://github.com/adblockplus/libadblockplus.git
Patch Set: Created April 26, 2017, 2:14 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 | « test/Notification.cpp ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: test/UpdateCheck.cpp
diff --git a/test/UpdateCheck.cpp b/test/UpdateCheck.cpp
index e98697133ae14890bcbf5c96869c7fc230c21667..a6f9dd457104ca1d10935debe15cd51e28e1db69 100644
--- a/test/UpdateCheck.cpp
+++ b/test/UpdateCheck.cpp
@@ -19,6 +19,8 @@
#include "BaseJsTest.h"
+using namespace AdblockPlus;
+
namespace
{
typedef std::shared_ptr<AdblockPlus::FilterEngine> FilterEnginePtr;
@@ -74,8 +76,11 @@ namespace
jsEngine->SetLogSystem(AdblockPlus::LogSystemPtr(new LazyLogSystem));
jsEngine->SetFileSystem(AdblockPlus::FileSystemPtr(new LazyFileSystem));
jsEngine->SetWebRequest(webRequestPtr);
- jsEngine->SetEventCallback("updateAvailable",
- std::bind(&UpdateCheckTest::EventCallback, this, std::placeholders::_1));
+ jsEngine->SetEventCallback("updateAvailable", [this](JsValueList&& params)
+ {
+ eventCallbackCalled = true;
+ eventCallbackParams = std::move(params);
+ });
filterEngine = AdblockPlus::FilterEngine::Create(jsEngine);
}
@@ -86,12 +91,6 @@ namespace
std::bind(&UpdateCheckTest::UpdateCallback, this, std::placeholders::_1));
}
- void EventCallback(const AdblockPlus::JsValueList& params)
- {
- eventCallbackCalled = true;
- eventCallbackParams = params;
- }
-
void UpdateCallback(const std::string& error)
{
updateCallbackCalled = true;
« no previous file with comments | « test/Notification.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld