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_; |
} |