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

Unified Diff: components/arc/boot_phase_monitor/arc_boot_phase_monitor_bridge.cc

Issue 2624513004: Prioritize ARC instance only when it is needed (Closed)
Patch Set: review Created 3 years, 11 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/boot_phase_monitor/arc_boot_phase_monitor_bridge.cc
diff --git a/components/arc/boot_phase_monitor/arc_boot_phase_monitor_bridge.cc b/components/arc/boot_phase_monitor/arc_boot_phase_monitor_bridge.cc
deleted file mode 100644
index 79a3e7d7e4ea51e109cb385ee0fdee276a4259de..0000000000000000000000000000000000000000
--- a/components/arc/boot_phase_monitor/arc_boot_phase_monitor_bridge.cc
+++ /dev/null
@@ -1,58 +0,0 @@
-// Copyright 2016 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/boot_phase_monitor/arc_boot_phase_monitor_bridge.h"
-
-#include "base/logging.h"
-#include "chromeos/dbus/dbus_thread_manager.h"
-#include "chromeos/dbus/session_manager_client.h"
-#include "components/arc/arc_bridge_service.h"
-
-namespace arc {
-
-namespace {
-
-void PrioritizeArcInstanceCallback(bool success) {
- VLOG(2) << "Finished prioritizing the instance: result=" << success;
- if (!success)
- LOG(WARNING) << "Failed to prioritize ARC";
-}
-
-} // namespace
-
-ArcBootPhaseMonitorBridge::ArcBootPhaseMonitorBridge(
- ArcBridgeService* bridge_service)
- : ArcService(bridge_service), binding_(this) {
- DCHECK(thread_checker_.CalledOnValidThread());
- arc_bridge_service()->boot_phase_monitor()->AddObserver(this);
-}
-
-ArcBootPhaseMonitorBridge::~ArcBootPhaseMonitorBridge() {
- DCHECK(thread_checker_.CalledOnValidThread());
- arc_bridge_service()->boot_phase_monitor()->RemoveObserver(this);
-}
-
-void ArcBootPhaseMonitorBridge::OnInstanceReady() {
- DCHECK(thread_checker_.CalledOnValidThread());
- auto* instance = ARC_GET_INSTANCE_FOR_METHOD(
- arc_bridge_service()->boot_phase_monitor(), Init);
- DCHECK(instance);
- instance->Init(binding_.CreateInterfacePtrAndBind());
-}
-
-void ArcBootPhaseMonitorBridge::OnInstanceClosed() {
- DCHECK(thread_checker_.CalledOnValidThread());
-}
-
-void ArcBootPhaseMonitorBridge::OnBootCompleted() {
- DCHECK(thread_checker_.CalledOnValidThread());
- VLOG(2) << "OnBootCompleted";
- chromeos::SessionManagerClient* session_manager_client =
- chromeos::DBusThreadManager::Get()->GetSessionManagerClient();
- session_manager_client->PrioritizeArcInstance(
- base::Bind(PrioritizeArcInstanceCallback));
- session_manager_client->EmitArcBooted();
-}
-
-} // namespace arc

Powered by Google App Engine
This is Rietveld 408576698