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
3// found in the LICENSE file.
4
5#include "athena/resource_manager/public/resource_manager_delegate.h"
6
7#include <string>
8
9#include "base/macros.h"
10
11namespace athena {
12
13namespace test {
14
15namespace {
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)
18// the memory pressure event will never go off.
19const int kMemoryPressureIntervalMs = 60000;
20}  // namespace
21
22class ResourceManagerDelegateImpl : public ResourceManagerDelegate {
23 public:
24  ResourceManagerDelegateImpl() {}
25  virtual ~ResourceManagerDelegateImpl() {}
26
27 private:
28  virtual int GetUsedMemoryInPercent() OVERRIDE {
29    return 0;
30  }
31
32  virtual int MemoryPressureIntervalInMS() OVERRIDE {
33    return kMemoryPressureIntervalMs;
34  }
35  DISALLOW_COPY_AND_ASSIGN(ResourceManagerDelegateImpl);
36};
37
38}  // namespace test
39
40// static
41ResourceManagerDelegate*
42ResourceManagerDelegate::CreateResourceManagerDelegate() {
43  return new test::ResourceManagerDelegateImpl;
44}
45
46}  // namespace athena
47