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

Unified Diff: chrome/browser/chromeos/status/memory_menu_button.h

Issue 7607035: CrOS - Memory debug widget shows anonymous memory and renderer kills. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: addressing review comments Created 9 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
« no previous file with comments | « base/process_util_linux.cc ('k') | chrome/browser/chromeos/status/memory_menu_button.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/chromeos/status/memory_menu_button.h
diff --git a/chrome/browser/chromeos/status/memory_menu_button.h b/chrome/browser/chromeos/status/memory_menu_button.h
index feddcac8942bb16d458fc36f27f176d7552caf26..d404c395a167a295f433f980f64e95f2061434a0 100644
--- a/chrome/browser/chromeos/status/memory_menu_button.h
+++ b/chrome/browser/chromeos/status/memory_menu_button.h
@@ -9,9 +9,15 @@
#include "base/memory/scoped_ptr.h"
#include "base/timer.h"
#include "chrome/browser/chromeos/status/status_area_button.h"
+#include "content/common/notification_observer.h"
+#include "content/common/notification_registrar.h"
#include "views/controls/menu/menu_delegate.h"
#include "views/controls/menu/view_menu_delegate.h"
+namespace base {
+struct SystemMemoryInfoKB;
+}
+
namespace views {
class MenuItemView;
}
@@ -23,7 +29,8 @@ class StatusAreaHost;
// Memory debugging display that lives in the status area.
class MemoryMenuButton : public StatusAreaButton,
public views::MenuDelegate,
- public views::ViewMenuDelegate {
+ public views::ViewMenuDelegate,
+ public NotificationObserver {
public:
explicit MemoryMenuButton(StatusAreaHost* host);
virtual ~MemoryMenuButton();
@@ -33,6 +40,14 @@ class MemoryMenuButton : public StatusAreaButton,
virtual bool IsCommandEnabled(int id) const OVERRIDE;
virtual void ExecuteCommand(int id) OVERRIDE;
+ // views::ViewMenuDelegate implementation.
+ virtual void RunMenu(views::View* source, const gfx::Point& pt) OVERRIDE;
+
+ // NotificationObserver overrides.
+ virtual void Observe(int type,
+ const NotificationSource& source,
+ const NotificationDetails& details) OVERRIDE;
+
// Updates the text on the menu button.
void UpdateText();
@@ -40,9 +55,6 @@ class MemoryMenuButton : public StatusAreaButton,
virtual int horizontal_padding() OVERRIDE;
private:
- // views::ViewMenuDelegate implementation.
- virtual void RunMenu(views::View* source, const gfx::Point& pt);
-
// Create and initialize menu if not already present.
void EnsureMenu();
@@ -55,11 +67,13 @@ class MemoryMenuButton : public StatusAreaButton,
// constructor.
scoped_ptr<views::MenuItemView> menu_;
- int mem_total_;
- int shmem_; // video driver memory, hidden from OS
- int mem_free_;
- int mem_buffers_;
- int mem_cache_;
+ // Raw data from /proc/meminfo
+ scoped_ptr<base::SystemMemoryInfoKB> meminfo_;
+
+ NotificationRegistrar registrar_;
+
+ // Number of renderer kills we have observed.
+ int renderer_kills_;
DISALLOW_COPY_AND_ASSIGN(MemoryMenuButton);
};
« no previous file with comments | « base/process_util_linux.cc ('k') | chrome/browser/chromeos/status/memory_menu_button.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698