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/child/webkitplatformsupport_impl.h" | 5 #include "webkit/child/webkitplatformsupport_impl.h" |
6 | 6 |
7 #include <math.h> | 7 #include <math.h> |
8 | 8 |
9 #include <vector> | 9 #include <vector> |
10 | 10 |
(...skipping 841 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
852 } | 852 } |
853 | 853 |
854 size_t WebKitPlatformSupportImpl::memoryUsageMB() { | 854 size_t WebKitPlatformSupportImpl::memoryUsageMB() { |
855 return getMemoryUsageMB(false); | 855 return getMemoryUsageMB(false); |
856 } | 856 } |
857 | 857 |
858 size_t WebKitPlatformSupportImpl::actualMemoryUsageMB() { | 858 size_t WebKitPlatformSupportImpl::actualMemoryUsageMB() { |
859 return getMemoryUsageMB(true); | 859 return getMemoryUsageMB(true); |
860 } | 860 } |
861 | 861 |
| 862 size_t WebKitPlatformSupportImpl::physicalMemoryMB() { |
| 863 return static_cast<size_t>(base::SysInfo::AmountOfPhysicalMemoryMB()); |
| 864 } |
| 865 |
862 void WebKitPlatformSupportImpl::startHeapProfiling( | 866 void WebKitPlatformSupportImpl::startHeapProfiling( |
863 const WebKit::WebString& prefix) { | 867 const WebKit::WebString& prefix) { |
864 // FIXME(morrita): Make this built on windows. | 868 // FIXME(morrita): Make this built on windows. |
865 #if !defined(NO_TCMALLOC) && defined(USE_TCMALLOC) && !defined(OS_WIN) | 869 #if !defined(NO_TCMALLOC) && defined(USE_TCMALLOC) && !defined(OS_WIN) |
866 HeapProfilerStart(prefix.utf8().data()); | 870 HeapProfilerStart(prefix.utf8().data()); |
867 #endif | 871 #endif |
868 } | 872 } |
869 | 873 |
870 void WebKitPlatformSupportImpl::stopHeapProfiling() { | 874 void WebKitPlatformSupportImpl::stopHeapProfiling() { |
871 #if !defined(NO_TCMALLOC) && defined(USE_TCMALLOC) && !defined(OS_WIN) | 875 #if !defined(NO_TCMALLOC) && defined(USE_TCMALLOC) && !defined(OS_WIN) |
(...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
925 if (--shared_timer_suspended_ == 0 && | 929 if (--shared_timer_suspended_ == 0 && |
926 (!shared_timer_.IsRunning() || | 930 (!shared_timer_.IsRunning() || |
927 shared_timer_fire_time_was_set_while_suspended_)) { | 931 shared_timer_fire_time_was_set_while_suspended_)) { |
928 shared_timer_fire_time_was_set_while_suspended_ = false; | 932 shared_timer_fire_time_was_set_while_suspended_ = false; |
929 setSharedTimerFireInterval( | 933 setSharedTimerFireInterval( |
930 shared_timer_fire_time_ - monotonicallyIncreasingTime()); | 934 shared_timer_fire_time_ - monotonicallyIncreasingTime()); |
931 } | 935 } |
932 } | 936 } |
933 | 937 |
934 } // namespace webkit_glue | 938 } // namespace webkit_glue |
OLD | NEW |