| OLD | NEW |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "components/arc/arc_bridge_service.h" | 5 #include "components/arc/arc_bridge_service.h" |
| 6 | 6 |
| 7 #include <utility> | 7 #include <utility> |
| 8 | 8 |
| 9 #include "base/command_line.h" | 9 #include "base/command_line.h" |
| 10 #include "base/sequenced_task_runner.h" | 10 #include "base/sequenced_task_runner.h" |
| (...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 71 if (crash_collector_instance()) | 71 if (crash_collector_instance()) |
| 72 observer->OnCrashCollectorInstanceReady(); | 72 observer->OnCrashCollectorInstanceReady(); |
| 73 if (ime_instance()) | 73 if (ime_instance()) |
| 74 observer->OnImeInstanceReady(); | 74 observer->OnImeInstanceReady(); |
| 75 if (metrics_instance()) | 75 if (metrics_instance()) |
| 76 observer->OnMetricsInstanceReady(); | 76 observer->OnMetricsInstanceReady(); |
| 77 if (net_instance()) | 77 if (net_instance()) |
| 78 observer->OnNetInstanceReady(); | 78 observer->OnNetInstanceReady(); |
| 79 if (notifications_instance()) | 79 if (notifications_instance()) |
| 80 observer->OnNotificationsInstanceReady(); | 80 observer->OnNotificationsInstanceReady(); |
| 81 if (obb_mounter_instance()) | |
| 82 observer->OnObbMounterInstanceReady(); | |
| 83 if (policy_instance()) | 81 if (policy_instance()) |
| 84 observer->OnPolicyInstanceReady(); | 82 observer->OnPolicyInstanceReady(); |
| 85 if (power_instance()) | 83 if (power_instance()) |
| 86 observer->OnPowerInstanceReady(); | 84 observer->OnPowerInstanceReady(); |
| 87 if (process_instance()) | 85 if (process_instance()) |
| 88 observer->OnProcessInstanceReady(); | 86 observer->OnProcessInstanceReady(); |
| 89 if (storage_manager_instance()) | 87 if (storage_manager_instance()) |
| 90 observer->OnStorageManagerInstanceReady(); | 88 observer->OnStorageManagerInstanceReady(); |
| 91 if (video_instance()) | 89 if (video_instance()) |
| 92 observer->OnVideoInstanceReady(); | 90 observer->OnVideoInstanceReady(); |
| (...skipping 274 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 367 | 365 |
| 368 void ArcBridgeService::CloseNotificationsChannel() { | 366 void ArcBridgeService::CloseNotificationsChannel() { |
| 369 DCHECK(CalledOnValidThread()); | 367 DCHECK(CalledOnValidThread()); |
| 370 if (!notifications_ptr_) | 368 if (!notifications_ptr_) |
| 371 return; | 369 return; |
| 372 | 370 |
| 373 notifications_ptr_.reset(); | 371 notifications_ptr_.reset(); |
| 374 FOR_EACH_OBSERVER(Observer, observer_list(), OnNotificationsInstanceClosed()); | 372 FOR_EACH_OBSERVER(Observer, observer_list(), OnNotificationsInstanceClosed()); |
| 375 } | 373 } |
| 376 | 374 |
| 377 void ArcBridgeService::OnObbMounterInstanceReady( | |
| 378 mojom::ObbMounterInstancePtr obb_mounter_ptr) { | |
| 379 DCHECK(CalledOnValidThread()); | |
| 380 temporary_obb_mounter_ptr_ = std::move(obb_mounter_ptr); | |
| 381 temporary_obb_mounter_ptr_.QueryVersion(base::Bind( | |
| 382 &ArcBridgeService::OnObbMounterVersionReady, | |
| 383 weak_factory_.GetWeakPtr())); | |
| 384 } | |
| 385 | |
| 386 void ArcBridgeService::OnObbMounterVersionReady(int32_t version) { | |
| 387 DCHECK(CalledOnValidThread()); | |
| 388 obb_mounter_ptr_ = std::move(temporary_obb_mounter_ptr_); | |
| 389 obb_mounter_ptr_.set_connection_error_handler(base::Bind( | |
| 390 &ArcBridgeService::CloseObbMounterChannel, | |
| 391 weak_factory_.GetWeakPtr())); | |
| 392 FOR_EACH_OBSERVER(Observer, observer_list(), OnObbMounterInstanceReady()); | |
| 393 } | |
| 394 | |
| 395 void ArcBridgeService::CloseObbMounterChannel() { | |
| 396 if (!obb_mounter_ptr_) | |
| 397 return; | |
| 398 | |
| 399 obb_mounter_ptr_.reset(); | |
| 400 FOR_EACH_OBSERVER(Observer, observer_list(), OnObbMounterInstanceClosed()); | |
| 401 } | |
| 402 | |
| 403 void ArcBridgeService::OnPolicyInstanceReady( | 375 void ArcBridgeService::OnPolicyInstanceReady( |
| 404 mojom::PolicyInstancePtr policy_ptr) { | 376 mojom::PolicyInstancePtr policy_ptr) { |
| 405 DCHECK(CalledOnValidThread()); | 377 DCHECK(CalledOnValidThread()); |
| 406 temporary_policy_ptr_ = std::move(policy_ptr); | 378 temporary_policy_ptr_ = std::move(policy_ptr); |
| 407 temporary_policy_ptr_.QueryVersion(base::Bind( | 379 temporary_policy_ptr_.QueryVersion(base::Bind( |
| 408 &ArcBridgeService::OnPolicyVersionReady, weak_factory_.GetWeakPtr())); | 380 &ArcBridgeService::OnPolicyVersionReady, weak_factory_.GetWeakPtr())); |
| 409 } | 381 } |
| 410 | 382 |
| 411 void ArcBridgeService::OnPolicyVersionReady(int32_t version) { | 383 void ArcBridgeService::OnPolicyVersionReady(int32_t version) { |
| 412 DCHECK(CalledOnValidThread()); | 384 DCHECK(CalledOnValidThread()); |
| (...skipping 167 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 580 CloseAudioChannel(); | 552 CloseAudioChannel(); |
| 581 CloseAuthChannel(); | 553 CloseAuthChannel(); |
| 582 CloseBluetoothChannel(); | 554 CloseBluetoothChannel(); |
| 583 CloseClipboardChannel(); | 555 CloseClipboardChannel(); |
| 584 CloseCrashCollectorChannel(); | 556 CloseCrashCollectorChannel(); |
| 585 CloseImeChannel(); | 557 CloseImeChannel(); |
| 586 CloseIntentHelperChannel(); | 558 CloseIntentHelperChannel(); |
| 587 CloseMetricsChannel(); | 559 CloseMetricsChannel(); |
| 588 CloseNetChannel(); | 560 CloseNetChannel(); |
| 589 CloseNotificationsChannel(); | 561 CloseNotificationsChannel(); |
| 590 CloseObbMounterChannel(); | |
| 591 ClosePolicyChannel(); | 562 ClosePolicyChannel(); |
| 592 ClosePowerChannel(); | 563 ClosePowerChannel(); |
| 593 CloseProcessChannel(); | 564 CloseProcessChannel(); |
| 594 CloseStorageManagerChannel(); | 565 CloseStorageManagerChannel(); |
| 595 CloseVideoChannel(); | 566 CloseVideoChannel(); |
| 596 CloseWindowManagerChannel(); | 567 CloseWindowManagerChannel(); |
| 597 } | 568 } |
| 598 | 569 |
| 599 } // namespace arc | 570 } // namespace arc |
| OLD | NEW |