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

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

Issue 2553713002: [Merge M-56] 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
« no previous file with comments | « chrome/browser/chromeos/arc/process/arc_process_service.h ('k') | components/arc/net/arc_net_host_impl.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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;
+
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() {}
« no previous file with comments | « chrome/browser/chromeos/arc/process/arc_process_service.h ('k') | components/arc/net/arc_net_host_impl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698