[PM] Add lifecycle states to PM nodes.

This gives nodes a clear lifecycle, and also prohibits property changes
during critical state changes (notifications of joining and leaving
graph).

BUG=1192777

Change-Id: Ieea9324d28defb38b3150edab942fdd6a059ec23
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2787365
Reviewed-by: Sigurður Ásgeirsson <[email protected]>
Commit-Queue: Chris Hamilton <[email protected]>
Cr-Commit-Position: refs/heads/master@{#867650}
diff --git a/components/performance_manager/public/graph/node.h b/components/performance_manager/public/graph/node.h
index d3c2cc11..b3a95d4 100644
--- a/components/performance_manager/public/graph/node.h
+++ b/components/performance_manager/public/graph/node.h
@@ -8,6 +8,7 @@
 #include <cstdint>
 
 #include "base/macros.h"
+#include "components/performance_manager/public/graph/node_state.h"
 
 namespace performance_manager {
 
@@ -24,6 +25,9 @@
   // Returns the graph to which this node belongs.
   virtual Graph* GetGraph() const = 0;
 
+  // Returns the state of this node.
+  virtual NodeState GetNodeState() const = 0;
+
   // The following functions are implementation detail and should not need to be
   // used by external clients. They provide the ability to safely downcast to
   // the underlying implementation.