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

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: Moved { on the previous line 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
Index: webkit/glue/webkitplatformsupport_impl.cc
diff --git a/webkit/glue/webkitplatformsupport_impl.cc b/webkit/glue/webkitplatformsupport_impl.cc
index 16358ffdda817ec39882af2e2227e05634079397..6b4a8590a7f39663b6ac90e79d5e1e06fb55405c 100644
--- a/webkit/glue/webkitplatformsupport_impl.cc
+++ b/webkit/glue/webkitplatformsupport_impl.cc
@@ -681,6 +681,23 @@ size_t WebKitPlatformSupportImpl::actualMemoryUsageMB() {
return getMemoryUsageMB(true);
}
+bool WebKitPlatformSupportImpl::getProcessMemorySize(size_t* private_bytes,
+ size_t* shared_bytes) {
+ using base::ProcessMetrics;
+#if defined(OS_MACOSX)
+ static ProcessMetrics* process_metrics =
tony 2012/05/29 18:11:18 CR_DEFINE_STATIC_LOCAL. It would be nice if we co
yurys 2012/05/30 08:06:27 CR_DEFINE_STATIC_LOCAL cannot be used here as it c
+ // The default port provider is sufficient to get data for the current
+ // process.
+ ProcessMetrics::CreateProcessMetrics(base::GetCurrentProcessHandle(),
+ NULL);
+#else
+ static ProcessMetrics* process_metrics =
tony 2012/05/29 18:11:18 CR_DEFINE_STATIC_LOCAL
yurys 2012/05/30 08:06:27 See my previous comment.
+ ProcessMetrics::CreateProcessMetrics(base::GetCurrentProcessHandle());
+#endif
+ DCHECK(process_metrics);
+ return process_metrics->GetMemoryBytes(private_bytes, shared_bytes);
+}
+
void WebKitPlatformSupportImpl::SuspendSharedTimer() {
++shared_timer_suspended_;
}
« webkit/glue/webkitplatformsupport_impl.h ('K') | « webkit/glue/webkitplatformsupport_impl.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698