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

Unified Diff: webkit/glue/webkitplatformsupport_impl.cc

Issue 9669039: Provide access to process private and shared memory size from WebKit code (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Return both private and shared memory size in one call Created 8 years, 9 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/webkitplatformsupport_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/webkitplatformsupport_impl.cc
diff --git a/webkit/glue/webkitplatformsupport_impl.cc b/webkit/glue/webkitplatformsupport_impl.cc
index 16358ffdda817ec39882af2e2227e05634079397..102d0bf570e1c5d45ba4506f17cb2cca6074a925 100644
--- a/webkit/glue/webkitplatformsupport_impl.cc
+++ b/webkit/glue/webkitplatformsupport_impl.cc
@@ -681,6 +681,24 @@ size_t WebKitPlatformSupportImpl::actualMemoryUsageMB() {
return getMemoryUsageMB(true);
}
+bool WebKitPlatformSupportImpl::getProcessMemorySize(size_t* private_bytes,
+ size_t* shared_bytes)
+{
pfeldman 2012/03/11 15:25:26 { on wrong line.
yurys 2012/03/11 15:25:58 Done.
+ using base::ProcessMetrics;
+#if defined(OS_MACOSX)
+ static ProcessMetrics* process_metrics =
+ // The default port provider is sufficient to get data for the current
+ // process.
+ ProcessMetrics::CreateProcessMetrics(base::GetCurrentProcessHandle(),
+ NULL);
+#else
+ static ProcessMetrics* process_metrics =
+ ProcessMetrics::CreateProcessMetrics(base::GetCurrentProcessHandle());
+#endif
+ DCHECK(process_metrics);
+ return process_metrics->GetMemoryBytes(private_bytes, shared_bytes);
+}
+
void WebKitPlatformSupportImpl::SuspendSharedTimer() {
++shared_timer_suspended_;
}
« no previous file with comments | « webkit/glue/webkitplatformsupport_impl.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698