diff options
author | Arsentiy Milchakov <milcars@mapswithme.com> | 2017-07-21 16:26:51 +0300 |
---|---|---|
committer | Aleksandr Zatsepin <alexzatsepin@users.noreply.github.com> | 2017-07-21 16:29:08 +0300 |
commit | 3272d3061ed9123f2f1ed34832d6856aa1d530d5 (patch) | |
tree | c3652570c7d0c8e11a1669597d9de9218c606ef8 /partners_api | |
parent | 6f7e6aca14e32716725a5011dd589b741da80232 (diff) |
[android] cian jni layer
Diffstat (limited to 'partners_api')
-rw-r--r-- | partners_api/cian_api.cpp | 10 | ||||
-rw-r--r-- | partners_api/cian_api.hpp | 4 |
2 files changed, 7 insertions, 7 deletions
diff --git a/partners_api/cian_api.cpp b/partners_api/cian_api.cpp index 0b41071026..5afefcad61 100644 --- a/partners_api/cian_api.cpp +++ b/partners_api/cian_api.cpp @@ -127,8 +127,8 @@ Api::~Api() m_worker.Shutdown(base::WorkerThread::Exit::SkipPending); } -uint64_t Api::GetRentNearby(ms::LatLon const & latlon, RentNearbyCallback const & cb, - ErrorCallback const & errCb) +uint64_t Api::GetRentNearby(ms::LatLon const & latlon, RentNearbyCallback const & onSuccess, + ErrorCallback const & onError) { auto const reqId = ++m_requestId; auto const & baseUrl = m_baseUrl; @@ -137,14 +137,14 @@ uint64_t Api::GetRentNearby(ms::LatLon const & latlon, RentNearbyCallback const auto const mercatorRect = MercatorBounds::MetresToXY(latlon.lat, latlon.lon, kSearchRadius); auto const rect = MercatorBounds::ToLatLonRect(mercatorRect); - m_worker.Push([reqId, rect, cb, errCb, baseUrl]() { + m_worker.Push([reqId, rect, onSuccess, onError, baseUrl]() { std::vector<RentPlace> result; auto const rawResult = RawApi::GetRentNearby(rect, baseUrl); if (!rawResult) { auto & code = rawResult.m_errorCode; - GetPlatform().RunOnGuiThread([errCb, code, reqId]() { errCb(code, reqId); }); + GetPlatform().RunOnGuiThread([onError, code, reqId]() { onError(code, reqId); }); return; } @@ -157,7 +157,7 @@ uint64_t Api::GetRentNearby(ms::LatLon const & latlon, RentNearbyCallback const LOG(LERROR, (e.Msg())); result.clear(); } - GetPlatform().RunOnGuiThread([cb, result, reqId]() { cb(result, reqId); }); + GetPlatform().RunOnGuiThread([onSuccess, result, reqId]() { onSuccess(result, reqId); }); }); return reqId; diff --git a/partners_api/cian_api.hpp b/partners_api/cian_api.hpp index d38bac9ad7..434d43423c 100644 --- a/partners_api/cian_api.hpp +++ b/partners_api/cian_api.hpp @@ -59,8 +59,8 @@ public: explicit Api(std::string const & baseUrl = kBaseUrl); virtual ~Api(); - uint64_t GetRentNearby(ms::LatLon const & latlon, RentNearbyCallback const & cb, - ErrorCallback const & errCb); + uint64_t GetRentNearby(ms::LatLon const & latlon, RentNearbyCallback const & onSuccess, + ErrorCallback const & onError); static bool IsCitySupported(std::string const & city); |