1 /* This Source Code Form is subject to the terms of the Mozilla Public
2 * License, v. 2.0. If a copy of the MPL was not distributed with this
3 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
5 #include "CrashAnnotations.h"
15 namespace CrashReporter
{
17 bool AnnotationFromString(Annotation
& aResult
, const char* aValue
) {
19 begin(kAnnotationStrings
), end(kAnnotationStrings
),
20 [&aValue
](const char* aString
) { return strcmp(aString
, aValue
) == 0; });
22 if (elem
== end(kAnnotationStrings
)) {
26 aResult
= static_cast<Annotation
>(elem
- begin(kAnnotationStrings
));
30 bool IsAnnotationWhitelistedForPing(Annotation aAnnotation
) {
32 begin(kCrashPingWhitelist
), end(kCrashPingWhitelist
),
33 [&aAnnotation
](Annotation aElement
) { return aElement
== aAnnotation
; });
35 return elem
!= end(kCrashPingWhitelist
);
38 } // namespace CrashReporter