| Index: components/arc/arc_session.cc
|
| diff --git a/components/arc/arc_session.cc b/components/arc/arc_session.cc
|
| index c063a64574273278a690b13e2d8c49e40426f0a0..c369d28c9c4e8c1501e9ced66c5270959a20463b 100644
|
| --- a/components/arc/arc_session.cc
|
| +++ b/components/arc/arc_session.cc
|
| @@ -28,7 +28,6 @@
|
| #include "chromeos/dbus/session_manager_client.h"
|
| #include "components/arc/arc_bridge_host_impl.h"
|
| #include "components/arc/arc_features.h"
|
| -#include "components/arc/arc_session_observer.h"
|
| #include "components/user_manager/user_manager.h"
|
| #include "mojo/edk/embedder/embedder.h"
|
| #include "mojo/edk/embedder/named_platform_handle.h"
|
| @@ -127,7 +126,7 @@ class ArcSessionImpl : public ArcSession,
|
| //
|
| // At any state, Stop() can be called. It does not immediately stop the
|
| // instance, but will eventually stop it.
|
| - // The actual stop will be notified via ArcSessionObserver::OnStopped().
|
| + // The actual stop will be notified via ArcSession::Observer::OnStopped().
|
| //
|
| // When Stop() is called, it makes various behavior based on the current
|
| // phase.
|
| @@ -235,7 +234,7 @@ class ArcSessionImpl : public ArcSession,
|
| void ArcInstanceStopped(bool clean) override;
|
|
|
| // Completes the termination procedure.
|
| - void OnStopped(ArcSessionObserver::StopReason reason);
|
| + void OnStopped(ArcStopReason reason);
|
|
|
| // Checks whether a function runs on the thread where the instance is
|
| // created.
|
| @@ -346,13 +345,13 @@ void ArcSessionImpl::OnSocketCreated(
|
|
|
| if (stop_requested_) {
|
| VLOG(1) << "Stop() called while connecting";
|
| - OnStopped(ArcSessionObserver::StopReason::SHUTDOWN);
|
| + OnStopped(ArcStopReason::SHUTDOWN);
|
| return;
|
| }
|
|
|
| if (!socket_fd.is_valid()) {
|
| LOG(ERROR) << "ARC: Error creating socket";
|
| - OnStopped(ArcSessionObserver::StopReason::GENERIC_BOOT_FAILURE);
|
| + OnStopped(ArcStopReason::GENERIC_BOOT_FAILURE);
|
| return;
|
| }
|
|
|
| @@ -393,15 +392,15 @@ void ArcSessionImpl::OnInstanceStarted(
|
| StopArcInstance();
|
| return;
|
| }
|
| - OnStopped(ArcSessionObserver::StopReason::SHUTDOWN);
|
| + OnStopped(ArcStopReason::SHUTDOWN);
|
| return;
|
| }
|
|
|
| if (result != StartArcInstanceResult::SUCCESS) {
|
| LOG(ERROR) << "Failed to start ARC instance";
|
| OnStopped(result == StartArcInstanceResult::LOW_FREE_DISK_SPACE
|
| - ? ArcSessionObserver::StopReason::LOW_DISK_SPACE
|
| - : ArcSessionObserver::StopReason::GENERIC_BOOT_FAILURE);
|
| + ? ArcStopReason::LOW_DISK_SPACE
|
| + : ArcStopReason::GENERIC_BOOT_FAILURE);
|
| return;
|
| }
|
|
|
| @@ -412,7 +411,7 @@ void ArcSessionImpl::OnInstanceStarted(
|
| // Stop().
|
| base::ScopedFD cancel_fd;
|
| if (!CreatePipe(&cancel_fd, &accept_cancel_pipe_)) {
|
| - OnStopped(ArcSessionObserver::StopReason::GENERIC_BOOT_FAILURE);
|
| + OnStopped(ArcStopReason::GENERIC_BOOT_FAILURE);
|
| return;
|
| }
|
|
|
| @@ -519,7 +518,7 @@ void ArcSessionImpl::Stop() {
|
| arc_bridge_host_.reset();
|
| switch (state_) {
|
| case State::NOT_STARTED:
|
| - OnStopped(ArcSessionObserver::StopReason::SHUTDOWN);
|
| + OnStopped(ArcStopReason::SHUTDOWN);
|
| return;
|
|
|
| case State::CREATING_SOCKET:
|
| @@ -576,24 +575,24 @@ void ArcSessionImpl::ArcInstanceStopped(bool clean) {
|
| // unlock the BlockingPool thread.
|
| accept_cancel_pipe_.reset();
|
|
|
| - ArcSessionObserver::StopReason reason;
|
| + ArcStopReason reason;
|
| if (stop_requested_) {
|
| // If the ARC instance is stopped after its explicit request,
|
| // return SHUTDOWN.
|
| - reason = ArcSessionObserver::StopReason::SHUTDOWN;
|
| + reason = ArcStopReason::SHUTDOWN;
|
| } else if (clean) {
|
| // If the ARC instance is stopped, but it is not explicitly requested,
|
| // then this is triggered by some failure during the starting procedure.
|
| // Return GENERIC_BOOT_FAILURE for the case.
|
| - reason = ArcSessionObserver::StopReason::GENERIC_BOOT_FAILURE;
|
| + reason = ArcStopReason::GENERIC_BOOT_FAILURE;
|
| } else {
|
| // Otherwise, this is caused by CRASH occured inside of the ARC instance.
|
| - reason = ArcSessionObserver::StopReason::CRASH;
|
| + reason = ArcStopReason::CRASH;
|
| }
|
| OnStopped(reason);
|
| }
|
|
|
| -void ArcSessionImpl::OnStopped(ArcSessionObserver::StopReason reason) {
|
| +void ArcSessionImpl::OnStopped(ArcStopReason reason) {
|
| DCHECK(thread_checker_.CalledOnValidThread());
|
| // OnStopped() should be called once per instance.
|
| DCHECK_NE(state_, State::STOPPED);
|
| @@ -626,7 +625,7 @@ void ArcSessionImpl::OnShutdown() {
|
| // Directly set to the STOPPED stateby OnStopped(). Note that calling
|
| // StopArcInstance() may not work well. At least, because the UI thread is
|
| // already stopped here, ArcInstanceStopped() callback cannot be invoked.
|
| - OnStopped(ArcSessionObserver::StopReason::SHUTDOWN);
|
| + OnStopped(ArcStopReason::SHUTDOWN);
|
| }
|
|
|
| } // namespace
|
| @@ -634,11 +633,11 @@ void ArcSessionImpl::OnShutdown() {
|
| ArcSession::ArcSession() = default;
|
| ArcSession::~ArcSession() = default;
|
|
|
| -void ArcSession::AddObserver(ArcSessionObserver* observer) {
|
| +void ArcSession::AddObserver(Observer* observer) {
|
| observer_list_.AddObserver(observer);
|
| }
|
|
|
| -void ArcSession::RemoveObserver(ArcSessionObserver* observer) {
|
| +void ArcSession::RemoveObserver(Observer* observer) {
|
| observer_list_.RemoveObserver(observer);
|
| }
|
|
|
|
|