Commit e0491c0b authored by Jeffrey Kardatzke's avatar Jeffrey Kardatzke Committed by Commit Bot

Use cicerone instead of concierge for container communication

This finishes the refactoring on the Chrome side of things so that it
communicates with cicerone instead of concierge for all communication
that goes to the container. Once this is merged and Chrome OS is uprev'd
to use the version of Chrome with this CL we can remove all of the
corresponding calls from concierge.

Bug: 842845
Test: Verified all related container functionality
Change-Id: Ia44796333b2e12e243a899477d5ca2581374166a
Reviewed-on: https://chromium-review.googlesource.com/1097939
Commit-Queue: Jeffrey Kardatzke <jkardatzke@google.com>
Reviewed-by: default avatarDan Erat <derat@chromium.org>
Reviewed-by: default avatarTimothy Loh <timloh@chromium.org>
Reviewed-by: default avatarNicholas Verne <nverne@chromium.org>
Cr-Commit-Position: refs/heads/master@{#566952}
parent 94570502
......@@ -9,13 +9,6 @@
<policy user="chronos">
<allow own="org.chromium.UrlHandlerService"/>
</policy>
<!-- TODO(jkardatzke): Remove crosvm when Chrome migrates to cicerone -->
<policy user="crosvm">
<!-- methods allowed -->
<allow send_destination="org.chromium.UrlHandlerService"
send_interface="org.chromium.UrlHandlerServiceInterface"
send_member="OpenUrl"/>
</policy>
<policy user="vm_cicerone">
<!-- methods allowed -->
<allow send_destination="org.chromium.UrlHandlerService"
......
......@@ -678,8 +678,7 @@ void CrostiniManager::StartContainer(std::string vm_name,
std::move(callback).Run(ConciergeClientResult::CLIENT_ERROR);
return;
}
if (!GetConciergeClient()->IsContainerStartedSignalConnected() ||
!GetConciergeClient()->IsContainerStartupFailedSignalConnected() ||
if (!GetConciergeClient()->IsContainerStartupFailedSignalConnected() ||
!GetCiceroneClient()->IsContainerStartedSignalConnected() ||
!GetCiceroneClient()->IsContainerShutdownSignalConnected()) {
LOG(ERROR) << "Async call to StartContainer can't complete when signal "
......@@ -707,13 +706,13 @@ void CrostiniManager::LaunchContainerApplication(
std::string container_name,
std::string desktop_file_id,
LaunchContainerApplicationCallback callback) {
vm_tools::concierge::LaunchContainerApplicationRequest request;
vm_tools::cicerone::LaunchContainerApplicationRequest request;
request.set_owner_id(CryptohomeIdForProfile(profile));
request.set_vm_name(std::move(vm_name));
request.set_container_name(std::move(container_name));
request.set_desktop_file_id(std::move(desktop_file_id));
GetConciergeClient()->LaunchContainerApplication(
GetCiceroneClient()->LaunchContainerApplication(
std::move(request),
base::BindOnce(&CrostiniManager::OnLaunchContainerApplication,
weak_ptr_factory_.GetWeakPtr(), std::move(callback)));
......@@ -727,7 +726,7 @@ void CrostiniManager::GetContainerAppIcons(
int icon_size,
int scale,
GetContainerAppIconsCallback callback) {
vm_tools::concierge::ContainerAppIconRequest request;
vm_tools::cicerone::ContainerAppIconRequest request;
request.set_owner_id(CryptohomeIdForProfile(profile));
request.set_vm_name(std::move(vm_name));
request.set_container_name(std::move(container_name));
......@@ -738,7 +737,7 @@ void CrostiniManager::GetContainerAppIcons(
request.set_size(icon_size);
request.set_scale(scale);
GetConciergeClient()->GetContainerAppIcons(
GetCiceroneClient()->GetContainerAppIcons(
std::move(request),
base::BindOnce(&CrostiniManager::OnGetContainerAppIcons,
weak_ptr_factory_.GetWeakPtr(), std::move(callback)));
......@@ -964,15 +963,10 @@ void CrostiniManager::OnStartContainer(
}
void CrostiniManager::OnContainerStarted(
const vm_tools::concierge::ContainerStartedSignal& signal) {
const vm_tools::cicerone::ContainerStartedSignal& signal) {
// Find the callbacks to call, then erase them from the map.
std::string owner_id = signal.owner_id();
// TODO(nverne): remove this check once Concierge always fills in owner_id.
if (owner_id.empty()) {
owner_id = CryptohomeIdForProfile(ProfileManager::GetPrimaryUserProfile());
}
auto range = start_container_callbacks_.equal_range(
std::make_tuple(owner_id, signal.vm_name(), signal.container_name()));
auto range = start_container_callbacks_.equal_range(std::make_tuple(
signal.owner_id(), signal.vm_name(), signal.container_name()));
for (auto it = range.first; it != range.second; ++it) {
std::move(it->second).Run(ConciergeClientResult::SUCCESS);
}
......@@ -982,45 +976,19 @@ void CrostiniManager::OnContainerStarted(
void CrostiniManager::OnContainerStartupFailed(
const vm_tools::concierge::ContainerStartedSignal& signal) {
// Find the callbacks to call, then erase them from the map.
std::string owner_id = signal.owner_id();
// TODO(nverne): remove this check once Concierge always fills in owner_id.
if (owner_id.empty()) {
owner_id = CryptohomeIdForProfile(ProfileManager::GetPrimaryUserProfile());
}
auto range = start_container_callbacks_.equal_range(
std::make_tuple(owner_id, signal.vm_name(), signal.container_name()));
auto range = start_container_callbacks_.equal_range(std::make_tuple(
signal.owner_id(), signal.vm_name(), signal.container_name()));
for (auto it = range.first; it != range.second; ++it) {
std::move(it->second).Run(ConciergeClientResult::CONTAINER_START_FAILED);
}
start_container_callbacks_.erase(range.first, range.second);
}
void CrostiniManager::OnContainerStarted(
const vm_tools::cicerone::ContainerStartedSignal& signal) {
// Find the callbacks to call, then erase them from the map.
std::string owner_id = signal.owner_id();
// TODO(jkardatzke): remove this check once Cicerone always fills in owner_id.
if (owner_id.empty()) {
owner_id = CryptohomeIdForProfile(ProfileManager::GetPrimaryUserProfile());
}
auto range = start_container_callbacks_.equal_range(
std::make_tuple(owner_id, signal.vm_name(), signal.container_name()));
for (auto it = range.first; it != range.second; ++it) {
std::move(it->second).Run(ConciergeClientResult::SUCCESS);
}
start_container_callbacks_.erase(range.first, range.second);
}
void CrostiniManager::OnContainerShutdown(
const vm_tools::cicerone::ContainerShutdownSignal& signal) {
// Find the callbacks to call, then erase them from the map.
std::string owner_id = signal.owner_id();
// TODO(joelhockey): remove this check once Cicerone always fills in owner_id.
if (owner_id.empty()) {
owner_id = CryptohomeIdForProfile(ProfileManager::GetPrimaryUserProfile());
}
auto range = shutdown_container_callbacks_.equal_range(
std::make_tuple(owner_id, signal.vm_name(), signal.container_name()));
auto range = shutdown_container_callbacks_.equal_range(std::make_tuple(
signal.owner_id(), signal.vm_name(), signal.container_name()));
for (auto it = range.first; it != range.second; ++it) {
std::move(it->second).Run();
}
......@@ -1029,7 +997,7 @@ void CrostiniManager::OnContainerShutdown(
void CrostiniManager::OnLaunchContainerApplication(
LaunchContainerApplicationCallback callback,
base::Optional<vm_tools::concierge::LaunchContainerApplicationResponse>
base::Optional<vm_tools::cicerone::LaunchContainerApplicationResponse>
reply) {
if (!reply.has_value()) {
LOG(ERROR) << "Failed to launch application. Empty response.";
......@@ -1037,7 +1005,7 @@ void CrostiniManager::OnLaunchContainerApplication(
ConciergeClientResult::LAUNCH_CONTAINER_APPLICATION_FAILED);
return;
}
vm_tools::concierge::LaunchContainerApplicationResponse response =
vm_tools::cicerone::LaunchContainerApplicationResponse response =
reply.value();
if (!response.success()) {
......@@ -1051,14 +1019,14 @@ void CrostiniManager::OnLaunchContainerApplication(
void CrostiniManager::OnGetContainerAppIcons(
GetContainerAppIconsCallback callback,
base::Optional<vm_tools::concierge::ContainerAppIconResponse> reply) {
base::Optional<vm_tools::cicerone::ContainerAppIconResponse> reply) {
std::vector<Icon> icons;
if (!reply.has_value()) {
LOG(ERROR) << "Failed to get container application icons. Empty response.";
std::move(callback).Run(ConciergeClientResult::DBUS_ERROR, icons);
return;
}
vm_tools::concierge::ContainerAppIconResponse response = reply.value();
vm_tools::cicerone::ContainerAppIconResponse response = reply.value();
for (auto& icon : *response.mutable_icons()) {
icons.emplace_back(
Icon{.desktop_file_id = std::move(*icon.mutable_desktop_file_id()),
......
......@@ -237,8 +237,6 @@ class CrostiniManager : public chromeos::ConciergeClient::Observer,
ShutdownContainerCallback shutdown_callback);
// ConciergeClient::Observer:
void OnContainerStarted(
const vm_tools::concierge::ContainerStartedSignal& signal) override;
void OnContainerStartupFailed(
const vm_tools::concierge::ContainerStartedSignal& signal) override;
......@@ -311,14 +309,14 @@ class CrostiniManager : public chromeos::ConciergeClient::Observer,
// Callback for CrostiniManager::LaunchContainerApplication.
void OnLaunchContainerApplication(
LaunchContainerApplicationCallback callback,
base::Optional<vm_tools::concierge::LaunchContainerApplicationResponse>
base::Optional<vm_tools::cicerone::LaunchContainerApplicationResponse>
reply);
// Callback for CrostiniManager::GetContainerAppIcons. Called after the
// Concierge service finishes.
void OnGetContainerAppIcons(
GetContainerAppIconsCallback callback,
base::Optional<vm_tools::concierge::ContainerAppIconResponse> reply);
base::Optional<vm_tools::cicerone::ContainerAppIconResponse> reply);
// Callback for CrostiniManager::GetContainerSshKeys. Called after the
// Concierge service finishes.
......
......@@ -341,16 +341,7 @@ TEST_F(CrostiniManagerTest, StartContainerContainerCryptohomeIdError) {
run_loop()->Run();
}
TEST_F(CrostiniManagerTest, StartContainerSignalConciergeNotConnectedError) {
fake_concierge_client_->set_container_started_signal_connected(false);
CrostiniManager::GetInstance()->StartContainer(
kVmName, kContainerName, kContainerUserName, kCryptohomeId,
base::BindOnce(&CrostiniManagerTest::StartContainerClientErrorCallback,
base::Unretained(this), run_loop()->QuitClosure()));
run_loop()->Run();
}
TEST_F(CrostiniManagerTest, StartContainerSignalCiceroneNotConnectedError) {
TEST_F(CrostiniManagerTest, StartContainerSignalNotConnectedError) {
fake_cicerone_client_->set_container_started_signal_connected(false);
CrostiniManager::GetInstance()->StartContainer(
kVmName, kContainerName, kContainerUserName, kCryptohomeId,
......@@ -359,7 +350,7 @@ TEST_F(CrostiniManagerTest, StartContainerSignalCiceroneNotConnectedError) {
run_loop()->Run();
}
TEST_F(CrostiniManagerTest, ShutdownContainerSignalCiceroneNotConnectedError) {
TEST_F(CrostiniManagerTest, ShutdownContainerSignalNotConnectedError) {
fake_cicerone_client_->set_container_shutdown_signal_connected(false);
CrostiniManager::GetInstance()->StartContainer(
kVmName, kContainerName, kContainerUserName, kCryptohomeId,
......
......@@ -33,10 +33,6 @@ class ConciergeClientImpl : public ConciergeClient {
observer_list_.RemoveObserver(observer);
}
bool IsContainerStartedSignalConnected() override {
return is_container_started_signal_connected_;
}
bool IsContainerStartupFailedSignalConnected() override {
return is_container_startup_failed_signal_connected_;
}
......@@ -164,53 +160,6 @@ class ConciergeClientImpl : public ConciergeClient {
weak_ptr_factory_.GetWeakPtr(), std::move(callback)));
}
void LaunchContainerApplication(
const vm_tools::concierge::LaunchContainerApplicationRequest& request,
DBusMethodCallback<
vm_tools::concierge::LaunchContainerApplicationResponse> callback)
override {
dbus::MethodCall method_call(
vm_tools::concierge::kVmConciergeInterface,
vm_tools::concierge::kLaunchContainerApplicationMethod);
dbus::MessageWriter writer(&method_call);
if (!writer.AppendProtoAsArrayOfBytes(request)) {
LOG(ERROR)
<< "Failed to encode LaunchContainerApplicationRequest protobuf";
std::move(callback).Run(base::nullopt);
return;
}
concierge_proxy_->CallMethod(
&method_call, dbus::ObjectProxy::TIMEOUT_INFINITE,
base::BindOnce(
&ConciergeClientImpl::OnDBusProtoResponse<
vm_tools::concierge::LaunchContainerApplicationResponse>,
weak_ptr_factory_.GetWeakPtr(), std::move(callback)));
}
void GetContainerAppIcons(
const vm_tools::concierge::ContainerAppIconRequest& request,
DBusMethodCallback<vm_tools::concierge::ContainerAppIconResponse>
callback) override {
dbus::MethodCall method_call(
vm_tools::concierge::kVmConciergeInterface,
vm_tools::concierge::kGetContainerAppIconMethod);
dbus::MessageWriter writer(&method_call);
if (!writer.AppendProtoAsArrayOfBytes(request)) {
LOG(ERROR) << "Failed to encode ContainerAppIonRequest protobuf";
std::move(callback).Run(base::nullopt);
return;
}
concierge_proxy_->CallMethod(
&method_call, dbus::ObjectProxy::TIMEOUT_INFINITE,
base::BindOnce(&ConciergeClientImpl::OnDBusProtoResponse<
vm_tools::concierge::ContainerAppIconResponse>,
weak_ptr_factory_.GetWeakPtr(), std::move(callback)));
}
void WaitForServiceToBeAvailable(
dbus::ObjectProxy::WaitForServiceToBeAvailableCallback callback)
override {
......@@ -248,13 +197,6 @@ class ConciergeClientImpl : public ConciergeClient {
LOG(ERROR) << "Unable to get dbus proxy for "
<< vm_tools::concierge::kVmConciergeServiceName;
}
concierge_proxy_->ConnectToSignal(
vm_tools::concierge::kVmConciergeInterface,
vm_tools::concierge::kContainerStartedSignal,
base::BindRepeating(&ConciergeClientImpl::OnContainerStartedSignal,
weak_ptr_factory_.GetWeakPtr()),
base::BindOnce(&ConciergeClientImpl::OnSignalConnected,
weak_ptr_factory_.GetWeakPtr()));
concierge_proxy_->ConnectToSignal(
vm_tools::concierge::kVmConciergeInterface,
vm_tools::concierge::kContainerStartupFailedSignal,
......@@ -283,24 +225,6 @@ class ConciergeClientImpl : public ConciergeClient {
std::move(callback).Run(std::move(reponse_proto));
}
void OnContainerStartedSignal(dbus::Signal* signal) {
DCHECK_EQ(signal->GetInterface(),
vm_tools::concierge::kVmConciergeInterface);
DCHECK_EQ(signal->GetMember(),
vm_tools::concierge::kContainerStartedSignal);
vm_tools::concierge::ContainerStartedSignal container_started_signal;
dbus::MessageReader reader(signal);
if (!reader.PopArrayOfBytesAsProto(&container_started_signal)) {
LOG(ERROR) << "Failed to parse proto from DBus Signal";
return;
}
// Tell our Observers.
for (auto& observer : observer_list_) {
observer.OnContainerStarted(container_started_signal);
}
}
void OnContainerStartupFailedSignal(dbus::Signal* signal) {
DCHECK_EQ(signal->GetInterface(),
vm_tools::concierge::kVmConciergeInterface);
......@@ -323,25 +247,18 @@ class ConciergeClientImpl : public ConciergeClient {
const std::string& signal_name,
bool is_connected) {
DCHECK_EQ(interface_name, vm_tools::concierge::kVmConciergeInterface);
DCHECK_EQ(signal_name, vm_tools::concierge::kContainerStartupFailedSignal);
if (!is_connected) {
LOG(ERROR)
<< "Failed to connect to Signal. Async StartContainer will not work";
}
if (signal_name == vm_tools::concierge::kContainerStartedSignal) {
is_container_started_signal_connected_ = is_connected;
} else if (signal_name ==
vm_tools::concierge::kContainerStartupFailedSignal) {
is_container_startup_failed_signal_connected_ = is_connected;
} else {
NOTREACHED();
}
is_container_startup_failed_signal_connected_ = is_connected;
}
dbus::ObjectProxy* concierge_proxy_ = nullptr;
base::ObserverList<Observer> observer_list_;
bool is_container_started_signal_connected_ = false;
bool is_container_startup_failed_signal_connected_ = false;
// Note: This should remain the last member so it'll be destroyed and
......
......@@ -19,11 +19,6 @@ class CHROMEOS_EXPORT ConciergeClient : public DBusClient {
public:
class Observer {
public:
// OnContainerStarted is signaled by Concierge after the long-running
// container startup process has been completed and the container is ready.
virtual void OnContainerStarted(
const vm_tools::concierge::ContainerStartedSignal& signal) = 0;
// OnContainerStartupFailed is signaled by Concierge after the long-running
// container startup process's failure is detected. Note the signal protocol
// buffer type is the same as in OnContainerStarted.
......@@ -40,10 +35,6 @@ class CHROMEOS_EXPORT ConciergeClient : public DBusClient {
// Removes an observer if added.
virtual void RemoveObserver(Observer* observer) = 0;
// IsContainerStartedSignalConnected must return true before StartContainer
// is called.
virtual bool IsContainerStartedSignalConnected() = 0;
// IsContainerStartupFailedSignalConnected must return true before
// StartContainer is called.
virtual bool IsContainerStartupFailedSignalConnected() = 0;
......@@ -88,21 +79,6 @@ class CHROMEOS_EXPORT ConciergeClient : public DBusClient {
DBusMethodCallback<vm_tools::concierge::StartContainerResponse>
callback) = 0;
// Launches an application inside a running Container.
// |callback| is called after the method call finishes.
virtual void LaunchContainerApplication(
const vm_tools::concierge::LaunchContainerApplicationRequest& request,
DBusMethodCallback<
vm_tools::concierge::LaunchContainerApplicationResponse>
callback) = 0;
// Gets application icons from inside a Container.
// |callback| is called after the method call finishes.
virtual void GetContainerAppIcons(
const vm_tools::concierge::ContainerAppIconRequest& request,
DBusMethodCallback<vm_tools::concierge::ContainerAppIconResponse>
callback) = 0;
// Registers |callback| to run when the Concierge service becomes available.
// If the service is already available, or if connecting to the name-owner-
// changed signal fails, |callback| will be run once asynchronously.
......
......@@ -8,7 +8,12 @@
namespace chromeos {
FakeCiceroneClient::FakeCiceroneClient() {}
FakeCiceroneClient::FakeCiceroneClient() {
launch_container_application_response_.Clear();
launch_container_application_response_.set_success(true);
container_app_icon_response_.Clear();
}
FakeCiceroneClient::~FakeCiceroneClient() = default;
void FakeCiceroneClient::AddObserver(Observer* observer) {
......@@ -31,18 +36,17 @@ void FakeCiceroneClient::LaunchContainerApplication(
const vm_tools::cicerone::LaunchContainerApplicationRequest& request,
DBusMethodCallback<vm_tools::cicerone::LaunchContainerApplicationResponse>
callback) {
vm_tools::cicerone::LaunchContainerApplicationResponse response;
response.set_success(true);
base::ThreadTaskRunnerHandle::Get()->PostTask(
FROM_HERE, base::BindOnce(std::move(callback), std::move(response)));
FROM_HERE, base::BindOnce(std::move(callback),
launch_container_application_response_));
}
void FakeCiceroneClient::GetContainerAppIcons(
const vm_tools::cicerone::ContainerAppIconRequest& request,
DBusMethodCallback<vm_tools::cicerone::ContainerAppIconResponse> callback) {
vm_tools::cicerone::ContainerAppIconResponse response;
base::ThreadTaskRunnerHandle::Get()->PostTask(
FROM_HERE, base::BindOnce(std::move(callback), std::move(response)));
FROM_HERE,
base::BindOnce(std::move(callback), container_app_icon_response_));
}
void FakeCiceroneClient::WaitForServiceToBeAvailable(
......
......@@ -58,12 +58,28 @@ class CHROMEOS_EXPORT FakeCiceroneClient : public CiceroneClient {
is_container_shutdown_signal_connected_ = connected;
}
void set_launch_container_application_response(
const vm_tools::cicerone::LaunchContainerApplicationResponse&
launch_container_application_response) {
launch_container_application_response_ =
launch_container_application_response;
}
void set_container_app_icon_response(
const vm_tools::cicerone::ContainerAppIconResponse&
container_app_icon_response) {
container_app_icon_response_ = container_app_icon_response;
}
protected:
void Init(dbus::Bus* bus) override {}
private:
bool is_container_started_signal_connected_ = true;
bool is_container_shutdown_signal_connected_ = true;
vm_tools::cicerone::LaunchContainerApplicationResponse
launch_container_application_response_;
vm_tools::cicerone::ContainerAppIconResponse container_app_icon_response_;
base::ObserverList<Observer> observer_list_;
DISALLOW_COPY_AND_ASSIGN(FakeCiceroneClient);
......
......@@ -25,11 +25,6 @@ void FakeConciergeClient::RemoveObserver(Observer* observer) {
observer_list_.RemoveObserver(observer);
}
// ConciergeClient override.
bool FakeConciergeClient::IsContainerStartedSignalConnected() {
return is_container_started_signal_connected_;
}
// ConciergeClient override.
bool FakeConciergeClient::IsContainerStartupFailedSignalConnected() {
return is_container_startup_failed_signal_connected_;
......@@ -89,24 +84,6 @@ void FakeConciergeClient::StartContainer(
base::BindOnce(std::move(callback), start_container_response_));
}
void FakeConciergeClient::LaunchContainerApplication(
const vm_tools::concierge::LaunchContainerApplicationRequest& request,
DBusMethodCallback<vm_tools::concierge::LaunchContainerApplicationResponse>
callback) {
base::ThreadTaskRunnerHandle::Get()->PostTask(
FROM_HERE, base::BindOnce(std::move(callback),
launch_container_application_response_));
}
void FakeConciergeClient::GetContainerAppIcons(
const vm_tools::concierge::ContainerAppIconRequest& request,
DBusMethodCallback<vm_tools::concierge::ContainerAppIconResponse>
callback) {
base::ThreadTaskRunnerHandle::Get()->PostTask(
FROM_HERE,
base::BindOnce(std::move(callback), container_app_icon_response_));
}
void FakeConciergeClient::WaitForServiceToBeAvailable(
dbus::ObjectProxy::WaitForServiceToBeAvailableCallback callback) {
base::ThreadTaskRunnerHandle::Get()->PostTask(
......@@ -145,10 +122,6 @@ void FakeConciergeClient::InitializeProtoResponses() {
start_container_response_.set_status(
vm_tools::concierge::CONTAINER_STATUS_RUNNING);
launch_container_application_response_.Clear();
launch_container_application_response_.set_success(true);
container_app_icon_response_.Clear();
container_ssh_keys_response_.Clear();
}
......
......@@ -22,10 +22,6 @@ class CHROMEOS_EXPORT FakeConciergeClient : public ConciergeClient {
// Removes an observer if added.
void RemoveObserver(Observer* observer) override;
// IsContainerStartedSignalConnected must return true before StartContainer
// is called.
bool IsContainerStartedSignalConnected() override;
// IsContainerStartupFailedSignalConnected must return true before
// StartContainer is called.
bool IsContainerStartupFailedSignalConnected() override;
......@@ -75,21 +71,6 @@ class CHROMEOS_EXPORT FakeConciergeClient : public ConciergeClient {
DBusMethodCallback<vm_tools::concierge::StartContainerResponse> callback)
override;
// Fake version of the method that launches an application inside a running
// Container. |callback| is called after the method call finishes.
void LaunchContainerApplication(
const vm_tools::concierge::LaunchContainerApplicationRequest& request,
DBusMethodCallback<
vm_tools::concierge::LaunchContainerApplicationResponse> callback)
override;
// Fake version of the method that gets application icons from inside a
// Container. |callback| is called after the method call finishes.
void GetContainerAppIcons(
const vm_tools::concierge::ContainerAppIconRequest& request,
DBusMethodCallback<vm_tools::concierge::ContainerAppIconResponse>
callback) override;
// Fake version of the method that waits for the Concierge service to be
// availble. |callback| is called after the method call finishes.
void WaitForServiceToBeAvailable(
......@@ -114,11 +95,7 @@ class CHROMEOS_EXPORT FakeConciergeClient : public ConciergeClient {
bool stop_vm_called() const { return stop_vm_called_; }
// Indicates whether StartContainer has been called
bool start_container_called() const { return start_container_called_; }
// Set ContainerStartedSignalConnected state
void set_container_started_signal_connected(bool connected) {
is_container_started_signal_connected_ = connected;
}
// Set ContainerStartedSignalConnected state
// Set ContainerStartupFailedSignalConnected state
void set_container_startup_failed_signal_connected(bool connected) {
is_container_startup_failed_signal_connected_ = connected;
}
......@@ -150,17 +127,6 @@ class CHROMEOS_EXPORT FakeConciergeClient : public ConciergeClient {
start_container_response) {
start_container_response_ = start_container_response;
}
void set_launch_container_application_response(
const vm_tools::concierge::LaunchContainerApplicationResponse&
launch_container_application_response) {
launch_container_application_response_ =
launch_container_application_response;
}
void set_container_app_icon_response(
const vm_tools::concierge::ContainerAppIconResponse&
container_app_icon_response) {
container_app_icon_response_ = container_app_icon_response;
}
void set_container_ssh_keys_response(
const vm_tools::concierge::ContainerSshKeysResponse&
container_ssh_keys_response) {
......@@ -179,7 +145,6 @@ class CHROMEOS_EXPORT FakeConciergeClient : public ConciergeClient {
bool start_termina_vm_called_ = false;
bool stop_vm_called_ = false;
bool start_container_called_ = false;
bool is_container_started_signal_connected_ = true;
bool is_container_startup_failed_signal_connected_ = true;
vm_tools::concierge::CreateDiskImageResponse create_disk_image_response_;
......@@ -188,9 +153,6 @@ class CHROMEOS_EXPORT FakeConciergeClient : public ConciergeClient {
vm_tools::concierge::StartVmResponse start_vm_response_;
vm_tools::concierge::StopVmResponse stop_vm_response_;
vm_tools::concierge::StartContainerResponse start_container_response_;
vm_tools::concierge::LaunchContainerApplicationResponse
launch_container_application_response_;
vm_tools::concierge::ContainerAppIconResponse container_app_icon_response_;
vm_tools::concierge::ContainerSshKeysResponse container_ssh_keys_response_;
base::ObserverList<Observer> observer_list_;
......
......@@ -11,12 +11,6 @@
<allow own="org.chromium.VmApplicationsService"/>
</policy>
<!-- TODO(jkardatzke):Remove the one for crosvm once we migrate Chrome to cicerone -->
<!-- The concierge service runs as crosvm -->
<policy user="crosvm">
<allow send_destination="org.chromium.VmApplicationsService"
send_interface="org.chromium.VmApplicationsService"/>
</policy>
<policy user="vm_cicerone">
<allow send_destination="org.chromium.VmApplicationsService"
send_interface="org.chromium.VmApplicationsService"/>
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment