| OLD | NEW |
| 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 Loading... |
| 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 Loading... |
| 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 |
| OLD | NEW |