Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(457)

Side by Side Diff: chrome/browser/about_flags.cc

Issue 2946113002: Use FrameIsAd to decide whether to isolate a frame in TopDocumentIsolation mode. (Closed)
Patch Set: Use FOR_EACH_TDI_MODE(V) macro. Created 3 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "chrome/browser/about_flags.h" 5 #include "chrome/browser/about_flags.h"
6 6
7 #include <iterator> 7 #include <iterator>
8 #include <map> 8 #include <map>
9 #include <set> 9 #include <set>
10 #include <utility> 10 #include <utility>
(...skipping 1060 matching lines...) Expand 10 before | Expand all | Expand 10 after
1071 arraysize(kOmniboxUIVerticalMargin6px), nullptr}, 1071 arraysize(kOmniboxUIVerticalMargin6px), nullptr},
1072 {"8px vertical margin", kOmniboxUIVerticalMargin8px, 1072 {"8px vertical margin", kOmniboxUIVerticalMargin8px,
1073 arraysize(kOmniboxUIVerticalMargin8px), nullptr}, 1073 arraysize(kOmniboxUIVerticalMargin8px), nullptr},
1074 {"10px vertical margin", kOmniboxUIVerticalMargin10px, 1074 {"10px vertical margin", kOmniboxUIVerticalMargin10px,
1075 arraysize(kOmniboxUIVerticalMargin10px), nullptr}, 1075 arraysize(kOmniboxUIVerticalMargin10px), nullptr},
1076 {"12px vertical margin", kOmniboxUIVerticalMargin12px, 1076 {"12px vertical margin", kOmniboxUIVerticalMargin12px,
1077 arraysize(kOmniboxUIVerticalMargin12px), nullptr}, 1077 arraysize(kOmniboxUIVerticalMargin12px), nullptr},
1078 {"14px vertical margin", kOmniboxUIVerticalMargin14px, 1078 {"14px vertical margin", kOmniboxUIVerticalMargin14px,
1079 arraysize(kOmniboxUIVerticalMargin14px), nullptr}}; 1079 arraysize(kOmniboxUIVerticalMargin14px), nullptr}};
1080 1080
1081 #define DEFINE_TDI_MODE_FEATURE_PARAM(name, value, description) \
1082 const FeatureEntry::FeatureParam kTopDocumentIsolationVariations_##name[] = \
1083 {{features::kTopDocumentIsolationModeParam, #value}};
1084 FOR_EACH_TDI_MODE(DEFINE_TDI_MODE_FEATURE_PARAM)
1085 #undef DEFINE_TDI_MODE_FEATURE_PARAM
1086
1087 const FeatureEntry::FeatureVariation kTopDocumentIsolationVariations[] = {
1088 #define DEFINE_TDI_MODE_VARIATION(name, value, description) \
1089 {"(" #name " - " description ")", kTopDocumentIsolationVariations_##name, \
1090 arraysize(kTopDocumentIsolationVariations_##name), nullptr},
1091 FOR_EACH_TDI_MODE(DEFINE_TDI_MODE_VARIATION)
1092 #undef DEFINE_TDI_MODE_VARIATION
1093 };
1094
1081 // RECORDING USER METRICS FOR FLAGS: 1095 // RECORDING USER METRICS FOR FLAGS:
1082 // ----------------------------------------------------------------------------- 1096 // -----------------------------------------------------------------------------
1083 // The first line of the entry is the internal name. 1097 // The first line of the entry is the internal name.
1084 // 1098 //
1085 // To add a new entry, add to the end of kFeatureEntries. There are two 1099 // To add a new entry, add to the end of kFeatureEntries. There are two
1086 // distinct types of entries: 1100 // distinct types of entries:
1087 // . SINGLE_VALUE: entry is either on or off. Use the SINGLE_VALUE_TYPE 1101 // . SINGLE_VALUE: entry is either on or off. Use the SINGLE_VALUE_TYPE
1088 // macro for this type supplying the command line to the macro. 1102 // macro for this type supplying the command line to the macro.
1089 // . MULTI_VALUE: a list of choices, the first of which should correspond to a 1103 // . MULTI_VALUE: a list of choices, the first of which should correspond to a
1090 // deactivated state for this lab (i.e. no command line option). To specify 1104 // deactivated state for this lab (i.e. no command line option). To specify
(...skipping 838 matching lines...) Expand 10 before | Expand all | Expand 10 after
1929 MULTI_VALUE_TYPE(kMarkHttpAsChoices)}, 1943 MULTI_VALUE_TYPE(kMarkHttpAsChoices)},
1930 {"enable-http-form-warning", flag_descriptions::kEnableHttpFormWarningName, 1944 {"enable-http-form-warning", flag_descriptions::kEnableHttpFormWarningName,
1931 flag_descriptions::kEnableHttpFormWarningDescription, kOsAll, 1945 flag_descriptions::kEnableHttpFormWarningDescription, kOsAll,
1932 FEATURE_VALUE_TYPE(security_state::kHttpFormWarningFeature)}, 1946 FEATURE_VALUE_TYPE(security_state::kHttpFormWarningFeature)},
1933 {"enable-site-per-process", flag_descriptions::kSitePerProcessName, 1947 {"enable-site-per-process", flag_descriptions::kSitePerProcessName,
1934 flag_descriptions::kSitePerProcessDescription, kOsAll, 1948 flag_descriptions::kSitePerProcessDescription, kOsAll,
1935 SINGLE_VALUE_TYPE(switches::kSitePerProcess)}, 1949 SINGLE_VALUE_TYPE(switches::kSitePerProcess)},
1936 {"enable-top-document-isolation", 1950 {"enable-top-document-isolation",
1937 flag_descriptions::kTopDocumentIsolationName, 1951 flag_descriptions::kTopDocumentIsolationName,
1938 flag_descriptions::kTopDocumentIsolationDescription, kOsAll, 1952 flag_descriptions::kTopDocumentIsolationDescription, kOsAll,
1939 FEATURE_VALUE_TYPE(features::kTopDocumentIsolation)}, 1953 FEATURE_WITH_PARAMS_VALUE_TYPE(features::kTopDocumentIsolation,
1954 kTopDocumentIsolationVariations,
1955 "TopDocumentIsolation")},
1940 {"enable-use-zoom-for-dsf", flag_descriptions::kEnableUseZoomForDsfName, 1956 {"enable-use-zoom-for-dsf", flag_descriptions::kEnableUseZoomForDsfName,
1941 flag_descriptions::kEnableUseZoomForDsfDescription, kOsAll, 1957 flag_descriptions::kEnableUseZoomForDsfDescription, kOsAll,
1942 MULTI_VALUE_TYPE(kEnableUseZoomForDSFChoices)}, 1958 MULTI_VALUE_TYPE(kEnableUseZoomForDSFChoices)},
1943 #if defined(OS_MACOSX) 1959 #if defined(OS_MACOSX)
1944 {"enable-harfbuzz-rendertext", flag_descriptions::kHarfbuzzRendertextName, 1960 {"enable-harfbuzz-rendertext", flag_descriptions::kHarfbuzzRendertextName,
1945 flag_descriptions::kHarfbuzzRendertextDescription, kOsMac, 1961 flag_descriptions::kHarfbuzzRendertextDescription, kOsMac,
1946 SINGLE_VALUE_TYPE(switches::kEnableHarfBuzzRenderText)}, 1962 SINGLE_VALUE_TYPE(switches::kEnableHarfBuzzRenderText)},
1947 #endif // OS_MACOSX 1963 #endif // OS_MACOSX
1948 {"data-reduction-proxy-lo-fi", 1964 {"data-reduction-proxy-lo-fi",
1949 flag_descriptions::kDataReductionProxyLoFiName, 1965 flag_descriptions::kDataReductionProxyLoFiName,
(...skipping 1387 matching lines...) Expand 10 before | Expand all | Expand 10 after
3337 const base::HistogramBase::Sample kBadSwitchFormatHistogramId = 0; 3353 const base::HistogramBase::Sample kBadSwitchFormatHistogramId = 0;
3338 3354
3339 const FeatureEntry* GetFeatureEntries(size_t* count) { 3355 const FeatureEntry* GetFeatureEntries(size_t* count) {
3340 *count = arraysize(kFeatureEntries); 3356 *count = arraysize(kFeatureEntries);
3341 return kFeatureEntries; 3357 return kFeatureEntries;
3342 } 3358 }
3343 3359
3344 } // namespace testing 3360 } // namespace testing
3345 3361
3346 } // namespace about_flags 3362 } // namespace about_flags
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698