Clean comments, namespace, and variable names

This CL removes TODOs and email addresses from comments, unifies some
namespaces and cleans a few variable names.  It is a copy of multiple
CLs on the widevine side.

Change-Id: I1bb649096476a5001a56d746427399de6a88ff69
This commit is contained in:
Fred Gylys-Colwell
2014-05-16 13:10:59 -07:00
parent 1dfd204f22
commit 6bac5bc50d
38 changed files with 154 additions and 1064 deletions

View File

@@ -1,7 +1,7 @@
// Copyright 2012 Google Inc. All Rights Reserved.
#ifndef CDM_BASE_BUFFER_READER_H_
#define CDM_BASE_BUFFER_READER_H_
#ifndef WVCDM_CORE_BUFFER_READER_H_
#define WVCDM_CORE_BUFFER_READER_H_
#include <stdint.h>
#include <string>
@@ -65,4 +65,4 @@ class BufferReader {
} // namespace wvcdm
#endif // CDM_BASE_BUFFER_READER_H_
#endif // WVCDM_CORE_BUFFER_READER_H_

View File

@@ -1,7 +1,7 @@
// Copyright 2013 Google Inc. All Rights Reserved.
#ifndef CDM_BASE_CDM_CLIENT_PROPERTY_SET_H_
#define CDM_BASE_CDM_CLIENT_PROPERTY_SET_H_
#ifndef WVCDM_CORE_CDM_CLIENT_PROPERTY_SET_H_
#define WVCDM_CORE_CDM_CLIENT_PROPERTY_SET_H_
#include <string>
#include <vector>
@@ -23,4 +23,4 @@ class CdmClientPropertySet {
} // namespace wvcdm
#endif // CDM_BASE_CDM_CLIENT_PROPERTY_SET_H_
#endif // WVCDM_CORE_CDM_CLIENT_PROPERTY_SET_H_

View File

@@ -1,7 +1,7 @@
// Copyright 2013 Google Inc. All Rights Reserved.
#ifndef CDM_BASE_CDM_ENGINE_H_
#define CDM_BASE_CDM_ENGINE_H_
#ifndef WVCDM_CORE_CDM_ENGINE_H_
#define WVCDM_CORE_CDM_ENGINE_H_
#include "certificate_provisioning.h"
#include "initialization_data.h"
@@ -132,4 +132,4 @@ class CdmEngine {
} // namespace wvcdm
#endif // CDM_BASE_CDM_ENGINE_H_
#endif // WVCDM_CORE_CDM_ENGINE_H_

View File

@@ -1,7 +1,7 @@
// Copyright 2012 Google Inc. All Rights Reserved.
#ifndef CDM_BASE_CDM_SESSION_H_
#define CDM_BASE_CDM_SESSION_H_
#ifndef WVCDM_CORE_CDM_SESSION_H_
#define WVCDM_CORE_CDM_SESSION_H_
#include <set>
@@ -131,4 +131,4 @@ class CdmSession {
} // namespace wvcdm
#endif // CDM_BASE_CDM_SESSION_H_
#endif // WVCDM_CORE_CDM_SESSION_H_

View File

@@ -1,7 +1,7 @@
// Copyright 2013 Google Inc. All Rights Reserved.
#ifndef CDM_BASE_CERTIFICATE_PROVISIONING_H_
#define CDM_BASE_CERTIFICATE_PROVISIONING_H_
#ifndef WVCDM_CORE_CERTIFICATE_PROVISIONING_H_
#define WVCDM_CORE_CERTIFICATE_PROVISIONING_H_
#include "crypto_session.h"
#include "oemcrypto_adapter.h"
@@ -40,4 +40,4 @@ class CertificateProvisioning {
};
} // namespace wvcdm
#endif // CDM_BASE_CERTIFICATE_PROVISIONING_H_
#endif // WVCDM_CORE_CERTIFICATE_PROVISIONING_H_

View File

@@ -2,8 +2,8 @@
//
// Clock - Platform independent interface for a time library
//
#ifndef CDM_BASE_CLOCK_H_
#define CDM_BASE_CLOCK_H_
#ifndef WVCDM_CORE_CLOCK_H_
#define WVCDM_CORE_CLOCK_H_
#include <stdint.h>
@@ -22,4 +22,4 @@ class Clock {
}; // namespace wvcdm
#endif // CDM_BASE_CLOCK_H_
#endif // WVCDM_CORE_CLOCK_H_

View File

@@ -1,9 +1,7 @@
// Copyright 2012 Google Inc. All Rights Reserved.
//
// OEMCrypto Client - wrapper class for C-style OEMCrypto interface
//
#ifndef CDM_BASE_CRYPTO_KEY_H_
#define CDM_BASE_CRYPTO_KEY_H_
#ifndef WVCDM_CORE_CRYPTO_KEY_H_
#define WVCDM_CORE_CRYPTO_KEY_H_
#include "wv_cdm_types.h"
@@ -39,4 +37,4 @@ private:
}; // namespace wvcdm
#endif // CDM_BASE_CRYPTO_KEY_H_
#endif // WVCDM_CORE_CRYPTO_KEY_H_

View File

@@ -1,9 +1,7 @@
// Copyright 2012 Google Inc. All Rights Reserved.
//
// OEMCrypto Client - wrapper class for C-style OEMCrypto interface
//
#ifndef CDM_BASE_CRYPTO_SESSSION_H_
#define CDM_BASE_CRYPTO_SESSSION_H_
#ifndef WVCDM_CORE_CRYPTO_SESSSION_H_
#define WVCDM_CORE_CRYPTO_SESSSION_H_
#include <string>
#include <map>
@@ -103,4 +101,4 @@ class CryptoSession {
}; // namespace wvcdm
#endif // CDM_BASE_CRYPTO_SESSSION_H_
#endif // WVCDM_CORE_CRYPTO_SESSSION_H_

View File

@@ -1,7 +1,7 @@
// Copyright 2013 Google Inc. All Rights Reserved.
//
#ifndef CDM_BASE_DEVICE_FILES_H_
#define CDM_BASE_DEVICE_FILES_H_
#ifndef WVCDM_CORE_DEVICE_FILES_H_
#define WVCDM_CORE_DEVICE_FILES_H_
#include "wv_cdm_types.h"
@@ -73,4 +73,4 @@ class DeviceFiles {
} // namespace wvcdm
#endif // CDM_BASE_DEVICE_FILES_H_
#endif // WVCDM_CORE_DEVICE_FILES_H_

View File

@@ -2,8 +2,8 @@
//
// File - Platform independent interface for a File class
//
#ifndef CDM_BASE_FILE_STORE_H_
#define CDM_BASE_FILE_STORE_H_
#ifndef WVCDM_CORE_FILE_STORE_H_
#define WVCDM_CORE_FILE_STORE_H_
#include "wv_cdm_types.h"
@@ -48,4 +48,4 @@ class File {
} // namespace wvcdm
#endif // CDM_BASE_FILE_STORE_H_
#endif // WVCDM_CORE_FILE_STORE_H_

View File

@@ -1,7 +1,7 @@
// Copyright 2012 Google Inc. All Rights Reserved.
#ifndef CDM_BASE_LICENSE_H_
#define CDM_BASE_LICENSE_H_
#ifndef WVCDM_CORE_LICENSE_H_
#define WVCDM_CORE_LICENSE_H_
#include <set>
@@ -76,4 +76,4 @@ class CdmLicense {
} // namespace wvcdm
#endif // CDM_BASE_LICENSE_H_
#endif // WVCDM_CORE_LICENSE_H_

View File

@@ -2,8 +2,8 @@
//
// Lock - Platform independent interface for a Mutex class
//
#ifndef CDM_BASE_LOCK_H_
#define CDM_BASE_LOCK_H_
#ifndef WVCDM_CORE_LOCK_H_
#define WVCDM_CORE_LOCK_H_
#include "wv_cdm_types.h"
@@ -58,4 +58,4 @@ class AutoLock {
}; // namespace wvcdm
#endif // CDM_BASE_LOCK_H_
#endif // WVCDM_CORE_LOCK_H_

View File

@@ -2,8 +2,8 @@
//
// Log - Platform independent interface for a Logging class
//
#ifndef CDM_BASE_LOG_H_
#define CDM_BASE_LOG_H_
#ifndef WVCDM_CORE_LOG_H_
#define WVCDM_CORE_LOG_H_
namespace wvcdm {
@@ -17,13 +17,10 @@ typedef enum {
LOG_VERBOSE
} LogPriority;
// Required to enable/disable verbose logging (LOGV) in Chromium. In Chromium,
// verbose logging level is controlled using command line switches --v (global)
// or --vmodule (per module). This function calls logging::InitLogging to
// initialize logging, which should have already been included in most Chromium
// based binaries. However, it is typically not included by default in
// unittests, in particular, the unittests in CDM core need to call InitLogging
// to be able to control verbose logging in command line.
// Enable/disable verbose logging (LOGV).
// This function is supplied for cases where the system layer does not
// initialize logging. This is also needed to initialize logging in
// unit tests.
void InitLogging(int argc, const char* const* argv);
void Log(const char* file, int line, LogPriority level, const char* fmt, ...);
@@ -37,4 +34,4 @@ void Log(const char* file, int line, LogPriority level, const char* fmt, ...);
}; // namespace wvcdm
#endif // CDM_BASE_LOG_H_
#endif // WVCDM_CORE_LOG_H_

View File

@@ -1,15 +1,11 @@
/*********************************************************************
* oemcrypto_adapter.h
*
* (c) Copyright 2013 Google, Inc.
*
* This interface allows CDM to open a Level 3 session instead of
* letting the wrapper function choose between level 1 or level 3.
*
*********************************************************************/
#ifndef OEMCRYPTO_ADAPTER_H_
#define OEMCRYPTO_ADAPTER_H_
// Copyright 2013 Google Inc. All Rights Reserved.
//
// oemcrypto_adapter.h
// This interface allows CDM to open a Level 3 session instead of
// letting the wrapper function choose between level 1 or level 3.
//
#ifndef WVCDM_CORE_OEMCRYPTO_ADAPTER_H_
#define WVCDM_CORE_OEMCRYPTO_ADAPTER_H_
#include "OEMCryptoCENC.h"
@@ -37,4 +33,4 @@ const char* OEMCrypto_SecurityLevel(SecurityLevel level);
bool OEMCrypto_SupportsUsageTable(SecurityLevel level);
} // namespace wvcdm
#endif // OEMCRYPTO_ADAPTER_H_
#endif // WVCDM_CORE_OEMCRYPTO_ADAPTER_H_

View File

@@ -1,7 +1,7 @@
// Copyright 2013 Google Inc. All Rights Reserved.
#ifndef CDM_BASE_POLICY_ENGINE_H_
#define CDM_BASE_POLICY_ENGINE_H_
#ifndef WVCDM_CORE_POLICY_ENGINE_H_
#define WVCDM_CORE_POLICY_ENGINE_H_
#include <string>
@@ -25,7 +25,7 @@ class PolicyEngine {
// UpdateLicense/OnTimerEvent/BeginDecryption and may be out of sync
// depending on the amount of time elapsed. The current decryption
// status is not calculated to avoid overhead in the decryption path.
inline bool can_decrypt() { return can_decrypt_; }
inline bool can_decrypt() { return can_decrypt_; }
// OnTimerEvent is called when a timer fires. It notifies the Policy Engine
// that the timer has fired and that it should check whether any events have
@@ -118,5 +118,4 @@ class PolicyEngine {
} // wvcdm
#endif // CDM_BASE_POLICY_ENGINE_H_
#endif // WVCDM_CORE_POLICY_ENGINE_H_

View File

@@ -1,8 +1,5 @@
// Copyright 2013 Google Inc. All Rights Reserved.
//
// RsaPublicKey based on //depot/google3/video/widevine/common/rsa_key.h by
// tinskip@google.com.
//
// Description:
// Declaration of classes representing AES and RSA public keys used
// for signature verification and encryption.
@@ -21,9 +18,9 @@
// Algorithm: RSA-OAEP
// Mask generation function: mgf1SHA1
// Label (encoding paramter): empty string
#ifndef CDM_BASE_PRIVACY_CRYPTO_H_
#define CDM_BASE_PRIVACY_CRYPTO_H_
//
#ifndef WVCDM_CORE_PRIVACY_CRYPTO_H_
#define WVCDM_CORE_PRIVACY_CRYPTO_H_
#include <string>
@@ -74,4 +71,4 @@ class RsaPublicKey {
} // namespace wvcdm
#endif // CDM_BASE_PRIVACY_CRYPTO_H_
#endif // WVCDM_CORE_PRIVACY_CRYPTO_H_

View File

@@ -1,7 +1,7 @@
// Copyright 2013 Google Inc. All Rights Reserved.
#ifndef CDM_BASE_PROPERTIES_H_
#define CDM_BASE_PROPERTIES_H_
#ifndef WVCDM_CORE_PROPERTIES_H_
#define WVCDM_CORE_PROPERTIES_H_
#include <map>
#include <string>
@@ -121,4 +121,4 @@ class Properties {
} // namespace wvcdm
#endif // CDM_BASE_PROPERTIES_H_
#endif // WVCDM_CORE_PROPERTIES_H_

View File

@@ -3,8 +3,8 @@
// A simple and partial implementation of scoped_ptr class.
// The implementation is copied from gtest/include/gtest/internal/gtest-port.h.
//
#ifndef CDM_BASE_SCOPED_PTR_H_
#define CDM_BASE_SCOPED_PTR_H_
#ifndef WVCDM_CORE_SCOPED_PTR_H_
#define WVCDM_CORE_SCOPED_PTR_H_
#include "wv_cdm_types.h"
@@ -61,4 +61,4 @@ class scoped_ptr {
}; // namespace wvcdm
#endif // CDM_BASE_SCOPED_PTR_H_
#endif // WVCDM_CORE_SCOPED_PTR_H_

View File

@@ -1,7 +1,7 @@
// Copyright 2013 Google Inc. All Rights Reserved.
#ifndef CDM_BASE_STRING_CONVERSIONS_H_
#define CDM_BASE_STRING_CONVERSIONS_H_
#ifndef WVCDM_CORE_STRING_CONVERSIONS_H_
#define WVCDM_CORE_STRING_CONVERSIONS_H_
#include <stddef.h>
#include <stdint.h>
@@ -25,4 +25,4 @@ int64_t htonll64(int64_t x);
}; // namespace wvcdm
#endif // CDM_BASE_STRING_CONVERSIONS_H_
#endif // WVCDM_CORE_STRING_CONVERSIONS_H_

View File

@@ -2,8 +2,8 @@
//
// Timer - Platform independent interface for a Timer class
//
#ifndef CDM_BASE_TIMER_H_
#define CDM_BASE_TIMER_H_
#ifndef WVCDM_CORE_TIMER_H_
#define WVCDM_CORE_TIMER_H_
#include "wv_cdm_types.h"
@@ -48,4 +48,4 @@ class Timer {
}; // namespace wvcdm
#endif // CDM_BASE_TIMER_H_
#endif // WVCDM_CORE_TIMER_H_

View File

@@ -1,15 +1,12 @@
// Copyright 2012 Google Inc. All Rights Reserved.
#ifndef CDM_BASE_WV_CDM_CONSTANTS_H_
#define CDM_BASE_WV_CDM_CONSTANTS_H_
#ifndef WVCDM_CORE_WV_CDM_CONSTANTS_H_
#define WVCDM_CORE_WV_CDM_CONSTANTS_H_
#include <string>
namespace wvcdm {
static const size_t KEY_CONTROL_SIZE = 16;
// TODO(kqyang): Key ID size is not fixed in spec, but conventionally we
// always use 16 bytes key id. We'll need to update oemcrypto to support
// variable size key id.
static const size_t KEY_ID_SIZE = 16;
static const size_t KEY_IV_SIZE = 16;
static const size_t KEY_PAD_SIZE = 16;
@@ -64,4 +61,4 @@ static const std::string CENC_INIT_DATA_FORMAT = "cenc";
static const std::string WEBM_INIT_DATA_FORMAT = "webm";
} // namespace wvcdm
#endif // CDM_BASE_WV_CDM_CONSTANTS_H_
#endif // WVCDM_CORE_WV_CDM_CONSTANTS_H_

View File

@@ -1,7 +1,7 @@
// Copyright 2012 Google Inc. All Rights Reserved.
#ifndef CDM_BASE_WV_CDM_EVENT_LISTENER_H_
#define CDM_BASE_WV_CDM_EVENT_LISTENER_H_
#ifndef WVCDM_CORE_WV_CDM_EVENT_LISTENER_H_
#define WVCDM_CORE_WV_CDM_EVENT_LISTENER_H_
#include "wv_cdm_types.h"
@@ -25,4 +25,4 @@ class WvCdmEventListener {
} // namespace wvcdm
#endif // CDM_BASE_WV_CDM_EVENT_LISTENER_H_
#endif // WVCDM_CORE_WV_CDM_EVENT_LISTENER_H_

View File

@@ -1,7 +1,7 @@
// Copyright 2013 Google Inc. All Rights Reserved.
#ifndef CDM_BASE_WV_CDM_TYPES_H_
#define CDM_BASE_WV_CDM_TYPES_H_
#ifndef WVCDM_CORE_WV_CDM_TYPES_H_
#define WVCDM_CORE_WV_CDM_TYPES_H_
#include <map>
#include <stdint.h>
@@ -125,4 +125,4 @@ class Key;
} // namespace wvcdm
#endif // CDM_BASE_WV_CDM_TYPES_H_
#endif // WVCDM_CORE_WV_CDM_TYPES_H_