rename: Rename firmware to blobid where appropriate
Rename a few variable, such as firmwares, to make it clear when it's a
firmware blobID or just a set of blobIDs.
Move the hash blobID into its own place since it isn't a firmware.
Change-Id: Ia4118d7da72d1e6e6bbe362ca82ad0fe65f394c4
Signed-off-by: Patrick Venture <venture@google.com>
diff --git a/firmware_handler.cpp b/firmware_handler.cpp
index 4c076de..23b0925 100644
--- a/firmware_handler.cpp
+++ b/firmware_handler.cpp
@@ -9,17 +9,22 @@
namespace blobs
{
+static std::string hashBlobID = "/flash/hash";
+
std::unique_ptr<GenericBlobInterface>
FirmwareBlobHandler::CreateFirmwareBlobHandler(
const std::vector<std::string>& firmwares, std::uint32_t transports)
{
- return std::make_unique<FirmwareBlobHandler>(firmwares, transports);
+ std::vector<std::string> blobs = firmwares;
+ blobs.push_back(hashBlobID);
+
+ return std::make_unique<FirmwareBlobHandler>(blobs, transports);
}
bool FirmwareBlobHandler::canHandleBlob(const std::string& path)
{
/* Check if the path is in our supported list (or active list). */
- if (std::count(firmwares.begin(), firmwares.end(), path))
+ if (std::count(blobIDs.begin(), blobIDs.end(), path))
{
return true;
}
@@ -37,7 +42,7 @@
* "/flash/active/hash" regardless of mechanism. This is done in the open
* comamnd, no extra work is required here.
*/
- return firmwares;
+ return blobIDs;
}
bool FirmwareBlobHandler::deleteBlob(const std::string& path)