1/*
2 * Copyright (C) 2012-2018 Apple Inc. All rights reserved.
3 *
4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions
6 * are met:
7 * 1. Redistributions of source code must retain the above copyright
8 * notice, this list of conditions and the following disclaimer.
9 * 2. Redistributions in binary form must reproduce the above copyright
10 * notice, this list of conditions and the following disclaimer in the
11 * documentation and/or other materials provided with the distribution.
12 *
13 * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
14 * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
15 * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
16 * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
17 * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
18 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
19 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
20 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
21 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
22 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
23 * THE POSSIBILITY OF SUCH DAMAGE.
24 */
25
26#include "config.h"
27#include "DiagnosticLoggingKeys.h"
28
29namespace WebCore {
30
31String DiagnosticLoggingKeys::mediaLoadedKey()
32{
33 return "mediaLoaded"_s;
34}
35
36String DiagnosticLoggingKeys::mediaLoadingFailedKey()
37{
38 return "mediaFailedLoading"_s;
39}
40
41String DiagnosticLoggingKeys::memoryCacheEntryDecisionKey()
42{
43 return "memoryCacheEntryDecision"_s;
44}
45
46String DiagnosticLoggingKeys::memoryCacheUsageKey()
47{
48 return "memoryCacheUsage"_s;
49}
50
51String DiagnosticLoggingKeys::missingValidatorFieldsKey()
52{
53 return "missingValidatorFields"_s;
54}
55
56String DiagnosticLoggingKeys::pluginLoadedKey()
57{
58 return "pluginLoaded"_s;
59}
60
61String DiagnosticLoggingKeys::pluginLoadingFailedKey()
62{
63 return "pluginFailedLoading"_s;
64}
65
66String DiagnosticLoggingKeys::postPageBackgroundingCPUUsageKey()
67{
68 return "postPageBackgroundingCPUUsage"_s;
69}
70
71String DiagnosticLoggingKeys::postPageBackgroundingMemoryUsageKey()
72{
73 return "postPageBackgroundingMemoryUsage"_s;
74}
75
76String DiagnosticLoggingKeys::pageHandlesWebGLContextLossKey()
77{
78 return "pageHandlesWebGLContextLoss"_s;
79}
80
81String DiagnosticLoggingKeys::postPageLoadCPUUsageKey()
82{
83 return "postPageLoadCPUUsage"_s;
84}
85
86String DiagnosticLoggingKeys::postPageLoadMemoryUsageKey()
87{
88 return "postPageLoadMemoryUsage"_s;
89}
90
91String DiagnosticLoggingKeys::provisionalLoadKey()
92{
93 return "provisionalLoad"_s;
94}
95
96String DiagnosticLoggingKeys::pageContainsPluginKey()
97{
98 return "pageContainsPlugin"_s;
99}
100
101String DiagnosticLoggingKeys::pageContainsAtLeastOnePluginKey()
102{
103 return "pageContainsAtLeastOnePlugin"_s;
104}
105
106String DiagnosticLoggingKeys::pageContainsMediaEngineKey()
107{
108 return "pageContainsMediaEngine"_s;
109}
110
111String DiagnosticLoggingKeys::pageContainsAtLeastOneMediaEngineKey()
112{
113 return "pageContainsAtLeastOneMediaEngine"_s;
114}
115
116String DiagnosticLoggingKeys::pageLoadedKey()
117{
118 return "pageLoaded"_s;
119}
120
121String DiagnosticLoggingKeys::playedKey()
122{
123 return "played"_s;
124}
125
126String DiagnosticLoggingKeys::engineFailedToLoadKey()
127{
128 return "engineFailedToLoad"_s;
129}
130
131String DiagnosticLoggingKeys::entryRightlyNotWarmedUpKey()
132{
133 return "entryRightlyNotWarmedUp"_s;
134}
135
136String DiagnosticLoggingKeys::entryWronglyNotWarmedUpKey()
137{
138 return "entryWronglyNotWarmedUp"_s;
139}
140
141String DiagnosticLoggingKeys::navigationKey()
142{
143 return "navigation"_s;
144}
145
146String DiagnosticLoggingKeys::needsRevalidationKey()
147{
148 return "needsRevalidation"_s;
149}
150
151String DiagnosticLoggingKeys::networkCacheKey()
152{
153 return "networkCache"_s;
154}
155
156String DiagnosticLoggingKeys::networkCacheFailureReasonKey()
157{
158 return "networkCacheFailureReason"_s;
159}
160
161String DiagnosticLoggingKeys::networkCacheUnusedReasonKey()
162{
163 return "networkCacheUnusedReason"_s;
164}
165
166String DiagnosticLoggingKeys::networkCacheReuseFailureKey()
167{
168 return "networkCacheReuseFailure"_s;
169}
170
171String DiagnosticLoggingKeys::networkKey()
172{
173 return "network"_s;
174}
175
176String DiagnosticLoggingKeys::networkProcessCrashedKey()
177{
178 return "networkProcessCrashed"_s;
179}
180
181String DiagnosticLoggingKeys::neverSeenBeforeKey()
182{
183 return "neverSeenBefore"_s;
184}
185
186String DiagnosticLoggingKeys::noKey()
187{
188 return "no"_s;
189}
190
191String DiagnosticLoggingKeys::noCacheKey()
192{
193 return "noCache"_s;
194}
195
196String DiagnosticLoggingKeys::noStoreKey()
197{
198 return "noStore"_s;
199}
200
201String DiagnosticLoggingKeys::nonVisibleStateKey()
202{
203 return "nonVisibleState"_s;
204}
205
206String DiagnosticLoggingKeys::notInMemoryCacheKey()
207{
208 return "notInMemoryCache"_s;
209}
210
211String DiagnosticLoggingKeys::pageCacheKey()
212{
213 return "pageCache"_s;
214}
215
216String DiagnosticLoggingKeys::pageCacheFailureKey()
217{
218 return "pageCacheFailure"_s;
219}
220
221String DiagnosticLoggingKeys::noDocumentLoaderKey()
222{
223 return "noDocumentLoader"_s;
224}
225
226String DiagnosticLoggingKeys::noLongerInCacheKey()
227{
228 return "noLongerInCache"_s;
229}
230
231String DiagnosticLoggingKeys::otherKey()
232{
233 return "other"_s;
234}
235
236String DiagnosticLoggingKeys::mainDocumentErrorKey()
237{
238 return "mainDocumentError"_s;
239}
240
241String DiagnosticLoggingKeys::mainResourceKey()
242{
243 return "mainResource"_s;
244}
245
246String DiagnosticLoggingKeys::isErrorPageKey()
247{
248 return "isErrorPage"_s;
249}
250
251String DiagnosticLoggingKeys::isExpiredKey()
252{
253 return "isExpired"_s;
254}
255
256String DiagnosticLoggingKeys::isReloadIgnoringCacheDataKey()
257{
258 return "isReloadIgnoringCacheData"_s;
259}
260
261String DiagnosticLoggingKeys::loadingKey()
262{
263 return "loading"_s;
264}
265
266String DiagnosticLoggingKeys::hasPluginsKey()
267{
268 return "hasPlugins"_s;
269}
270
271String DiagnosticLoggingKeys::httpsNoStoreKey()
272{
273 return "httpsNoStore"_s;
274}
275
276String DiagnosticLoggingKeys::imageKey()
277{
278 return "image"_s;
279}
280
281String DiagnosticLoggingKeys::inMemoryCacheKey()
282{
283 return "inMemoryCache"_s;
284}
285
286String DiagnosticLoggingKeys::inactiveKey()
287{
288 return "inactive"_s;
289}
290
291String DiagnosticLoggingKeys::internalErrorKey()
292{
293 return "internalError"_s;
294}
295
296String DiagnosticLoggingKeys::invalidSessionIDKey()
297{
298 return "invalidSessionID"_s;
299}
300
301String DiagnosticLoggingKeys::isAttachmentKey()
302{
303 return "isAttachment"_s;
304}
305
306String DiagnosticLoggingKeys::isConditionalRequestKey()
307{
308 return "isConditionalRequest"_s;
309}
310
311String DiagnosticLoggingKeys::isDisabledKey()
312{
313 return "isDisabled"_s;
314}
315
316String DiagnosticLoggingKeys::noCurrentHistoryItemKey()
317{
318 return "noCurrentHistoryItem"_s;
319}
320
321String DiagnosticLoggingKeys::quirkRedirectComingKey()
322{
323 return "quirkRedirectComing"_s;
324}
325
326String DiagnosticLoggingKeys::rawKey()
327{
328 return "raw"_s;
329}
330
331String DiagnosticLoggingKeys::redirectKey()
332{
333 return "redirect"_s;
334}
335
336String DiagnosticLoggingKeys::isLoadingKey()
337{
338 return "isLoading"_s;
339}
340
341String DiagnosticLoggingKeys::documentLoaderStoppingKey()
342{
343 return "documentLoaderStopping"_s;
344}
345
346String DiagnosticLoggingKeys::domainCausingCrashKey()
347{
348 return "DomainCausingCrash"_s;
349}
350
351String DiagnosticLoggingKeys::domainCausingEnergyDrainKey()
352{
353 return "DomainCausingEnergyDrain"_s;
354}
355
356String DiagnosticLoggingKeys::domainCausingJetsamKey()
357{
358 return "DomainCausingJetsam"_s;
359}
360
361String DiagnosticLoggingKeys::simulatedPageCrashKey()
362{
363 return "SimulatedPageCrash"_s;
364}
365
366String DiagnosticLoggingKeys::exceededActiveMemoryLimitKey()
367{
368 return "ExceededActiveMemoryLimit"_s;
369}
370
371String DiagnosticLoggingKeys::exceededInactiveMemoryLimitKey()
372{
373 return "ExceededInactiveMemoryLimit"_s;
374}
375
376String DiagnosticLoggingKeys::exceededBackgroundCPULimitKey()
377{
378 return "ExceededBackgroundCPULimit"_s;
379}
380
381String DiagnosticLoggingKeys::domainVisitedKey()
382{
383 return "DomainVisited"_s;
384}
385
386String DiagnosticLoggingKeys::cannotSuspendActiveDOMObjectsKey()
387{
388 return "cannotSuspendActiveDOMObjects"_s;
389}
390
391String DiagnosticLoggingKeys::cpuUsageKey()
392{
393 return "cpuUsage"_s;
394}
395
396String DiagnosticLoggingKeys::createSharedBufferFailedKey()
397{
398 return "createSharedBufferFailed"_s;
399}
400
401String DiagnosticLoggingKeys::activeInForegroundTabKey()
402{
403 return "activeInForegroundTab"_s;
404}
405
406String DiagnosticLoggingKeys::activeInBackgroundTabOnlyKey()
407{
408 return "activeInBackgroundTabOnly"_s;
409}
410
411String DiagnosticLoggingKeys::applicationCacheKey()
412{
413 return "applicationCache"_s;
414}
415
416#if ENABLE(APPLICATION_MANIFEST)
417String DiagnosticLoggingKeys::applicationManifestKey()
418{
419 return "applicationManifest"_s;
420}
421#endif
422
423String DiagnosticLoggingKeys::audioKey()
424{
425 return "audio"_s;
426}
427
428String DiagnosticLoggingKeys::backNavigationDeltaKey()
429{
430 return "backNavigationDelta"_s;
431}
432
433String DiagnosticLoggingKeys::canCacheKey()
434{
435 return "canCache"_s;
436}
437
438String DiagnosticLoggingKeys::cacheControlNoStoreKey()
439{
440 return "cacheControlNoStore"_s;
441}
442
443String DiagnosticLoggingKeys::cachedResourceRevalidationKey()
444{
445 return "cachedResourceRevalidation"_s;
446}
447
448String DiagnosticLoggingKeys::cachedResourceRevalidationReasonKey()
449{
450 return "cachedResourceRevalidationReason"_s;
451}
452
453String DiagnosticLoggingKeys::deniedByClientKey()
454{
455 return "deniedByClient"_s;
456}
457
458String DiagnosticLoggingKeys::deviceMotionKey()
459{
460 return "deviceMotion"_s;
461}
462
463String DiagnosticLoggingKeys::deviceOrientationKey()
464{
465 return "deviceOrientation"_s;
466}
467
468String DiagnosticLoggingKeys::diskCacheKey()
469{
470 return "diskCache"_s;
471}
472
473String DiagnosticLoggingKeys::diskCacheAfterValidationKey()
474{
475 return "diskCacheAfterValidation"_s;
476}
477
478String DiagnosticLoggingKeys::reloadKey()
479{
480 return "reload"_s;
481}
482
483String DiagnosticLoggingKeys::replaceKey()
484{
485 return "replace"_s;
486}
487
488String DiagnosticLoggingKeys::retrievalRequestKey()
489{
490 return "retrievalRequest"_s;
491}
492
493String DiagnosticLoggingKeys::resourceLoadedKey()
494{
495 return "resourceLoaded"_s;
496}
497
498String DiagnosticLoggingKeys::resourceResponseSourceKey()
499{
500 return "resourceResponseSource"_s;
501}
502
503String DiagnosticLoggingKeys::retrievalKey()
504{
505 return "retrieval"_s;
506}
507
508String DiagnosticLoggingKeys::revalidatingKey()
509{
510 return "revalidating"_s;
511}
512
513String DiagnosticLoggingKeys::reloadFromOriginKey()
514{
515 return "reloadFromOrigin"_s;
516}
517
518String DiagnosticLoggingKeys::reloadRevalidatingExpiredKey()
519{
520 return "reloadRevalidatingExpired"_s;
521}
522
523String DiagnosticLoggingKeys::sameLoadKey()
524{
525 return "sameLoad"_s;
526}
527
528String DiagnosticLoggingKeys::scriptKey()
529{
530 return "script"_s;
531}
532
533String DiagnosticLoggingKeys::serviceWorkerKey()
534{
535 return "serviceWorker"_s;
536}
537
538String DiagnosticLoggingKeys::streamingMedia()
539{
540 return "streamingMedia"_s;
541}
542
543String DiagnosticLoggingKeys::styleSheetKey()
544{
545 return "styleSheet"_s;
546}
547
548String DiagnosticLoggingKeys::successfulSpeculativeWarmupWithRevalidationKey()
549{
550 return "successfulSpeculativeWarmupWithRevalidation"_s;
551}
552
553String DiagnosticLoggingKeys::successfulSpeculativeWarmupWithoutRevalidationKey()
554{
555 return "successfulSpeculativeWarmupWithoutRevalidation"_s;
556}
557
558String DiagnosticLoggingKeys::svgDocumentKey()
559{
560 return "svgDocument"_s;
561}
562
563String DiagnosticLoggingKeys::synchronousMessageFailedKey()
564{
565 return "synchronousMessageFailed"_s;
566}
567
568String DiagnosticLoggingKeys::telemetryPageLoadKey()
569{
570 return "telemetryPageLoad"_s;
571}
572
573String DiagnosticLoggingKeys::timedOutKey()
574{
575 return "timedOut"_s;
576}
577
578String DiagnosticLoggingKeys::canceledLessThan2SecondsKey()
579{
580 return "canceledLessThan2Seconds"_s;
581}
582
583String DiagnosticLoggingKeys::canceledLessThan5SecondsKey()
584{
585 return "canceledLessThan5Seconds"_s;
586}
587
588String DiagnosticLoggingKeys::canceledLessThan20SecondsKey()
589{
590 return "canceledLessThan20Seconds"_s;
591}
592
593String DiagnosticLoggingKeys::canceledMoreThan20SecondsKey()
594{
595 return "canceledMoreThan20Seconds"_s;
596}
597
598String DiagnosticLoggingKeys::failedLessThan2SecondsKey()
599{
600 return "failedLessThan2Seconds"_s;
601}
602
603String DiagnosticLoggingKeys::failedLessThan5SecondsKey()
604{
605 return "failedLessThan5Seconds"_s;
606}
607
608String DiagnosticLoggingKeys::failedLessThan20SecondsKey()
609{
610 return "failedLessThan20Seconds"_s;
611}
612
613String DiagnosticLoggingKeys::failedMoreThan20SecondsKey()
614{
615 return "failedMoreThan20Seconds"_s;
616}
617
618String DiagnosticLoggingKeys::occurredKey()
619{
620 return "occurred"_s;
621}
622
623String DiagnosticLoggingKeys::succeededLessThan2SecondsKey()
624{
625 return "succeededLessThan2Seconds"_s;
626}
627
628String DiagnosticLoggingKeys::succeededLessThan5SecondsKey()
629{
630 return "succeededLessThan5Seconds"_s;
631}
632
633String DiagnosticLoggingKeys::succeededLessThan20SecondsKey()
634{
635 return "succeededLessThan20Seconds"_s;
636}
637
638String DiagnosticLoggingKeys::succeededMoreThan20SecondsKey()
639{
640 return "succeededMoreThan20Seconds"_s;
641}
642
643String DiagnosticLoggingKeys::uncacheableStatusCodeKey()
644{
645 return "uncacheableStatusCode"_s;
646}
647
648String DiagnosticLoggingKeys::underMemoryPressureKey()
649{
650 return "underMemoryPressure"_s;
651}
652
653String DiagnosticLoggingKeys::unknownEntryRequestKey()
654{
655 return "unknownEntryRequest"_s;
656}
657
658String DiagnosticLoggingKeys::unlikelyToReuseKey()
659{
660 return "unlikelyToReuse"_s;
661}
662
663String DiagnosticLoggingKeys::unsupportedHTTPMethodKey()
664{
665 return "unsupportedHTTPMethod"_s;
666}
667
668String DiagnosticLoggingKeys::unsuspendableDOMObjectKey()
669{
670 return "unsuspendableDOMObject"_s;
671}
672
673String DiagnosticLoggingKeys::unusedKey()
674{
675 return "unused"_s;
676}
677
678String DiagnosticLoggingKeys::unusedReasonCredentialSettingsKey()
679{
680 return "unused.reason.credentialSettings"_s;
681}
682
683String DiagnosticLoggingKeys::unusedReasonErrorKey()
684{
685 return "unused.reason.error"_s;
686}
687
688String DiagnosticLoggingKeys::unusedReasonMustRevalidateNoValidatorKey()
689{
690 return "unused.reason.mustRevalidateNoValidator"_s;
691}
692
693String DiagnosticLoggingKeys::unusedReasonNoStoreKey()
694{
695 return "unused.reason.noStore"_s;
696}
697
698String DiagnosticLoggingKeys::unusedReasonRedirectChainKey()
699{
700 return "unused.reason.redirectChain"_s;
701}
702
703String DiagnosticLoggingKeys::unusedReasonReloadKey()
704{
705 return "unused.reason.reload"_s;
706}
707
708String DiagnosticLoggingKeys::unusedReasonTypeMismatchKey()
709{
710 return "unused.reason.typeMismatch"_s;
711}
712
713String DiagnosticLoggingKeys::usedKey()
714{
715 return "used"_s;
716}
717
718String DiagnosticLoggingKeys::userZoomActionKey()
719{
720 return "userZoomAction"_s;
721}
722
723String DiagnosticLoggingKeys::varyingHeaderMismatchKey()
724{
725 return "varyingHeaderMismatch"_s;
726}
727
728String DiagnosticLoggingKeys::videoKey()
729{
730 return "video"_s;
731}
732
733String DiagnosticLoggingKeys::visibleNonActiveStateKey()
734{
735 return "visibleNonActiveState"_s;
736}
737
738String DiagnosticLoggingKeys::visibleAndActiveStateKey()
739{
740 return "visibleAndActiveState"_s;
741}
742
743String DiagnosticLoggingKeys::wastedSpeculativeWarmupWithRevalidationKey()
744{
745 return "wastedSpeculativeWarmupWithRevalidation"_s;
746}
747
748String DiagnosticLoggingKeys::wastedSpeculativeWarmupWithoutRevalidationKey()
749{
750 return "wastedSpeculativeWarmupWithoutRevalidation"_s;
751}
752
753String DiagnosticLoggingKeys::webViewKey()
754{
755 return "webView"_s;
756}
757
758String DiagnosticLoggingKeys::yesKey()
759{
760 return "yes"_s;
761}
762
763String DiagnosticLoggingKeys::expiredKey()
764{
765 return "expired"_s;
766}
767
768String DiagnosticLoggingKeys::fontKey()
769{
770 return "font"_s;
771}
772
773String DiagnosticLoggingKeys::prunedDueToMemoryPressureKey()
774{
775 return "pruned.memoryPressure"_s;
776}
777
778String DiagnosticLoggingKeys::prunedDueToMaxSizeReached()
779{
780 return "pruned.capacityReached"_s;
781}
782
783String DiagnosticLoggingKeys::prunedDueToProcessSuspended()
784{
785 return "pruned.processSuspended"_s;
786}
787
788String WebCore::DiagnosticLoggingKeys::notHTTPFamilyKey()
789{
790 return "notHTTPFamily"_s;
791}
792
793String WebCore::DiagnosticLoggingKeys::webGLStateKey()
794{
795 return "webGLState"_s;
796}
797
798String DiagnosticLoggingKeys::memoryUsageToDiagnosticLoggingKey(uint64_t memoryUsage)
799{
800 if (memoryUsage < 32 * MB)
801 return "below32"_s;
802 if (memoryUsage < 64 * MB)
803 return "32to64"_s;
804 if (memoryUsage < 128 * MB)
805 return "64to128"_s;
806 if (memoryUsage < 256 * MB)
807 return "128to256"_s;
808 if (memoryUsage < 512 * MB)
809 return "256to512"_s;
810 if (memoryUsage < 1024 * MB)
811 return "512to1024"_s;
812 if (memoryUsage < 2048 * MB)
813 return "1024to2048"_s;
814 if (memoryUsage < 4096llu * MB)
815 return "2048to4096"_s;
816 if (memoryUsage < 8192llu * MB)
817 return "4096to8192"_s;
818 if (memoryUsage < 16384llu * MB)
819 return "8192to16384"_s;
820 if (memoryUsage < 32768llu * MB)
821 return "16384to32768"_s;
822 return "over32768"_s;
823}
824
825String DiagnosticLoggingKeys::foregroundCPUUsageToDiagnosticLoggingKey(double cpuUsage)
826{
827 if (cpuUsage < 10)
828 return "below10"_s;
829 if (cpuUsage < 20)
830 return "10to20"_s;
831 if (cpuUsage < 40)
832 return "20to40"_s;
833 if (cpuUsage < 60)
834 return "40to60"_s;
835 if (cpuUsage < 80)
836 return "60to80"_s;
837 return "over80"_s;
838}
839
840String DiagnosticLoggingKeys::backgroundCPUUsageToDiagnosticLoggingKey(double cpuUsage)
841{
842 if (cpuUsage < 1)
843 return "below1"_s;
844 if (cpuUsage < 5)
845 return "1to5"_s;
846 if (cpuUsage < 10)
847 return "5to10"_s;
848 if (cpuUsage < 30)
849 return "10to30"_s;
850 if (cpuUsage < 50)
851 return "30to50"_s;
852 if (cpuUsage < 70)
853 return "50to70"_s;
854 return "over70"_s;
855}
856
857String DiagnosticLoggingKeys::resourceLoadStatisticsTelemetryKey()
858{
859 return "resourceLoadStatisticsTelemetry"_s;
860}
861
862} // namespace WebCore
863
864