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

Side by Side Diff: chrome/browser/task_management/sampling/task_group.h

Issue 1439213004: Fix various TaskManager bugs and add new enhancements (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: auto*& --> auto* Created 5 years, 1 month 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 unified diff | Download patch
OLDNEW
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_SAMPLING_TASK_GROUP_H_ 5 #ifndef CHROME_BROWSER_TASK_MANAGEMENT_SAMPLING_TASK_GROUP_H_
6 #define CHROME_BROWSER_TASK_MANAGEMENT_SAMPLING_TASK_GROUP_H_ 6 #define CHROME_BROWSER_TASK_MANAGEMENT_SAMPLING_TASK_GROUP_H_
7 7
8 #include <map> 8 #include <map>
9 9
10 #include "base/memory/weak_ptr.h" 10 #include "base/memory/weak_ptr.h"
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after
47 47
48 size_t num_tasks() const { return tasks_.size(); } 48 size_t num_tasks() const { return tasks_.size(); }
49 bool empty() const { return tasks_.empty(); } 49 bool empty() const { return tasks_.empty(); }
50 50
51 double cpu_usage() const { return cpu_usage_; } 51 double cpu_usage() const { return cpu_usage_; }
52 int64 private_bytes() const { return memory_usage_.private_bytes; } 52 int64 private_bytes() const { return memory_usage_.private_bytes; }
53 int64 shared_bytes() const { return memory_usage_.shared_bytes; } 53 int64 shared_bytes() const { return memory_usage_.shared_bytes; }
54 int64 physical_bytes() const { return memory_usage_.physical_bytes; } 54 int64 physical_bytes() const { return memory_usage_.physical_bytes; }
55 int64 gpu_memory() const { return gpu_memory_; } 55 int64 gpu_memory() const { return gpu_memory_; }
56 bool gpu_memory_has_duplicates() const { return gpu_memory_has_duplicates_; } 56 bool gpu_memory_has_duplicates() const { return gpu_memory_has_duplicates_; }
57 int64 per_process_network_usage() const { return per_process_network_usage_; }
57 58
58 #if defined(OS_WIN) 59 #if defined(OS_WIN)
59 int64 gdi_current_handles() const { return gdi_current_handles_; } 60 int64 gdi_current_handles() const { return gdi_current_handles_; }
60 int64 gdi_peak_handles() const { return gdi_peak_handles_; } 61 int64 gdi_peak_handles() const { return gdi_peak_handles_; }
61 int64 user_current_handles() const { return user_current_handles_; } 62 int64 user_current_handles() const { return user_current_handles_; }
62 int64 user_peak_handles() const { return user_peak_handles_; } 63 int64 user_peak_handles() const { return user_peak_handles_; }
63 #endif // defined(OS_WIN) 64 #endif // defined(OS_WIN)
64 65
65 #if !defined(DISABLE_NACL) 66 #if !defined(DISABLE_NACL)
66 int nacl_debug_stub_port() const { return nacl_debug_stub_port_; } 67 int nacl_debug_stub_port() const { return nacl_debug_stub_port_; }
(...skipping 23 matching lines...) Expand all
90 scoped_refptr<TaskGroupSampler> worker_thread_sampler_; 91 scoped_refptr<TaskGroupSampler> worker_thread_sampler_;
91 92
92 // Maps the Tasks by their IDs. 93 // Maps the Tasks by their IDs.
93 // Tasks are not owned by the TaskGroup. They're owned by the TaskProviders. 94 // Tasks are not owned by the TaskGroup. They're owned by the TaskProviders.
94 std::map<TaskId, Task*> tasks_; 95 std::map<TaskId, Task*> tasks_;
95 96
96 // The per process resources usages. 97 // The per process resources usages.
97 double cpu_usage_; 98 double cpu_usage_;
98 MemoryUsageStats memory_usage_; 99 MemoryUsageStats memory_usage_;
99 int64 gpu_memory_; 100 int64 gpu_memory_;
101 // The network usage in bytes per second as the sum of all network usages of
102 // the individual tasks sharing the same process.
103 int64 per_process_network_usage_;
100 #if defined(OS_WIN) 104 #if defined(OS_WIN)
101 // Windows GDI and USER Handles. 105 // Windows GDI and USER Handles.
102 int64 gdi_current_handles_; 106 int64 gdi_current_handles_;
103 int64 gdi_peak_handles_; 107 int64 gdi_peak_handles_;
104 int64 user_current_handles_; 108 int64 user_current_handles_;
105 int64 user_peak_handles_; 109 int64 user_peak_handles_;
106 #endif // defined(OS_WIN) 110 #endif // defined(OS_WIN)
107 #if !defined(DISABLE_NACL) 111 #if !defined(DISABLE_NACL)
108 int nacl_debug_stub_port_; 112 int nacl_debug_stub_port_;
109 #endif // !defined(DISABLE_NACL) 113 #endif // !defined(DISABLE_NACL)
110 int idle_wakeups_per_second_; 114 int idle_wakeups_per_second_;
111 bool gpu_memory_has_duplicates_; 115 bool gpu_memory_has_duplicates_;
112 116
113 // Always keep this the last member of this class so that it's the first to be 117 // Always keep this the last member of this class so that it's the first to be
114 // destroyed. 118 // destroyed.
115 base::WeakPtrFactory<TaskGroup> weak_ptr_factory_; 119 base::WeakPtrFactory<TaskGroup> weak_ptr_factory_;
116 120
117 DISALLOW_COPY_AND_ASSIGN(TaskGroup); 121 DISALLOW_COPY_AND_ASSIGN(TaskGroup);
118 }; 122 };
119 123
120 } // namespace task_management 124 } // namespace task_management
121 125
122 126
123 #endif // CHROME_BROWSER_TASK_MANAGEMENT_SAMPLING_TASK_GROUP_H_ 127 #endif // CHROME_BROWSER_TASK_MANAGEMENT_SAMPLING_TASK_GROUP_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698