memory_graph_page_view.h 2.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263
  1. // Copyright 2020 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. #ifndef ASH_HUD_DISPLAY_MEMORY_GRAPH_PAGE_VIEW_H_
  5. #define ASH_HUD_DISPLAY_MEMORY_GRAPH_PAGE_VIEW_H_
  6. #include "ash/hud_display/graph.h"
  7. #include "ash/hud_display/graph_page_view_base.h"
  8. namespace ash {
  9. namespace hud_display {
  10. class ReferenceLines;
  11. // MemoryGraphPageView class draws memory graphs.
  12. class MemoryGraphPageView : public GraphPageViewBase {
  13. public:
  14. METADATA_HEADER(MemoryGraphPageView);
  15. explicit MemoryGraphPageView(const base::TimeDelta refresh_interval);
  16. MemoryGraphPageView(const MemoryGraphPageView&) = delete;
  17. MemoryGraphPageView& operator=(const MemoryGraphPageView&) = delete;
  18. ~MemoryGraphPageView() override;
  19. // view::
  20. void OnPaint(gfx::Canvas* canvas) override;
  21. // Update page data from the new snapshot.
  22. void UpdateData(const DataSource::Snapshot& snapshot) override;
  23. private:
  24. // This is used to re-layout reference lines when total ram size is known.
  25. double total_ram_ = 0;
  26. // --- Stacked:
  27. // Share of the total RAM occupied by Chrome browser private RSS.
  28. Graph graph_chrome_rss_private_;
  29. // Share of the total RAM reported as Free memory be kernel.
  30. Graph graph_mem_free_;
  31. // Total RAM - other graphs in this stack.
  32. Graph graph_mem_used_unknown_;
  33. // Share of the total RAM occupied by Chrome type=renderer processes private
  34. // RSS.
  35. Graph graph_renderers_rss_private_;
  36. // Share of the total RAM occupied by ARC++ processes private RSS.
  37. Graph graph_arc_rss_private_;
  38. // Share of the total RAM occupied by Chrome type=gpu process private RSS.
  39. Graph graph_gpu_rss_private_;
  40. // Share of the total RAM used by kernel GPU driver.
  41. Graph graph_gpu_kernel_;
  42. // Not stacked:
  43. // Share of the total RAM occupied by Chrome browser process shared RSS.
  44. Graph graph_chrome_rss_shared_;
  45. ReferenceLines* reference_lines_ = nullptr; // not owned.
  46. };
  47. } // namespace hud_display
  48. } // namespace ash
  49. #endif // ASH_HUD_DISPLAY_MEMORY_GRAPH_PAGE_VIEW_H_