Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(463)

Side by Side Diff: webkit/child/webkitplatformsupport_impl.cc

Issue 67373006: Cache the numberOfProcessors value on posix and expose it to blink (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « webkit/child/webkitplatformsupport_impl.h ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 844 matching lines...) Expand 10 before | Expand all | Expand 10 after
855 } 855 }
856 856
857 size_t WebKitPlatformSupportImpl::actualMemoryUsageMB() { 857 size_t WebKitPlatformSupportImpl::actualMemoryUsageMB() {
858 return getMemoryUsageMB(true); 858 return getMemoryUsageMB(true);
859 } 859 }
860 860
861 size_t WebKitPlatformSupportImpl::physicalMemoryMB() { 861 size_t WebKitPlatformSupportImpl::physicalMemoryMB() {
862 return static_cast<size_t>(base::SysInfo::AmountOfPhysicalMemoryMB()); 862 return static_cast<size_t>(base::SysInfo::AmountOfPhysicalMemoryMB());
863 } 863 }
864 864
865 size_t WebKitPlatformSupportImpl::numberOfProcessors() {
866 return static_cast<size_t>(base::SysInfo::NumberOfProcessors());
867 }
868
865 void WebKitPlatformSupportImpl::startHeapProfiling( 869 void WebKitPlatformSupportImpl::startHeapProfiling(
866 const blink::WebString& prefix) { 870 const blink::WebString& prefix) {
867 // FIXME(morrita): Make this built on windows. 871 // FIXME(morrita): Make this built on windows.
868 #if !defined(NO_TCMALLOC) && defined(USE_TCMALLOC) && !defined(OS_WIN) 872 #if !defined(NO_TCMALLOC) && defined(USE_TCMALLOC) && !defined(OS_WIN)
869 HeapProfilerStart(prefix.utf8().data()); 873 HeapProfilerStart(prefix.utf8().data());
870 #endif 874 #endif
871 } 875 }
872 876
873 void WebKitPlatformSupportImpl::stopHeapProfiling() { 877 void WebKitPlatformSupportImpl::stopHeapProfiling() {
874 #if !defined(NO_TCMALLOC) && defined(USE_TCMALLOC) && !defined(OS_WIN) 878 #if !defined(NO_TCMALLOC) && defined(USE_TCMALLOC) && !defined(OS_WIN)
(...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after
928 if (--shared_timer_suspended_ == 0 && 932 if (--shared_timer_suspended_ == 0 &&
929 (!shared_timer_.IsRunning() || 933 (!shared_timer_.IsRunning() ||
930 shared_timer_fire_time_was_set_while_suspended_)) { 934 shared_timer_fire_time_was_set_while_suspended_)) {
931 shared_timer_fire_time_was_set_while_suspended_ = false; 935 shared_timer_fire_time_was_set_while_suspended_ = false;
932 setSharedTimerFireInterval( 936 setSharedTimerFireInterval(
933 shared_timer_fire_time_ - monotonicallyIncreasingTime()); 937 shared_timer_fire_time_ - monotonicallyIncreasingTime());
934 } 938 }
935 } 939 }
936 940
937 } // namespace webkit_glue 941 } // namespace webkit_glue
OLDNEW
« no previous file with comments | « webkit/child/webkitplatformsupport_impl.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698