OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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 "chrome/browser/extensions/api/system_memory/memory_info_provider.h" | 5 #include "chrome/browser/extensions/api/system_memory/memory_info_provider.h" |
6 | 6 |
7 #include "base/sys_info.h" | 7 #include "base/sys_info.h" |
8 | 8 |
9 namespace extensions { | 9 namespace extensions { |
10 | 10 |
(...skipping 21 matching lines...) Expand all Loading... |
32 info_.capacity = static_cast<double>(base::SysInfo::AmountOfPhysicalMemory()); | 32 info_.capacity = static_cast<double>(base::SysInfo::AmountOfPhysicalMemory()); |
33 info_.available_capacity = | 33 info_.available_capacity = |
34 static_cast<double>(base::SysInfo::AmountOfAvailablePhysicalMemory()); | 34 static_cast<double>(base::SysInfo::AmountOfAvailablePhysicalMemory()); |
35 return true; | 35 return true; |
36 } | 36 } |
37 | 37 |
38 // static | 38 // static |
39 MemoryInfoProvider* MemoryInfoProvider::Get() { | 39 MemoryInfoProvider* MemoryInfoProvider::Get() { |
40 if (provider_.Get().get() == NULL) | 40 if (provider_.Get().get() == NULL) |
41 provider_.Get() = new MemoryInfoProvider(); | 41 provider_.Get() = new MemoryInfoProvider(); |
42 return provider_.Get(); | 42 return provider_.Get().get(); |
43 } | 43 } |
44 | 44 |
45 } // namespace extensions | 45 } // namespace extensions |
OLD | NEW |