buffet: Extract StorageInterface and implementations into separate files

This will make it easy to reuse file storage and memory storage
implementations in the forthcoming state aggregator.

BUG=chromium:369322
TEST=Unittests

Change-Id: Ie0dc0dbbfcc13e038352ecf77e2ad28bd41907d9
Reviewed-on: https://chromium-review.googlesource.com/198045
Tested-by: Christopher Wiley <wiley@chromium.org>
Reviewed-by: Alex Vakulenko <avakulenko@chromium.org>
Commit-Queue: Alex Vakulenko <avakulenko@chromium.org>
Tested-by: Alex Vakulenko <avakulenko@chromium.org>
diff --git a/buffet/device_registration_info.h b/buffet/device_registration_info.h
index c60cf69..f48bae9 100644
--- a/buffet/device_registration_info.h
+++ b/buffet/device_registration_info.h
@@ -14,6 +14,7 @@
 
 #include "buffet/data_encoding.h"
 #include "buffet/http_transport.h"
+#include "buffet/storage_interface.h"
 
 namespace base {
   class Value;
@@ -24,19 +25,6 @@
 // The DeviceRegistrationInfo class represents device registration information.
 class DeviceRegistrationInfo {
  public:
-  // The device registration configuration storage interface.
-  struct StorageInterface {
-    virtual ~StorageInterface() = default;
-    // Load the device registration configuration from storage.
-    // If it fails (e.g. the storage container [file?] doesn't exist), then
-    // it returns empty unique_ptr (aka nullptr).
-    virtual std::unique_ptr<base::Value> Load() = 0;
-    // Save the device registration configuration to storage.
-    // If saved successfully, returns true. Could fail when writing to
-    // physical storage like file system for various reasons (out of disk space,
-    // access permissions, etc).
-    virtual bool Save(const base::Value* config) = 0;
-  };
   // This is a helper class for unit testing.
   class TestHelper;
   // Default-constructed uses CURL HTTP transport.