Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(2444)

Unified Diff: athena/resource_manager/public/resource_manager_delegate.h

Issue 513523002: Adding Baseframework of the ResourceManager (all hooks and observers) are being put in place with a… (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Aaaand another rebase Created 6 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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;
+};
+
+} // namespace athena
+
+#endif // ATHENA_RESOURCE_MANAGER_PUBLIC_RESOURCE_MANAGER_DLEGATE_H_

Powered by Google App Engine
This is Rietveld 408576698