mirror of
https://github.com/mozilla/gecko-dev.git
synced 2025-02-25 03:49:42 +00:00
Bug 1577885 - Remove using namespace std from GMP ClearKey r=bryce
Differential Revision: https://phabricator.services.mozilla.com/D44269 --HG-- extra : moz-landing-system : lando
This commit is contained in:
parent
28ad95b9a1
commit
2f5a215771
@ -18,7 +18,8 @@
|
||||
|
||||
#include <algorithm>
|
||||
|
||||
using namespace std;
|
||||
using std::string;
|
||||
using std::vector;
|
||||
|
||||
/**
|
||||
* Take a base64-encoded string, convert (in-place) each character to its
|
||||
@ -86,4 +87,4 @@ bool DecodeBase64(const string& aEncoded, vector<uint8_t>& aOutDecoded) {
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
@ -26,9 +26,13 @@
|
||||
#include <sstream>
|
||||
#include <string.h>
|
||||
|
||||
using namespace std;
|
||||
using namespace cdm;
|
||||
|
||||
using std::function;
|
||||
using std::string;
|
||||
using std::stringstream;
|
||||
using std::vector;
|
||||
|
||||
void ClearKeyPersistence::ReadAllRecordsFromIndex(
|
||||
function<void()>&& aOnComplete) {
|
||||
// Clear what we think the index file contains, we're about to read it again.
|
||||
|
@ -26,7 +26,6 @@
|
||||
|
||||
using namespace mozilla;
|
||||
using namespace cdm;
|
||||
using namespace std;
|
||||
|
||||
ClearKeySession::ClearKeySession(const std::string& aSessionId,
|
||||
SessionType aSessionType)
|
||||
@ -49,7 +48,7 @@ bool ClearKeySession::Init(InitDataType aInitDataType, const uint8_t* aInitData,
|
||||
} else if (aInitDataType == InitDataType::kWebM &&
|
||||
aInitDataSize <= kMaxWebmInitDataSize) {
|
||||
// "webm" initData format is simply the raw bytes of the keyId.
|
||||
vector<uint8_t> keyId;
|
||||
std::vector<uint8_t> keyId;
|
||||
keyId.assign(aInitData, aInitData + aInitDataSize);
|
||||
mKeyIds.push_back(keyId);
|
||||
}
|
||||
|
@ -30,9 +30,12 @@
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
|
||||
using namespace std;
|
||||
using namespace cdm;
|
||||
|
||||
using std::function;
|
||||
using std::string;
|
||||
using std::vector;
|
||||
|
||||
ClearKeySessionManager::ClearKeySessionManager(Host_10* aHost)
|
||||
: mDecryptionManager(ClearKeyDecryptionManager::Get()) {
|
||||
CK_LOGD("ClearKeySessionManager ctor %p", this);
|
||||
|
@ -28,7 +28,10 @@
|
||||
#include <vector>
|
||||
|
||||
using namespace cdm;
|
||||
using namespace std;
|
||||
|
||||
using std::function;
|
||||
using std::string;
|
||||
using std::vector;
|
||||
|
||||
class WriteRecordClient : public FileIOClient {
|
||||
public:
|
||||
|
@ -39,7 +39,10 @@
|
||||
#include "psshparser/PsshParser.h"
|
||||
|
||||
using namespace cdm;
|
||||
using namespace std;
|
||||
|
||||
using std::string;
|
||||
using std::stringstream;
|
||||
using std::vector;
|
||||
|
||||
void CK_Log(const char* aFmt, ...) {
|
||||
FILE* out = stdout;
|
||||
@ -65,8 +68,8 @@ void CK_Log(const char* aFmt, ...) {
|
||||
}
|
||||
|
||||
static bool PrintableAsString(const uint8_t* aBytes, uint32_t aLength) {
|
||||
return all_of(aBytes, aBytes + aLength,
|
||||
[](uint8_t c) { return isprint(c) == 1; });
|
||||
return std::all_of(aBytes, aBytes + aLength,
|
||||
[](uint8_t c) { return isprint(c) == 1; });
|
||||
}
|
||||
|
||||
void CK_LogArray(const char* prepend, const uint8_t* aData,
|
||||
@ -104,7 +107,7 @@ void ClearKeyUtils::DecryptAES(const vector<uint8_t>& aKey,
|
||||
oaes_encrypt(aes, &aIV[0], CENC_KEY_LEN, &enc[0], &encLen);
|
||||
|
||||
assert(encLen >= 2 * OAES_BLOCK_SIZE + CENC_KEY_LEN);
|
||||
size_t blockLen = min(aData.size() - i, CENC_KEY_LEN);
|
||||
size_t blockLen = std::min(aData.size() - i, CENC_KEY_LEN);
|
||||
for (size_t j = 0; j < blockLen; j++) {
|
||||
aData[i + j] ^= enc[2 * OAES_BLOCK_SIZE + j];
|
||||
}
|
||||
|
@ -84,7 +84,7 @@ void* CreateCdmInstance(int cdm_interface_version, const char* key_system,
|
||||
const size_t TEST_READ_SIZE = 16 * 1024;
|
||||
|
||||
bool CanReadSome(cdm::PlatformFile aFile) {
|
||||
vector<uint8_t> data;
|
||||
std::vector<uint8_t> data;
|
||||
data.resize(TEST_READ_SIZE);
|
||||
#ifdef XP_WIN
|
||||
DWORD bytesRead = 0;
|
||||
|
Loading…
x
Reference in New Issue
Block a user