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

Unified Diff: content/public/common/content_features.h

Issue 2946113002: Use FrameIsAd to decide whether to isolate a frame in TopDocumentIsolation mode. (Closed)
Patch Set: Addressing CR feedback from jkarlin@ and creis@. 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « content/public/browser/navigation_handle.h ('k') | content/public/common/content_features.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/public/common/content_features.h
diff --git a/content/public/common/content_features.h b/content/public/common/content_features.h
index cb04406f984d603fae532d77792ad780646d7c4c..83732027ba2dac1356ab0a018a0160f8d3dbaab9 100644
--- a/content/public/common/content_features.h
+++ b/content/public/common/content_features.h
@@ -77,7 +77,41 @@ CONTENT_EXPORT extern const base::Feature kSkipCompositingSmallScrollers;
CONTENT_EXPORT extern const base::Feature kSlimmingPaintInvalidation;
CONTENT_EXPORT extern const base::Feature kTimerThrottlingForHiddenFrames;
CONTENT_EXPORT extern const base::Feature kTokenBinding;
+
CONTENT_EXPORT extern const base::Feature kTopDocumentIsolation;
+
+// If the kTopDocumentIsolation base::Feature is enabled, then it can be
+// configured by additional parameters (see also GetFieldTrialParamsByFeature).
+// |kTopDocumentIsolationModeParam| is the name of an optional parameter that
+// specifies TopDocumentIsolationMode. Valid values of this parameter are
+// strings that represent numeric values of TopDocumentIsolationMode enum values
+// (e.g. "1" for TopDocumentIsolationMode::CrossSite).
+CONTENT_EXPORT extern const char kTopDocumentIsolationModeParam[];
+
+// If the kTopDocumentIsolation base::Feature is enabled, the values of this
+// enum represent the mode for selecting *which* frames to isolate.
+//
+// These values should NOT be renumbered, because 1) they can be specified in a
+// server-side trial config and 2) they can be persisted in the state of
+// chrome://flags selected by the user.
+enum class TopDocumentIsolationMode {
+ // This value indicates that kTopDocumentIsolationModeParam was not specified.
+ // Corresponds to "Enabled" state in chrome://flags (i.e. the user didn't
+ // select a more specific isolation mode).
+ Unspecified = 0,
+
+// Each of the modes below corresponds to "Enabled (<name> - <description>)"
+// state in chrome://flags.
+#define FOR_EACH_TDI_MODE(V) \
+ V(CrossSite, 1, \
+ "isolate all frames from sites other than the top-level frame") \
+ V(Ads, 2, "isolate only cross-site ads detected by heuristics")
+
+#define DEFINE_TDI_MODE_ENUM_VALUE(name, value, description) name = value,
+ FOR_EACH_TDI_MODE(DEFINE_TDI_MODE_ENUM_VALUE)
+#undef DEFINE_TDI_MODE_ENUM_VALUE
+};
+
CONTENT_EXPORT extern const base::Feature kTouchpadAndWheelScrollLatching;
CONTENT_EXPORT extern const base::Feature kUseFeaturePolicyForPermissions;
CONTENT_EXPORT extern const base::Feature kUseMojoAudioOutputStreamFactory;
« no previous file with comments | « content/public/browser/navigation_handle.h ('k') | content/public/common/content_features.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698