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 |
11 #include <math.h> | 11 #include <math.h> |
12 | 12 |
13 #include <vector> | 13 #include <vector> |
14 | 14 |
| 15 #include "base/allocator/allocator_extension.h" |
15 #include "base/bind.h" | 16 #include "base/bind.h" |
16 #include "base/debug/trace_event.h" | 17 #include "base/debug/trace_event.h" |
17 #include "base/memory/scoped_ptr.h" | 18 #include "base/memory/scoped_ptr.h" |
18 #include "base/memory/singleton.h" | 19 #include "base/memory/singleton.h" |
19 #include "base/message_loop.h" | 20 #include "base/message_loop.h" |
20 #include "base/metrics/histogram.h" | 21 #include "base/metrics/histogram.h" |
21 #include "base/metrics/stats_counters.h" | 22 #include "base/metrics/stats_counters.h" |
22 #include "base/platform_file.h" | 23 #include "base/platform_file.h" |
23 #include "base/process_util.h" | 24 #include "base/process_util.h" |
24 #include "base/rand_util.h" | 25 #include "base/rand_util.h" |
(...skipping 788 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
813 return base::SysInfo::DalvikHeapSizeMB() / 8; | 814 return base::SysInfo::DalvikHeapSizeMB() / 8; |
814 } | 815 } |
815 #endif | 816 #endif |
816 | 817 |
817 bool WebKitPlatformSupportImpl::processMemorySizesInBytes( | 818 bool WebKitPlatformSupportImpl::processMemorySizesInBytes( |
818 size_t* private_bytes, | 819 size_t* private_bytes, |
819 size_t* shared_bytes) { | 820 size_t* shared_bytes) { |
820 return CurrentProcessMetrics()->GetMemoryBytes(private_bytes, shared_bytes); | 821 return CurrentProcessMetrics()->GetMemoryBytes(private_bytes, shared_bytes); |
821 } | 822 } |
822 | 823 |
| 824 bool WebKitPlatformSupportImpl::memoryAllocatorInternalsInBytes(size_t* size) { |
| 825 return base::allocator::GetAllocatorWasteSize(size); |
| 826 } |
| 827 |
823 void WebKitPlatformSupportImpl::SuspendSharedTimer() { | 828 void WebKitPlatformSupportImpl::SuspendSharedTimer() { |
824 ++shared_timer_suspended_; | 829 ++shared_timer_suspended_; |
825 } | 830 } |
826 | 831 |
827 void WebKitPlatformSupportImpl::ResumeSharedTimer() { | 832 void WebKitPlatformSupportImpl::ResumeSharedTimer() { |
828 // The shared timer may have fired or been adjusted while we were suspended. | 833 // The shared timer may have fired or been adjusted while we were suspended. |
829 if (--shared_timer_suspended_ == 0 && !shared_timer_.IsRunning()) { | 834 if (--shared_timer_suspended_ == 0 && !shared_timer_.IsRunning()) { |
830 setSharedTimerFireInterval( | 835 setSharedTimerFireInterval( |
831 shared_timer_fire_time_ - monotonicallyIncreasingTime()); | 836 shared_timer_fire_time_ - monotonicallyIncreasingTime()); |
832 } | 837 } |
(...skipping 18 matching lines...) Expand all Loading... |
851 worker_task_runner->OnWorkerRunLoopStopped(runLoop); | 856 worker_task_runner->OnWorkerRunLoopStopped(runLoop); |
852 } | 857 } |
853 | 858 |
854 #if defined(OS_ANDROID) | 859 #if defined(OS_ANDROID) |
855 WebKit::WebFlingAnimator* WebKitPlatformSupportImpl::createFlingAnimator() { | 860 WebKit::WebFlingAnimator* WebKitPlatformSupportImpl::createFlingAnimator() { |
856 return new FlingAnimatorImpl(); | 861 return new FlingAnimatorImpl(); |
857 } | 862 } |
858 #endif | 863 #endif |
859 | 864 |
860 } // namespace webkit_glue | 865 } // namespace webkit_glue |
OLD | NEW |