Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(77)

Unified Diff: components/arc/test/fake_arc_bridge_bootstrap.cc

Issue 2379223004: Switch from Delegate to Observer. (Closed)
Patch Set: Rebase Created 4 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « components/arc/test/fake_arc_bridge_bootstrap.h ('k') | components/arc/test/fake_arc_bridge_instance.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: components/arc/test/fake_arc_bridge_bootstrap.cc
diff --git a/components/arc/test/fake_arc_bridge_bootstrap.cc b/components/arc/test/fake_arc_bridge_bootstrap.cc
index 5c2c2b9d83c1fe3d5e3a2a5859d207bb79dcc59d..8f4c3f729b5a978995908925f5e5be5adc663e04 100644
--- a/components/arc/test/fake_arc_bridge_bootstrap.cc
+++ b/components/arc/test/fake_arc_bridge_bootstrap.cc
@@ -5,7 +5,6 @@
#include "components/arc/test/fake_arc_bridge_bootstrap.h"
#include <memory>
-#include <utility>
#include "base/logging.h"
#include "base/memory/ptr_util.h"
@@ -17,13 +16,11 @@ FakeArcBridgeBootstrap::FakeArcBridgeBootstrap() = default;
FakeArcBridgeBootstrap::~FakeArcBridgeBootstrap() = default;
void FakeArcBridgeBootstrap::Start() {
- DCHECK(delegate_);
if (boot_failure_emulation_enabled_) {
- delegate_->OnStopped(boot_failure_reason_);
+ FOR_EACH_OBSERVER(Observer, observer_list_,
+ OnStopped(boot_failure_reason_));
} else if (!boot_suspended_) {
- mojom::ArcBridgeInstancePtr instance_ptr;
- instance_.Bind(mojo::GetProxy(&instance_ptr));
- delegate_->OnConnectionEstablished(std::move(instance_ptr));
+ FOR_EACH_OBSERVER(Observer, observer_list_, OnReady());
}
}
@@ -33,9 +30,7 @@ void FakeArcBridgeBootstrap::Stop() {
void FakeArcBridgeBootstrap::StopWithReason(
ArcBridgeService::StopReason reason) {
- DCHECK(delegate_);
- instance_.Unbind();
- delegate_->OnStopped(reason);
+ FOR_EACH_OBSERVER(Observer, observer_list_, OnStopped(reason));
}
void FakeArcBridgeBootstrap::EnableBootFailureEmulation(
« no previous file with comments | « components/arc/test/fake_arc_bridge_bootstrap.h ('k') | components/arc/test/fake_arc_bridge_instance.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698