From 175c605e548f8a9d660d19c98a63c6030d33d909 Mon Sep 17 00:00:00 2001 From: Simon Fels Date: Thu, 30 Jun 2016 00:02:02 +0200 Subject: [PATCH] Rename server class to PlatformApi --- Android.mk | 2 +- android/CMakeLists.txt | 2 +- android/service/host_connector.cpp | 6 +++--- android/service/host_connector.h | 4 ++-- android/service/message_processor.cpp | 12 ++++++------ android/service/message_processor.h | 6 +++--- android/service/{server.cpp => platform_api.cpp} | 12 ++++++------ android/service/{server.h => platform_api.h} | 10 +++++----- 8 files changed, 27 insertions(+), 27 deletions(-) rename android/service/{server.cpp => platform_api.cpp} (87%) rename android/service/{server.h => platform_api.h} (92%) diff --git a/Android.mk b/Android.mk index 7e8332b..1bdc234 100644 --- a/Android.mk +++ b/Android.mk @@ -30,7 +30,7 @@ LOCAL_SRC_FILES := \ android/service/host_connector.cpp \ android/service/local_socket_connection.cpp \ android/service/message_processor.cpp \ - android/service/server.cpp \ + android/service/platform_api.cpp \ src/anbox/common/fd.cpp \ src/anbox/bridge/message_processor.cpp \ src/anbox/bridge/pending_call_cache.cpp \ diff --git a/android/CMakeLists.txt b/android/CMakeLists.txt index 186ac43..40b37b6 100644 --- a/android/CMakeLists.txt +++ b/android/CMakeLists.txt @@ -7,7 +7,7 @@ set(ANBOXD_SOURCES ${CMAKE_SOURCE_DIR}/src/anbox/bridge/message_processor.cpp ${CMAKE_SOURCE_DIR}/src/anbox/bridge/pending_call_cache.cpp ${CMAKE_SOURCE_DIR}/src/anbox/common/fd.cpp - service/server.cpp + service/platform_api.cpp service/message_processor.cpp service/local_socket_connection.cpp service/host_connector.cpp diff --git a/android/service/host_connector.cpp b/android/service/host_connector.cpp index d5d4454..b4acda4 100644 --- a/android/service/host_connector.cpp +++ b/android/service/host_connector.cpp @@ -18,7 +18,7 @@ #include "android/service/host_connector.h" #include "android/service/local_socket_connection.h" #include "android/service/message_processor.h" -#include "android/service/server.h" +#include "android/service/platform_api.h" #include #include @@ -28,8 +28,8 @@ namespace android { HostConnector::HostConnector() : socket_(std::make_shared("/dev/anbox_bridge")), pending_calls_(std::make_shared()), - server_(std::make_shared()), - message_processor_(std::make_shared(socket_, pending_calls_, server_)), + platform_api_(std::make_shared()), + message_processor_(std::make_shared(socket_, pending_calls_, platform_api_)), running_(false) { } diff --git a/android/service/host_connector.h b/android/service/host_connector.h index 5f84282..608752f 100644 --- a/android/service/host_connector.h +++ b/android/service/host_connector.h @@ -29,7 +29,7 @@ class PendingCallCache; namespace android { class LocalSocketConnection; class MessageProcessor; -class Server; +class PlatformApi; class HostConnector { public: HostConnector(); @@ -43,7 +43,7 @@ private: std::shared_ptr socket_; std::shared_ptr pending_calls_; - std::shared_ptr server_; + std::shared_ptr platform_api_; std::shared_ptr message_processor_; std::thread thread_; std::atomic running_; diff --git a/android/service/message_processor.cpp b/android/service/message_processor.cpp index cf403a8..1268476 100644 --- a/android/service/message_processor.cpp +++ b/android/service/message_processor.cpp @@ -16,7 +16,7 @@ */ #include "android/service/message_processor.h" -#include "android/service/server.h" +#include "android/service/platform_api.h" #include "anbox/bridge/template_message_processor.h" @@ -24,9 +24,9 @@ namespace anbox { namespace android { MessageProcessor::MessageProcessor(const std::shared_ptr &sender, const std::shared_ptr &pending_calls, - const std::shared_ptr &server) : + const std::shared_ptr &platform_api) : bridge::MessageProcessor(sender, pending_calls), - server_(server) { + platform_api_(platform_api) { } MessageProcessor::~MessageProcessor() { @@ -34,11 +34,11 @@ MessageProcessor::~MessageProcessor() { void MessageProcessor::dispatch(bridge::Invocation const& invocation) { if (invocation.method_name() == "install_application") - invoke(this, server_.get(), &Server::install_application, invocation); + invoke(this, platform_api_.get(), &PlatformApi::install_application, invocation); else if (invocation.method_name() == "launch_application") - invoke(this, server_.get(), &Server::launch_application, invocation); + invoke(this, platform_api_.get(), &PlatformApi::launch_application, invocation); else if (invocation.method_name() == "set_dns_servers") - invoke(this, server_.get(), &Server::set_dns_servers, invocation); + invoke(this, platform_api_.get(), &PlatformApi::set_dns_servers, invocation); } void MessageProcessor::process_event_sequence(const std::string&) { diff --git a/android/service/message_processor.h b/android/service/message_processor.h index 89a393b..eeab463 100644 --- a/android/service/message_processor.h +++ b/android/service/message_processor.h @@ -22,19 +22,19 @@ namespace anbox { namespace android { -class Server; +class PlatformApi; class MessageProcessor : public bridge::MessageProcessor { public: MessageProcessor(const std::shared_ptr &sender, const std::shared_ptr &pending_calls, - const std::shared_ptr &server); + const std::shared_ptr &platform_api); ~MessageProcessor(); void dispatch(bridge::Invocation const& invocation) override; void process_event_sequence(const std::string &event) override; private: - std::shared_ptr server_; + std::shared_ptr platform_api_; }; } // namespace anbox } // namespace network diff --git a/android/service/server.cpp b/android/service/platform_api.cpp similarity index 87% rename from android/service/server.cpp rename to android/service/platform_api.cpp index 8b58cde..84b7c8c 100644 --- a/android/service/server.cpp +++ b/android/service/platform_api.cpp @@ -15,7 +15,7 @@ * */ -#include "android/service/server.h" +#include "android/service/platform_api.h" #include "anbox_bridge.pb.h" @@ -31,13 +31,13 @@ std::map common_env = { namespace anbox { namespace android { -Server::Server() { +PlatformApi::PlatformApi() { } -Server::~Server() { +PlatformApi::~PlatformApi() { } -void Server::install_application(anbox::protobuf::bridge::InstallApplication const *request, +void PlatformApi::install_application(anbox::protobuf::bridge::InstallApplication const *request, anbox::protobuf::bridge::Void *response, google::protobuf::Closure *done) { (void) response; @@ -54,7 +54,7 @@ void Server::install_application(anbox::protobuf::bridge::InstallApplication con done->Run(); } -void Server::launch_application(anbox::protobuf::bridge::LaunchApplication const *request, +void PlatformApi::launch_application(anbox::protobuf::bridge::LaunchApplication const *request, anbox::protobuf::bridge::Void *response, google::protobuf::Closure *done) { (void) response; @@ -75,7 +75,7 @@ void Server::launch_application(anbox::protobuf::bridge::LaunchApplication const done->Run(); } -void Server::set_dns_servers(anbox::protobuf::bridge::SetDnsServers const *request, +void PlatformApi::set_dns_servers(anbox::protobuf::bridge::SetDnsServers const *request, anbox::protobuf::bridge::Void *response, google::protobuf::Closure *done) { (void) response; diff --git a/android/service/server.h b/android/service/platform_api.h similarity index 92% rename from android/service/server.h rename to android/service/platform_api.h index 9407982..9337145 100644 --- a/android/service/server.h +++ b/android/service/platform_api.h @@ -15,8 +15,8 @@ * */ -#ifndef ANBOX_ANDROID_SERVER_H_ -#define ANBOX_ANDROID_SERVER_H_ +#ifndef ANBOX_ANDROID_PLATFORM_API_H_ +#define ANBOX_ANDROID_PLATFORM_API_H_ namespace google { namespace protobuf { @@ -34,10 +34,10 @@ class Void; } // namespace bridge } // namespace protobuf namespace android { -class Server { +class PlatformApi { public: - Server(); - ~Server(); + PlatformApi(); + ~PlatformApi(); void install_application(anbox::protobuf::bridge::InstallApplication const *request, anbox::protobuf::bridge::Void *response,