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_MANAGEMENT_PROVIDERS_CHILD_PROCESS_TASK_H_ | 5 #ifndef CHROME_BROWSER_TASK_MANAGEMENT_PROVIDERS_CHILD_PROCESS_TASK_H_ |
6 #define CHROME_BROWSER_TASK_MANAGEMENT_PROVIDERS_CHILD_PROCESS_TASK_H_ | 6 #define CHROME_BROWSER_TASK_MANAGEMENT_PROVIDERS_CHILD_PROCESS_TASK_H_ |
7 | 7 |
8 #include "chrome/browser/task_management/providers/task.h" | 8 #include "chrome/browser/task_management/providers/task.h" |
9 | 9 |
10 class ProcessResourceUsage; | 10 class ProcessResourceUsage; |
(...skipping 12 matching lines...) Expand all Loading... |
23 // received from observing |content::BrowserChildProcessObserver|. | 23 // received from observing |content::BrowserChildProcessObserver|. |
24 explicit ChildProcessTask(const content::ChildProcessData& data); | 24 explicit ChildProcessTask(const content::ChildProcessData& data); |
25 | 25 |
26 ~ChildProcessTask() override; | 26 ~ChildProcessTask() override; |
27 | 27 |
28 // task_management::Task: | 28 // task_management::Task: |
29 void Refresh(const base::TimeDelta& update_interval, | 29 void Refresh(const base::TimeDelta& update_interval, |
30 int64 refresh_flags) override; | 30 int64 refresh_flags) override; |
31 Type GetType() const override; | 31 Type GetType() const override; |
32 int GetChildProcessUniqueID() const override; | 32 int GetChildProcessUniqueID() const override; |
| 33 base::string16 GetProfileName() const override; |
33 bool ReportsV8Memory() const; | 34 bool ReportsV8Memory() const; |
34 int64 GetV8MemoryAllocated() const override; | 35 int64 GetV8MemoryAllocated() const override; |
35 int64 GetV8MemoryUsed() const override; | 36 int64 GetV8MemoryUsed() const override; |
36 | 37 |
37 private: | 38 private: |
38 // The Mojo service wrapper that will provide us with the V8 memory usage of | 39 // The Mojo service wrapper that will provide us with the V8 memory usage of |
39 // the browser child process represented by this object. | 40 // the browser child process represented by this object. |
40 scoped_ptr<ProcessResourceUsage> process_resources_sampler_; | 41 scoped_ptr<ProcessResourceUsage> process_resources_sampler_; |
41 | 42 |
42 // The allocated and used V8 memory (in bytes). | 43 // The allocated and used V8 memory (in bytes). |
43 int64 v8_memory_allocated_; | 44 int64 v8_memory_allocated_; |
44 int64 v8_memory_used_; | 45 int64 v8_memory_used_; |
45 | 46 |
| 47 // The name of the active user profile at the time of the construction of this |
| 48 // task. |
| 49 const base::string16 profile_name_; |
| 50 |
46 // The unique ID of the child process. It is not the PID of the process. | 51 // The unique ID of the child process. It is not the PID of the process. |
47 // See |content::ChildProcessData::id|. | 52 // See |content::ChildProcessData::id|. |
48 const int unique_child_process_id_; | 53 const int unique_child_process_id_; |
49 | 54 |
50 // The type of the child process. See |content::ProcessType| and | 55 // The type of the child process. See |content::ProcessType| and |
51 // |NaClTrustedProcessType|. | 56 // |NaClTrustedProcessType|. |
52 const int process_type_; | 57 const int process_type_; |
53 | 58 |
| 59 // Depending on the |process_type_|, determines whether this task uses V8 |
| 60 // memory or not. |
| 61 const bool uses_v8_memory_; |
| 62 |
54 DISALLOW_COPY_AND_ASSIGN(ChildProcessTask); | 63 DISALLOW_COPY_AND_ASSIGN(ChildProcessTask); |
55 }; | 64 }; |
56 | 65 |
57 } // namespace task_management | 66 } // namespace task_management |
58 | 67 |
59 | 68 |
60 #endif // CHROME_BROWSER_TASK_MANAGEMENT_PROVIDERS_CHILD_PROCESS_TASK_H_ | 69 #endif // CHROME_BROWSER_TASK_MANAGEMENT_PROVIDERS_CHILD_PROCESS_TASK_H_ |
OLD | NEW |