Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #ifndef CHROME_BROWSER_TASK_MANAGER_PROVIDERS_ARC_ARC_PROCESS_TASK_PROVIDER_H_ | 5 #ifndef CHROME_BROWSER_TASK_MANAGER_PROVIDERS_ARC_ARC_PROCESS_TASK_PROVIDER_H_ |
| 6 #define CHROME_BROWSER_TASK_MANAGER_PROVIDERS_ARC_ARC_PROCESS_TASK_PROVIDER_H_ | 6 #define CHROME_BROWSER_TASK_MANAGER_PROVIDERS_ARC_ARC_PROCESS_TASK_PROVIDER_H_ |
| 7 | 7 |
| 8 #include <memory> | 8 #include <memory> |
| 9 #include <unordered_map> | 9 #include <unordered_map> |
| 10 #include <vector> | 10 #include <vector> |
| 11 | 11 |
| 12 #include "base/callback.h" | 12 #include "base/callback.h" |
| 13 #include "base/macros.h" | 13 #include "base/macros.h" |
| 14 #include "base/memory/weak_ptr.h" | 14 #include "base/memory/weak_ptr.h" |
| 15 #include "base/process/process.h" | 15 #include "base/process/process.h" |
| 16 #include "chrome/browser/chromeos/arc/process/arc_process.h" | 16 #include "chrome/browser/chromeos/arc/process/arc_process.h" |
| 17 #include "chrome/browser/task_manager/providers/arc/arc_process_filter.h" | |
| 17 #include "chrome/browser/task_manager/providers/arc/arc_process_task.h" | 18 #include "chrome/browser/task_manager/providers/arc/arc_process_task.h" |
| 18 #include "chrome/browser/task_manager/providers/task_provider.h" | 19 #include "chrome/browser/task_manager/providers/task_provider.h" |
| 19 | 20 |
| 20 namespace task_manager { | 21 namespace task_manager { |
| 21 | 22 |
| 22 // This provides the ARC process tasks. | 23 // This provides the ARC process tasks. |
| 23 // | 24 // |
| 24 // Since this provider obtains ARC process information via IPC and procfs, | 25 // Since this provider obtains ARC process information via IPC and procfs, |
| 25 // it can never avoid race conditions. For example, in an extreme case such as | 26 // it can never avoid race conditions. For example, in an extreme case such as |
| 26 // fork(2) is called millions of times in a second, this provider can return | 27 // fork(2) is called millions of times in a second, this provider can return |
| (...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 58 | 59 |
| 59 void ScheduleNextAppRequest(); | 60 void ScheduleNextAppRequest(); |
| 60 void ScheduleNextSystemRequest(); | 61 void ScheduleNextSystemRequest(); |
| 61 | 62 |
| 62 ArcTaskMap nspid_to_task_; | 63 ArcTaskMap nspid_to_task_; |
| 63 ArcTaskMap nspid_to_sys_task_; | 64 ArcTaskMap nspid_to_sys_task_; |
| 64 | 65 |
| 65 // Whether to continue the periodical polling. | 66 // Whether to continue the periodical polling. |
| 66 bool is_updating_; | 67 bool is_updating_; |
| 67 | 68 |
| 69 // Filters out ARC processes that are not useful to display. | |
| 70 // See crbug.com/654564 | |
| 71 ArcProcessFilter process_filter_; | |
|
Luis Héctor Chávez
2017/01/26 17:55:13
nit: const
Eliot Courtney
2017/01/30 07:48:53
Done.
| |
| 72 | |
| 68 // Always keep this the last member of this class to make sure it's the | 73 // Always keep this the last member of this class to make sure it's the |
| 69 // first thing to be destructed. | 74 // first thing to be destructed. |
| 70 base::WeakPtrFactory<ArcProcessTaskProvider> weak_ptr_factory_; | 75 base::WeakPtrFactory<ArcProcessTaskProvider> weak_ptr_factory_; |
| 71 | 76 |
| 72 DISALLOW_COPY_AND_ASSIGN(ArcProcessTaskProvider); | 77 DISALLOW_COPY_AND_ASSIGN(ArcProcessTaskProvider); |
| 73 }; | 78 }; |
| 74 | 79 |
| 75 } // namespace task_manager | 80 } // namespace task_manager |
| 76 | 81 |
| 77 #endif // CHROME_BROWSER_TASK_MANAGER_PROVIDERS_ARC_ARC_PROCESS_TASK_PROVIDER_H _ | 82 #endif // CHROME_BROWSER_TASK_MANAGER_PROVIDERS_ARC_ARC_PROCESS_TASK_PROVIDER_H _ |
| OLD | NEW |