Cleanup OSCrypt after initialisation

OSCrypt only needs to read from the backend during its initialisation.
Instances created for this initialisation can be cleaned up afterwards.

To support this change, the mocking of OSCrypt can no longer be based
on a singleton. Tests using the mocking mechanism are updated.

Bug: 709096
Change-Id: Iba5b37ad45ada11b9a217dc2c388313f2371f647
Reviewed-on: https://chromium-review.googlesource.com/571221
Reviewed-by: Roger Tawa <[email protected]>
Reviewed-by: Mathieu Perreault <[email protected]>
Reviewed-by: Martin Šrámek <[email protected]>
Reviewed-by: Pavel Yatsuk <[email protected]>
Reviewed-by: Scott Violet <[email protected]>
Reviewed-by: Vasilii Sukhanov <[email protected]>
Commit-Queue: Christos Froussios <[email protected]>
Cr-Commit-Position: refs/heads/master@{#488675}
diff --git a/components/os_crypt/os_crypt_mocker_linux.h b/components/os_crypt/os_crypt_mocker_linux.h
index b9a6507..4a4c1cd2 100644
--- a/components/os_crypt/os_crypt_mocker_linux.h
+++ b/components/os_crypt/os_crypt_mocker_linux.h
@@ -20,17 +20,11 @@
   // KeyStorageLinux
   std::string GetKey() override;
 
-  // Set the password that OSCryptMockerLinux holds.
-  void ResetTo(base::StringPiece new_key);
-
   // Get a pointer to the stored password. OSCryptMockerLinux owns the pointer.
   std::string* GetKeyPtr();
 
-  // Getter for the singleton.
-  static OSCryptMockerLinux* GetInstance();
-
-  // Inject the singleton mock into OSCrypt.
-  static void SetUpWithSingleton();
+  // Inject the mocking scheme into OSCrypt.
+  static void SetUp();
 
   // Restore OSCrypt to its real behaviour.
   static void TearDown();