libchromeos: Replace scoped_ptr with std::unique_ptr in async http callbacks
Changed callbacks to use std::unique_ptr in async HTTP response callbacks
instead of scoped_ptr, now that we can do this with base::Callback.
This eliminates the need to mix scoped_ptr and std::unique_ptr in the same
translation unit.
Sweep the code in leaderd and buffet to match the signature of the callbacks.
BUG=None
TEST=`FEATURES=test emerge-link libchromeos leaderd buffet`
CQ-DEPEND=CL:*214526
Change-Id: I2f93db3f863b2fb1994058b2b1fff12760edd022
Reviewed-on: https://chromium-review.googlesource.com/267342
Tested-by: Alex Vakulenko <avakulenko@chromium.org>
Trybot-Ready: Alex Vakulenko <avakulenko@chromium.org>
Reviewed-by: Christopher Wiley <wiley@chromium.org>
Commit-Queue: Alex Vakulenko <avakulenko@chromium.org>
diff --git a/buffet/device_registration_info.cc b/buffet/device_registration_info.cc
index 2b42492..a56a15a 100644
--- a/buffet/device_registration_info.cc
+++ b/buffet/device_registration_info.cc
@@ -583,7 +583,7 @@
FROM_HERE, base::Bind(cb, base::Owned(value.release())));
}
-using ResponsePtr = scoped_ptr<chromeos::http::Response>;
+using ResponsePtr = std::unique_ptr<chromeos::http::Response>;
void SendRequestWithRetries(
const std::string& method,
@@ -614,7 +614,7 @@
int status_code = response->GetStatusCode();
if (status_code >= chromeos::http::status_code::Continue &&
status_code < chromeos::http::status_code::BadRequest) {
- success_callback.Run(request_id, response.Pass());
+ success_callback.Run(request_id, std::move(response));
return;
}