OLD | NEW |
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2013 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/child/webkit_child_helpers.h" | 5 #include "webkit/child/webkit_child_helpers.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 |
11 #include "base/logging.h" | 11 #include "base/logging.h" |
12 #include "base/memory/scoped_ptr.h" | 12 #include "base/memory/scoped_ptr.h" |
13 #include "base/process_util.h" | 13 #include "base/process/process_metrics.h" |
14 #include "v8/include/v8.h" | 14 #include "v8/include/v8.h" |
15 | 15 |
16 namespace webkit_glue { | 16 namespace webkit_glue { |
17 | 17 |
18 #if defined(OS_LINUX) || defined(OS_ANDROID) | 18 #if defined(OS_LINUX) || defined(OS_ANDROID) |
19 size_t MemoryUsageKB() { | 19 size_t MemoryUsageKB() { |
20 struct mallinfo minfo = mallinfo(); | 20 struct mallinfo minfo = mallinfo(); |
21 uint64_t mem_usage = | 21 uint64_t mem_usage = |
22 #if defined(USE_TCMALLOC) | 22 #if defined(USE_TCMALLOC) |
23 minfo.uordblks | 23 minfo.uordblks |
(...skipping 20 matching lines...) Expand all Loading... |
44 #else | 44 #else |
45 size_t MemoryUsageKB() { | 45 size_t MemoryUsageKB() { |
46 scoped_ptr<base::ProcessMetrics> process_metrics( | 46 scoped_ptr<base::ProcessMetrics> process_metrics( |
47 base::ProcessMetrics::CreateProcessMetrics( | 47 base::ProcessMetrics::CreateProcessMetrics( |
48 base::GetCurrentProcessHandle())); | 48 base::GetCurrentProcessHandle())); |
49 return process_metrics->GetPagefileUsage() >> 10; | 49 return process_metrics->GetPagefileUsage() >> 10; |
50 } | 50 } |
51 #endif | 51 #endif |
52 | 52 |
53 } // webkit_glue | 53 } // webkit_glue |
OLD | NEW |