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

Unified Diff: components/arc/test/fake_arc_bridge_instance.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_instance.h ('k') | components/arc/test/fake_intent_helper_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_instance.cc
diff --git a/components/arc/test/fake_arc_bridge_instance.cc b/components/arc/test/fake_arc_bridge_instance.cc
deleted file mode 100644
index c1f03f94e6ba218c66fe94e48f4efbcbb6bad0ce..0000000000000000000000000000000000000000
--- a/components/arc/test/fake_arc_bridge_instance.cc
+++ /dev/null
@@ -1,50 +0,0 @@
-// Copyright 2015 The Chromium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-#include "components/arc/test/fake_arc_bridge_instance.h"
-
-#include <utility>
-
-#include "base/run_loop.h"
-
-namespace arc {
-
-FakeArcBridgeInstance::FakeArcBridgeInstance() : binding_(this) {}
-FakeArcBridgeInstance::~FakeArcBridgeInstance() {}
-
-void FakeArcBridgeInstance::Init(mojom::ArcBridgeHostPtr host) {
- host_ptr_ = std::move(host);
- init_calls_++;
-
- // Wake WaitForInitCall().
- if (!quit_closure_.is_null())
- quit_closure_.Run();
- quit_closure_.Reset();
-}
-
-void FakeArcBridgeInstance::Unbind() {
- host_ptr_.reset();
- if (binding_.is_bound())
- binding_.Close();
-}
-
-void FakeArcBridgeInstance::Bind(
- mojo::InterfaceRequest<mojom::ArcBridgeInstance> interface_request) {
- binding_.Bind(std::move(interface_request));
-}
-
-void FakeArcBridgeInstance::WaitForInitCall() {
- base::RunLoop run_loop;
- quit_closure_ = run_loop.QuitClosure();
- binding_.set_connection_error_handler(run_loop.QuitClosure());
- run_loop.Run();
-}
-
-void FakeArcBridgeInstance::Stop(ArcBridgeService::StopReason reason) {
- if (!delegate_)
- return;
- delegate_->OnStopped(reason);
-}
-
-} // namespace arc
« no previous file with comments | « components/arc/test/fake_arc_bridge_instance.h ('k') | components/arc/test/fake_intent_helper_instance.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698