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

Unified Diff: components/arc/bluetooth/arc_bluetooth_bridge.cc

Issue 2357053002: Always use arc::InstanceHolder<T>::GetInstanceForMethod (Closed)
Patch Set: rebase, no code change Created 4 years, 3 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
Index: components/arc/bluetooth/arc_bluetooth_bridge.cc
diff --git a/components/arc/bluetooth/arc_bluetooth_bridge.cc b/components/arc/bluetooth/arc_bluetooth_bridge.cc
index 08059b527de01956fae81f1534a3ab5b89e91d8c..6d43d563199ef82754b4738a5a433caea2323bf0 100644
--- a/components/arc/bluetooth/arc_bluetooth_bridge.cc
+++ b/components/arc/bluetooth/arc_bluetooth_bridge.cc
@@ -290,19 +290,15 @@ void ArcBluetoothBridge::OnAdapterInitialized(
// register ourselves as an observer with it then. Since our adapter is
// ready, we should register it now.
if (!bluetooth_adapter_->HasObserver(this) &&
- arc_bridge_service()->bluetooth()->instance()) {
+ arc_bridge_service()->bluetooth()->has_instance()) {
bluetooth_adapter_->AddObserver(this);
}
}
void ArcBluetoothBridge::OnInstanceReady() {
mojom::BluetoothInstance* bluetooth_instance =
- arc_bridge_service()->bluetooth()->instance();
- if (!bluetooth_instance) {
- LOG(ERROR) << "OnBluetoothInstanceReady called, "
- << "but no bluetooth instance found";
- return;
- }
+ arc_bridge_service()->bluetooth()->GetInstanceForMethod("Init");
+ DCHECK(bluetooth_instance);
bluetooth_instance->Init(binding_.CreateInterfacePtrAndBind());
« no previous file with comments | « components/arc/audio/arc_audio_bridge.cc ('k') | components/arc/boot_phase_monitor/arc_boot_phase_monitor_bridge.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698