| 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/memory_details.h" | 5 #include "chrome/browser/memory_details.h" |
| 6 | 6 |
| 7 #include <psapi.h> | 7 #include <psapi.h> |
| 8 | 8 |
| 9 #include "base/file_path.h" | 9 #include "base/file_path.h" |
| 10 #include "base/file_version_info.h" | 10 #include "base/file_version_info.h" |
| (...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 58 process.process_name = process_template[index].process_name; | 58 process.process_name = process_template[index].process_name; |
| 59 process_data_.push_back(process); | 59 process_data_.push_back(process); |
| 60 } | 60 } |
| 61 } | 61 } |
| 62 | 62 |
| 63 ProcessData* MemoryDetails::ChromeBrowser() { | 63 ProcessData* MemoryDetails::ChromeBrowser() { |
| 64 return &process_data_[CHROME_BROWSER]; | 64 return &process_data_[CHROME_BROWSER]; |
| 65 } | 65 } |
| 66 | 66 |
| 67 void MemoryDetails::CollectProcessData( | 67 void MemoryDetails::CollectProcessData( |
| 68 std::vector<ProcessMemoryInformation> child_info) { | 68 const std::vector<ProcessMemoryInformation>& child_info) { |
| 69 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::FILE)); | 69 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::FILE)); |
| 70 | 70 |
| 71 // Clear old data. | 71 // Clear old data. |
| 72 for (unsigned int index = 0; index < process_data_.size(); index++) | 72 for (unsigned int index = 0; index < process_data_.size(); index++) |
| 73 process_data_[index].processes.clear(); | 73 process_data_[index].processes.clear(); |
| 74 | 74 |
| 75 base::win::WindowsArchitecture windows_architecture = | 75 base::win::WindowsArchitecture windows_architecture = |
| 76 base::win::GetWindowsArchitecture(); | 76 base::win::GetWindowsArchitecture(); |
| 77 | 77 |
| 78 base::win::ScopedHandle snapshot( | 78 base::win::ScopedHandle snapshot( |
| (...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 151 } | 151 } |
| 152 break; | 152 break; |
| 153 } | 153 } |
| 154 } while (::Process32Next(snapshot, &process_entry)); | 154 } while (::Process32Next(snapshot, &process_entry)); |
| 155 | 155 |
| 156 // Finally return to the browser thread. | 156 // Finally return to the browser thread. |
| 157 BrowserThread::PostTask( | 157 BrowserThread::PostTask( |
| 158 BrowserThread::UI, FROM_HERE, | 158 BrowserThread::UI, FROM_HERE, |
| 159 NewRunnableMethod(this, &MemoryDetails::CollectChildInfoOnUIThread)); | 159 NewRunnableMethod(this, &MemoryDetails::CollectChildInfoOnUIThread)); |
| 160 } | 160 } |
| OLD | NEW |