// Copyright 2017 The Chromium Authors // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. #ifndef CHROME_BROWSER_PREDICTORS_LOADING_PREDICTOR_CONFIG_H_ #define CHROME_BROWSER_PREDICTORS_LOADING_PREDICTOR_CONFIG_H_ #include <cstddef> #include <string> class Profile; namespace predictors { // Returns whether the Loading Predictor is enabled for the given |profile|. If // true, the predictor can observe page load events, build historical database // and perform allowed speculative actions based on this database. bool IsLoadingPredictorEnabled(Profile* profile); // Returns whether the current |profile| settings allow to perform preresolve // and preconnect actions. This setting is controlled by the user, so the return // value shouldn't be cached. bool IsPreconnectAllowed(Profile* profile); // Indicates what caused the page load hint. enum class HintOrigin { … }; // Gets the string that can be used to record histograms for the hint origin. // // Keep in sync with LoadingPredictorHintOrigin in histograms.xml. Will DCHECK // if an origin is added that is not listed in histograms.xml. std::string GetStringNameForHintOrigin(HintOrigin hint_origin); // Represents the config for the Loading predictor. struct LoadingPredictorConfig { … }; } // namespace predictors #endif // CHROME_BROWSER_PREDICTORS_LOADING_PREDICTOR_CONFIG_H_