Rename server class to PlatformApi

This commit is contained in:
Simon Fels 2016-06-30 00:02:02 +02:00
commit 175c605e54
8 changed files with 27 additions and 27 deletions

View file

@ -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 \

View file

@ -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

View file

@ -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 <functional>
#include <array>
@ -28,8 +28,8 @@ namespace android {
HostConnector::HostConnector() :
socket_(std::make_shared<LocalSocketConnection>("/dev/anbox_bridge")),
pending_calls_(std::make_shared<bridge::PendingCallCache>()),
server_(std::make_shared<Server>()),
message_processor_(std::make_shared<MessageProcessor>(socket_, pending_calls_, server_)),
platform_api_(std::make_shared<PlatformApi>()),
message_processor_(std::make_shared<MessageProcessor>(socket_, pending_calls_, platform_api_)),
running_(false) {
}

View file

@ -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<LocalSocketConnection> socket_;
std::shared_ptr<bridge::PendingCallCache> pending_calls_;
std::shared_ptr<Server> server_;
std::shared_ptr<PlatformApi> platform_api_;
std::shared_ptr<MessageProcessor> message_processor_;
std::thread thread_;
std::atomic<bool> running_;

View file

@ -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<network::MessageSender> &sender,
const std::shared_ptr<bridge::PendingCallCache> &pending_calls,
const std::shared_ptr<Server> &server) :
const std::shared_ptr<PlatformApi> &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&) {

View file

@ -22,19 +22,19 @@
namespace anbox {
namespace android {
class Server;
class PlatformApi;
class MessageProcessor : public bridge::MessageProcessor {
public:
MessageProcessor(const std::shared_ptr<network::MessageSender> &sender,
const std::shared_ptr<bridge::PendingCallCache> &pending_calls,
const std::shared_ptr<Server> &server);
const std::shared_ptr<PlatformApi> &platform_api);
~MessageProcessor();
void dispatch(bridge::Invocation const& invocation) override;
void process_event_sequence(const std::string &event) override;
private:
std::shared_ptr<Server> server_;
std::shared_ptr<PlatformApi> platform_api_;
};
} // namespace anbox
} // namespace network

View file

@ -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<std::string,std::string> 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;

View file

@ -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,