File: field_trial_settings.h

package info (click to toggle)
chromium 139.0.7258.127-1
  • links: PTS, VCS
  • area: main
  • in suites:
  • size: 6,122,068 kB
  • sloc: cpp: 35,100,771; ansic: 7,163,530; javascript: 4,103,002; python: 1,436,920; asm: 946,517; xml: 746,709; pascal: 187,653; perl: 88,691; sh: 88,436; objc: 79,953; sql: 51,488; cs: 44,583; fortran: 24,137; makefile: 22,147; tcl: 15,277; php: 13,980; yacc: 8,984; ruby: 7,485; awk: 3,720; lisp: 3,096; lex: 1,327; ada: 727; jsp: 228; sed: 36
file content (100 lines) | stat: -rw-r--r-- 4,346 bytes parent folder | download | duplicates (6)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
// Copyright 2020 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_PRELOADING_PREFETCH_SEARCH_PREFETCH_FIELD_TRIAL_SETTINGS_H_
#define CHROME_BROWSER_PRELOADING_PREFETCH_SEARCH_PREFETCH_FIELD_TRIAL_SETTINGS_H_

#include "base/feature_list.h"
#include "base/metrics/field_trial_params.h"
#include "base/time/time.h"

BASE_DECLARE_FEATURE(kSearchPrefetchServicePrefetching);

BASE_DECLARE_FEATURE(kSearchPrefetchOnlyAllowDefaultMatchPreloading);

BASE_DECLARE_FEATURE(kSearchPrefetchWithNoVarySearchDiskCache);

// Whether the search prefetch service actually initiates prefetches.
bool SearchPrefetchServicePrefetchingIsEnabled();

// The amount of time a response is considered valid after the prefetch starts.
base::TimeDelta SearchPrefetchCachingLimit();

// The number of prefetches that can be initiated (but not served) within a time
// period as long as |SearchPrefetchCachingLimit()|
size_t SearchPrefetchMaxAttemptsPerCachingDuration();

// The amount of time that a network error will cause the search prefetch
// service to stop prefetching responses.
base::TimeDelta SearchPrefetchErrorBackoffDuration();

// The max number of stored cached prefetch responses. This is stored as a list
// of navigation URLs to prefetch URLs.
size_t SearchPrefetchMaxCacheEntries();
// Overrides the max cache size for testing. This should be used only when tests
// need to override the cache size dynamically. Otherwise, the cache size should
// be set through base::ScopedFeatureList.
void SetSearchPrefetchMaxCacheEntriesForTesting(size_t cache_site);

BASE_DECLARE_FEATURE(kSearchNavigationPrefetch);

// Feature params for the "pf" query param for suggest prefetch and navigation
// prefetch respectively. This param allows the search server to treat the
// requests differently based on the source.
extern const base::FeatureParam<std::string> kSuggestPrefetchParam;
extern const base::FeatureParam<std::string> kNavigationPrefetchParam;

// An experimental feature to measure if starting search prefetches during
// navigation events provides benefit over the typical navigation flow.
bool IsSearchNavigationPrefetchEnabled();

// A flavor of navigation prefetch that triggers when the user changes the
// selected index in omnibox to a search suggestion via arrow buttons. This is
// for Desktop only.
bool IsUpOrDownArrowPrefetchEnabled();

// A flavor of navigation prefetch that triggers when the user pushes the mouse
// down on a Search suggestion. This is for Desktop only.
bool IsSearchMouseDownPrefetchEnabled();

// A flavor of navigation prefetch that triggers when the user touches down on a
// Search suggestion. This is for Android only.
bool IsTouchDownPrefetchEnabled();

// Allows the top selection to be prefetched by navigation prefetch strategies.
bool AllowTopNavigationPrefetch();

// Allows search history suggestions to be prefetched by navigation prefetch
// strategies.
bool PrefetchSearchHistorySuggestions();

// Whether Omnibox prefetch and prerender should be restricted to the suggestion
// being the default match.
bool OnlyAllowDefaultMatchPreloading();
bool IsNoVarySearchDiskCacheEnabled();

// Allows the omnibox search prefetch in Incognito.
//
// Note SearchPrefetchService partially supports Incognito profile. For now,
// it supports the on-press triggered search prefetch only. Other prefetches
// must not be triggered in Incognito. crbug.com/394716358 for more details.
bool IsPrefetchIncognitoEnabled();

// When this feature is enabled, SearchPrefetchService will send a request to
// the network service to preload shared dictionary from the disk storage for
// the AutocompleteResult's `destination_url`.
BASE_DECLARE_FEATURE(kAutocompleteDictionaryPreload);

// The amount of time preloaded dictionary is kept alive.
extern const base::FeatureParam<base::TimeDelta>
    kAutocompletePreloadedDictionaryTimeout;

// If enabled, suppresses SearchPrefetch (https://crbug.com/350519234)
BASE_DECLARE_FEATURE(kSuppressesSearchPrefetchOnSlowNetwork);

// The threshold to determine if the network is slow or not.
extern const base::FeatureParam<base::TimeDelta>
    kSuppressesSearchPrefetchOnSlowNetworkThreshold;

#endif  // CHROME_BROWSER_PRELOADING_PREFETCH_SEARCH_PREFETCH_FIELD_TRIAL_SETTINGS_H_