1 // Copyright 2016 The Chromium Authors. All rights reserved. 2 // Use of this source code is governed by a BSD-style license that can be 3 // found in the LICENSE file. 4 5 #ifndef THIRD_PARTY_BLINK_PUBLIC_COMMON_LOADER_LOADING_BEHAVIOR_FLAG_H_ 6 #define THIRD_PARTY_BLINK_PUBLIC_COMMON_LOADER_LOADING_BEHAVIOR_FLAG_H_ 7 8 namespace blink { 9 10 // This enum tracks certain behavior Blink exhibits when loading a page. This is 11 // for use in metrics collection by the loading team, to evaluate experimental 12 // features and potential areas of improvement in the loading stack. The main 13 // consumer is the page_load_metrics component, which sends bit flags to the 14 // browser process for histogram splitting. 15 enum LoadingBehaviorFlag { 16 kLoadingBehaviorNone = 0, 17 // Indicates that the page used the document.write evaluator to preload scan 18 // for resources inserted via document.write. 19 // DEPRECATED, feature has been turned down. 20 kLoadingBehaviorDocumentWriteEvaluator = 1 << 0, 21 // Indicates that the page is controlled by a Service Worker. 22 kLoadingBehaviorServiceWorkerControlled = 1 << 1, 23 // Indicates that the page has a synchronous, cross-origin document.written 24 // script. 25 kLoadingBehaviorDocumentWriteBlock = 1 << 2, 26 // Indicates that the page is a reload and has a synchronous, cross-origin 27 // document.written script. 28 kLoadingBehaviorDocumentWriteBlockReload = 1 << 3, 29 // The page loaded external CSS that generated a PreloadRequest via the 30 // CSSPreloaderResourceClient. 31 kLoadingBehaviorCSSPreloadFound = 1 << 4, 32 // Indicates that the page has a synchronous, same-origin document.written 33 // script with different protocol. 34 kLoadingBehaviorDocumentWriteBlockDifferentScheme = 1 << 5, 35 // Indicates that a subresource on the page matched the subresource filtering 36 // rules. 37 kLoadingBehaviorSubresourceFilterMatch = 1 << 6, 38 // Indicates that the page is an AMP document, with <html amp> tag. 39 kLoadingBehaviorAmpDocumentLoaded = 1 << 7, 40 // Indicates that font preloading (via <link rel=preload> or Font JS API) has 41 // occurred before the first rendering cycle begins. Used to study the 42 // effects of delaying the first rendering cycle for web font loading. 43 kLoadingBehaviorFontPreloadStartedBeforeRendering = 1 << 8, 44 }; 45 46 } // namespace blink 47 48 #endif // THIRD_PARTY_BLINK_PUBLIC_COMMON_LOADER_LOADING_BEHAVIOR_FLAG_H_ 49