Add More Base Path Helpers to DeviceFiles
(This is a merge of http://go/wvgerrit/13910/ from the Widevine CDM repository.) DeviceFiles has a lot of repeated code whenever it needs to check for file existence or remove a file. When reading and writing files, it has wrappers that handle this repeated burden. This change adds wrappers for the other functionality used by DeviceFiles as well, to reduce duplication. Change-Id: If959b504672c1b907346d28f31648d8028de8bdf
This commit is contained in:
@@ -3,6 +3,8 @@
|
||||
#ifndef WVCDM_CORE_DEVICE_FILES_H_
|
||||
#define WVCDM_CORE_DEVICE_FILES_H_
|
||||
|
||||
#include <unistd.h>
|
||||
|
||||
#include "scoped_ptr.h"
|
||||
#include "wv_cdm_types.h"
|
||||
|
||||
@@ -81,9 +83,14 @@ class DeviceFiles {
|
||||
CdmKeyResponse* license_response);
|
||||
|
||||
private:
|
||||
// Helpers that wrap the File interface and automatically handle hashing, as
|
||||
// well as adding the device files base path to to the file name.
|
||||
bool StoreFileWithHash(const char* name, const std::string& serialized_file);
|
||||
bool StoreFileRaw(const char* name, const std::string& serialized_file);
|
||||
bool RetrieveHashedFile(const char* name, std::string* serialized_file);
|
||||
bool FileExists(const char* name);
|
||||
bool RemoveFile(const char* name);
|
||||
ssize_t GetFileSize(const char* name);
|
||||
|
||||
// Certificate and offline licenses are now stored in security
|
||||
// level specific directories. In an earlier version they were
|
||||
|
||||
Reference in New Issue
Block a user