Add the ability to remove a component from component tree

This functionality will be neaded on Brillo side to remove components
added by vendor daemons when those daemons exit (normally or abnormally).
This will allow those daemons to re-add the same component when they get
restarted.

Change-Id: Ida350cfa38d4f1265d1e86fccca893cdf7f5030c
Reviewed-on: https://weave-review.googlesource.com/2087
Reviewed-by: Vitaly Buka <vitalybuka@google.com>
diff --git a/src/component_manager.h b/src/component_manager.h
index cf16720..832b274 100644
--- a/src/component_manager.h
+++ b/src/component_manager.h
@@ -85,6 +85,22 @@
                                      const std::vector<std::string>& traits,
                                      ErrorPtr* error) = 0;
 
+  // Removes an existing component instance from device.
+  // |path| is a path to the parent component (or empty string if a root-level
+  // component is being removed).
+  // |name| is a name of the component to be removed.
+  virtual bool RemoveComponent(const std::string& path,
+                               const std::string& name,
+                               ErrorPtr* error) = 0;
+
+  // Removes an element from component array.
+  // |path| is a path to the parent component.
+  // |index| is a zero-based element index in the component array.
+  virtual bool RemoveComponentArrayItem(const std::string& path,
+                                        const std::string& name,
+                                        size_t index,
+                                        ErrorPtr* error) = 0;
+
   // Sets callback which is called when new components are added.
   virtual void AddComponentTreeChangedCallback(
       const base::Closure& callback) = 0;