buffet: Move global instance of CommandManager to buffet::Manager
Removed the global static instance of CommandManager and
transferred ownership of this global instance to buffet::Manager
class.
BUG=None
TEST=USE=buffet P2_TEST_FILTER="buffet::*" FEATURES=test emerge-link platform2
Change-Id: If1b4875d3c26f146bc4f454bb0aaaaf8b17a0c72
Reviewed-on: https://chromium-review.googlesource.com/209563
Tested-by: Alex Vakulenko <avakulenko@chromium.org>
Reviewed-by: Chris Sosa <sosa@chromium.org>
Reviewed-by: Christopher Wiley <wiley@chromium.org>
Commit-Queue: Alex Vakulenko <avakulenko@chromium.org>
diff --git a/buffet/commands/command_manager.h b/buffet/commands/command_manager.h
index 02d92fd..1199892 100644
--- a/buffet/commands/command_manager.h
+++ b/buffet/commands/command_manager.h
@@ -52,13 +52,11 @@
bool LoadCommands(const base::FilePath& json_file_path,
ErrorPtr* error);
- // Factory static method to get the global singleton instance of the object.
- static CommandManager* GetInstance();
- // Global startup method to be called by buffet daemon at startup.
- // Initializes the global object singleton and loads the standard GCD command
+ // Startup method to be called by buffet daemon at startup.
+ // Initializes the object and loads the standard GCD command
// dictionary as well as static vendor-provided command definitions for
// the current device.
- static void Startup();
+ void Startup();
private:
// Helper function to load a JSON file that is expected to be
@@ -66,14 +64,10 @@
// in error details in |error|.
std::unique_ptr<const base::DictionaryValue> LoadJsonDict(
const base::FilePath& json_file_path, ErrorPtr* error);
- // Helper method to be called at buffet shutdown to clean up the global
- // singleton instance of this class.
- static void Shutdown();
CommandDictionary base_dictionary_; // Base/std command definitions/schemas.
CommandDictionary dictionary_; // Command definitions/schemas.
- static CommandManager* instance_; // Global singleton instance of the object.
DISALLOW_COPY_AND_ASSIGN(CommandManager);
};