0
Commit Graph

6 Commits

Author SHA1 Message Date
Henrique Nakashima
1623df1518 [Android] Use FeatureMap to generalize ContentFeatureList
This reduces code duplication in ContentFeatureList.java and
content_feature_list.cc, reusing the code in base
FeatureMap.java and feature_map.cc.

ContentFeatureList is kept for convenience static methods to
access ContentFeatureMap, but we can inline and update callers in
a follow-up if desired.

Also add a TODO to ContentFeatureList since I noticed the constants
there with feature names largely overlap with the constants in the
generated ContentFeatures.

Using this opportunity to update documentation
(since ContentFeatureList is used as an example) with the new
FeatureMap API.

Change-Id: I2360830bfbceff20714fc65db4dce5ef743ab95a
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4544343
Reviewed-by: Mark Schillaci <mschillaci@google.com>
Reviewed-by: Jinsuk Kim <jinsukkim@chromium.org>
Commit-Queue: Henrique Nakashima <hnakashima@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1151372}
2023-05-31 18:23:35 +00:00
Daniel Cheng
dc644a135d Add BASE_FEATURE() / BASE_DECLARE_FEATURE() macros for defining features
There are subtle requirements around declaring and defining
base::Features. In addition, these requirements also evolve over time:
updating the various uses requires updating an estimated 6000+ uses.

Introduce helper macros modelled after absl's ABSL_FLAG() and
ABSL_DECLARE_FLAG() macros instead; in the future, base::Feature may
even become an internal implementation detail.

This also simplifies the helper script for autogenerating Java features
from C++ features, as it no longer needs to try to accommodate all
potential reorderings of `CONSTINIT`, `const`, and export macros.

Bug: 1364289
Change-Id: Id88f7c4a60efa28cdab36accb4d8386ec84ea3e4
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3902697
Reviewed-by: Egor Pasko <pasko@chromium.org>
Reviewed-by: Alexei Svitkine <asvitkine@chromium.org>
Commit-Queue: Daniel Cheng <dcheng@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1048852}
2022-09-19 23:21:37 +00:00
Avi Drissman
7b017a99d8 Update copyright headers in docs/ and styleguide/
No-Try: true
Bug: 1098010
Change-Id: Id44652c3572c46c4ec732b69473fb951749d35eb
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3878321
Commit-Queue: Avi Drissman <avi@chromium.org>
Owners-Override: Avi Drissman <avi@chromium.org>
Reviewed-by: Mark Mentovai <mark@chromium.org>
Auto-Submit: Avi Drissman <avi@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1043985}
2022-09-07 15:50:38 +00:00
Mike Frysinger
e69fa05666 drop "All rights reserved" from examples
OSS licensing has asked us to remove this from new file headers.

Change-Id: I89121dd167aa88617ce2090f8684148bbbac90ed
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3792556
Commit-Queue: Mike Frysinger <vapier@chromium.org>
Reviewed-by: Jan Wilken Dörrie <jdoerrie@chromium.org>
Reviewed-by: Bruce Dawson <brucedawson@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1031130}
2022-08-03 18:40:53 +00:00
Scott Haseley
f89462b425 aw: Expose ThreadedScrollPreventRenderingStarvation to to WebView flags UI
This exposes ThreadedScrollPreventRenderingStarvation to the WebView
flags UI. To do this, we need to expose the blink schedueler features.
Since these are in a different location than the blink public/common
features, this CL adds a new android_library for these.

Bug: 1315279
Change-Id: Ie479213b3653baf16129cbe96ea88f07d14aff30
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3803410
Commit-Queue: Scott Haseley <shaseley@chromium.org>
Reviewed-by: Michael Bai <michaelbai@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1030814}
2022-08-02 23:37:45 +00:00
Nate Fischer
ac07b26220 Android: add java_cpp_features GN rule
This adds the java_cpp_features GN rule to autogenerate Java String
constants representing C++ features. This refactors parts of
java_cpp_strings so java_cpp_features can share it.

This aims to address the most common syntaxes for declaring C++
features (string literal names, "brace" and "equals brace"
initialization, with & without the "base::" namespace).

Design: http://go/autogen-java-features
Bug: 1060097
Fixed: 1091031
Test: vpython build/android/gpy/java_cpp_strings_tests.py
Test: vpython build/android/gpy/java_cpp_features_tests.py
Test: tools/md_browser/md_browser.py docs/android_accessing_cpp_features_in_java.md
Change-Id: I5311f72f8837c122186148cf183f4219087df96a
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2412840
Auto-Submit: Nate Fischer <ntfschr@chromium.org>
Reviewed-by: Andrew Grieve <agrieve@chromium.org>
Reviewed-by: Henrique Nakashima <hnakashima@chromium.org>
Reviewed-by: Peter Wen <wnwen@chromium.org>
Commit-Queue: Andrew Grieve <agrieve@chromium.org>
Cr-Commit-Position: refs/heads/master@{#812889}
2020-10-01 20:20:14 +00:00