| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 "content/child/blink_platform_impl.h" | 5 #include "content/child/blink_platform_impl.h" |
| 6 | 6 |
| 7 #include <math.h> | 7 #include <math.h> |
| 8 | 8 |
| 9 #include <memory> | 9 #include <memory> |
| 10 #include <vector> | 10 #include <vector> |
| (...skipping 759 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 770 bool BlinkPlatformImpl::DatabaseSetFileSize( | 770 bool BlinkPlatformImpl::DatabaseSetFileSize( |
| 771 const blink::WebString& vfs_file_name, | 771 const blink::WebString& vfs_file_name, |
| 772 long long size) { | 772 long long size) { |
| 773 return false; | 773 return false; |
| 774 } | 774 } |
| 775 | 775 |
| 776 size_t BlinkPlatformImpl::ActualMemoryUsageMB() { | 776 size_t BlinkPlatformImpl::ActualMemoryUsageMB() { |
| 777 return GetMemoryUsageKB() >> 10; | 777 return GetMemoryUsageKB() >> 10; |
| 778 } | 778 } |
| 779 | 779 |
| 780 size_t BlinkPlatformImpl::AmountOfPhysicalMemoryMB() { |
| 781 return static_cast<size_t>(base::SysInfo::AmountOfPhysicalMemoryMB()); |
| 782 } |
| 783 |
| 780 size_t BlinkPlatformImpl::NumberOfProcessors() { | 784 size_t BlinkPlatformImpl::NumberOfProcessors() { |
| 781 return static_cast<size_t>(base::SysInfo::NumberOfProcessors()); | 785 return static_cast<size_t>(base::SysInfo::NumberOfProcessors()); |
| 782 } | 786 } |
| 783 | 787 |
| 784 size_t BlinkPlatformImpl::MaxDecodedImageBytes() { | 788 size_t BlinkPlatformImpl::MaxDecodedImageBytes() { |
| 785 #if defined(OS_ANDROID) | 789 #if defined(OS_ANDROID) |
| 786 if (base::SysInfo::IsLowEndDevice()) { | 790 if (base::SysInfo::IsLowEndDevice()) { |
| 787 // Limit image decoded size to 3M pixels on low end devices. | 791 // Limit image decoded size to 3M pixels on low end devices. |
| 788 // 4 is maximum number of bytes per pixel. | 792 // 4 is maximum number of bytes per pixel. |
| 789 return 3 * 1024 * 1024 * 4; | 793 return 3 * 1024 * 1024 * 4; |
| (...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 846 | 850 |
| 847 std::unique_ptr<blink::WebFeaturePolicy> | 851 std::unique_ptr<blink::WebFeaturePolicy> |
| 848 BlinkPlatformImpl::DuplicateFeaturePolicyWithOrigin( | 852 BlinkPlatformImpl::DuplicateFeaturePolicyWithOrigin( |
| 849 const blink::WebFeaturePolicy& policy, | 853 const blink::WebFeaturePolicy& policy, |
| 850 const blink::WebSecurityOrigin& new_origin) { | 854 const blink::WebSecurityOrigin& new_origin) { |
| 851 return FeaturePolicy::CreateFromPolicyWithOrigin( | 855 return FeaturePolicy::CreateFromPolicyWithOrigin( |
| 852 static_cast<const FeaturePolicy&>(policy), url::Origin(new_origin)); | 856 static_cast<const FeaturePolicy&>(policy), url::Origin(new_origin)); |
| 853 } | 857 } |
| 854 | 858 |
| 855 } // namespace content | 859 } // namespace content |
| OLD | NEW |