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

Side by Side Diff: chrome/browser/memory_details_win.cc

Issue 306032: Simplify threading in browser thread by making only ChromeThread deal with di... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: a few more simplifications 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
Property Changes:
Added: svn:eol-style
+ LF
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 #include "chrome/browser/memory_details.h" 5 #include "chrome/browser/memory_details.h"
6 #include <psapi.h> 6 #include <psapi.h>
7 7
8 #include "app/l10n_util.h" 8 #include "app/l10n_util.h"
9 #include "base/file_version_info.h" 9 #include "base/file_version_info.h"
10 #include "base/string_util.h" 10 #include "base/string_util.h"
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after
55 process_data_.push_back(process); 55 process_data_.push_back(process);
56 } 56 }
57 } 57 }
58 58
59 ProcessData* MemoryDetails::ChromeBrowser() { 59 ProcessData* MemoryDetails::ChromeBrowser() {
60 return &process_data_[CHROME_BROWSER]; 60 return &process_data_[CHROME_BROWSER];
61 } 61 }
62 62
63 void MemoryDetails::CollectProcessData( 63 void MemoryDetails::CollectProcessData(
64 std::vector<ProcessMemoryInformation> child_info) { 64 std::vector<ProcessMemoryInformation> child_info) {
65 DCHECK(MessageLoop::current() == 65 DCHECK(ChromeThread::CurrentlyOn(ChromeThread::FILE));
66 ChromeThread::GetMessageLoop(ChromeThread::FILE));
67 66
68 // Clear old data. 67 // Clear old data.
69 for (int index = 0; index < arraysize(g_process_template); index++) 68 for (int index = 0; index < arraysize(g_process_template); index++)
70 process_data_[index].processes.clear(); 69 process_data_[index].processes.clear();
71 70
72 SYSTEM_INFO system_info; 71 SYSTEM_INFO system_info;
73 GetNativeSystemInfo(&system_info); 72 GetNativeSystemInfo(&system_info);
74 bool is_64bit_os = 73 bool is_64bit_os =
75 system_info.wProcessorArchitecture == PROCESSOR_ARCHITECTURE_AMD64; 74 system_info.wProcessorArchitecture == PROCESSOR_ARCHITECTURE_AMD64;
76 75
(...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after
147 // Add the process info to our list. 146 // Add the process info to our list.
148 process_data_[index2].processes.push_back(info); 147 process_data_[index2].processes.push_back(info);
149 break; 148 break;
150 } 149 }
151 } while (::Process32Next(snapshot, &process_entry)); 150 } while (::Process32Next(snapshot, &process_entry));
152 151
153 // Finally return to the browser thread. 152 // Finally return to the browser thread.
154 ui_loop_->PostTask(FROM_HERE, 153 ui_loop_->PostTask(FROM_HERE,
155 NewRunnableMethod(this, &MemoryDetails::CollectChildInfoOnUIThread)); 154 NewRunnableMethod(this, &MemoryDetails::CollectChildInfoOnUIThread));
156 } 155 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698