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

Unified Diff: content/child/blink_platform_impl.cc

Issue 1433603004: Add ProcessMetrics::CreateCurrentProcessMetrics() method. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@a_counter_with_ts
Patch Set: Remove patch dependency Created 5 years, 1 month 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 | « content/browser/browser_main_loop.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/child/blink_platform_impl.cc
diff --git a/content/child/blink_platform_impl.cc b/content/child/blink_platform_impl.cc
index 7f99386b21206522a64ba9688703b37b50e1aa79..8b2684fed343fe041d42fbd106562ae5d708af0d 100644
--- a/content/child/blink_platform_impl.cc
+++ b/content/child/blink_platform_impl.cc
@@ -1215,20 +1215,6 @@ blink::WebString BlinkPlatformImpl::signedPublicKeyAndChallengeString(
return blink::WebString("");
}
-static scoped_ptr<base::ProcessMetrics> CurrentProcessMetrics() {
- using base::ProcessMetrics;
-#if defined(OS_MACOSX)
- return scoped_ptr<ProcessMetrics>(
- // The default port provider is sufficient to get data for the current
- // process.
- ProcessMetrics::CreateProcessMetrics(base::GetCurrentProcessHandle(),
- NULL));
-#else
- return scoped_ptr<ProcessMetrics>(
- ProcessMetrics::CreateProcessMetrics(base::GetCurrentProcessHandle()));
-#endif
-}
-
static size_t getMemoryUsageMB(bool bypass_cache) {
size_t current_mem_usage = 0;
MemoryUsageCache* mem_usage_cache_singleton = MemoryUsageCache::GetInstance();
@@ -1268,7 +1254,9 @@ size_t BlinkPlatformImpl::numberOfProcessors() {
bool BlinkPlatformImpl::processMemorySizesInBytes(
size_t* private_bytes,
size_t* shared_bytes) {
- return CurrentProcessMetrics()->GetMemoryBytes(private_bytes, shared_bytes);
+ scoped_ptr<base::ProcessMetrics> current_process_metrics(
+ base::ProcessMetrics::CreateCurrentProcessMetrics());
+ return current_process_metrics->GetMemoryBytes(private_bytes, shared_bytes);
}
bool BlinkPlatformImpl::memoryAllocatorWasteInBytes(size_t* size) {
« no previous file with comments | « content/browser/browser_main_loop.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698