summaryrefslogtreecommitdiffstats
path: root/chrome
diff options
context:
space:
mode:
authorthakis@chromium.org <thakis@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-12-19 01:31:03 +0000
committerthakis@chromium.org <thakis@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-12-19 01:31:03 +0000
commit0d525036512529fc73287726ac65649040672f86 (patch)
treec7228937ed591491d541b76aee909ee3090fb1db /chrome
parent27f2b6626e1c0e71d8b8e5d20e017beee762d7d6 (diff)
downloadchromium_src-0d525036512529fc73287726ac65649040672f86.zip
chromium_src-0d525036512529fc73287726ac65649040672f86.tar.gz
chromium_src-0d525036512529fc73287726ac65649040672f86.tar.bz2
Revert 34994, maybe it regressed startup perf - Fix cpu/memory measurements on OS X.
Right now, this only works for the current process; support for child processes will be added in a later CL. BUG=13156,25454 TEST=Hook up task manager (connect menu item to commandDispatch:, give it the right tag). Stats for the browser process should now be right, and %cpu should be 0 (for now) for all other processes. Review URL: http://codereview.chromium.org/500118 TBR=thakis@chromium.org Review URL: http://codereview.chromium.org/504068 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@35025 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome')
-rw-r--r--chrome/browser/safe_browsing/safe_browsing_database_unittest.cc5
-rw-r--r--chrome/browser/task_manager.cc13
-rw-r--r--chrome/common/mach_ipc_mac.h5
-rw-r--r--chrome/common/mach_ipc_mac.mm8
-rw-r--r--chrome/test/chrome_process_util.h7
5 files changed, 10 insertions, 28 deletions
diff --git a/chrome/browser/safe_browsing/safe_browsing_database_unittest.cc b/chrome/browser/safe_browsing/safe_browsing_database_unittest.cc
index 30f9de4..3d244c0 100644
--- a/chrome/browser/safe_browsing/safe_browsing_database_unittest.cc
+++ b/chrome/browser/safe_browsing/safe_browsing_database_unittest.cc
@@ -1078,12 +1078,7 @@ void PeformUpdate(const std::wstring& initial_db,
Time before_time = Time::Now();
base::ProcessHandle handle = base::Process::Current().handle();
scoped_ptr<base::ProcessMetrics> metric(
-#if !defined(OS_MACOSX)
base::ProcessMetrics::CreateProcessMetrics(handle));
-#else
- // Getting stats only for the current process is enough, so NULL is fine.
- base::ProcessMetrics::CreateProcessMetrics(handle, NULL));
-#endif
CHECK(metric->GetIOCounters(&before));
std::vector<SBListChunkRanges> lists;
diff --git a/chrome/browser/task_manager.cc b/chrome/browser/task_manager.cc
index edd7b37..43952a5 100644
--- a/chrome/browser/task_manager.cc
+++ b/chrome/browser/task_manager.cc
@@ -533,14 +533,7 @@ void TaskManagerModel::AddResource(TaskManager::Resource* resource) {
// Create the ProcessMetrics for this process if needed (not in map).
if (metrics_map_.find(process) == metrics_map_.end()) {
base::ProcessMetrics* pm =
-#if !defined(OS_MACOSX)
base::ProcessMetrics::CreateProcessMetrics(process);
-#else
- // TODO(thakis): Write a port provider that knows the task ports of
- // child processes.
- base::ProcessMetrics::CreateProcessMetrics(process, NULL);
-#endif
-
metrics_map_[process] = pm;
}
@@ -777,12 +770,12 @@ void TaskManagerModel::OnJobRemoved(URLRequestJob* job) {
}
void TaskManagerModel::OnJobDone(URLRequestJob* job,
- const URLRequestStatus& status) {
+ const URLRequestStatus& status) {
}
void TaskManagerModel::OnJobRedirect(URLRequestJob* job,
- const GURL& location,
- int status_code) {
+ const GURL& location,
+ int status_code) {
}
void TaskManagerModel::OnBytesRead(URLRequestJob* job, int byte_count) {
diff --git a/chrome/common/mach_ipc_mac.h b/chrome/common/mach_ipc_mac.h
index 42b9c65..8c345dd 100644
--- a/chrome/common/mach_ipc_mac.h
+++ b/chrome/common/mach_ipc_mac.h
@@ -167,9 +167,8 @@ class MachMessage {
bool AddDescriptor(const MachMsgPortDescriptor &desc);
int GetDescriptorCount() const {
- return storage_->body.msgh_descriptor_count;
- }
-
+ return storage_->body.msgh_descriptor_count;
+ }
MachMsgPortDescriptor *GetDescriptor(int n);
// Convenience method which gets the mach port described by the descriptor
diff --git a/chrome/common/mach_ipc_mac.mm b/chrome/common/mach_ipc_mac.mm
index 7693d9a..3c95ef6 100644
--- a/chrome/common/mach_ipc_mac.mm
+++ b/chrome/common/mach_ipc_mac.mm
@@ -213,10 +213,10 @@ ReceivePort::ReceivePort() {
if (init_result_ != KERN_SUCCESS)
return;
- init_result_ = mach_port_insert_right(current_task,
- port_,
- port_,
- MACH_MSG_TYPE_MAKE_SEND);
+ init_result_ = mach_port_insert_right(current_task,
+ port_,
+ port_,
+ MACH_MSG_TYPE_MAKE_SEND);
}
//==============================================================================
diff --git a/chrome/test/chrome_process_util.h b/chrome/test/chrome_process_util.h
index 4fb1513..19a5446 100644
--- a/chrome/test/chrome_process_util.h
+++ b/chrome/test/chrome_process_util.h
@@ -57,12 +57,7 @@ class ChromeTestProcessMetrics {
private:
explicit ChromeTestProcessMetrics(base::ProcessHandle process) {
- process_metrics_.reset(
-#if !defined(OS_MACOSX)
- base::ProcessMetrics::CreateProcessMetrics(process));
-#else
- base::ProcessMetrics::CreateProcessMetrics(process, NULL));
-#endif
+ process_metrics_.reset(base::ProcessMetrics::CreateProcessMetrics(process));
process_handle_ = process;
}