summaryrefslogtreecommitdiffstats
path: root/webkit/glue/webkitclient_impl.cc
diff options
context:
space:
mode:
authorjam@chromium.org <jam@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-03-02 21:21:46 +0000
committerjam@chromium.org <jam@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-03-02 21:21:46 +0000
commit1036feaea6379716f3819c87b83b2018498b5dd8 (patch)
tree50c5b4b746bd2e3055b8f61bb6fd5b2f4293bfc0 /webkit/glue/webkitclient_impl.cc
parent5514473423a04826f6f3029825b6c21391ba247a (diff)
downloadchromium_src-1036feaea6379716f3819c87b83b2018498b5dd8.zip
chromium_src-1036feaea6379716f3819c87b83b2018498b5dd8.tar.gz
chromium_src-1036feaea6379716f3819c87b83b2018498b5dd8.tar.bz2
Note: I'm reverting it to see if it fixes all the dromaeo_test failures.
Revert 40158 - Estimate the renderer working set on Linux. This is less expensive and works in the Chromium SUID sandbox because it does not require access to /proc. BUG=32519 TEST=none Review URL: http://codereview.chromium.org/593060 TBR=thestig@chromium.org Review URL: http://codereview.chromium.org/660400 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@40432 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'webkit/glue/webkitclient_impl.cc')
-rw-r--r--webkit/glue/webkitclient_impl.cc56
1 files changed, 5 insertions, 51 deletions
diff --git a/webkit/glue/webkitclient_impl.cc b/webkit/glue/webkitclient_impl.cc
index 53da614..322ca09 100644
--- a/webkit/glue/webkitclient_impl.cc
+++ b/webkit/glue/webkitclient_impl.cc
@@ -4,14 +4,8 @@
#include "webkit/glue/webkitclient_impl.h"
-#if defined(OS_LINUX)
-#include <malloc.h>
-#endif
-
#include <math.h>
-#include <vector>
-
#include "base/file_path.h"
#include "base/file_util.h"
#include "base/message_loop.h"
@@ -37,10 +31,6 @@
#include "webkit/glue/websocketstreamhandle_impl.h"
#include "webkit/glue/weburlloader_impl.h"
-#if defined(OS_LINUX)
-#include "v8/include/v8.h"
-#endif
-
using WebKit::WebApplicationCacheHost;
using WebKit::WebApplicationCacheHostClient;
using WebKit::WebCookie;
@@ -153,7 +143,7 @@ void WebKitClientImpl::getPluginList(bool refresh,
WideToUTF16Hack(plugin.desc),
FilePathStringToWebString(plugin.path.BaseName().value()));
- for (size_t j = 0; j < plugin.mime_types.size(); ++j) {
+ for (size_t j = 0; j < plugin.mime_types.size(); ++ j) {
const WebPluginMimeType& mime_type = plugin.mime_types[j];
builder->addMediaTypeToLastPlugin(
@@ -319,56 +309,20 @@ WebKit::WebString WebKitClientImpl::signedPublicKeyAndChallengeString(
return WebKit::WebString();
}
-#if defined(OS_LINUX)
-static size_t memoryUsageMBLinux() {
- struct mallinfo minfo = mallinfo();
- uint64_t mem_usage =
-#if defined(USE_TCMALLOC)
- minfo.uordblks
-#else
- (minfo.hblkhd + minfo.arena)
-#endif
- >> 20;
-
- v8::HeapStatistics stat;
- v8::V8::GetHeapStatistics(&stat);
- mem_usage += static_cast<uint64_t>(stat.total_heap_size()) >> 20;
- return mem_usage;
-}
-#endif
-
-#if defined(OS_MACOSX)
-static size_t memoryUsageMBMac() {
+size_t WebKitClientImpl::memoryUsageMB() {
using base::ProcessMetrics;
static ProcessMetrics* process_metrics =
+#if !defined(OS_MACOSX)
+ ProcessMetrics::CreateProcessMetrics(base::GetCurrentProcessHandle());
+#else
// The default port provider is sufficient to get data for the current
// process.
ProcessMetrics::CreateProcessMetrics(base::GetCurrentProcessHandle(),
NULL);
- DCHECK(process_metrics);
- return process_metrics->GetPagefileUsage() >> 20;
-}
#endif
-
-#if !defined(OS_LINUX) && !defined(OS_MACOSX)
-static size_t memoryUsageMBGeneric() {
- using base::ProcessMetrics;
- static ProcessMetrics* process_metrics =
- ProcessMetrics::CreateProcessMetrics(base::GetCurrentProcessHandle());
DCHECK(process_metrics);
return process_metrics->GetPagefileUsage() >> 20;
}
-#endif
-
-size_t WebKitClientImpl::memoryUsageMB() {
-#if defined(OS_LINUX)
- return memoryUsageMBLinux();
-#elif defined(OS_MACOSX)
- return memoryUsageMBMac();
-#else
- return memoryUsageMBGeneric();
-#endif
-}
bool WebKitClientImpl::fileExists(const WebKit::WebString& path) {
FilePath::StringType file_path = webkit_glue::WebStringToFilePathString(path);