| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 #include "chrome/browser/process_info_snapshot.h" | 5 #include "chrome/browser/process_info_snapshot.h" |
| 6 | 6 |
| 7 #include <sys/sysctl.h> | 7 #include <sys/sysctl.h> |
| 8 | 8 |
| 9 #include <sstream> | 9 #include <sstream> |
| 10 | 10 |
| 11 #include "base/command_line.h" | 11 #include "base/command_line.h" |
| 12 #include "base/files/file_path.h" |
| 12 #include "base/logging.h" | 13 #include "base/logging.h" |
| 14 #include "base/process/launch.h" |
| 13 #include "base/strings/string_number_conversions.h" | 15 #include "base/strings/string_number_conversions.h" |
| 14 #include "base/strings/string_util.h" | 16 #include "base/strings/string_util.h" |
| 15 #include "base/threading/thread.h" | 17 #include "base/threading/thread.h" |
| 16 | 18 |
| 17 // Default constructor. | 19 // Default constructor. |
| 18 ProcessInfoSnapshot::ProcessInfoSnapshot() { } | 20 ProcessInfoSnapshot::ProcessInfoSnapshot() { } |
| 19 | 21 |
| 20 // Destructor: just call |Reset()| to release everything. | 22 // Destructor: just call |Reset()| to release everything. |
| 21 ProcessInfoSnapshot::~ProcessInfoSnapshot() { | 23 ProcessInfoSnapshot::~ProcessInfoSnapshot() { |
| 22 Reset(); | 24 Reset(); |
| (...skipping 363 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 386 ws_usage->shareable = 0; | 388 ws_usage->shareable = 0; |
| 387 ws_usage->shared = 0; | 389 ws_usage->shared = 0; |
| 388 return false; | 390 return false; |
| 389 } | 391 } |
| 390 | 392 |
| 391 ws_usage->priv = proc_info.rprvt / 1024; | 393 ws_usage->priv = proc_info.rprvt / 1024; |
| 392 ws_usage->shareable = proc_info.rss / 1024; | 394 ws_usage->shareable = proc_info.rss / 1024; |
| 393 ws_usage->shared = proc_info.rshrd / 1024; | 395 ws_usage->shared = proc_info.rshrd / 1024; |
| 394 return true; | 396 return true; |
| 395 } | 397 } |
| OLD | NEW |