Skip to content

Commit

Permalink
Use helper macros to define base::Features in //net, part 1
Browse files Browse the repository at this point in the history
This allows:
- features to be defined with a consistent set of qualifiers, and for
  that set of qualifiers to be updated over time as appropriate.
- better PRESUBMIT checks to ensure that base::Features are not defined
  in headers.
- simplifies things for scripts trying to extract feature definitions
  out of C++ code.

The primary CL was generated using a script that automatically rewrites
base::Feature declarations and definitions to the macro form. Changes to
any files with known incompatibilities with the macros (base::Features
without static storage duration and base::Features declared as static
class members) were then fully reverted; those changes will be manually
handled in followups.

This is a manual cleanup pass that fixed several instances missed by the
original automation, since these use a non-standard export macro.

Bug: 1364289
Change-Id: Id611ded07f8c7c817f88dfd5ec938e936c38d722
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3931306
Reviewed-by: Lei Zhang <thestig@chromium.org>
Auto-Submit: Daniel Cheng <dcheng@chromium.org>
Owners-Override: Lei Zhang <thestig@chromium.org>
Commit-Queue: Lei Zhang <thestig@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1053885}
  • Loading branch information
zetafunction authored and Chromium LUCI CQ committed Oct 1, 2022
1 parent d4ce88f commit 3617b73
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion net/disk_cache/cache_util.h
Expand Up @@ -20,7 +20,7 @@ namespace disk_cache {

// Experiment to increase the cache size to see the impact on various
// performance metrics.
NET_EXPORT_PRIVATE extern const base::Feature kChangeDiskCacheSizeExperiment;
NET_EXPORT_PRIVATE BASE_DECLARE_FEATURE(kChangeDiskCacheSizeExperiment);

// Moves the cache files from the given path to another location.
// Fails if the destination exists already, or if it doesn't have
Expand Down
2 changes: 1 addition & 1 deletion net/disk_cache/simple/simple_synchronous_entry.h
Expand Up @@ -41,7 +41,7 @@ namespace disk_cache {
class BackendFileOperations;
class UnboundBackendFileOperations;

NET_EXPORT_PRIVATE extern const base::Feature kSimpleCachePrefetchExperiment;
NET_EXPORT_PRIVATE BASE_DECLARE_FEATURE(kSimpleCachePrefetchExperiment);
NET_EXPORT_PRIVATE extern const char kSimpleCacheFullPrefetchBytesParam[];
NET_EXPORT_PRIVATE extern const char
kSimpleCacheTrailerPrefetchSpeculativeBytesParam[];
Expand Down

0 comments on commit 3617b73

Please sign in to comment.