This PR simplifies JSON reading in several places by:
- Using `base::JSONReader::ReadDict`
- Using `base::JSONReader::ReadList`
- Using `base::test::ParseJson*`
This changes aim to make the checks around the parsing and its
expectations simpler to read.
This PR also introduces patch for `base::JSONReader::ReadList` which is
only available in M135.
Chromium change:
https://chromium.googlesource.com/chromium/src/+/cb3669146301529c0c364a0478372fc46ddf514a
commit cb3669146301529c0c364a0478372fc46ddf514a
Author: Claudio DeSouza <cdesouza@chromium.org>
Date: Wed Feb 19 16:51:29 2025 -0800
[base] Adding `JSONReader::ReadList`
This class already provides `ReadDict`, which has proven its usefulness
in general. This change adds the corresponding implementation for
`base::Value::Dict`.
Bug: 40912723
Brave Performance Predictor
This component is based on our blog post.
The current implementation is only for bandwidth prediction and uses a subset of the features discussed in the post for better cross-platform support. Key groups of features used are:
- URLs of blocked requests, from which we extract counts and distinct third-parties (e.g. tracking networks)
- total counts and sizes of loaded requests by type (scripts, images, fonts, stylesheets, media, document and “other”)
- basic page performance metrics (page load time, page interactive time, dom content loaded, first visual change, first meaningful paint)
The component includes:
- Generated linear regression model to parameters in a C++ header file (bandwidth_linreg_parameters.h)
- An interface to the model that buffers submitted features and runs the model when requested