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

Unified Diff: chrome/browser/ui/app_list/arc/arc_app_utils.cc

Issue 2323133002: Speed up ARC boot if the user launches ARC app while ARC is not ready (Closed)
Patch Set: Fix unit_tests 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: chrome/browser/ui/app_list/arc/arc_app_utils.cc
diff --git a/chrome/browser/ui/app_list/arc/arc_app_utils.cc b/chrome/browser/ui/app_list/arc/arc_app_utils.cc
index d8730352e7ac59dd6984746a1d1d1a499bd75349..1589e30f076388ace68bb5a580d978c085ea8c8d 100644
--- a/chrome/browser/ui/app_list/arc/arc_app_utils.cc
+++ b/chrome/browser/ui/app_list/arc/arc_app_utils.cc
@@ -4,6 +4,7 @@
#include "chrome/browser/ui/app_list/arc/arc_app_utils.h"
+#include <memory>
#include <string>
#include "ash/shell.h"
@@ -12,6 +13,8 @@
#include "chrome/browser/ui/app_list/arc/arc_app_list_prefs.h"
#include "chrome/browser/ui/ash/launcher/arc_app_deferred_launcher_controller.h"
#include "chrome/browser/ui/ash/launcher/chrome_launcher_controller.h"
+#include "chromeos/dbus/dbus_thread_manager.h"
+#include "chromeos/dbus/session_manager_client.h"
#include "components/arc/arc_bridge_service.h"
#include "ui/aura/window.h"
#include "ui/display/display.h"
@@ -74,6 +77,12 @@ arc::mojom::AppInstance* GetAppInstance(int required_version,
return app_instance;
}
+void PrioritizeArcInstanceCallback(bool success) {
+ VLOG(2) << "Finished prioritizing the instance: result=" << success;
+ if (!success)
+ LOG(ERROR) << "Failed to prioritize ARC";
+}
+
// Find a proper size and position for a given rectangle on the screen.
// TODO(skuhne): This needs more consideration, but it is lacking
// WindowPositioner functionality since we do not have an Aura::Window yet.
@@ -252,6 +261,16 @@ bool LaunchApp(content::BrowserContext* context,
if (chrome_controller) {
chrome_controller->GetArcDeferredLauncher()->RegisterDeferredLaunch(
app_id);
+
+ // On some boards, ARC is booted with a restricted set of resources by
+ // default to avoid slowing down Chrome's user session restoration.
+ // However, the restriction should be lifted once the user explicitly
+ // tries to launch an ARC app.
+ VLOG(2) << "Prioritizing the instance";
+ chromeos::SessionManagerClient* session_manager_client =
+ chromeos::DBusThreadManager::Get()->GetSessionManagerClient();
+ session_manager_client->PrioritizeArcInstance(
+ base::Bind(PrioritizeArcInstanceCallback));
}
}
prefs->SetLastLaunchTime(app_id, base::Time::Now());
« no previous file with comments | « chrome/browser/chromeos/settings/device_settings_test_helper.cc ('k') | chromeos/dbus/fake_session_manager_client.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698