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

Side by Side Diff: chrome/browser/task_manager.h

Issue 339012: Report "N/A" for memory columns in Linux Task Manager. (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: Also fix minor bug in linux PorcessMetrics Created 11 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 | Annotate | Revision Log
« no previous file with comments | « base/process_util_linux.cc ('k') | chrome/browser/task_manager.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2006-2008 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_H_ 5 #ifndef CHROME_BROWSER_TASK_MANAGER_H_
6 #define CHROME_BROWSER_TASK_MANAGER_H_ 6 #define CHROME_BROWSER_TASK_MANAGER_H_
7 7
8 #include <map> 8 #include <map>
9 #include <string> 9 #include <string>
10 #include <utility> 10 #include <utility>
(...skipping 295 matching lines...) Expand 10 before | Expand all | Expand 10 after
306 306
307 // Returns the network usage (in byte per second) that should be displayed for 307 // Returns the network usage (in byte per second) that should be displayed for
308 // the passed |resource|. -1 means the information is not available for that 308 // the passed |resource|. -1 means the information is not available for that
309 // resource. 309 // resource.
310 int64 GetNetworkUsage(TaskManager::Resource* resource) const; 310 int64 GetNetworkUsage(TaskManager::Resource* resource) const;
311 311
312 // Returns the CPU usage (in %) that should be displayed for the passed 312 // Returns the CPU usage (in %) that should be displayed for the passed
313 // |resource|. 313 // |resource|.
314 int GetCPUUsage(TaskManager::Resource* resource) const; 314 int GetCPUUsage(TaskManager::Resource* resource) const;
315 315
316 // Retrieves the private memory (in KB) that should be displayed from the 316 // Gets the private memory (in KB) that should be displayed for the passed
317 // passed |process_metrics|. 317 // resource index.
318 size_t GetPrivateMemory(const base::ProcessMetrics* process_metrics) const; 318 bool GetPrivateMemory(int index, size_t* result) const;
319 319
320 // Returns the shared memory (in KB) that should be displayed from the passed 320 // Gets the shared memory (in KB) that should be displayed for the passed
321 // |process_metrics|. 321 // resource index.
322 size_t GetSharedMemory(const base::ProcessMetrics* process_metrics) const; 322 bool GetSharedMemory(int index, size_t* result) const;
323 323
324 // Returns the pysical memory (in KB) that should be displayed from the passed 324 // Gets the physical memory (in KB) that should be displayed for the passed
325 // |process_metrics|. 325 // resource index.
326 size_t GetPhysicalMemory(const base::ProcessMetrics* process_metrics) const; 326 bool GetPhysicalMemory(int index, size_t* result) const;
327 327
328 // Returns the stat value at the column |col_id| that should be displayed from 328 // Returns the stat value at the column |col_id| that should be displayed from
329 // the passed |process_metrics|. 329 // the passed |process_metrics|.
330 int GetStatsValue(const TaskManager::Resource* resource, int col_id) const; 330 int GetStatsValue(const TaskManager::Resource* resource, int col_id) const;
331 331
332 // Retrieves the ProcessMetrics for the resources at the specified rows. 332 // Retrieves the ProcessMetrics for the resources at the specified row.
333 // Returns true if there was a ProcessMetrics available for both rows. 333 // Returns true if there was a ProcessMetrics available.
334 bool GetProcessMetricsForRows(int row1, 334 bool GetProcessMetricsForRow(int row,
335 int row2, 335 base::ProcessMetrics** proc_metrics) const;
336 base::ProcessMetrics** proc_metrics1,
337 base::ProcessMetrics** proc_metrics2) const;
338 336
339 // Given a number, this function returns the formatted string that should be 337 // Given a number, this function returns the formatted string that should be
340 // displayed in the task manager's memory cell. 338 // displayed in the task manager's memory cell.
341 std::wstring GetMemCellText(int64 number) const; 339 std::wstring GetMemCellText(int64 number) const;
342 340
343 // The list of providers to the task manager. They are ref counted. 341 // The list of providers to the task manager. They are ref counted.
344 ResourceProviderList providers_; 342 ResourceProviderList providers_;
345 343
346 // The list of all the resources displayed in the task manager. They are owned 344 // The list of all the resources displayed in the task manager. They are owned
347 // by the ResourceProviders. 345 // by the ResourceProviders.
(...skipping 27 matching lines...) Expand all
375 // Whether we are currently in the process of updating. 373 // Whether we are currently in the process of updating.
376 UpdateState update_state_; 374 UpdateState update_state_;
377 375
378 // See design doc at http://go/at-teleporter for more information. 376 // See design doc at http://go/at-teleporter for more information.
379 static int goats_teleported_; 377 static int goats_teleported_;
380 378
381 DISALLOW_COPY_AND_ASSIGN(TaskManagerModel); 379 DISALLOW_COPY_AND_ASSIGN(TaskManagerModel);
382 }; 380 };
383 381
384 #endif // CHROME_BROWSER_TASK_MANAGER_H_ 382 #endif // CHROME_BROWSER_TASK_MANAGER_H_
OLDNEW
« no previous file with comments | « base/process_util_linux.cc ('k') | chrome/browser/task_manager.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698