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

Unified Diff: webkit/glue/webkitclient_impl.cc

Issue 332010: Expose a method to access amount of memory used by the current process. (Closed) Base URL: http://src.chromium.org/svn/trunk/src/
Patch Set: '' Created 11 years, 2 months 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « webkit/glue/webkitclient_impl.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: webkit/glue/webkitclient_impl.cc
===================================================================
--- webkit/glue/webkitclient_impl.cc (revision 30574)
+++ webkit/glue/webkitclient_impl.cc (working copy)
@@ -15,6 +15,7 @@
#include "base/file_path.h"
#include "base/file_util.h"
#include "base/message_loop.h"
+#include "base/process_util.h"
#include "base/platform_file.h"
#include "base/stats_counters.h"
#include "base/string_util.h"
@@ -363,6 +364,14 @@
return WebKit::WebString();
}
+int WebKitClientImpl::memoryUsageMB() {
+ using base::ProcessMetrics;
+ static ProcessMetrics* process_metrics =
+ ProcessMetrics::CreateProcessMetrics(base::GetCurrentProcessHandle());
+ DCHECK(process_metrics);
+ return process_metrics->GetPagefileUsage() >> 20;
+}
+
bool WebKitClientImpl::fileExists(const WebKit::WebString& path) {
FilePath::StringType file_path = webkit_glue::WebStringToFilePathString(path);
return file_util::PathExists(FilePath(file_path));
« no previous file with comments | « webkit/glue/webkitclient_impl.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698