| 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 "athena/resource_manager/public/resource_manager_delegate.h" | 5 #include "athena/resource_manager/public/resource_manager_delegate.h" |
| 6 | 6 |
| 7 #include <string> | 7 #include <string> |
| 8 | 8 |
| 9 #include "base/macros.h" | 9 #include "base/macros.h" |
| 10 | 10 |
| 11 namespace athena { | 11 namespace athena { |
| 12 | 12 |
| 13 namespace test { | 13 namespace test { |
| 14 | 14 |
| 15 namespace { | 15 namespace { |
| 16 // This is the minimum amount of time in milliseconds between checks for | 16 // This is the minimum amount of time in milliseconds between checks for |
| 17 // low memory. Since we report no memory use (and the timeout is extremely long) | 17 // low memory. Since we report no memory use (and the timeout is extremely long) |
| 18 // the memory pressure event will never go off. | 18 // the memory pressure event will never go off. |
| 19 const int kMemoryPressureIntervalMs = 60000; | 19 const int kMemoryPressureIntervalMs = 60000; |
| 20 } // namespace | 20 } // namespace |
| 21 | 21 |
| 22 class ResourceManagerDelegateImpl : public ResourceManagerDelegate { | 22 class ResourceManagerDelegateImpl : public ResourceManagerDelegate { |
| 23 public: | 23 public: |
| 24 ResourceManagerDelegateImpl() {} | 24 ResourceManagerDelegateImpl() {} |
| 25 virtual ~ResourceManagerDelegateImpl() {} | 25 ~ResourceManagerDelegateImpl() override {} |
| 26 | 26 |
| 27 private: | 27 private: |
| 28 virtual int GetUsedMemoryInPercent() override { | 28 int GetUsedMemoryInPercent() override { return 0; } |
| 29 return 0; | |
| 30 } | |
| 31 | 29 |
| 32 virtual int MemoryPressureIntervalInMS() override { | 30 int MemoryPressureIntervalInMS() override { |
| 33 return kMemoryPressureIntervalMs; | 31 return kMemoryPressureIntervalMs; |
| 34 } | 32 } |
| 35 DISALLOW_COPY_AND_ASSIGN(ResourceManagerDelegateImpl); | 33 DISALLOW_COPY_AND_ASSIGN(ResourceManagerDelegateImpl); |
| 36 }; | 34 }; |
| 37 | 35 |
| 38 } // namespace test | 36 } // namespace test |
| 39 | 37 |
| 40 // static | 38 // static |
| 41 ResourceManagerDelegate* | 39 ResourceManagerDelegate* |
| 42 ResourceManagerDelegate::CreateResourceManagerDelegate() { | 40 ResourceManagerDelegate::CreateResourceManagerDelegate() { |
| 43 return new test::ResourceManagerDelegateImpl; | 41 return new test::ResourceManagerDelegateImpl; |
| 44 } | 42 } |
| 45 | 43 |
| 46 } // namespace athena | 44 } // namespace athena |
| OLD | NEW |