Chromium Code Reviews| Index: athena/resource_manager/public/resource_manager_delegate.h |
| diff --git a/athena/resource_manager/public/resource_manager_delegate.h b/athena/resource_manager/public/resource_manager_delegate.h |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..d879c782cb28a87097d16d74c1f7d2fba4b76975 |
| --- /dev/null |
| +++ b/athena/resource_manager/public/resource_manager_delegate.h |
| @@ -0,0 +1,33 @@ |
| +// Copyright 2014 The Chromium Authors. All rights reserved. |
| +// Use of this source code is governed by a BSD-style license that can be |
| +// found in the LICENSE file. |
| + |
| +#ifndef ATHENA_RESOURCE_MANAGER_PUBLIC_RESOURCE_MANAGER_DLEGATE_H_ |
| +#define ATHENA_RESOURCE_MANAGER_PUBLIC_RESOURCE_MANAGER_DLEGATE_H_ |
| + |
| +#include <string> |
| + |
| +#include "base/macros.h" |
| + |
| +namespace athena { |
| + |
| +// The resource manager delegate which abstracts system function calls to allow |
| +// unit tests to override them. |
| +class ResourceManagerDelegate { |
| + public: |
| + static ResourceManagerDelegate* CreateResourceManagerDelegate(); |
| + |
| + ResourceManagerDelegate() {} |
| + virtual ~ResourceManagerDelegate() {} |
| + |
| + // Returns the percentage of memory used in the system. |
| + virtual int GetUsedMemoryInPercent() = 0; |
| + |
| + // Returns the time memory pressure interval time in ms to be used by the |
| + // memory pressure monitoring system. |
| + virtual int MemoryPressureIntervalInMS() = 0; |
|
Jun Mukai
2014/08/27 16:57:48
possibly better to return base::TimeDelta instead?
Mr4D (OOO till 08-26)
2014/08/27 18:09:38
Having "real ms's" value seems to be much better t
|
| +}; |
| + |
| +} // namespace athena |
| + |
| +#endif // ATHENA_RESOURCE_MANAGER_PUBLIC_RESOURCE_MANAGER_DLEGATE_H_ |