Ran clang-format on android/cdm/ files.

[ Merge of http://go/wvgerrit/87123 ]

Certain android files have yet to be formated since we introduced
clang-formatting.

Test: built for android
Bug: 134365840
Change-Id: Ia316b039e7469f7cf803464ee95a919fe7966450
This commit is contained in:
Alex Dale
2019-10-02 11:55:27 -07:00
parent 78e84dcd3b
commit bdcb79a442
13 changed files with 1023 additions and 1081 deletions

View File

@@ -13,7 +13,6 @@
namespace wvcdm {
class AmiAdapter {
public:
AmiAdapter();
AmiAdapter(int64_t parent);
@@ -26,7 +25,6 @@ class AmiAdapter {
private:
android::MediaAnalyticsItem analytics_item_;
};
} // namespace wvcdm

View File

@@ -43,17 +43,16 @@ struct CdmIdentifier {
// comparison in lieu of the == operator when checking to see if the
// identifier would cause the default provisioned certificate to be used.
bool IsEquivalentToDefault() {
return spoid == EMPTY_SPOID
&& origin == EMPTY_ORIGIN
&& app_package_name == EMPTY_APP_PACKAGE_NAME;
return spoid == EMPTY_SPOID && origin == EMPTY_ORIGIN &&
app_package_name == EMPTY_APP_PACKAGE_NAME;
}
};
// Provide comparison operators
inline bool operator==(const CdmIdentifier& lhs, const CdmIdentifier& rhs) {
return lhs.spoid == rhs.spoid && lhs.origin == rhs.origin
&& lhs.app_package_name == rhs.app_package_name
&& lhs.unique_id == rhs.unique_id;
return lhs.spoid == rhs.spoid && lhs.origin == rhs.origin &&
lhs.app_package_name == rhs.app_package_name &&
lhs.unique_id == rhs.unique_id;
}
inline bool operator!=(const CdmIdentifier& lhs, const CdmIdentifier& rhs) {
@@ -61,13 +60,13 @@ inline bool operator!=(const CdmIdentifier& lhs, const CdmIdentifier& rhs) {
}
inline bool operator<(const CdmIdentifier& lhs, const CdmIdentifier& rhs) {
return (lhs.spoid < rhs.spoid)
|| ((lhs.spoid == rhs.spoid)
&& (lhs.origin < rhs.origin
|| (lhs.origin == rhs.origin
&& (lhs.app_package_name < rhs.app_package_name
|| (lhs.app_package_name == rhs.app_package_name
&& lhs.unique_id < rhs.unique_id)))));
return (lhs.spoid < rhs.spoid) ||
((lhs.spoid == rhs.spoid) &&
(lhs.origin < rhs.origin ||
(lhs.origin == rhs.origin &&
(lhs.app_package_name < rhs.app_package_name ||
(lhs.app_package_name == rhs.app_package_name &&
lhs.unique_id < rhs.unique_id)))));
}
inline bool operator>(const CdmIdentifier& lhs, const CdmIdentifier& rhs) {
@@ -83,12 +82,8 @@ inline bool operator>=(const CdmIdentifier& lhs, const CdmIdentifier& rhs) {
}
// Provide default
static const CdmIdentifier kDefaultCdmIdentifier = {
EMPTY_SPOID,
EMPTY_ORIGIN,
EMPTY_APP_PACKAGE_NAME,
0
};
static const CdmIdentifier kDefaultCdmIdentifier = {EMPTY_SPOID, EMPTY_ORIGIN,
EMPTY_APP_PACKAGE_NAME, 0};
} // namespace wvcdm

View File

@@ -5,8 +5,8 @@
#ifndef CDM_BASE_PROPERTIES_CONFIGURATION_H_
#define CDM_BASE_PROPERTIES_CONFIGURATION_H_
#include "wv_cdm_constants.h"
#include "properties.h"
#include "wv_cdm_constants.h"
namespace wvcdm {
@@ -39,6 +39,6 @@ const bool kDeviceFilesIsARealFileSystem = true;
// will be treated as a release request. If false, a restoration will fail.
const bool kAllowRestoreOfflineLicenseWithRelease = false;
} // namespace wvcdm
} // namespace wvcdm
#endif // CDM_BASE_WV_PROPERTIES_CONFIGURATION_H_

View File

@@ -22,8 +22,8 @@ namespace wvcdm {
class TimerHandler {
public:
TimerHandler() {};
virtual ~TimerHandler() {};
TimerHandler() {}
virtual ~TimerHandler() {}
virtual void OnTimerEvent() = 0;
};
@@ -42,7 +42,7 @@ class Timer {
Timer();
~Timer();
bool Start(TimerHandler *handler, uint32_t time_in_secs);
bool Start(TimerHandler* handler, uint32_t time_in_secs);
void Stop();
bool IsRunning();

View File

@@ -108,8 +108,7 @@ class WvContentDecryptionModule : public android::RefBase, public TimerHandler {
virtual CdmResponseType RemoveAllUsageInfo(const std::string& app_id,
const CdmIdentifier& identifier);
virtual CdmResponseType RemoveUsageInfo(
const std::string& app_id,
const CdmIdentifier& identifier,
const std::string& app_id, const CdmIdentifier& identifier,
const CdmSecureStopId& secure_stop_id);
virtual CdmResponseType ReleaseUsageInfo(
const CdmUsageInfoReleaseMessage& message,
@@ -151,22 +150,18 @@ class WvContentDecryptionModule : public android::RefBase, public TimerHandler {
// Return the list of key_set_ids stored on the current (origin-specific)
// file system.
virtual CdmResponseType ListStoredLicenses(
CdmSecurityLevel security_level,
const CdmIdentifier& identifier,
CdmSecurityLevel security_level, const CdmIdentifier& identifier,
std::vector<CdmKeySetId>* key_set_ids);
// Retrieve offline license state using key_set_id.
virtual CdmResponseType GetOfflineLicenseState(
const CdmKeySetId& key_set_id,
CdmSecurityLevel security_level,
const CdmIdentifier& identifier,
CdmOfflineLicenseState* licenseState);
const CdmKeySetId& key_set_id, CdmSecurityLevel security_level,
const CdmIdentifier& identifier, CdmOfflineLicenseState* licenseState);
// Remove offline license using key_set_id.
virtual CdmResponseType RemoveOfflineLicense(
const CdmKeySetId& key_set_id,
CdmSecurityLevel security_level,
const CdmIdentifier& identifier);
virtual CdmResponseType RemoveOfflineLicense(const CdmKeySetId& key_set_id,
CdmSecurityLevel security_level,
const CdmIdentifier& identifier);
private:
struct CdmInfo {