Bug 1726615 - Reorder includes in ClearKey files. r=alwu

Reorder includes to match Google C++ style. The follow decisions were made to
resolve ambiguities.
- The pssh parser and clearkey are considered part of mozilla-central/Gecko and
  so have their includes grouped into the 'your project' includes at the end of
  includes. I.e. they're grouped with other mozilla-central headers.
- NSS and the CDM headers are considered as coming from other libs, so are
  placed in a block preceding the mozilla-central's.

I think everything else is decided by using the style guide and by Mozilla using
case sensitive sorting.

This also changes a few instances of using "systemheader.h" to <systemheader.h>,
which is more in line with the style guide.

Differential Revision: https://phabricator.services.mozilla.com/D123230
This commit is contained in:
Bryce Seager van Dyk 2021-08-20 18:00:12 +00:00
parent 925f82df84
commit fa930a9e95
21 changed files with 92 additions and 75 deletions

View File

@ -17,10 +17,11 @@
#ifndef __ClearKeyBase64_h__
#define __ClearKeyBase64_h__
#include <vector>
#include <string>
#include <stdint.h>
#include <string>
#include <vector>
// Decodes a base64 encoded string. Returns true on success.
bool DecodeBase64(const std::string& aEncoded,
std::vector<uint8_t>& aOutDecoded);

View File

@ -7,16 +7,17 @@
#ifndef ClearKeyCDM_h_
#define ClearKeyCDM_h_
#include "ClearKeySessionManager.h"
// This include is required in order for content_decryption_module to work
// on Unix systems.
#include "stddef.h"
#include <stddef.h>
#include "content_decryption_module.h"
#include "ClearKeySessionManager.h"
#ifdef ENABLE_WMF
# include "WMFUtils.h"
# include "VideoDecoder.h"
# include "WMFUtils.h"
#endif
class ClearKeyCDM : public cdm::ContentDecryptionModule_10 {

View File

@ -16,15 +16,15 @@
#include "ClearKeyDecryptionManager.h"
#include "psshparser/PsshParser.h"
#include <assert.h>
#include <string.h>
#include <vector>
#include <algorithm>
#include "mozilla/CheckedInt.h"
#include "mozilla/Span.h"
#include "psshparser/PsshParser.h"
using namespace cdm;

View File

@ -17,15 +17,17 @@
#ifndef __ClearKeyDecryptionManager_h__
#define __ClearKeyDecryptionManager_h__
#include "ClearKeyUtils.h"
// This include is required in order for content_decryption_module to work
// on Unix systems.
#include "stddef.h"
#include "content_decryption_module.h"
#include "RefCounted.h"
#include <stddef.h>
#include <map>
#include "content_decryption_module.h"
#include "ClearKeyUtils.h"
#include "RefCounted.h"
class ClearKeyDecryptor;
class CryptoMetaData {

View File

@ -16,16 +16,17 @@
#include "ClearKeyPersistence.h"
#include "ClearKeyUtils.h"
#include "ClearKeyStorage.h"
#include "ClearKeySessionManager.h"
#include "RefCounted.h"
#include <assert.h>
#include <stdint.h>
#include <sstream>
#include <string.h>
#include <sstream>
#include "ClearKeySessionManager.h"
#include "ClearKeyStorage.h"
#include "ClearKeyUtils.h"
#include "RefCounted.h"
using namespace cdm;
using std::function;

View File

@ -19,15 +19,17 @@
// This include is required in order for content_decryption_module to work
// on Unix systems.
#include "stddef.h"
#include "content_decryption_module.h"
#include "RefCounted.h"
#include <stddef.h>
#include <functional>
#include <set>
#include <string>
#include <vector>
#include "content_decryption_module.h"
#include "RefCounted.h"
class ClearKeySessionManager;
// Whether we've loaded the persistent session ids yet.

View File

@ -14,16 +14,16 @@
* limitations under the License.
*/
#include <assert.h>
#include <string.h>
#include "BigEndian.h"
#include "ClearKeyDecryptionManager.h"
#include "ClearKeySession.h"
#include "ClearKeyUtils.h"
#include "ClearKeyStorage.h"
#include "ClearKeyUtils.h"
#include "psshparser/PsshParser.h"
#include <assert.h>
#include <string.h>
using namespace mozilla;
using namespace cdm;

View File

@ -17,15 +17,17 @@
#ifndef __ClearKeySession_h__
#define __ClearKeySession_h__
#include "ClearKeyUtils.h"
// This include is required in order for content_decryption_module to work
// on Unix systems.
#include "stddef.h"
#include "content_decryption_module.h"
#include <stddef.h>
#include <string>
#include <vector>
#include "content_decryption_module.h"
#include "ClearKeyUtils.h"
class ClearKeySession {
public:
explicit ClearKeySession(const std::string& aSessionId,

View File

@ -14,22 +14,21 @@
* limitations under the License.
*/
#include "ClearKeyDecryptionManager.h"
#include "ClearKeySessionManager.h"
#include "ClearKeyUtils.h"
#include "ClearKeyStorage.h"
#include "ClearKeyPersistence.h"
// This include is required in order for content_decryption_module to work
// on Unix systems.
#include "stddef.h"
#include "content_decryption_module.h"
#include "psshparser/PsshParser.h"
#include <assert.h>
#include <stdint.h>
#include <stdio.h>
#include <string.h>
#include "content_decryption_module.h"
#include "ClearKeyDecryptionManager.h"
#include "ClearKeyPersistence.h"
#include "ClearKeyStorage.h"
#include "ClearKeyUtils.h"
#include "psshparser/PsshParser.h"
using namespace cdm;
using std::function;

View File

@ -28,12 +28,13 @@
#include <set>
#include <string>
#include "content_decryption_module.h"
#include "ClearKeyDecryptionManager.h"
#include "ClearKeyPersistence.h"
#include "ClearKeySession.h"
#include "ClearKeyUtils.h"
#include "RefCounted.h"
#include "content_decryption_module.h"
#include "mozilla/TimeStamp.h"
class ClearKeySessionManager final : public RefCounted {

View File

@ -16,16 +16,17 @@
#include "ClearKeyStorage.h"
#include "ClearKeyUtils.h"
#include <assert.h>
// This include is required in order for content_decryption_module to work
// on Unix systems.
#include "stddef.h"
#include <stddef.h>
#include <vector>
#include "content_decryption_module.h"
#include <assert.h>
#include "ArrayUtils.h"
#include <vector>
#include "ClearKeyUtils.h"
using namespace cdm;

View File

@ -17,8 +17,9 @@
#ifndef __ClearKeyStorage_h__
#define __ClearKeyStorage_h__
#include <functional>
#include <stdint.h>
#include <functional>
#include <string>
#include <vector>

View File

@ -20,9 +20,6 @@
#include <ctype.h>
#include <memory.h>
#include <stdarg.h>
// This include is required in order for content_decryption_module to work // on
// Unix systems.
#include <stddef.h>
#include <stdint.h>
#include <stdio.h>
#include <stdlib.h>
@ -33,14 +30,15 @@
#include <sstream>
#include <vector>
#include "pk11pub.h"
#include "prerror.h"
#include "secmodt.h"
#include "ArrayUtils.h"
#include "BigEndian.h"
#include "ClearKeyBase64.h"
#include "mozilla/Sprintf.h"
#include "pk11pub.h"
#include "prerror.h"
#include "psshparser/PsshParser.h"
#include "secmodt.h"
using namespace cdm;
using std::string;

View File

@ -26,9 +26,10 @@
#include <vector>
#include "content_decryption_module.h"
#include "mozilla/Span.h"
#include "pk11pub.h"
#include "mozilla/Span.h"
#if 0
void CK_Log(const char* aFmt, ...);
# define CK_LOGE(...) CK_Log(__VA_ARGS__)

View File

@ -17,12 +17,13 @@
#ifndef __RefCount_h__
#define __RefCount_h__
#include <stdint.h>
#include <assert.h>
#include "ClearKeyUtils.h"
#include <stdint.h>
#include <atomic>
#include "ClearKeyUtils.h"
// Note: Thread safe.
class RefCounted {
public:

View File

@ -19,8 +19,8 @@
#include <limits>
#include "BigEndian.h"
#include "ClearKeyDecryptionManager.h"
#include "ClearKeyUtils.h"
#include "ClearKeyDecryptionManager.h"
#include "VideoDecoder.h"
#include "mozilla/CheckedInt.h"

View File

@ -17,13 +17,14 @@
#ifndef __VideoDecoder_h__
#define __VideoDecoder_h__
// This include is required in order for content_decryption_module to work
// on Unix systems.
#include <stddef.h>
#include <atomic>
#include <queue>
#include <thread>
// This include is required in order for content_decryption_module to work
// on Unix systems.
#include "stddef.h"
#include "content_decryption_module.h"
#include "WMFH264Decoder.h"

View File

@ -15,9 +15,11 @@
*/
#include "WMFH264Decoder.h"
#include <algorithm>
#include <codecapi.h>
#include <algorithm>
namespace wmf {
WMFH264Decoder::WMFH264Decoder() : mDecoder(nullptr) {

View File

@ -15,14 +15,15 @@
*/
#include "WMFUtils.h"
#include "ClearKeyUtils.h"
#include <versionhelpers.h>
#include <algorithm>
#include <stdio.h>
#define INITGUID
#include <guiddef.h>
#include <stdio.h>
#include <versionhelpers.h>
#include <algorithm>
#include "ClearKeyUtils.h"
#ifndef __MINGW32__
# pragma comment(lib, "mfuuid.lib")

View File

@ -17,19 +17,19 @@
#ifndef __WMFUtils_h__
#define __WMFUtils_h__
#include <cstdint>
#include <string>
#include <assert.h>
#include <mfapi.h>
#include <mferror.h>
#include <mfobjects.h>
#include <mftransform.h>
#include <wmcodecdsp.h>
#include "mozilla/Attributes.h"
#include "VideoLimits.h"
#include <cstdint>
#include <string>
#include "VideoLimits.h"
#include "gmp-platform.h"
#include "mozilla/Attributes.h"
void LOG(const char* format, ...);

View File

@ -15,20 +15,22 @@
*/
#include <assert.h>
// This include is required in order for content_decryption_module to work
// on Unix systems.
#include <stddef.h>
#include <stdio.h>
#include <string.h>
#include <vector>
#include <string>
#include <vector>
#include "content_decryption_module.h"
#include "content_decryption_module_ext.h"
#include "nss.h"
#include "ClearKeyCDM.h"
#include "ClearKeySessionManager.h"
#include "mozilla/dom/KeySystemNames.h"
// This include is required in order for content_decryption_module to work
// on Unix systems.
#include "stddef.h"
#include "content_decryption_module.h"
#include "content_decryption_module_ext.h"
#include "nss.h"
#ifndef XP_WIN
# include <sys/types.h>