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 799 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
824 return base::SysInfo::DalvikHeapSizeMB() / 8; | 825 return base::SysInfo::DalvikHeapSizeMB() / 8; |
825 } | 826 } |
826 #endif | 827 #endif |
827 | 828 |
828 bool WebKitPlatformSupportImpl::processMemorySizesInBytes( | 829 bool WebKitPlatformSupportImpl::processMemorySizesInBytes( |
829 size_t* private_bytes, | 830 size_t* private_bytes, |
830 size_t* shared_bytes) { | 831 size_t* shared_bytes) { |
831 return CurrentProcessMetrics()->GetMemoryBytes(private_bytes, shared_bytes); | 832 return CurrentProcessMetrics()->GetMemoryBytes(private_bytes, shared_bytes); |
832 } | 833 } |
833 | 834 |
| 835 bool WebKitPlatformSupportImpl::memoryAllocatorWasteInBytes(size_t* size) { |
| 836 return base::allocator::GetAllocatorWasteSize(size); |
| 837 } |
| 838 |
834 void WebKitPlatformSupportImpl::SuspendSharedTimer() { | 839 void WebKitPlatformSupportImpl::SuspendSharedTimer() { |
835 ++shared_timer_suspended_; | 840 ++shared_timer_suspended_; |
836 } | 841 } |
837 | 842 |
838 void WebKitPlatformSupportImpl::ResumeSharedTimer() { | 843 void WebKitPlatformSupportImpl::ResumeSharedTimer() { |
839 // The shared timer may have fired or been adjusted while we were suspended. | 844 // The shared timer may have fired or been adjusted while we were suspended. |
840 if (--shared_timer_suspended_ == 0 && !shared_timer_.IsRunning()) { | 845 if (--shared_timer_suspended_ == 0 && !shared_timer_.IsRunning()) { |
841 setSharedTimerFireInterval( | 846 setSharedTimerFireInterval( |
842 shared_timer_fire_time_ - monotonicallyIncreasingTime()); | 847 shared_timer_fire_time_ - monotonicallyIncreasingTime()); |
843 } | 848 } |
(...skipping 29 matching lines...) Expand all Loading... |
873 #endif | 878 #endif |
874 | 879 |
875 if (device_source == WebKit::WebGestureEvent::Touchscreen) | 880 if (device_source == WebKit::WebGestureEvent::Touchscreen) |
876 return TouchFlingGestureCurve::CreateForTouchScreen(velocity, | 881 return TouchFlingGestureCurve::CreateForTouchScreen(velocity, |
877 cumulative_scroll); | 882 cumulative_scroll); |
878 | 883 |
879 return TouchFlingGestureCurve::CreateForTouchPad(velocity, cumulative_scroll); | 884 return TouchFlingGestureCurve::CreateForTouchPad(velocity, cumulative_scroll); |
880 } | 885 } |
881 | 886 |
882 } // namespace webkit_glue | 887 } // namespace webkit_glue |
OLD | NEW |