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

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: Rebasing... 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 const char kTopDocumentIsolationVariations_Ads_Value[] = {
1082 '0' + static_cast<int>(features::TopDocumentIsolationMode::Ads), '\0'};
Łukasz Anforowicz 2017/06/30 15:28:36 My opinion is that the code above is better than 1
Charlie Reis 2017/06/30 23:28:45 Looks like you got this resolved.
1083 const FeatureEntry::FeatureParam kTopDocumentIsolationVariations_Ads[] = {
1084 {features::kTopDocumentIsolationModeParam,
1085 kTopDocumentIsolationVariations_Ads_Value}};
1086
1087 const char kTopDocumentIsolationVariations_Xsite_Value[] = {
1088 '0' + static_cast<int>(features::TopDocumentIsolationMode::Xsite), '\0'};
1089 const FeatureEntry::FeatureParam kTopDocumentIsolationVariations_Xsite[] = {
1090 {features::kTopDocumentIsolationModeParam,
1091 kTopDocumentIsolationVariations_Xsite_Value}};
1092
1093 const FeatureEntry::FeatureVariation kTopDocumentIsolationVariations[] = {
1094 {"(isolate ads detected by heuristics)",
1095 kTopDocumentIsolationVariations_Ads,
1096 arraysize(kTopDocumentIsolationVariations_Ads), nullptr},
1097 {"(isolate all frames from site other than the top-level frame)",
Łukasz Anforowicz 2017/06/30 15:28:37 The string above is concatenated with "Enabled " s
1098 kTopDocumentIsolationVariations_Xsite,
1099 arraysize(kTopDocumentIsolationVariations_Xsite), nullptr},
1100 };
1101
1081 // RECORDING USER METRICS FOR FLAGS: 1102 // RECORDING USER METRICS FOR FLAGS:
1082 // ----------------------------------------------------------------------------- 1103 // -----------------------------------------------------------------------------
1083 // The first line of the entry is the internal name. 1104 // The first line of the entry is the internal name.
1084 // 1105 //
1085 // To add a new entry, add to the end of kFeatureEntries. There are two 1106 // To add a new entry, add to the end of kFeatureEntries. There are two
1086 // distinct types of entries: 1107 // distinct types of entries:
1087 // . SINGLE_VALUE: entry is either on or off. Use the SINGLE_VALUE_TYPE 1108 // . 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. 1109 // 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 1110 // . 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 1111 // 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)}, 1950 MULTI_VALUE_TYPE(kMarkHttpAsChoices)},
1930 {"enable-http-form-warning", flag_descriptions::kEnableHttpFormWarningName, 1951 {"enable-http-form-warning", flag_descriptions::kEnableHttpFormWarningName,
1931 flag_descriptions::kEnableHttpFormWarningDescription, kOsAll, 1952 flag_descriptions::kEnableHttpFormWarningDescription, kOsAll,
1932 FEATURE_VALUE_TYPE(security_state::kHttpFormWarningFeature)}, 1953 FEATURE_VALUE_TYPE(security_state::kHttpFormWarningFeature)},
1933 {"enable-site-per-process", flag_descriptions::kSitePerProcessName, 1954 {"enable-site-per-process", flag_descriptions::kSitePerProcessName,
1934 flag_descriptions::kSitePerProcessDescription, kOsAll, 1955 flag_descriptions::kSitePerProcessDescription, kOsAll,
1935 SINGLE_VALUE_TYPE(switches::kSitePerProcess)}, 1956 SINGLE_VALUE_TYPE(switches::kSitePerProcess)},
1936 {"enable-top-document-isolation", 1957 {"enable-top-document-isolation",
1937 flag_descriptions::kTopDocumentIsolationName, 1958 flag_descriptions::kTopDocumentIsolationName,
1938 flag_descriptions::kTopDocumentIsolationDescription, kOsAll, 1959 flag_descriptions::kTopDocumentIsolationDescription, kOsAll,
1939 FEATURE_VALUE_TYPE(features::kTopDocumentIsolation)}, 1960 FEATURE_WITH_PARAMS_VALUE_TYPE(features::kTopDocumentIsolation,
1961 kTopDocumentIsolationVariations,
1962 "TopDocumentIsolation")},
1940 {"enable-use-zoom-for-dsf", flag_descriptions::kEnableUseZoomForDsfName, 1963 {"enable-use-zoom-for-dsf", flag_descriptions::kEnableUseZoomForDsfName,
1941 flag_descriptions::kEnableUseZoomForDsfDescription, kOsAll, 1964 flag_descriptions::kEnableUseZoomForDsfDescription, kOsAll,
1942 MULTI_VALUE_TYPE(kEnableUseZoomForDSFChoices)}, 1965 MULTI_VALUE_TYPE(kEnableUseZoomForDSFChoices)},
1943 #if defined(OS_MACOSX) 1966 #if defined(OS_MACOSX)
1944 {"enable-harfbuzz-rendertext", flag_descriptions::kHarfbuzzRendertextName, 1967 {"enable-harfbuzz-rendertext", flag_descriptions::kHarfbuzzRendertextName,
1945 flag_descriptions::kHarfbuzzRendertextDescription, kOsMac, 1968 flag_descriptions::kHarfbuzzRendertextDescription, kOsMac,
1946 SINGLE_VALUE_TYPE(switches::kEnableHarfBuzzRenderText)}, 1969 SINGLE_VALUE_TYPE(switches::kEnableHarfBuzzRenderText)},
1947 #endif // OS_MACOSX 1970 #endif // OS_MACOSX
1948 {"data-reduction-proxy-lo-fi", 1971 {"data-reduction-proxy-lo-fi",
1949 flag_descriptions::kDataReductionProxyLoFiName, 1972 flag_descriptions::kDataReductionProxyLoFiName,
(...skipping 1387 matching lines...) Expand 10 before | Expand all | Expand 10 after
3337 const base::HistogramBase::Sample kBadSwitchFormatHistogramId = 0; 3360 const base::HistogramBase::Sample kBadSwitchFormatHistogramId = 0;
3338 3361
3339 const FeatureEntry* GetFeatureEntries(size_t* count) { 3362 const FeatureEntry* GetFeatureEntries(size_t* count) {
3340 *count = arraysize(kFeatureEntries); 3363 *count = arraysize(kFeatureEntries);
3341 return kFeatureEntries; 3364 return kFeatureEntries;
3342 } 3365 }
3343 3366
3344 } // namespace testing 3367 } // namespace testing
3345 3368
3346 } // namespace about_flags 3369 } // namespace about_flags
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698