| OLD | NEW |
| 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 #include "chrome/browser/memory_details.h" | 5 #include "chrome/browser/memory_details.h" |
| 6 | 6 |
| 7 #include <unistd.h> | 7 #include <unistd.h> |
| 8 #include <fcntl.h> | 8 #include <fcntl.h> |
| 9 #include <dirent.h> | 9 #include <dirent.h> |
| 10 | 10 |
| (...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 51 { "firefox-3.5", FIREFOX }, | 51 { "firefox-3.5", FIREFOX }, |
| 52 { "firefox-3.0", FIREFOX }, | 52 { "firefox-3.0", FIREFOX }, |
| 53 { "opera", OPERA }, | 53 { "opera", OPERA }, |
| 54 { "konqueror", KONQUEROR }, | 54 { "konqueror", KONQUEROR }, |
| 55 { "epiphany-browser", EPIPHANY }, | 55 { "epiphany-browser", EPIPHANY }, |
| 56 { "epiphany", EPIPHANY }, | 56 { "epiphany", EPIPHANY }, |
| 57 { "midori", MIDORI }, | 57 { "midori", MIDORI }, |
| 58 { "", MAX_BROWSERS }, | 58 { "", MAX_BROWSERS }, |
| 59 }; | 59 }; |
| 60 | 60 |
| 61 MemoryDetails::MemoryDetails() | 61 MemoryDetails::MemoryDetails() { |
| 62 : ui_loop_(NULL) { | |
| 63 } | 62 } |
| 64 | 63 |
| 65 ProcessData* MemoryDetails::ChromeBrowser() { | 64 ProcessData* MemoryDetails::ChromeBrowser() { |
| 66 return &process_data_[0]; | 65 return &process_data_[0]; |
| 67 } | 66 } |
| 68 | 67 |
| 69 struct Process { | 68 struct Process { |
| 70 pid_t pid; | 69 pid_t pid; |
| 71 pid_t parent; | 70 pid_t parent; |
| 72 std::string name; | 71 std::string name; |
| (...skipping 172 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 245 if (type != MAX_BROWSERS) | 244 if (type != MAX_BROWSERS) |
| 246 browser.name = ASCIIToWide(kBrowserPrettyNames[type]); | 245 browser.name = ASCIIToWide(kBrowserPrettyNames[type]); |
| 247 break; | 246 break; |
| 248 } | 247 } |
| 249 } | 248 } |
| 250 | 249 |
| 251 process_data_.push_back(browser); | 250 process_data_.push_back(browser); |
| 252 } | 251 } |
| 253 | 252 |
| 254 // Finally return to the browser thread. | 253 // Finally return to the browser thread. |
| 255 ui_loop_->PostTask(FROM_HERE, | 254 ChromeThread::PostTask( |
| 255 ChromeThread::UI, FROM_HERE, |
| 256 NewRunnableMethod(this, &MemoryDetails::CollectChildInfoOnUIThread)); | 256 NewRunnableMethod(this, &MemoryDetails::CollectChildInfoOnUIThread)); |
| 257 } | 257 } |
| OLD | NEW |