summaryrefslogtreecommitdiffstats
path: root/chrome/test/perf
diff options
context:
space:
mode:
authorpaul@chromium.org <paul@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-08-25 21:00:40 +0000
committerpaul@chromium.org <paul@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-08-25 21:00:40 +0000
commit3e39eaddf605708bf70cd138703a91de7e3372e0 (patch)
treeccc9c526d618c1aa91b9672c884413cd96e97bf3 /chrome/test/perf
parent158613cfe50a24f729bf756dd763463799251a11 (diff)
downloadchromium_src-3e39eaddf605708bf70cd138703a91de7e3372e0.zip
chromium_src-3e39eaddf605708bf70cd138703a91de7e3372e0.tar.gz
chromium_src-3e39eaddf605708bf70cd138703a91de7e3372e0.tar.bz2
First part of getting memory_tests running on Mac.
This CL provides the scaffolding for subsequent changes. BUG=16434 (http://crbug.com/16434) TEST=Nothing yet. Review URL: http://codereview.chromium.org/174402 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@24313 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/test/perf')
-rw-r--r--chrome/test/perf/mem_usage.h10
-rw-r--r--chrome/test/perf/mem_usage_linux.cc26
-rw-r--r--chrome/test/perf/mem_usage_mac.cc28
-rw-r--r--chrome/test/perf/mem_usage_win.cc (renamed from chrome/test/perf/mem_usage.cc)12
4 files changed, 66 insertions, 10 deletions
diff --git a/chrome/test/perf/mem_usage.h b/chrome/test/perf/mem_usage.h
index 7a8041e..7d76a65 100644
--- a/chrome/test/perf/mem_usage.h
+++ b/chrome/test/perf/mem_usage.h
@@ -5,6 +5,8 @@
#ifndef CHROME_TEST_PERF_MEM_USAGE_H_
#define CHROME_TEST_PERF_MEM_USAGE_H_
+#include "base/basictypes.h"
+
// Get memory information for the process with given process ID.
//
// The Windows psapi provides memory information of a process through structure
@@ -29,10 +31,10 @@
// and PeakPagefileUsage (returned by peak_virtual_size), Working Set and
// Peak working Set.
bool GetMemoryInfo(uint32 process_id,
- size_t *peak_virtual_size,
- size_t *current_virtual_size,
- size_t *peak_working_set_size,
- size_t *current_working_set_size);
+ size_t* peak_virtual_size,
+ size_t* current_virtual_size,
+ size_t* peak_working_set_size,
+ size_t* current_working_set_size);
// Get the number of bytes currently committed by the system.
// Returns -1 on failure.
diff --git a/chrome/test/perf/mem_usage_linux.cc b/chrome/test/perf/mem_usage_linux.cc
new file mode 100644
index 0000000..0d3b825
--- /dev/null
+++ b/chrome/test/perf/mem_usage_linux.cc
@@ -0,0 +1,26 @@
+// Copyright (c) 2009 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#include "chrome/test/perf/mem_usage.h"
+
+#include "base/logging.h"
+
+bool GetMemoryInfo(uint32 process_id,
+ size_t* peak_virtual_size,
+ size_t* current_virtual_size,
+ size_t* peak_working_set_size,
+ size_t* current_working_set_size) {
+ NOTIMPLEMENTED();
+ return false;
+}
+
+size_t GetSystemCommitCharge() {
+ NOTIMPLEMENTED();
+ return 0;
+}
+
+void PrintChromeMemoryUsageInfo() {
+ NOTIMPLEMENTED();
+}
+
diff --git a/chrome/test/perf/mem_usage_mac.cc b/chrome/test/perf/mem_usage_mac.cc
new file mode 100644
index 0000000..671c989
--- /dev/null
+++ b/chrome/test/perf/mem_usage_mac.cc
@@ -0,0 +1,28 @@
+// Copyright (c) 2009 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#include "chrome/test/perf/mem_usage.h"
+
+#include <mach/mach.h>
+
+#include "base/logging.h"
+
+bool GetMemoryInfo(uint32 process_id,
+ size_t* peak_virtual_size,
+ size_t* current_virtual_size,
+ size_t* peak_working_set_size,
+ size_t* current_working_set_size) {
+ NOTIMPLEMENTED();
+ return false;
+}
+
+size_t GetSystemCommitCharge() {
+ NOTIMPLEMENTED();
+ return 0;
+}
+
+void PrintChromeMemoryUsageInfo() {
+ NOTIMPLEMENTED();
+}
+
diff --git a/chrome/test/perf/mem_usage.cc b/chrome/test/perf/mem_usage_win.cc
index f67e56a..8759c97 100644
--- a/chrome/test/perf/mem_usage.cc
+++ b/chrome/test/perf/mem_usage_win.cc
@@ -2,23 +2,23 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
+#include "chrome/test/perf/mem_usage.h"
+
#include <windows.h>
#include <psapi.h>
-#include "base/basictypes.h"
#include "base/file_path.h"
#include "base/path_service.h"
#include "base/process_util.h"
#include "chrome/common/chrome_constants.h"
#include "chrome/common/chrome_paths.h"
#include "chrome/test/chrome_process_util.h"
-#include "chrome/test/perf/mem_usage.h"
bool GetMemoryInfo(uint32 process_id,
- size_t *peak_virtual_size,
- size_t *current_virtual_size,
- size_t *peak_working_set_size,
- size_t *current_working_set_size) {
+ size_t* peak_virtual_size,
+ size_t* current_virtual_size,
+ size_t* peak_working_set_size,
+ size_t* current_working_set_size) {
if (!peak_virtual_size || !current_virtual_size)
return false;