OLD | NEW |
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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/task_manager/task_manager.h" | 5 #include "chrome/browser/task_manager/task_manager.h" |
6 | 6 |
7 #include "app/l10n_util.h" | 7 #include "app/l10n_util.h" |
8 #include "app/resource_bundle.h" | 8 #include "app/resource_bundle.h" |
9 #include "base/compiler_specific.h" | 9 #include "base/compiler_specific.h" |
10 #include "base/i18n/number_formatting.h" | 10 #include "base/i18n/number_formatting.h" |
(...skipping 609 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
620 resources_.insert(++iter, resource); | 620 resources_.insert(++iter, resource); |
621 } | 621 } |
622 | 622 |
623 // Create the ProcessMetrics for this process if needed (not in map). | 623 // Create the ProcessMetrics for this process if needed (not in map). |
624 if (metrics_map_.find(process) == metrics_map_.end()) { | 624 if (metrics_map_.find(process) == metrics_map_.end()) { |
625 base::ProcessMetrics* pm = | 625 base::ProcessMetrics* pm = |
626 #if !defined(OS_MACOSX) | 626 #if !defined(OS_MACOSX) |
627 base::ProcessMetrics::CreateProcessMetrics(process); | 627 base::ProcessMetrics::CreateProcessMetrics(process); |
628 #else | 628 #else |
629 base::ProcessMetrics::CreateProcessMetrics(process, | 629 base::ProcessMetrics::CreateProcessMetrics(process, |
630 MachBroker::instance()); | 630 MachBroker::GetInstance()); |
631 #endif | 631 #endif |
632 | 632 |
633 metrics_map_[process] = pm; | 633 metrics_map_[process] = pm; |
634 } | 634 } |
635 | 635 |
636 // Notify the table that the contents have changed for it to redraw. | 636 // Notify the table that the contents have changed for it to redraw. |
637 FOR_EACH_OBSERVER(TaskManagerModelObserver, observer_list_, | 637 FOR_EACH_OBSERVER(TaskManagerModelObserver, observer_list_, |
638 OnItemsAdded(new_entry_index, 1)); | 638 OnItemsAdded(new_entry_index, 1)); |
639 } | 639 } |
640 | 640 |
(...skipping 383 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1024 MetricsMap::const_iterator iter = metrics_map_.find(handle); | 1024 MetricsMap::const_iterator iter = metrics_map_.find(handle); |
1025 if (iter == metrics_map_.end()) | 1025 if (iter == metrics_map_.end()) |
1026 return false; | 1026 return false; |
1027 | 1027 |
1028 if (!iter->second->GetMemoryBytes(&usage->first, &usage->second)) | 1028 if (!iter->second->GetMemoryBytes(&usage->first, &usage->second)) |
1029 return false; | 1029 return false; |
1030 | 1030 |
1031 memory_usage_map_.insert(std::make_pair(handle, *usage)); | 1031 memory_usage_map_.insert(std::make_pair(handle, *usage)); |
1032 return true; | 1032 return true; |
1033 } | 1033 } |
OLD | NEW |