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

Unified Diff: chrome/browser/task_management/providers/arc/arc_process_task_provider.cc

Issue 2043293002: arc: Clear the ARC task list when ARC get disabled. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@lkgr
Patch Set: Update comment. Created 4 years, 6 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 | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/task_management/providers/arc/arc_process_task_provider.cc
diff --git a/chrome/browser/task_management/providers/arc/arc_process_task_provider.cc b/chrome/browser/task_management/providers/arc/arc_process_task_provider.cc
index 8756626034d94e5c22b816dae07c8aad040acf15..e119ded47007ad5ff4b871e0cb04f383bb9eb215 100644
--- a/chrome/browser/task_management/providers/arc/arc_process_task_provider.cc
+++ b/chrome/browser/task_management/providers/arc/arc_process_task_provider.cc
@@ -92,12 +92,15 @@ void ArcProcessTaskProvider::OnUpdateProcessList(
void ArcProcessTaskProvider::RequestProcessList() {
arc::ArcProcessService* arc_process_service =
arc::ArcProcessService::Get();
+ auto callback = base::Bind(&ArcProcessTaskProvider::OnUpdateProcessList,
+ weak_ptr_factory_.GetWeakPtr());
if (!arc_process_service ||
- !arc_process_service->RequestProcessList(
- base::Bind(&ArcProcessTaskProvider::OnUpdateProcessList,
- weak_ptr_factory_.GetWeakPtr()))) {
+ !arc_process_service->RequestProcessList(callback)) {
VLOG(2) << "ARC process instance is not ready.";
- ScheduleNextRequest();
+ // Update with the empty ARC process list.
+ // Note that this can happen in the middle of the session if the user has
+ // just opted out from ARC.
+ callback.Run(std::vector<ArcProcess>());
}
}
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698