mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-11-29 15:52:07 +00:00
bug 1252687 - get rid of static nsStrings in PerformanceObserver.cpp r=bz
This commit is contained in:
parent
8fc1f1f3e4
commit
966ec780b8
@ -135,14 +135,14 @@ PerformanceObserver::QueueEntry(PerformanceEntry* aEntry)
|
|||||||
mQueuedEntries.AppendElement(aEntry);
|
mQueuedEntries.AppendElement(aEntry);
|
||||||
}
|
}
|
||||||
|
|
||||||
static nsString sValidTypeNames[7] = {
|
static const char16_t* sValidTypeNames[7] = {
|
||||||
NS_LITERAL_STRING("composite"),
|
MOZ_UTF16("composite"),
|
||||||
NS_LITERAL_STRING("mark"),
|
MOZ_UTF16("mark"),
|
||||||
NS_LITERAL_STRING("measure"),
|
MOZ_UTF16("measure"),
|
||||||
NS_LITERAL_STRING("navigation"),
|
MOZ_UTF16("navigation"),
|
||||||
NS_LITERAL_STRING("render"),
|
MOZ_UTF16("render"),
|
||||||
NS_LITERAL_STRING("resource"),
|
MOZ_UTF16("resource"),
|
||||||
NS_LITERAL_STRING("server")
|
MOZ_UTF16("server")
|
||||||
};
|
};
|
||||||
|
|
||||||
void
|
void
|
||||||
@ -156,7 +156,8 @@ PerformanceObserver::Observe(const PerformanceObserverInit& aOptions,
|
|||||||
|
|
||||||
nsTArray<nsString> validEntryTypes;
|
nsTArray<nsString> validEntryTypes;
|
||||||
|
|
||||||
for (const nsString& validTypeName : sValidTypeNames) {
|
for (const char16_t* name : sValidTypeNames) {
|
||||||
|
nsDependentString validTypeName(name);
|
||||||
if (aOptions.mEntryTypes.Contains<nsString>(validTypeName) &&
|
if (aOptions.mEntryTypes.Contains<nsString>(validTypeName) &&
|
||||||
!validEntryTypes.Contains<nsString>(validTypeName)) {
|
!validEntryTypes.Contains<nsString>(validTypeName)) {
|
||||||
validEntryTypes.AppendElement(validTypeName);
|
validEntryTypes.AppendElement(validTypeName);
|
||||||
|
Loading…
Reference in New Issue
Block a user