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_task.h" | 17 #include "chrome/browser/task_manager/providers/arc/arc_process_task.h" |
| 18 #include "chrome/browser/task_manager/providers/arc/arc_process_whitelist.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 |
| 27 // wrong results. However, its chance is very low, and even if we hit the case, | 28 // wrong results. However, its chance is very low, and even if we hit the case, |
| (...skipping 30 matching lines...) Expand all 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 ArcProcessWhitelist whitelist_; | |
|
Luis Héctor Chávez
2017/01/24 17:09:41
nit: can you add a comment for consistency with th
Eliot Courtney
2017/01/25 02:08:12
Done.
| |
| 70 | |
| 68 // Always keep this the last member of this class to make sure it's the | 71 // Always keep this the last member of this class to make sure it's the |
| 69 // first thing to be destructed. | 72 // first thing to be destructed. |
| 70 base::WeakPtrFactory<ArcProcessTaskProvider> weak_ptr_factory_; | 73 base::WeakPtrFactory<ArcProcessTaskProvider> weak_ptr_factory_; |
| 71 | 74 |
| 72 DISALLOW_COPY_AND_ASSIGN(ArcProcessTaskProvider); | 75 DISALLOW_COPY_AND_ASSIGN(ArcProcessTaskProvider); |
| 73 }; | 76 }; |
| 74 | 77 |
| 75 } // namespace task_manager | 78 } // namespace task_manager |
| 76 | 79 |
| 77 #endif // CHROME_BROWSER_TASK_MANAGER_PROVIDERS_ARC_ARC_PROCESS_TASK_PROVIDER_H _ | 80 #endif // CHROME_BROWSER_TASK_MANAGER_PROVIDERS_ARC_ARC_PROCESS_TASK_PROVIDER_H _ |
| OLD | NEW |