Bug 1304722 - don't define nsCString constants in VideoUtils.h; r=mattwoodrow

Doing this causes a separate copy of each string to be included in each
compilation unit that includes VideoUtils.h, and since global
nsLiteralCString objects require a static constructor, injects static
constructors into all those compilation units as well.  Moving the
object definitions to a source file and leaving the declarations in the
header makes everything work as expected.
This commit is contained in:
Nathan Froyd 2016-10-04 16:38:52 -04:00
Родитель 634e9fe732
Коммит 0269018b2e
2 изменённых файлов: 7 добавлений и 3 удалений

Просмотреть файл

@ -29,6 +29,10 @@
namespace mozilla {
NS_NAMED_LITERAL_CSTRING(kEMEKeySystemClearkey, "org.w3.clearkey");
NS_NAMED_LITERAL_CSTRING(kEMEKeySystemWidevine, "com.widevine.alpha");
NS_NAMED_LITERAL_CSTRING(kEMEKeySystemPrimetime, "com.adobe.primetime");
using layers::PlanarYCbCrImage;
CheckedInt64 SaferMultDiv(int64_t aValue, uint32_t aMul, uint32_t aDiv) {

Просмотреть файл

@ -40,9 +40,9 @@ using mozilla::CheckedUint32;
namespace mozilla {
// EME Key System String.
static NS_NAMED_LITERAL_CSTRING(kEMEKeySystemClearkey, "org.w3.clearkey");
static NS_NAMED_LITERAL_CSTRING(kEMEKeySystemWidevine, "com.widevine.alpha");
static NS_NAMED_LITERAL_CSTRING(kEMEKeySystemPrimetime, "com.adobe.primetime");
extern const nsLiteralCString kEMEKeySystemClearkey;
extern const nsLiteralCString kEMEKeySystemWidevine;
extern const nsLiteralCString kEMEKeySystemPrimetime;
/**
* ReentrantMonitorConditionallyEnter