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

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: Doh... need to also change s/Default/Unspecified/ in chrome_content_browser_client.cc 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
Index: content/public/common/content_features.h
diff --git a/content/public/common/content_features.h b/content/public/common/content_features.h
index 7ee19ae40f9dc5e9487309f15732dd4d8d10e8a3..5f2d105d598c6c1942ea2fe1539541081677431c 100644
--- a/content/public/common/content_features.h
+++ b/content/public/common/content_features.h
@@ -71,7 +71,37 @@ 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).
Alexei Svitkine (slow) 2017/07/07 16:55:06 Nit: Remove extra space before "1".
Łukasz Anforowicz 2017/07/07 20:41:42 Ooops. How did that happen? I wanted to blame "g
+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.
Alexei Svitkine (slow) 2017/07/07 16:55:05 Can you add a comment that mentions these are spec
Łukasz Anforowicz 2017/07/07 20:41:42 Done.
+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;

Powered by Google App Engine
This is Rietveld 408576698