Chromium Code Reviews| Index: chrome/browser/chromeos/arc/arc_process_service.h |
| diff --git a/chrome/browser/chromeos/arc/arc_process_service.h b/chrome/browser/chromeos/arc/arc_process_service.h |
| index 231c58dd7389aca66b9f7f826c2bb68b58ad46e0..fa654b9221f1bfe58bd8c1159d063e7a70c494f7 100644 |
| --- a/chrome/browser/chromeos/arc/arc_process_service.h |
| +++ b/chrome/browser/chromeos/arc/arc_process_service.h |
| @@ -11,6 +11,7 @@ |
| #include "base/callback.h" |
| #include "base/memory/ref_counted.h" |
| #include "base/memory/weak_ptr.h" |
| +#include "base/process/process_iterator.h" |
| #include "base/threading/sequenced_worker_pool.h" |
| #include "base/threading/thread_checker.h" |
| #include "chrome/browser/chromeos/arc/arc_process.h" |
| @@ -21,16 +22,16 @@ namespace arc { |
| // A single global entry to get a list of ARC processes. |
| // |
| -// Call RequestProcessList() on the main UI thread to get a list of all ARC |
| -// processes. It returns vector<arc::ArcProcess>, which includes pid <-> nspid |
| -// mapping. |
| +// Call RequestAppProcessList() / RequestSystemProcessList on the main UI |
|
cylee1
2016/06/02 20:58:45
nit: RequestSystemProcessList()
Hsu-Cheng
2016/06/29 10:33:57
Done.
|
| +// thread to get a list of all ARC app / system processes. It returns |
| +// vector<arc::ArcProcess>, which includes pid <-> nspid mapping. |
| // Example: |
| // void OnUpdateProcessList(const vector<arc::ArcProcess>&) {...} |
| // |
| // arc::ArcProcessService* arc_process_service = |
| // arc::ArcProcessService::Get(); |
| // if (!arc_process_service || |
| -// !arc_process_service->RequestProcessList( |
| +// !arc_process_service->RequestAppProcessList( |
| // base::Bind(&OnUpdateProcessList)) { |
| // LOG(ERROR) << "ARC process instance not ready."; |
| // } |
| @@ -51,11 +52,17 @@ class ArcProcessService : public ArcService, |
| // Returns true if ARC IPC is ready for process list request, |
| // otherwise false. |
| - bool RequestProcessList(RequestProcessListCallback callback); |
| + bool RequestAppProcessList(RequestProcessListCallback callback); |
| + bool RequestSystemProcessList(RequestProcessListCallback callback); |
|
cylee1
2016/06/02 20:58:45
Have you measured how much time does the function
Hsu-Cheng
2016/06/29 10:33:57
I didn't test it with stress scenario. The time ne
|
| private: |
| void Reset(); |
| + void FetchAndReturnSystemProcessList(std::vector<ArcProcess>* ret_processes); |
| + |
| + base::ProcessId GetArcInitProcessId( |
|
Yusuke Sato
2016/06/02 21:50:11
can be static
Hsu-Cheng
2016/06/29 10:33:57
Done.
|
| + const base::ProcessIterator::ProcessEntries& entry_list); |
| + |
| void OnReceiveProcessList( |
| const RequestProcessListCallback& callback, |
| mojo::Array<arc::mojom::RunningAppProcessInfoPtr> mojo_processes); |