Merge latest oemcrypto-v17 change
No-Typo-Check: Not related to this change. Bug: 161477208 Change-Id: I99e4780f6855b7045aa0cd5a49c13d2d0d51ed64
This commit is contained in:
committed by
Fred Gylys-Colwell
parent
c924960962
commit
642965c678
@@ -20,7 +20,6 @@
|
||||
#include "file_utils.h"
|
||||
#include "log.h"
|
||||
#include "string_conversions.h"
|
||||
#include "wv_cdm_constants.h"
|
||||
|
||||
#include <openssl/md5.h>
|
||||
|
||||
@@ -28,7 +27,7 @@
|
||||
// to strerror_r(3).
|
||||
#define ERRORSTR_BUF_SIZE 1024
|
||||
|
||||
namespace wvcdm {
|
||||
namespace wvutil {
|
||||
namespace {
|
||||
// Maximum number of attempts to read or write on a file.
|
||||
constexpr size_t kMaxIoAttempts = 5;
|
||||
@@ -42,6 +41,8 @@ constexpr int kClosedFd = -1;
|
||||
// handling code to enter a bad state.
|
||||
constexpr int kNoError = 0;
|
||||
|
||||
constexpr char kEmptyOrigin[] = "";
|
||||
|
||||
// Reads from file specified by |fd| into the provided |buffer| up to
|
||||
// the number of bytes specified by |count|.
|
||||
// This is an internal function and assumes that all parameters are
|
||||
@@ -282,7 +283,7 @@ std::string GetFileNameSafeHash(const std::string& input) {
|
||||
std::vector<uint8_t> hash(MD5_DIGEST_LENGTH);
|
||||
MD5(reinterpret_cast<const uint8_t*>(input.data()), input.size(),
|
||||
hash.data());
|
||||
return wvcdm::Base64SafeEncode(hash);
|
||||
return wvutil::Base64SafeEncode(hash);
|
||||
}
|
||||
|
||||
std::string GetFileNameForIdentifier(const std::string path,
|
||||
@@ -425,7 +426,7 @@ class AndroidFile : public File {
|
||||
|
||||
class FileSystem::Impl {};
|
||||
|
||||
FileSystem::FileSystem() : FileSystem(EMPTY_ORIGIN, nullptr) {}
|
||||
FileSystem::FileSystem() : FileSystem(kEmptyOrigin, nullptr) {}
|
||||
FileSystem::FileSystem(const std::string& origin, void* /* extra_data */)
|
||||
: origin_(origin) {}
|
||||
|
||||
@@ -528,4 +529,4 @@ void FileSystem::set_origin(const std::string& origin) { origin_ = origin; }
|
||||
void FileSystem::set_identifier(const std::string& identifier) {
|
||||
identifier_ = identifier;
|
||||
}
|
||||
} // namespace wvcdm
|
||||
} // namespace wvutil
|
||||
|
||||
Reference in New Issue
Block a user