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

Unified Diff: athena/resource_manager/public/resource_manager.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: Self nits 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.h
diff --git a/athena/resource_manager/public/resource_manager.h b/athena/resource_manager/public/resource_manager.h
new file mode 100644
index 0000000000000000000000000000000000000000..c07ac7ba852771e5d6e4fe9a643981c00ef7b258
--- /dev/null
+++ b/athena/resource_manager/public/resource_manager.h
@@ -0,0 +1,39 @@
+// 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_H_
+#define ATHENA_RESOURCE_MANAGER_PUBLIC_RESOURCE_MANAGER_H_
+
+#include "athena/resource_manager/memory_pressure_notifier.h"
+#include "base/basictypes.h"
+
+namespace athena {
+
+// The resource manager is monitoring activity changes, low memory conditions
+// and other events to control the activity state (pre-/un-/re-/loading them)
+// to keep enough memory free that no jank/lag will show when new applications
+// are loaded and / or a navigation between applications takes place.
+class ResourceManager {
+ public:
+ // Creates the instance handling the resources. Passed is the |delegate| which
+ // works as OS abstracting delegate. The ownership is transferred to the
+ // ResourceManager.
Jun Mukai 2014/08/27 01:21:18 Seems delegate is not passed? Please update the c
Mr4D (OOO till 08-26) 2014/08/27 16:12:12 Indeed! Done.
+ static void Create();
+ static ResourceManager* Get();
+ static void Shutdown();
+
+ ResourceManager();
+ virtual ~ResourceManager();
+
+ // Unit tests can simulate MemoryPressure changes with this call.
+ virtual void SetMemoryPressureForTest(
+ MemoryPressureObserver::MemoryPressure pressure) = 0;
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(ResourceManager);
+};
+
+} // namespace athena
+
+#endif // ATHENA_RESOURCE_MANAGER_PUBLIC_RESOURCE_MANAGER_H_

Powered by Google App Engine
This is Rietveld 408576698