Add a compile-time-checked string literal initializer for FourCC.
authorjer.noble@apple.com <jer.noble@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 15 Nov 2017 19:06:53 +0000 (19:06 +0000)
committerjer.noble@apple.com <jer.noble@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 15 Nov 2017 19:06:53 +0000 (19:06 +0000)
commit3031fc05544bde7c2ffd9947963025d4562dba17
treea991d99933caa6fee3d9e7027bd59ba39f3e4ff4
parentc0260602557123b89dc36ee10e99871aee1ad8a8
Add a compile-time-checked string literal initializer for FourCC.
https://bugs.webkit.org/show_bug.cgi?id=179706

Reviewed by Alex Christensen.

Add a contexpr constructor for FourCC that takes a string literal and static_asserts that it
is exactly 4 chars long. Use this string literal constructor everywhere instead of multi-
character literals.

* platform/graphics/FourCC.h:
(WebCore::FourCC::FourCC):
* platform/graphics/iso/ISOBox.cpp:
(WebCore::ISOBox::parse):
* platform/graphics/iso/ISOOriginalFormatBox.h:
(WebCore::ISOOriginalFormatBox::boxTypeName):
* platform/graphics/iso/ISOProtectionSchemeInfoBox.h:
(WebCore::ISOProtectionSchemeInfoBox::boxTypeName):
* platform/graphics/iso/ISOSchemeInformationBox.h:
(WebCore::ISOSchemeInformationBox::boxTypeName):
* platform/graphics/iso/ISOSchemeTypeBox.h:
(WebCore::ISOSchemeTypeBox::boxTypeName):
* platform/graphics/iso/ISOTrackEncryptionBox.h:
(WebCore::ISOTrackEncryptionBox::boxTypeName):
* platform/graphics/iso/ISOVTTCue.h:
(WebCore::ISOWebVTTCue::boxTypeName):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@224887 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Source/WebCore/ChangeLog
Source/WebCore/platform/graphics/FourCC.h
Source/WebCore/platform/graphics/iso/ISOBox.cpp
Source/WebCore/platform/graphics/iso/ISOOriginalFormatBox.h
Source/WebCore/platform/graphics/iso/ISOProtectionSchemeInfoBox.h
Source/WebCore/platform/graphics/iso/ISOSchemeInformationBox.h
Source/WebCore/platform/graphics/iso/ISOSchemeTypeBox.h
Source/WebCore/platform/graphics/iso/ISOTrackEncryptionBox.h
Source/WebCore/platform/graphics/iso/ISOVTTCue.cpp
Source/WebCore/platform/graphics/iso/ISOVTTCue.h