webservd: Use abstract D-Bus proxy interfaces
D-Bus code generator now uses abstract proxy interfaces whenever
possible, so made necessary modifications on the caller side to
use them as well.
BUG: 26092352
Change-Id: I26990cb383fc39b858a084ff1bed7a4cfc4f2f74
diff --git a/libwebserv/protocol_handler.cc b/libwebserv/protocol_handler.cc
index 73b61db..76d1606 100644
--- a/libwebserv/protocol_handler.cc
+++ b/libwebserv/protocol_handler.cc
@@ -109,7 +109,7 @@
request_handlers_.emplace(
++last_handler_id_,
HandlerMapEntry{url, method,
- std::map<ProtocolHandlerProxy*, std::string>{},
+ std::map<ProtocolHandlerProxyInterface*, std::string>{},
std::move(handler)});
// For each instance of remote protocol handler object sharing the same name,
// add the request handler.
@@ -155,7 +155,7 @@
return true;
}
-void ProtocolHandler::Connect(ProtocolHandlerProxy* proxy) {
+void ProtocolHandler::Connect(ProtocolHandlerProxyInterface* proxy) {
proxies_.emplace(proxy->GetObjectPath(), proxy);
for (const auto& pair : request_handlers_) {
proxy->AddRequestHandlerAsync(
@@ -181,7 +181,7 @@
}
void ProtocolHandler::AddHandlerSuccess(int handler_id,
- ProtocolHandlerProxy* proxy,
+ ProtocolHandlerProxyInterface* proxy,
const std::string& remote_handler_id) {
auto p = request_handlers_.find(handler_id);
CHECK(p != request_handlers_.end());
@@ -229,7 +229,8 @@
int status_code,
const std::multimap<std::string, std::string>& headers,
brillo::StreamPtr data_stream) {
- ProtocolHandlerProxy* proxy = GetRequestProtocolHandlerProxy(request_id);
+ ProtocolHandlerProxyInterface* proxy =
+ GetRequestProtocolHandlerProxy(request_id);
if (!proxy)
return;
@@ -252,7 +253,8 @@
int file_id,
const base::Callback<void(brillo::StreamPtr)>& success_callback,
const base::Callback<void(brillo::Error*)>& error_callback) {
- ProtocolHandlerProxy* proxy = GetRequestProtocolHandlerProxy(request_id);
+ ProtocolHandlerProxyInterface* proxy =
+ GetRequestProtocolHandlerProxy(request_id);
CHECK(proxy);
// Store the success/error callback in a shared object so it can be referenced
@@ -287,7 +289,7 @@
base::Bind(on_error));
}
-ProtocolHandler::ProtocolHandlerProxy*
+ProtocolHandler::ProtocolHandlerProxyInterface*
ProtocolHandler::GetRequestProtocolHandlerProxy(
const std::string& request_id) const {
auto iter = request_id_map_.find(request_id);