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

Unified Diff: chrome/browser/chromeos/arc/process/arc_process_service.cc

Issue 2541843003: arc: Reduce logspam when ARC is not enabled/available (Closed)
Patch Set: Created 4 years 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/chromeos/arc/process/arc_process_service.cc
diff --git a/chrome/browser/chromeos/arc/process/arc_process_service.cc b/chrome/browser/chromeos/arc/process/arc_process_service.cc
index c91e741d8ccfd142901713a65d932b4fe8f4deb4..71d729ff148408ad1963cb33df21f60063676557 100644
--- a/chrome/browser/chromeos/arc/process/arc_process_service.cc
+++ b/chrome/browser/chromeos/arc/process/arc_process_service.cc
@@ -227,11 +227,6 @@ ArcProcessService* ArcProcessService::Get() {
return g_arc_process_service;
}
-void ArcProcessService::OnInstanceReady() {
- DCHECK_CURRENTLY_ON(content::BrowserThread::UI);
- GetTaskRunner()->PostTask(FROM_HERE, base::Bind(&Reset, nspid_to_pid_));
-}
-
void ArcProcessService::RequestSystemProcessList(
RequestProcessListCallback callback) {
DCHECK_CURRENTLY_ON(content::BrowserThread::UI);
@@ -245,12 +240,19 @@ bool ArcProcessService::RequestAppProcessList(
RequestProcessListCallback callback) {
DCHECK_CURRENTLY_ON(content::BrowserThread::UI);
+ // Since several services call this class to get information about the ARC
+ // process list, it can produce a lot of logspam when the board is ARC-ready
+ // but the user has not opted into ARC. This redundant check avoids that
+ // logspam.
+ if (!instance_ready_)
+ return false;
Yusuke Sato 2016/11/30 23:29:39 I think this would also remove legit logs when the
Luis Héctor Chávez 2016/11/30 23:45:08 ArcBridgeService::GetEnabled() unfortunately does
Yusuke Sato 2016/11/30 23:59:30 The DCHECK in ~ObserverList<> is actually an optio
Yusuke Sato 2016/12/01 02:29:21 Chatted with Luis offline. Let's keep the member v
+
mojom::ProcessInstance* process_instance =
arc_bridge_service()->process()->GetInstanceForMethod(
"RequestProcessList");
- if (!process_instance) {
+ if (!process_instance)
return false;
- }
+
process_instance->RequestProcessList(
base::Bind(&ArcProcessService::OnReceiveProcessList,
weak_ptr_factory_.GetWeakPtr(), callback));
@@ -273,6 +275,17 @@ scoped_refptr<base::SingleThreadTaskRunner> ArcProcessService::GetTaskRunner() {
return heavy_task_thread_.task_runner();
}
+void ArcProcessService::OnInstanceReady() {
+ DCHECK_CURRENTLY_ON(content::BrowserThread::UI);
+ GetTaskRunner()->PostTask(FROM_HERE, base::Bind(&Reset, nspid_to_pid_));
+ instance_ready_ = true;
+}
+
+void ArcProcessService::OnInstanceClosed() {
+ DCHECK_CURRENTLY_ON(content::BrowserThread::UI);
+ instance_ready_ = false;
+}
+
inline ArcProcessService::NSPidToPidMap::NSPidToPidMap() {}
inline ArcProcessService::NSPidToPidMap::~NSPidToPidMap() {}

Powered by Google App Engine
This is Rietveld 408576698