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

Side by Side Diff: webkit/glue/webkitplatformsupport_impl.cc

Issue 9138019: Estimate renderer memory usage in MacOS via working set size instead of page file size. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 11 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "webkit/glue/webkitplatformsupport_impl.h" 5 #include "webkit/glue/webkitplatformsupport_impl.h"
6 6
7 #if defined(OS_LINUX) 7 #if defined(OS_LINUX)
8 #include <malloc.h> 8 #include <malloc.h>
9 #endif 9 #endif
10 10
(...skipping 627 matching lines...) Expand 10 before | Expand all | Expand 10 after
638 638
639 #if defined(OS_MACOSX) 639 #if defined(OS_MACOSX)
640 static size_t memoryUsageMBMac() { 640 static size_t memoryUsageMBMac() {
641 using base::ProcessMetrics; 641 using base::ProcessMetrics;
642 static ProcessMetrics* process_metrics = 642 static ProcessMetrics* process_metrics =
643 // The default port provider is sufficient to get data for the current 643 // The default port provider is sufficient to get data for the current
644 // process. 644 // process.
645 ProcessMetrics::CreateProcessMetrics(base::GetCurrentProcessHandle(), 645 ProcessMetrics::CreateProcessMetrics(base::GetCurrentProcessHandle(),
646 NULL); 646 NULL);
647 DCHECK(process_metrics); 647 DCHECK(process_metrics);
648 return process_metrics->GetPagefileUsage() >> 20; 648 return process_metrics->GetWorkingSetSize() >> 20;
649 } 649 }
650 #endif 650 #endif
651 651
652 #if !defined(OS_LINUX) && !defined(OS_MACOSX) 652 #if !defined(OS_LINUX) && !defined(OS_MACOSX)
653 static size_t memoryUsageMBGeneric() { 653 static size_t memoryUsageMBGeneric() {
654 using base::ProcessMetrics; 654 using base::ProcessMetrics;
655 static ProcessMetrics* process_metrics = 655 static ProcessMetrics* process_metrics =
656 ProcessMetrics::CreateProcessMetrics(base::GetCurrentProcessHandle()); 656 ProcessMetrics::CreateProcessMetrics(base::GetCurrentProcessHandle());
657 DCHECK(process_metrics); 657 DCHECK(process_metrics);
658 return process_metrics->GetPagefileUsage() >> 20; 658 return process_metrics->GetPagefileUsage() >> 20;
(...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after
711 worker_task_runner->OnWorkerRunLoopStarted(runLoop); 711 worker_task_runner->OnWorkerRunLoopStarted(runLoop);
712 } 712 }
713 713
714 void WebKitPlatformSupportImpl::didStopWorkerRunLoop( 714 void WebKitPlatformSupportImpl::didStopWorkerRunLoop(
715 const WebKit::WebWorkerRunLoop& runLoop) { 715 const WebKit::WebWorkerRunLoop& runLoop) {
716 WorkerTaskRunner* worker_task_runner = WorkerTaskRunner::Instance(); 716 WorkerTaskRunner* worker_task_runner = WorkerTaskRunner::Instance();
717 worker_task_runner->OnWorkerRunLoopStopped(runLoop); 717 worker_task_runner->OnWorkerRunLoopStopped(runLoop);
718 } 718 }
719 719
720 } // namespace webkit_glue 720 } // namespace webkit_glue
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698