diff --git a/.github/update.log b/.github/update.log index bab587f31b..67397ed321 100644 --- a/.github/update.log +++ b/.github/update.log @@ -882,3 +882,4 @@ Update On Fri Jan 10 19:35:24 CET 2025 Update On Sat Jan 11 19:31:54 CET 2025 Update On Sun Jan 12 19:31:00 CET 2025 Update On Mon Jan 13 19:35:28 CET 2025 +Update On Tue Jan 14 19:32:59 CET 2025 diff --git a/bbdown/.github/workflows/build_latest.yml b/bbdown/.github/workflows/build_latest.yml index 1a1e3a26a1..3f8c46e68c 100644 --- a/bbdown/.github/workflows/build_latest.yml +++ b/bbdown/.github/workflows/build_latest.yml @@ -60,6 +60,46 @@ jobs: needs: set-date steps: + - name: setup deb822 repos + run: | + if [[ $ImageOS == "ubuntu24" ]]; then + cat < deb822sources + Types: deb + URIs: http://archive.ubuntu.com/ubuntu/ + Suites: noble + Components: main restricted universe + Architectures: amd64 + + Types: deb + URIs: http://security.ubuntu.com/ubuntu/ + Suites: noble-security + Components: main restricted universe + Architectures: amd64 + + Types: deb + URIs: http://archive.ubuntu.com/ubuntu/ + Suites: noble-updates + Components: main restricted universe + Architectures: amd64 + + Types: deb + URIs: http://azure.ports.ubuntu.com/ubuntu-ports/ + Suites: noble + Components: main restricted multiverse universe + Architectures: arm64 + + Types: deb + URIs: http://azure.ports.ubuntu.com/ubuntu-ports/ + Suites: noble-updates + Components: main restricted multiverse universe + Architectures: arm64 + EOF + + sudo mv deb822sources /etc/apt/sources.list.d/ubuntu.sources + else + sudo mv config/crosscomp-sources.list /etc/apt/sources.list + fi + # https://learn.microsoft.com/zh-cn/dotnet/core/deploying/native-aot/cross-compile - run: | sudo dpkg --add-architecture arm64 @@ -72,7 +112,7 @@ jobs: sudo sed -i -e 's/deb mirror/deb [arch=amd64] mirror/g' /etc/apt/sources.list sudo apt-get update sudo apt-get install -y curl wget libicu-dev libcurl4-openssl-dev zlib1g-dev libkrb5-dev clang llvm binutils-aarch64-linux-gnu gcc-aarch64-linux-gnu zlib1g-dev:arm64 - + - uses: actions/checkout@v1 - name: Set up dotnet @@ -133,7 +173,7 @@ jobs: with: name: BBDown_osx-x64 path: BBDown_${{ needs.set-date.outputs.date }}_osx-x64.zip - + - name: Upload Artifact [osx-arm64] uses: actions/upload-artifact@v3.1.3 with: diff --git a/clash-nyanpasu/backend/Cargo.lock b/clash-nyanpasu/backend/Cargo.lock index c14412d487..5e07cd1e2f 100644 --- a/clash-nyanpasu/backend/Cargo.lock +++ b/clash-nyanpasu/backend/Cargo.lock @@ -1496,7 +1496,7 @@ dependencies = [ "chrono", "clap", "colored", - "convert_case 0.6.0", + "convert_case 0.7.1", "ctrlc", "dashmap", "deelevate", @@ -1764,9 +1764,9 @@ checksum = "6245d59a3e82a7fc217c5828a6692dbc6dfb63a0c8c90495621f7b9d79704a0e" [[package]] name = "convert_case" -version = "0.6.0" +version = "0.7.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ec182b0ca2f35d8fc196cf3404988fd8b8c739a4d270ff118a398feb0cbec1ca" +checksum = "bb402b8d4c85569410425650ce3eddc7d698ed96d39a73f941b08fb63082f1e7" dependencies = [ "unicode-segmentation", ] diff --git a/clash-nyanpasu/backend/tauri/Cargo.toml b/clash-nyanpasu/backend/tauri/Cargo.toml index bcf3a79ed0..fcf5605500 100644 --- a/clash-nyanpasu/backend/tauri/Cargo.toml +++ b/clash-nyanpasu/backend/tauri/Cargo.toml @@ -35,7 +35,7 @@ futures = "0.3" glob = "0.3.1" timeago = "0.4" humansize = "2.1.3" -convert_case = "0.6.0" +convert_case = "0.7.0" anyhow = "1.0" pretty_assertions = "1.4.0" chrono = "0.4.31" diff --git a/clash-nyanpasu/frontend/nyanpasu/package.json b/clash-nyanpasu/frontend/nyanpasu/package.json index 46bbcf2b65..115049fd1c 100644 --- a/clash-nyanpasu/frontend/nyanpasu/package.json +++ b/clash-nyanpasu/frontend/nyanpasu/package.json @@ -61,7 +61,7 @@ "@tauri-apps/plugin-clipboard-manager": "2.2.0", "@tauri-apps/plugin-dialog": "2.2.0", "@tauri-apps/plugin-fs": "2.2.0", - "@tauri-apps/plugin-notification": "2.2.0", + "@tauri-apps/plugin-notification": "2.2.1", "@tauri-apps/plugin-os": "2.2.0", "@tauri-apps/plugin-process": "2.2.0", "@tauri-apps/plugin-shell": "2.2.0", diff --git a/clash-nyanpasu/manifest/version.json b/clash-nyanpasu/manifest/version.json index 299f13629d..874333d048 100644 --- a/clash-nyanpasu/manifest/version.json +++ b/clash-nyanpasu/manifest/version.json @@ -5,7 +5,7 @@ "mihomo_alpha": "alpha-c7661d7", "clash_rs": "v0.7.4", "clash_premium": "2023-09-05-gdcc8d87", - "clash_rs_alpha": "0.7.4-alpha+sha.306b0f1" + "clash_rs_alpha": "0.7.4-alpha+sha.63aec82" }, "arch_template": { "mihomo": { @@ -69,5 +69,5 @@ "linux-armv7hf": "clash-armv7-unknown-linux-gnueabihf" } }, - "updated_at": "2025-01-09T22:20:42.120Z" + "updated_at": "2025-01-13T22:20:24.809Z" } diff --git a/clash-nyanpasu/package.json b/clash-nyanpasu/package.json index 70cae00da8..8c56669ce8 100644 --- a/clash-nyanpasu/package.json +++ b/clash-nyanpasu/package.json @@ -64,7 +64,7 @@ "@tauri-apps/cli": "2.2.4", "@types/fs-extra": "11.0.4", "@types/lodash-es": "4.17.12", - "@types/node": "22.10.5", + "@types/node": "22.10.6", "@typescript-eslint/eslint-plugin": "8.19.1", "@typescript-eslint/parser": "8.19.1", "autoprefixer": "10.4.20", @@ -108,7 +108,7 @@ "typescript": "5.7.3", "typescript-eslint": "8.19.1" }, - "packageManager": "pnpm@9.15.3+sha512.1f79bc245a66eb0b07c5d4d83131240774642caaa86ef7d0434ab47c0d16f66b04e21e0c086eb61e62c77efc4d7f7ec071afad3796af64892fae66509173893a", + "packageManager": "pnpm@9.15.4+sha512.b2dc20e2fc72b3e18848459b37359a32064663e5627a51e4c74b2c29dd8e8e0491483c3abb40789cfd578bf362fb6ba8261b05f0387d76792ed6e23ea3b1b6a0", "engines": { "node": "22.13.0" }, diff --git a/clash-nyanpasu/pnpm-lock.yaml b/clash-nyanpasu/pnpm-lock.yaml index dd4444aafd..5ee68b8916 100644 --- a/clash-nyanpasu/pnpm-lock.yaml +++ b/clash-nyanpasu/pnpm-lock.yaml @@ -20,7 +20,7 @@ importers: devDependencies: '@commitlint/cli': specifier: 19.6.1 - version: 19.6.1(@types/node@22.10.5)(typescript@5.7.3) + version: 19.6.1(@types/node@22.10.6)(typescript@5.7.3) '@commitlint/config-conventional': specifier: 19.6.0 version: 19.6.0 @@ -40,8 +40,8 @@ importers: specifier: 4.17.12 version: 4.17.12 '@types/node': - specifier: 22.10.5 - version: 22.10.5 + specifier: 22.10.6 + version: 22.10.6 '@typescript-eslint/eslint-plugin': specifier: 8.19.1 version: 8.19.1(@typescript-eslint/parser@8.19.1(eslint@9.18.0(jiti@2.4.2))(typescript@5.7.3))(eslint@9.18.0(jiti@2.4.2))(typescript@5.7.3) @@ -101,7 +101,7 @@ importers: version: 15.14.0 knip: specifier: 5.42.0 - version: 5.42.0(@types/node@22.10.5)(typescript@5.7.3) + version: 5.42.0(@types/node@22.10.6)(typescript@5.7.3) lint-staged: specifier: 15.3.0 version: 15.3.0 @@ -331,7 +331,7 @@ importers: version: 1.89.2(@tanstack/react-router@1.89.2(@tanstack/router-generator@1.87.7)(react-dom@19.0.0(react@19.0.0))(react@19.0.0))(csstype@3.1.3)(react-dom@19.0.0(react@19.0.0))(react@19.0.0) '@tanstack/router-plugin': specifier: 1.87.13 - version: 1.87.13(vite@6.0.7(@types/node@22.10.5)(jiti@2.4.2)(less@4.2.0)(sass-embedded@1.83.1)(sass@1.83.0)(stylus@0.62.0)(terser@5.36.0)(tsx@4.19.2)(yaml@2.6.1)) + version: 1.87.13(vite@6.0.7(@types/node@22.10.6)(jiti@2.4.2)(less@4.2.0)(sass-embedded@1.83.1)(sass@1.83.0)(stylus@0.62.0)(terser@5.36.0)(tsx@4.19.2)(yaml@2.6.1)) '@tauri-apps/plugin-clipboard-manager': specifier: 2.2.0 version: 2.2.0 @@ -342,8 +342,8 @@ importers: specifier: 2.2.0 version: 2.2.0 '@tauri-apps/plugin-notification': - specifier: 2.2.0 - version: 2.2.0 + specifier: 2.2.1 + version: 2.2.1 '@tauri-apps/plugin-os': specifier: 2.2.0 version: 2.2.0 @@ -367,13 +367,13 @@ importers: version: 13.12.2 '@vitejs/plugin-legacy': specifier: 6.0.0 - version: 6.0.0(terser@5.36.0)(vite@6.0.7(@types/node@22.10.5)(jiti@2.4.2)(less@4.2.0)(sass-embedded@1.83.1)(sass@1.83.0)(stylus@0.62.0)(terser@5.36.0)(tsx@4.19.2)(yaml@2.6.1)) + version: 6.0.0(terser@5.36.0)(vite@6.0.7(@types/node@22.10.6)(jiti@2.4.2)(less@4.2.0)(sass-embedded@1.83.1)(sass@1.83.0)(stylus@0.62.0)(terser@5.36.0)(tsx@4.19.2)(yaml@2.6.1)) '@vitejs/plugin-react': specifier: 4.3.4 - version: 4.3.4(vite@6.0.7(@types/node@22.10.5)(jiti@2.4.2)(less@4.2.0)(sass-embedded@1.83.1)(sass@1.83.0)(stylus@0.62.0)(terser@5.36.0)(tsx@4.19.2)(yaml@2.6.1)) + version: 4.3.4(vite@6.0.7(@types/node@22.10.6)(jiti@2.4.2)(less@4.2.0)(sass-embedded@1.83.1)(sass@1.83.0)(stylus@0.62.0)(terser@5.36.0)(tsx@4.19.2)(yaml@2.6.1)) '@vitejs/plugin-react-swc': specifier: 3.7.2 - version: 3.7.2(vite@6.0.7(@types/node@22.10.5)(jiti@2.4.2)(less@4.2.0)(sass-embedded@1.83.1)(sass@1.83.0)(stylus@0.62.0)(terser@5.36.0)(tsx@4.19.2)(yaml@2.6.1)) + version: 3.7.2(vite@6.0.7(@types/node@22.10.6)(jiti@2.4.2)(less@4.2.0)(sass-embedded@1.83.1)(sass@1.83.0)(stylus@0.62.0)(terser@5.36.0)(tsx@4.19.2)(yaml@2.6.1)) change-case: specifier: 5.4.4 version: 5.4.4 @@ -415,19 +415,19 @@ importers: version: 13.12.0 vite: specifier: 6.0.7 - version: 6.0.7(@types/node@22.10.5)(jiti@2.4.2)(less@4.2.0)(sass-embedded@1.83.1)(sass@1.83.0)(stylus@0.62.0)(terser@5.36.0)(tsx@4.19.2)(yaml@2.6.1) + version: 6.0.7(@types/node@22.10.6)(jiti@2.4.2)(less@4.2.0)(sass-embedded@1.83.1)(sass@1.83.0)(stylus@0.62.0)(terser@5.36.0)(tsx@4.19.2)(yaml@2.6.1) vite-plugin-html: specifier: 3.2.2 - version: 3.2.2(vite@6.0.7(@types/node@22.10.5)(jiti@2.4.2)(less@4.2.0)(sass-embedded@1.83.1)(sass@1.83.0)(stylus@0.62.0)(terser@5.36.0)(tsx@4.19.2)(yaml@2.6.1)) + version: 3.2.2(vite@6.0.7(@types/node@22.10.6)(jiti@2.4.2)(less@4.2.0)(sass-embedded@1.83.1)(sass@1.83.0)(stylus@0.62.0)(terser@5.36.0)(tsx@4.19.2)(yaml@2.6.1)) vite-plugin-sass-dts: specifier: 1.3.30 - version: 1.3.30(postcss@8.4.49)(prettier@3.4.2)(sass-embedded@1.83.1)(vite@6.0.7(@types/node@22.10.5)(jiti@2.4.2)(less@4.2.0)(sass-embedded@1.83.1)(sass@1.83.0)(stylus@0.62.0)(terser@5.36.0)(tsx@4.19.2)(yaml@2.6.1)) + version: 1.3.30(postcss@8.4.49)(prettier@3.4.2)(sass-embedded@1.83.1)(vite@6.0.7(@types/node@22.10.6)(jiti@2.4.2)(less@4.2.0)(sass-embedded@1.83.1)(sass@1.83.0)(stylus@0.62.0)(terser@5.36.0)(tsx@4.19.2)(yaml@2.6.1)) vite-plugin-svgr: specifier: 4.3.0 - version: 4.3.0(rollup@4.27.4)(typescript@5.7.3)(vite@6.0.7(@types/node@22.10.5)(jiti@2.4.2)(less@4.2.0)(sass-embedded@1.83.1)(sass@1.83.0)(stylus@0.62.0)(terser@5.36.0)(tsx@4.19.2)(yaml@2.6.1)) + version: 4.3.0(rollup@4.27.4)(typescript@5.7.3)(vite@6.0.7(@types/node@22.10.6)(jiti@2.4.2)(less@4.2.0)(sass-embedded@1.83.1)(sass@1.83.0)(stylus@0.62.0)(terser@5.36.0)(tsx@4.19.2)(yaml@2.6.1)) vite-tsconfig-paths: specifier: 5.1.4 - version: 5.1.4(typescript@5.7.3)(vite@6.0.7(@types/node@22.10.5)(jiti@2.4.2)(less@4.2.0)(sass-embedded@1.83.1)(sass@1.83.0)(stylus@0.62.0)(terser@5.36.0)(tsx@4.19.2)(yaml@2.6.1)) + version: 5.1.4(typescript@5.7.3)(vite@6.0.7(@types/node@22.10.6)(jiti@2.4.2)(less@4.2.0)(sass-embedded@1.83.1)(sass@1.83.0)(stylus@0.62.0)(terser@5.36.0)(tsx@4.19.2)(yaml@2.6.1)) zod: specifier: 3.24.1 version: 3.24.1 @@ -463,7 +463,7 @@ importers: version: 19.0.6 '@vitejs/plugin-react': specifier: 4.3.4 - version: 4.3.4(vite@6.0.7(@types/node@22.10.5)(jiti@2.4.2)(less@4.2.0)(sass-embedded@1.83.1)(sass@1.83.0)(stylus@0.62.0)(terser@5.36.0)(tsx@4.19.2)(yaml@2.6.1)) + version: 4.3.4(vite@6.0.7(@types/node@22.10.6)(jiti@2.4.2)(less@4.2.0)(sass-embedded@1.83.1)(sass@1.83.0)(stylus@0.62.0)(terser@5.36.0)(tsx@4.19.2)(yaml@2.6.1)) ahooks: specifier: 3.8.4 version: 3.8.4(react@19.0.0) @@ -490,10 +490,10 @@ importers: version: 17.6.0(react-dom@19.0.0(react@19.0.0))(react@19.0.0) vite: specifier: 6.0.7 - version: 6.0.7(@types/node@22.10.5)(jiti@2.4.2)(less@4.2.0)(sass-embedded@1.83.1)(sass@1.83.0)(stylus@0.62.0)(terser@5.36.0)(tsx@4.19.2)(yaml@2.6.1) + version: 6.0.7(@types/node@22.10.6)(jiti@2.4.2)(less@4.2.0)(sass-embedded@1.83.1)(sass@1.83.0)(stylus@0.62.0)(terser@5.36.0)(tsx@4.19.2)(yaml@2.6.1) vite-tsconfig-paths: specifier: 5.1.4 - version: 5.1.4(typescript@5.7.3)(vite@6.0.7(@types/node@22.10.5)(jiti@2.4.2)(less@4.2.0)(sass-embedded@1.83.1)(sass@1.83.0)(stylus@0.62.0)(terser@5.36.0)(tsx@4.19.2)(yaml@2.6.1)) + version: 5.1.4(typescript@5.7.3)(vite@6.0.7(@types/node@22.10.6)(jiti@2.4.2)(less@4.2.0)(sass-embedded@1.83.1)(sass@1.83.0)(stylus@0.62.0)(terser@5.36.0)(tsx@4.19.2)(yaml@2.6.1)) devDependencies: '@emotion/react': specifier: 11.14.0 @@ -518,7 +518,7 @@ importers: version: 5.1.0(typescript@5.7.3) vite-plugin-dts: specifier: 4.5.0 - version: 4.5.0(@types/node@22.10.5)(rollup@4.27.4)(typescript@5.7.3)(vite@6.0.7(@types/node@22.10.5)(jiti@2.4.2)(less@4.2.0)(sass-embedded@1.83.1)(sass@1.83.0)(stylus@0.62.0)(terser@5.36.0)(tsx@4.19.2)(yaml@2.6.1)) + version: 4.5.0(@types/node@22.10.6)(rollup@4.27.4)(typescript@5.7.3)(vite@6.0.7(@types/node@22.10.6)(jiti@2.4.2)(less@4.2.0)(sass-embedded@1.83.1)(sass@1.83.0)(stylus@0.62.0)(terser@5.36.0)(tsx@4.19.2)(yaml@2.6.1)) scripts: dependencies: @@ -2904,8 +2904,8 @@ packages: '@tauri-apps/plugin-fs@2.2.0': resolution: {integrity: sha512-+08mApuONKI8/sCNEZ6AR8vf5vI9DXD4YfrQ9NQmhRxYKMLVhRW164vdW5BSLmMpuevftpQ2FVoL9EFkfG9Z+g==} - '@tauri-apps/plugin-notification@2.2.0': - resolution: {integrity: sha512-uhE3a2gFlqwiWhY/JbhXOF13K4iILEYxUk0D2Y+q69HP6tnfPqKCuNTHxDM0H+oFAakXESNmJVnYw0Vi4IrMMQ==} + '@tauri-apps/plugin-notification@2.2.1': + resolution: {integrity: sha512-QF8Zod6XDhxD6xkD5nU/BjbOpJ6+3gxGCrVULOdLpvMuMSN2Z2IdObV/qgnrEJk1UamUCF1ClQUqNCbk4zTJNQ==} '@tauri-apps/plugin-os@2.2.0': resolution: {integrity: sha512-HszbCdbisMlu5QhCNAN8YIWyz2v33abAWha6+uvV2CKX8P5VSct/y+kEe22JeyqrxCnWlQ3DRx7s49Byg7/0EA==} @@ -3108,8 +3108,8 @@ packages: '@types/node@22.10.1': resolution: {integrity: sha512-qKgsUwfHZV2WCWLAnVP1JqnpE6Im6h3Y0+fYgMTasNQ7V++CBX5OT1as0g0f+OyubbFqhf6XVNIsmN4IIhEgGQ==} - '@types/node@22.10.5': - resolution: {integrity: sha512-F8Q+SeGimwOo86fiovQh8qiXfFEh2/ocYv7tU5pJ3EXMSSxk1Joj5wefpFK2fHTf/N6HKGSxIDBT9f3gCxXPkQ==} + '@types/node@22.10.6': + resolution: {integrity: sha512-qNiuwC4ZDAUNcY47xgaSuS92cjf8JbSUoaKS77bmLG1rU7MlATVSiw/IlrjtIyyskXBZ8KkNfjK/P5na7rgXbQ==} '@types/parse-json@4.0.2': resolution: {integrity: sha512-dISoDXWWQwUquiKsyZ4Ng+HX2KsPL7LyHKHQwgGFEA3IaKac4Obd+h2a/a6waisAoepJlBcx9paWqjA8/HVjCw==} @@ -9054,11 +9054,11 @@ snapshots: '@bufbuild/protobuf@2.2.3': {} - '@commitlint/cli@19.6.1(@types/node@22.10.5)(typescript@5.7.3)': + '@commitlint/cli@19.6.1(@types/node@22.10.6)(typescript@5.7.3)': dependencies: '@commitlint/format': 19.5.0 '@commitlint/lint': 19.6.0 - '@commitlint/load': 19.6.1(@types/node@22.10.5)(typescript@5.7.3) + '@commitlint/load': 19.6.1(@types/node@22.10.6)(typescript@5.7.3) '@commitlint/read': 19.5.0 '@commitlint/types': 19.5.0 tinyexec: 0.3.1 @@ -9105,7 +9105,7 @@ snapshots: '@commitlint/rules': 19.6.0 '@commitlint/types': 19.5.0 - '@commitlint/load@19.6.1(@types/node@22.10.5)(typescript@5.7.3)': + '@commitlint/load@19.6.1(@types/node@22.10.6)(typescript@5.7.3)': dependencies: '@commitlint/config-validator': 19.5.0 '@commitlint/execute-rule': 19.5.0 @@ -9113,7 +9113,7 @@ snapshots: '@commitlint/types': 19.5.0 chalk: 5.3.0 cosmiconfig: 9.0.0(typescript@5.7.3) - cosmiconfig-typescript-loader: 6.1.0(@types/node@22.10.5)(cosmiconfig@9.0.0(typescript@5.7.3))(typescript@5.7.3) + cosmiconfig-typescript-loader: 6.1.0(@types/node@22.10.6)(cosmiconfig@9.0.0(typescript@5.7.3))(typescript@5.7.3) lodash.isplainobject: 4.0.6 lodash.merge: 4.6.2 lodash.uniq: 4.5.0 @@ -9615,23 +9615,23 @@ snapshots: '@material/material-color-utilities@0.3.0': {} - '@microsoft/api-extractor-model@7.30.2(@types/node@22.10.5)': + '@microsoft/api-extractor-model@7.30.2(@types/node@22.10.6)': dependencies: '@microsoft/tsdoc': 0.15.1 '@microsoft/tsdoc-config': 0.17.1 - '@rushstack/node-core-library': 5.10.2(@types/node@22.10.5) + '@rushstack/node-core-library': 5.10.2(@types/node@22.10.6) transitivePeerDependencies: - '@types/node' - '@microsoft/api-extractor@7.49.1(@types/node@22.10.5)': + '@microsoft/api-extractor@7.49.1(@types/node@22.10.6)': dependencies: - '@microsoft/api-extractor-model': 7.30.2(@types/node@22.10.5) + '@microsoft/api-extractor-model': 7.30.2(@types/node@22.10.6) '@microsoft/tsdoc': 0.15.1 '@microsoft/tsdoc-config': 0.17.1 - '@rushstack/node-core-library': 5.10.2(@types/node@22.10.5) + '@rushstack/node-core-library': 5.10.2(@types/node@22.10.6) '@rushstack/rig-package': 0.5.3 - '@rushstack/terminal': 0.14.5(@types/node@22.10.5) - '@rushstack/ts-command-line': 4.23.3(@types/node@22.10.5) + '@rushstack/terminal': 0.14.5(@types/node@22.10.6) + '@rushstack/ts-command-line': 4.23.3(@types/node@22.10.6) lodash: 4.17.21 minimatch: 3.0.8 resolve: 1.22.8 @@ -10299,7 +10299,7 @@ snapshots: '@rtsao/scc@1.1.0': {} - '@rushstack/node-core-library@5.10.2(@types/node@22.10.5)': + '@rushstack/node-core-library@5.10.2(@types/node@22.10.6)': dependencies: ajv: 8.13.0 ajv-draft-04: 1.0.0(ajv@8.13.0) @@ -10310,23 +10310,23 @@ snapshots: resolve: 1.22.8 semver: 7.5.4 optionalDependencies: - '@types/node': 22.10.5 + '@types/node': 22.10.6 '@rushstack/rig-package@0.5.3': dependencies: resolve: 1.22.8 strip-json-comments: 3.1.1 - '@rushstack/terminal@0.14.5(@types/node@22.10.5)': + '@rushstack/terminal@0.14.5(@types/node@22.10.6)': dependencies: - '@rushstack/node-core-library': 5.10.2(@types/node@22.10.5) + '@rushstack/node-core-library': 5.10.2(@types/node@22.10.6) supports-color: 8.1.1 optionalDependencies: - '@types/node': 22.10.5 + '@types/node': 22.10.6 - '@rushstack/ts-command-line@4.23.3(@types/node@22.10.5)': + '@rushstack/ts-command-line@4.23.3(@types/node@22.10.6)': dependencies: - '@rushstack/terminal': 0.14.5(@types/node@22.10.5) + '@rushstack/terminal': 0.14.5(@types/node@22.10.6) '@types/argparse': 1.0.38 argparse: 1.0.10 string-argv: 0.3.2 @@ -10575,7 +10575,7 @@ snapshots: tsx: 4.19.2 zod: 3.24.1 - '@tanstack/router-plugin@1.87.13(vite@6.0.7(@types/node@22.10.5)(jiti@2.4.2)(less@4.2.0)(sass-embedded@1.83.1)(sass@1.83.0)(stylus@0.62.0)(terser@5.36.0)(tsx@4.19.2)(yaml@2.6.1))': + '@tanstack/router-plugin@1.87.13(vite@6.0.7(@types/node@22.10.6)(jiti@2.4.2)(less@4.2.0)(sass-embedded@1.83.1)(sass@1.83.0)(stylus@0.62.0)(terser@5.36.0)(tsx@4.19.2)(yaml@2.6.1))': dependencies: '@babel/core': 7.26.0 '@babel/generator': 7.26.3 @@ -10596,7 +10596,7 @@ snapshots: unplugin: 1.16.0 zod: 3.24.1 optionalDependencies: - vite: 6.0.7(@types/node@22.10.5)(jiti@2.4.2)(less@4.2.0)(sass-embedded@1.83.1)(sass@1.83.0)(stylus@0.62.0)(terser@5.36.0)(tsx@4.19.2)(yaml@2.6.1) + vite: 6.0.7(@types/node@22.10.6)(jiti@2.4.2)(less@4.2.0)(sass-embedded@1.83.1)(sass@1.83.0)(stylus@0.62.0)(terser@5.36.0)(tsx@4.19.2)(yaml@2.6.1) transitivePeerDependencies: - supports-color @@ -10676,7 +10676,7 @@ snapshots: dependencies: '@tauri-apps/api': 2.2.0 - '@tauri-apps/plugin-notification@2.2.0': + '@tauri-apps/plugin-notification@2.2.1': dependencies: '@tauri-apps/api': 2.2.0 @@ -10742,12 +10742,12 @@ snapshots: dependencies: '@types/http-cache-semantics': 4.0.4 '@types/keyv': 3.1.4 - '@types/node': 22.10.5 + '@types/node': 22.10.6 '@types/responselike': 1.0.3 '@types/conventional-commits-parser@5.0.0': dependencies: - '@types/node': 22.10.5 + '@types/node': 22.10.6 '@types/d3-array@3.2.1': {} @@ -10883,7 +10883,7 @@ snapshots: '@types/fs-extra@11.0.4': dependencies: '@types/jsonfile': 6.1.4 - '@types/node': 22.10.5 + '@types/node': 22.10.6 '@types/geojson@7946.0.14': {} @@ -10901,11 +10901,11 @@ snapshots: '@types/jsonfile@6.1.4': dependencies: - '@types/node': 22.10.5 + '@types/node': 22.10.6 '@types/keyv@3.1.4': dependencies: - '@types/node': 22.10.5 + '@types/node': 22.10.6 '@types/lodash-es@4.17.12': dependencies: @@ -10925,7 +10925,7 @@ snapshots: dependencies: undici-types: 6.20.0 - '@types/node@22.10.5': + '@types/node@22.10.6': dependencies: undici-types: 6.20.0 @@ -10955,7 +10955,7 @@ snapshots: '@types/responselike@1.0.3': dependencies: - '@types/node': 22.10.5 + '@types/node': 22.10.6 '@types/retry@0.12.2': {} @@ -10967,7 +10967,7 @@ snapshots: '@types/yauzl@2.10.3': dependencies: - '@types/node': 22.10.5 + '@types/node': 22.10.6 optional: true '@typescript-eslint/eslint-plugin@8.19.1(@typescript-eslint/parser@8.19.1(eslint@9.18.0(jiti@2.4.2))(typescript@5.7.3))(eslint@9.18.0(jiti@2.4.2))(typescript@5.7.3)': @@ -11086,7 +11086,7 @@ snapshots: '@ungap/structured-clone@1.2.0': {} - '@vitejs/plugin-legacy@6.0.0(terser@5.36.0)(vite@6.0.7(@types/node@22.10.5)(jiti@2.4.2)(less@4.2.0)(sass-embedded@1.83.1)(sass@1.83.0)(stylus@0.62.0)(terser@5.36.0)(tsx@4.19.2)(yaml@2.6.1))': + '@vitejs/plugin-legacy@6.0.0(terser@5.36.0)(vite@6.0.7(@types/node@22.10.6)(jiti@2.4.2)(less@4.2.0)(sass-embedded@1.83.1)(sass@1.83.0)(stylus@0.62.0)(terser@5.36.0)(tsx@4.19.2)(yaml@2.6.1))': dependencies: '@babel/core': 7.26.0 '@babel/preset-env': 7.26.0(@babel/core@7.26.0) @@ -11097,25 +11097,25 @@ snapshots: regenerator-runtime: 0.14.1 systemjs: 6.15.1 terser: 5.36.0 - vite: 6.0.7(@types/node@22.10.5)(jiti@2.4.2)(less@4.2.0)(sass-embedded@1.83.1)(sass@1.83.0)(stylus@0.62.0)(terser@5.36.0)(tsx@4.19.2)(yaml@2.6.1) + vite: 6.0.7(@types/node@22.10.6)(jiti@2.4.2)(less@4.2.0)(sass-embedded@1.83.1)(sass@1.83.0)(stylus@0.62.0)(terser@5.36.0)(tsx@4.19.2)(yaml@2.6.1) transitivePeerDependencies: - supports-color - '@vitejs/plugin-react-swc@3.7.2(vite@6.0.7(@types/node@22.10.5)(jiti@2.4.2)(less@4.2.0)(sass-embedded@1.83.1)(sass@1.83.0)(stylus@0.62.0)(terser@5.36.0)(tsx@4.19.2)(yaml@2.6.1))': + '@vitejs/plugin-react-swc@3.7.2(vite@6.0.7(@types/node@22.10.6)(jiti@2.4.2)(less@4.2.0)(sass-embedded@1.83.1)(sass@1.83.0)(stylus@0.62.0)(terser@5.36.0)(tsx@4.19.2)(yaml@2.6.1))': dependencies: '@swc/core': 1.7.26 - vite: 6.0.7(@types/node@22.10.5)(jiti@2.4.2)(less@4.2.0)(sass-embedded@1.83.1)(sass@1.83.0)(stylus@0.62.0)(terser@5.36.0)(tsx@4.19.2)(yaml@2.6.1) + vite: 6.0.7(@types/node@22.10.6)(jiti@2.4.2)(less@4.2.0)(sass-embedded@1.83.1)(sass@1.83.0)(stylus@0.62.0)(terser@5.36.0)(tsx@4.19.2)(yaml@2.6.1) transitivePeerDependencies: - '@swc/helpers' - '@vitejs/plugin-react@4.3.4(vite@6.0.7(@types/node@22.10.5)(jiti@2.4.2)(less@4.2.0)(sass-embedded@1.83.1)(sass@1.83.0)(stylus@0.62.0)(terser@5.36.0)(tsx@4.19.2)(yaml@2.6.1))': + '@vitejs/plugin-react@4.3.4(vite@6.0.7(@types/node@22.10.6)(jiti@2.4.2)(less@4.2.0)(sass-embedded@1.83.1)(sass@1.83.0)(stylus@0.62.0)(terser@5.36.0)(tsx@4.19.2)(yaml@2.6.1))': dependencies: '@babel/core': 7.26.0 '@babel/plugin-transform-react-jsx-self': 7.25.9(@babel/core@7.26.0) '@babel/plugin-transform-react-jsx-source': 7.25.9(@babel/core@7.26.0) '@types/babel__core': 7.20.5 react-refresh: 0.14.2 - vite: 6.0.7(@types/node@22.10.5)(jiti@2.4.2)(less@4.2.0)(sass-embedded@1.83.1)(sass@1.83.0)(stylus@0.62.0)(terser@5.36.0)(tsx@4.19.2)(yaml@2.6.1) + vite: 6.0.7(@types/node@22.10.6)(jiti@2.4.2)(less@4.2.0)(sass-embedded@1.83.1)(sass@1.83.0)(stylus@0.62.0)(terser@5.36.0)(tsx@4.19.2)(yaml@2.6.1) transitivePeerDependencies: - supports-color @@ -11803,9 +11803,9 @@ snapshots: core-js@3.40.0: {} - cosmiconfig-typescript-loader@6.1.0(@types/node@22.10.5)(cosmiconfig@9.0.0(typescript@5.7.3))(typescript@5.7.3): + cosmiconfig-typescript-loader@6.1.0(@types/node@22.10.6)(cosmiconfig@9.0.0(typescript@5.7.3))(typescript@5.7.3): dependencies: - '@types/node': 22.10.5 + '@types/node': 22.10.6 cosmiconfig: 9.0.0(typescript@5.7.3) jiti: 2.4.1 typescript: 5.7.3 @@ -13846,11 +13846,11 @@ snapshots: kind-of@6.0.3: {} - knip@5.42.0(@types/node@22.10.5)(typescript@5.7.3): + knip@5.42.0(@types/node@22.10.6)(typescript@5.7.3): dependencies: '@nodelib/fs.walk': 3.0.1 '@snyk/github-codeowners': 1.1.0 - '@types/node': 22.10.5 + '@types/node': 22.10.6 easy-table: 1.2.0 enhanced-resolve: 5.18.0 fast-glob: 3.3.3 @@ -16507,9 +16507,9 @@ snapshots: - rollup - supports-color - vite-plugin-dts@4.5.0(@types/node@22.10.5)(rollup@4.27.4)(typescript@5.7.3)(vite@6.0.7(@types/node@22.10.5)(jiti@2.4.2)(less@4.2.0)(sass-embedded@1.83.1)(sass@1.83.0)(stylus@0.62.0)(terser@5.36.0)(tsx@4.19.2)(yaml@2.6.1)): + vite-plugin-dts@4.5.0(@types/node@22.10.6)(rollup@4.27.4)(typescript@5.7.3)(vite@6.0.7(@types/node@22.10.6)(jiti@2.4.2)(less@4.2.0)(sass-embedded@1.83.1)(sass@1.83.0)(stylus@0.62.0)(terser@5.36.0)(tsx@4.19.2)(yaml@2.6.1)): dependencies: - '@microsoft/api-extractor': 7.49.1(@types/node@22.10.5) + '@microsoft/api-extractor': 7.49.1(@types/node@22.10.6) '@rollup/pluginutils': 5.1.4(rollup@4.27.4) '@volar/typescript': 2.4.11 '@vue/language-core': 2.2.0(typescript@5.7.3) @@ -16520,13 +16520,13 @@ snapshots: magic-string: 0.30.17 typescript: 5.7.3 optionalDependencies: - vite: 6.0.7(@types/node@22.10.5)(jiti@2.4.2)(less@4.2.0)(sass-embedded@1.83.1)(sass@1.83.0)(stylus@0.62.0)(terser@5.36.0)(tsx@4.19.2)(yaml@2.6.1) + vite: 6.0.7(@types/node@22.10.6)(jiti@2.4.2)(less@4.2.0)(sass-embedded@1.83.1)(sass@1.83.0)(stylus@0.62.0)(terser@5.36.0)(tsx@4.19.2)(yaml@2.6.1) transitivePeerDependencies: - '@types/node' - rollup - supports-color - vite-plugin-html@3.2.2(vite@6.0.7(@types/node@22.10.5)(jiti@2.4.2)(less@4.2.0)(sass-embedded@1.83.1)(sass@1.83.0)(stylus@0.62.0)(terser@5.36.0)(tsx@4.19.2)(yaml@2.6.1)): + vite-plugin-html@3.2.2(vite@6.0.7(@types/node@22.10.6)(jiti@2.4.2)(less@4.2.0)(sass-embedded@1.83.1)(sass@1.83.0)(stylus@0.62.0)(terser@5.36.0)(tsx@4.19.2)(yaml@2.6.1)): dependencies: '@rollup/pluginutils': 4.2.1 colorette: 2.0.20 @@ -16540,45 +16540,45 @@ snapshots: html-minifier-terser: 6.1.0 node-html-parser: 5.4.2 pathe: 0.2.0 - vite: 6.0.7(@types/node@22.10.5)(jiti@2.4.2)(less@4.2.0)(sass-embedded@1.83.1)(sass@1.83.0)(stylus@0.62.0)(terser@5.36.0)(tsx@4.19.2)(yaml@2.6.1) + vite: 6.0.7(@types/node@22.10.6)(jiti@2.4.2)(less@4.2.0)(sass-embedded@1.83.1)(sass@1.83.0)(stylus@0.62.0)(terser@5.36.0)(tsx@4.19.2)(yaml@2.6.1) - vite-plugin-sass-dts@1.3.30(postcss@8.4.49)(prettier@3.4.2)(sass-embedded@1.83.1)(vite@6.0.7(@types/node@22.10.5)(jiti@2.4.2)(less@4.2.0)(sass-embedded@1.83.1)(sass@1.83.0)(stylus@0.62.0)(terser@5.36.0)(tsx@4.19.2)(yaml@2.6.1)): + vite-plugin-sass-dts@1.3.30(postcss@8.4.49)(prettier@3.4.2)(sass-embedded@1.83.1)(vite@6.0.7(@types/node@22.10.6)(jiti@2.4.2)(less@4.2.0)(sass-embedded@1.83.1)(sass@1.83.0)(stylus@0.62.0)(terser@5.36.0)(tsx@4.19.2)(yaml@2.6.1)): dependencies: postcss: 8.4.49 postcss-js: 4.0.1(postcss@8.4.49) prettier: 3.4.2 sass-embedded: 1.83.1 - vite: 6.0.7(@types/node@22.10.5)(jiti@2.4.2)(less@4.2.0)(sass-embedded@1.83.1)(sass@1.83.0)(stylus@0.62.0)(terser@5.36.0)(tsx@4.19.2)(yaml@2.6.1) + vite: 6.0.7(@types/node@22.10.6)(jiti@2.4.2)(less@4.2.0)(sass-embedded@1.83.1)(sass@1.83.0)(stylus@0.62.0)(terser@5.36.0)(tsx@4.19.2)(yaml@2.6.1) - vite-plugin-svgr@4.3.0(rollup@4.27.4)(typescript@5.7.3)(vite@6.0.7(@types/node@22.10.5)(jiti@2.4.2)(less@4.2.0)(sass-embedded@1.83.1)(sass@1.83.0)(stylus@0.62.0)(terser@5.36.0)(tsx@4.19.2)(yaml@2.6.1)): + vite-plugin-svgr@4.3.0(rollup@4.27.4)(typescript@5.7.3)(vite@6.0.7(@types/node@22.10.6)(jiti@2.4.2)(less@4.2.0)(sass-embedded@1.83.1)(sass@1.83.0)(stylus@0.62.0)(terser@5.36.0)(tsx@4.19.2)(yaml@2.6.1)): dependencies: '@rollup/pluginutils': 5.1.3(rollup@4.27.4) '@svgr/core': 8.1.0(typescript@5.7.3) '@svgr/plugin-jsx': 8.1.0(@svgr/core@8.1.0(typescript@5.7.3)) - vite: 6.0.7(@types/node@22.10.5)(jiti@2.4.2)(less@4.2.0)(sass-embedded@1.83.1)(sass@1.83.0)(stylus@0.62.0)(terser@5.36.0)(tsx@4.19.2)(yaml@2.6.1) + vite: 6.0.7(@types/node@22.10.6)(jiti@2.4.2)(less@4.2.0)(sass-embedded@1.83.1)(sass@1.83.0)(stylus@0.62.0)(terser@5.36.0)(tsx@4.19.2)(yaml@2.6.1) transitivePeerDependencies: - rollup - supports-color - typescript - vite-tsconfig-paths@5.1.4(typescript@5.7.3)(vite@6.0.7(@types/node@22.10.5)(jiti@2.4.2)(less@4.2.0)(sass-embedded@1.83.1)(sass@1.83.0)(stylus@0.62.0)(terser@5.36.0)(tsx@4.19.2)(yaml@2.6.1)): + vite-tsconfig-paths@5.1.4(typescript@5.7.3)(vite@6.0.7(@types/node@22.10.6)(jiti@2.4.2)(less@4.2.0)(sass-embedded@1.83.1)(sass@1.83.0)(stylus@0.62.0)(terser@5.36.0)(tsx@4.19.2)(yaml@2.6.1)): dependencies: debug: 4.3.7 globrex: 0.1.2 tsconfck: 3.0.3(typescript@5.7.3) optionalDependencies: - vite: 6.0.7(@types/node@22.10.5)(jiti@2.4.2)(less@4.2.0)(sass-embedded@1.83.1)(sass@1.83.0)(stylus@0.62.0)(terser@5.36.0)(tsx@4.19.2)(yaml@2.6.1) + vite: 6.0.7(@types/node@22.10.6)(jiti@2.4.2)(less@4.2.0)(sass-embedded@1.83.1)(sass@1.83.0)(stylus@0.62.0)(terser@5.36.0)(tsx@4.19.2)(yaml@2.6.1) transitivePeerDependencies: - supports-color - typescript - vite@6.0.7(@types/node@22.10.5)(jiti@2.4.2)(less@4.2.0)(sass-embedded@1.83.1)(sass@1.83.0)(stylus@0.62.0)(terser@5.36.0)(tsx@4.19.2)(yaml@2.6.1): + vite@6.0.7(@types/node@22.10.6)(jiti@2.4.2)(less@4.2.0)(sass-embedded@1.83.1)(sass@1.83.0)(stylus@0.62.0)(terser@5.36.0)(tsx@4.19.2)(yaml@2.6.1): dependencies: esbuild: 0.24.2 postcss: 8.4.49 rollup: 4.27.4 optionalDependencies: - '@types/node': 22.10.5 + '@types/node': 22.10.6 fsevents: 2.3.3 jiti: 2.4.2 less: 4.2.0 diff --git a/lede/target/linux/generic/config-5.10 b/lede/target/linux/generic/config-5.10 index 3f2382d3d8..45292ae683 100644 --- a/lede/target/linux/generic/config-5.10 +++ b/lede/target/linux/generic/config-5.10 @@ -319,6 +319,8 @@ CONFIG_ARCH_MMAP_RND_COMPAT_BITS_MIN=8 # CONFIG_ARM64_ERRATUM_1508412 is not set # CONFIG_ARM64_ERRATUM_1530923 is not set # CONFIG_ARM64_ERRATUM_1542419 is not set +# CONFIG_ARM64_ERRATUM_1742098 is not set +# CONFIG_ARM64_ERRATUM_3194386 is not set # CONFIG_ARM64_ERRATUM_819472 is not set # CONFIG_ARM64_ERRATUM_824069 is not set # CONFIG_ARM64_ERRATUM_826319 is not set @@ -412,6 +414,7 @@ CONFIG_ARM_GIC_MAX_NR=1 # CONFIG_AS3935 is not set # CONFIG_AS73211 is not set # CONFIG_ASM9260_TIMER is not set +# CONFIG_ASN1 is not set # CONFIG_ASUS_LAPTOP is not set # CONFIG_ASUS_WIRELESS is not set # CONFIG_ASYMMETRIC_KEY_TYPE is not set @@ -2529,6 +2532,8 @@ CONFIG_INET_TABLE_PERTURB_ORDER=16 CONFIG_INIT_ENV_ARG_LIMIT=32 # CONFIG_INIT_ON_ALLOC_DEFAULT_ON is not set # CONFIG_INIT_ON_FREE_DEFAULT_ON is not set +# CONFIG_INIT_STACK_ALL_PATTERN is not set +# CONFIG_INIT_STACK_ALL_ZERO is not set CONFIG_INIT_STACK_NONE=y CONFIG_INOTIFY_USER=y # CONFIG_INPUT is not set @@ -4538,6 +4543,9 @@ CONFIG_PRINT_STACK_DEPTH=64 # CONFIG_PROC_CHILDREN is not set CONFIG_PROC_FS=y # CONFIG_PROC_KCORE is not set +CONFIG_PROC_MEM_ALWAYS_FORCE=y +# CONFIG_PROC_MEM_FORCE_PTRACE is not set +# CONFIG_PROC_MEM_NO_FORCE is not set # CONFIG_PROC_PAGE_MONITOR is not set # CONFIG_PROC_STRIPPED is not set CONFIG_PROC_SYSCTL=y diff --git a/lede/target/linux/generic/config-5.15 b/lede/target/linux/generic/config-5.15 index d79e67e86b..02898bad44 100644 --- a/lede/target/linux/generic/config-5.15 +++ b/lede/target/linux/generic/config-5.15 @@ -335,6 +335,7 @@ CONFIG_ARCH_MMAP_RND_COMPAT_BITS_MIN=8 # CONFIG_ARM64_ERRATUM_2253138 is not set # CONFIG_ARM64_ERRATUM_2441007 is not set # CONFIG_ARM64_ERRATUM_2441009 is not set +# CONFIG_ARM64_ERRATUM_3194386 is not set # CONFIG_ARM64_ERRATUM_819472 is not set # CONFIG_ARM64_ERRATUM_824069 is not set # CONFIG_ARM64_ERRATUM_826319 is not set @@ -2666,6 +2667,8 @@ CONFIG_INET_TABLE_PERTURB_ORDER=16 CONFIG_INIT_ENV_ARG_LIMIT=32 # CONFIG_INIT_ON_ALLOC_DEFAULT_ON is not set # CONFIG_INIT_ON_FREE_DEFAULT_ON is not set +# CONFIG_INIT_STACK_ALL_PATTERN is not set +# CONFIG_INIT_STACK_ALL_ZERO is not set CONFIG_INIT_STACK_NONE=y CONFIG_INOTIFY_USER=y # CONFIG_INPUT is not set @@ -4774,6 +4777,9 @@ CONFIG_PRINT_STACK_DEPTH=64 # CONFIG_PROC_CHILDREN is not set CONFIG_PROC_FS=y # CONFIG_PROC_KCORE is not set +CONFIG_PROC_MEM_ALWAYS_FORCE=y +# CONFIG_PROC_MEM_FORCE_PTRACE is not set +# CONFIG_PROC_MEM_NO_FORCE is not set # CONFIG_PROC_PAGE_MONITOR is not set # CONFIG_PROC_STRIPPED is not set CONFIG_PROC_SYSCTL=y diff --git a/lede/target/linux/generic/config-5.4 b/lede/target/linux/generic/config-5.4 index fa19816db4..e14106984d 100644 --- a/lede/target/linux/generic/config-5.4 +++ b/lede/target/linux/generic/config-5.4 @@ -299,6 +299,8 @@ CONFIG_ARCH_MMAP_RND_COMPAT_BITS_MIN=8 # CONFIG_ARM64_ERRATUM_1024718 is not set # CONFIG_ARM64_ERRATUM_1463225 is not set # CONFIG_ARM64_ERRATUM_1542419 is not set +# CONFIG_ARM64_ERRATUM_1742098 is not set +# CONFIG_ARM64_ERRATUM_3194386 is not set # CONFIG_ARM64_ERRATUM_819472 is not set # CONFIG_ARM64_ERRATUM_824069 is not set # CONFIG_ARM64_ERRATUM_826319 is not set @@ -384,6 +386,7 @@ CONFIG_ARM_GIC_MAX_NR=1 # CONFIG_ARM_VIRT_EXT is not set # CONFIG_AS3935 is not set # CONFIG_ASM9260_TIMER is not set +# CONFIG_ASN1 is not set # CONFIG_ASUS_LAPTOP is not set # CONFIG_ASUS_WIRELESS is not set # CONFIG_ASYMMETRIC_KEY_TYPE is not set @@ -653,6 +656,7 @@ CONFIG_BPF_JIT=y # CONFIG_BPF_JIT_ALWAYS_ON is not set # CONFIG_BPF_STREAM_PARSER is not set CONFIG_BPF_SYSCALL=y +CONFIG_BPF_UNPRIV_DEFAULT_OFF=y # CONFIG_BPQETHER is not set CONFIG_BQL=y CONFIG_BRANCH_PROFILE_NONE=y @@ -2276,6 +2280,7 @@ CONFIG_INET_TABLE_PERTURB_ORDER=16 CONFIG_INIT_ENV_ARG_LIMIT=32 # CONFIG_INIT_ON_ALLOC_DEFAULT_ON is not set # CONFIG_INIT_ON_FREE_DEFAULT_ON is not set +# CONFIG_INIT_STACK_ALL is not set CONFIG_INIT_STACK_NONE=y # CONFIG_INLINE_READ_LOCK is not set # CONFIG_INLINE_READ_LOCK_BH is not set @@ -3061,6 +3066,7 @@ CONFIG_MISC_FILESYSTEMS=y # CONFIG_MISDN_NETJET is not set # CONFIG_MISDN_SPEEDFAX is not set # CONFIG_MISDN_W6692 is not set +CONFIG_MITIGATE_SPECTRE_BRANCH_HISTORY=y # CONFIG_MKISS is not set # CONFIG_MLX4_CORE is not set # CONFIG_MLX4_EN is not set @@ -3304,10 +3310,12 @@ CONFIG_MTD_SPLIT=y # CONFIG_MTD_SPLIT_FIRMWARE is not set CONFIG_MTD_SPLIT_FIRMWARE_NAME="firmware" # CONFIG_MTD_SPLIT_FIT_FW is not set +# CONFIG_MTD_SPLIT_H3C_VFS is not set # CONFIG_MTD_SPLIT_JIMAGE_FW is not set # CONFIG_MTD_SPLIT_LZMA_FW is not set # CONFIG_MTD_SPLIT_MINOR_FW is not set # CONFIG_MTD_SPLIT_SEAMA_FW is not set +# CONFIG_MTD_SPLIT_SEIL_FW is not set CONFIG_MTD_SPLIT_SQUASHFS_ROOT=y CONFIG_MTD_SPLIT_SUPPORT=y # CONFIG_MTD_SPLIT_TPLINK_FW is not set @@ -3832,6 +3840,7 @@ CONFIG_NMI_LOG_BUF_SHIFT=13 # CONFIG_NO_HZ_IDLE is not set # CONFIG_NS83820 is not set # CONFIG_NTB is not set +# CONFIG_NTFS3_FS is not set # CONFIG_NTFS_DEBUG is not set # CONFIG_NTFS_FS is not set # CONFIG_NTFS_RW is not set @@ -4172,6 +4181,9 @@ CONFIG_PRINT_STACK_DEPTH=64 # CONFIG_PROC_CHILDREN is not set CONFIG_PROC_FS=y # CONFIG_PROC_KCORE is not set +CONFIG_PROC_MEM_ALWAYS_FORCE=y +# CONFIG_PROC_MEM_FORCE_PTRACE is not set +# CONFIG_PROC_MEM_NO_FORCE is not set # CONFIG_PROC_PAGE_MONITOR is not set # CONFIG_PROC_STRIPPED is not set CONFIG_PROC_SYSCTL=y diff --git a/lede/target/linux/generic/config-6.12 b/lede/target/linux/generic/config-6.12 index 6a9a3dcb49..887bbac005 100644 --- a/lede/target/linux/generic/config-6.12 +++ b/lede/target/linux/generic/config-6.12 @@ -2618,6 +2618,7 @@ CONFIG_IIO_CONSUMERS_PER_TRIGGER=2 # CONFIG_IMX93_ADC is not set # CONFIG_IMX_IPUV3_CORE is not set # CONFIG_IMX_SCMI_BBM_EXT is not set +# CONFIG_IMX_SCMI_MISC_DRV is not set # CONFIG_IMX_SCMI_MISC_EXT is not set # CONFIG_IMX_THERMAL is not set # CONFIG_INA2XX_ADC is not set diff --git a/mieru/Makefile b/mieru/Makefile index cef0a7c438..ac3dbcfec3 100644 --- a/mieru/Makefile +++ b/mieru/Makefile @@ -32,7 +32,7 @@ PROJECT_NAME=$(shell basename "${ROOT}") # - pkg/version/current.go # # Use `tools/bump_version.sh` script to change all those files at one shot. -VERSION="3.11.0" +VERSION="3.11.1" # Build binaries and installation packages. .PHONY: build diff --git a/mieru/build/package/mieru/amd64/debian/DEBIAN/control b/mieru/build/package/mieru/amd64/debian/DEBIAN/control index 5bc6db586d..b5adb63a6f 100755 --- a/mieru/build/package/mieru/amd64/debian/DEBIAN/control +++ b/mieru/build/package/mieru/amd64/debian/DEBIAN/control @@ -1,5 +1,5 @@ Package: mieru -Version: 3.11.0 +Version: 3.11.1 Section: net Priority: optional Architecture: amd64 diff --git a/mieru/build/package/mieru/amd64/rpm/mieru.spec b/mieru/build/package/mieru/amd64/rpm/mieru.spec index e7bcd2dd5d..1ccb533848 100644 --- a/mieru/build/package/mieru/amd64/rpm/mieru.spec +++ b/mieru/build/package/mieru/amd64/rpm/mieru.spec @@ -1,5 +1,5 @@ Name: mieru -Version: 3.11.0 +Version: 3.11.1 Release: 1%{?dist} Summary: Mieru proxy client License: GPLv3+ diff --git a/mieru/build/package/mieru/arm64/debian/DEBIAN/control b/mieru/build/package/mieru/arm64/debian/DEBIAN/control index 14203c3333..abb72bc5f9 100755 --- a/mieru/build/package/mieru/arm64/debian/DEBIAN/control +++ b/mieru/build/package/mieru/arm64/debian/DEBIAN/control @@ -1,5 +1,5 @@ Package: mieru -Version: 3.11.0 +Version: 3.11.1 Section: net Priority: optional Architecture: arm64 diff --git a/mieru/build/package/mieru/arm64/rpm/mieru.spec b/mieru/build/package/mieru/arm64/rpm/mieru.spec index e7bcd2dd5d..1ccb533848 100644 --- a/mieru/build/package/mieru/arm64/rpm/mieru.spec +++ b/mieru/build/package/mieru/arm64/rpm/mieru.spec @@ -1,5 +1,5 @@ Name: mieru -Version: 3.11.0 +Version: 3.11.1 Release: 1%{?dist} Summary: Mieru proxy client License: GPLv3+ diff --git a/mieru/build/package/mita/amd64/debian/DEBIAN/control b/mieru/build/package/mita/amd64/debian/DEBIAN/control index aefe5efb72..d4ef9e0ca1 100755 --- a/mieru/build/package/mita/amd64/debian/DEBIAN/control +++ b/mieru/build/package/mita/amd64/debian/DEBIAN/control @@ -1,5 +1,5 @@ Package: mita -Version: 3.11.0 +Version: 3.11.1 Section: net Priority: optional Architecture: amd64 diff --git a/mieru/build/package/mita/amd64/rpm/mita.spec b/mieru/build/package/mita/amd64/rpm/mita.spec index 2739ebca81..cf8a7d7c90 100644 --- a/mieru/build/package/mita/amd64/rpm/mita.spec +++ b/mieru/build/package/mita/amd64/rpm/mita.spec @@ -1,5 +1,5 @@ Name: mita -Version: 3.11.0 +Version: 3.11.1 Release: 1%{?dist} Summary: Mieru proxy server License: GPLv3+ diff --git a/mieru/build/package/mita/arm64/debian/DEBIAN/control b/mieru/build/package/mita/arm64/debian/DEBIAN/control index 8103a63b3e..24c3ac6a29 100755 --- a/mieru/build/package/mita/arm64/debian/DEBIAN/control +++ b/mieru/build/package/mita/arm64/debian/DEBIAN/control @@ -1,5 +1,5 @@ Package: mita -Version: 3.11.0 +Version: 3.11.1 Section: net Priority: optional Architecture: arm64 diff --git a/mieru/build/package/mita/arm64/rpm/mita.spec b/mieru/build/package/mita/arm64/rpm/mita.spec index 8a551b94a7..91b4f48edd 100644 --- a/mieru/build/package/mita/arm64/rpm/mita.spec +++ b/mieru/build/package/mita/arm64/rpm/mita.spec @@ -1,5 +1,5 @@ Name: mita -Version: 3.11.0 +Version: 3.11.1 Release: 1%{?dist} Summary: Mieru proxy server License: GPLv3+ diff --git a/mieru/docs/server-install.md b/mieru/docs/server-install.md index 6fad290330..df70f9c71e 100644 --- a/mieru/docs/server-install.md +++ b/mieru/docs/server-install.md @@ -8,32 +8,32 @@ Before installation and configuration, connect to the server via SSH and then ex ```sh # Debian / Ubuntu - X86_64 -curl -LSO https://github.com/enfein/mieru/releases/download/v3.11.0/mita_3.11.0_amd64.deb +curl -LSO https://github.com/enfein/mieru/releases/download/v3.11.1/mita_3.11.1_amd64.deb # Debian / Ubuntu - ARM 64 -curl -LSO https://github.com/enfein/mieru/releases/download/v3.11.0/mita_3.11.0_arm64.deb +curl -LSO https://github.com/enfein/mieru/releases/download/v3.11.1/mita_3.11.1_arm64.deb # RedHat / CentOS / Rocky Linux - X86_64 -curl -LSO https://github.com/enfein/mieru/releases/download/v3.11.0/mita-3.11.0-1.x86_64.rpm +curl -LSO https://github.com/enfein/mieru/releases/download/v3.11.1/mita-3.11.1-1.x86_64.rpm # RedHat / CentOS / Rocky Linux - ARM 64 -curl -LSO https://github.com/enfein/mieru/releases/download/v3.11.0/mita-3.11.0-1.aarch64.rpm +curl -LSO https://github.com/enfein/mieru/releases/download/v3.11.1/mita-3.11.1-1.aarch64.rpm ``` ## Install mita package ```sh # Debian / Ubuntu - X86_64 -sudo dpkg -i mita_3.11.0_amd64.deb +sudo dpkg -i mita_3.11.1_amd64.deb # Debian / Ubuntu - ARM 64 -sudo dpkg -i mita_3.11.0_arm64.deb +sudo dpkg -i mita_3.11.1_arm64.deb # RedHat / CentOS / Rocky Linux - X86_64 -sudo rpm -Uvh --force mita-3.11.0-1.x86_64.rpm +sudo rpm -Uvh --force mita-3.11.1-1.x86_64.rpm # RedHat / CentOS / Rocky Linux - ARM 64 -sudo rpm -Uvh --force mita-3.11.0-1.aarch64.rpm +sudo rpm -Uvh --force mita-3.11.1-1.aarch64.rpm ``` Those instructions can also be used to upgrade the version of mita software package. diff --git a/mieru/docs/server-install.zh_CN.md b/mieru/docs/server-install.zh_CN.md index b35bc995a9..4d984cd0df 100644 --- a/mieru/docs/server-install.zh_CN.md +++ b/mieru/docs/server-install.zh_CN.md @@ -8,32 +8,32 @@ ```sh # Debian / Ubuntu - X86_64 -curl -LSO https://github.com/enfein/mieru/releases/download/v3.11.0/mita_3.11.0_amd64.deb +curl -LSO https://github.com/enfein/mieru/releases/download/v3.11.1/mita_3.11.1_amd64.deb # Debian / Ubuntu - ARM 64 -curl -LSO https://github.com/enfein/mieru/releases/download/v3.11.0/mita_3.11.0_arm64.deb +curl -LSO https://github.com/enfein/mieru/releases/download/v3.11.1/mita_3.11.1_arm64.deb # RedHat / CentOS / Rocky Linux - X86_64 -curl -LSO https://github.com/enfein/mieru/releases/download/v3.11.0/mita-3.11.0-1.x86_64.rpm +curl -LSO https://github.com/enfein/mieru/releases/download/v3.11.1/mita-3.11.1-1.x86_64.rpm # RedHat / CentOS / Rocky Linux - ARM 64 -curl -LSO https://github.com/enfein/mieru/releases/download/v3.11.0/mita-3.11.0-1.aarch64.rpm +curl -LSO https://github.com/enfein/mieru/releases/download/v3.11.1/mita-3.11.1-1.aarch64.rpm ``` ## 安装 mita 软件包 ```sh # Debian / Ubuntu - X86_64 -sudo dpkg -i mita_3.11.0_amd64.deb +sudo dpkg -i mita_3.11.1_amd64.deb # Debian / Ubuntu - ARM 64 -sudo dpkg -i mita_3.11.0_arm64.deb +sudo dpkg -i mita_3.11.1_arm64.deb # RedHat / CentOS / Rocky Linux - X86_64 -sudo rpm -Uvh --force mita-3.11.0-1.x86_64.rpm +sudo rpm -Uvh --force mita-3.11.1-1.x86_64.rpm # RedHat / CentOS / Rocky Linux - ARM 64 -sudo rpm -Uvh --force mita-3.11.0-1.aarch64.rpm +sudo rpm -Uvh --force mita-3.11.1-1.aarch64.rpm ``` 上述指令也可以用来升级 mita 软件包的版本。 diff --git a/mieru/pkg/protocol/session.go b/mieru/pkg/protocol/session.go index b811d0b7db..42baa83835 100644 --- a/mieru/pkg/protocol/session.go +++ b/mieru/pkg/protocol/session.go @@ -584,11 +584,10 @@ func (s *Session) runOutputOnceStream() { } s.oLock.Lock() - defer s.oLock.Unlock() - for { seg, ok := s.sendQueue.DeleteMin() if !ok { + s.oLock.Unlock() break } if err := s.output(seg, nil); err != nil { @@ -597,6 +596,7 @@ func (s *Session) runOutputOnceStream() { if s.outputHasErr.CompareAndSwap(false, true) { close(s.outputErr) } + s.oLock.Unlock() // s.oLock can be acquired by s.closeWithError(). s.closeWithError(err) break } diff --git a/mieru/pkg/version/current.go b/mieru/pkg/version/current.go index 7de5f5d938..322af5f073 100644 --- a/mieru/pkg/version/current.go +++ b/mieru/pkg/version/current.go @@ -16,5 +16,5 @@ package version const ( - AppVersion = "3.11.0" + AppVersion = "3.11.1" ) diff --git a/naiveproxy/CHROMIUM_VERSION b/naiveproxy/CHROMIUM_VERSION index 2234a95d8f..57c8cdf4c9 100644 --- a/naiveproxy/CHROMIUM_VERSION +++ b/naiveproxy/CHROMIUM_VERSION @@ -1 +1 @@ -131.0.6778.86 +132.0.6834.79 diff --git a/naiveproxy/README.md b/naiveproxy/README.md index 877666df1a..3e6fd1f2d2 100644 --- a/naiveproxy/README.md +++ b/naiveproxy/README.md @@ -82,6 +82,7 @@ Or `quic://user:pass@example.com`, if it works better. See also [parameter usage * [v2rayN](https://github.com/2dust/v2rayN), GUI client, Windows * [NekoBox for Android](https://github.com/MatsuriDayo/NekoBoxForAndroid), Proxy toolchain, Android * [NekoRay / NekoBox For PC](https://github.com/MatsuriDayo/nekoray), Qt based GUI, Windows, Linux +* [Yet Another Shadow Socket](https://github.com/Chilledheart/yass), NaïveProxy-compatible forward proxy, Android, iOS, Windows, macOS, Linux, FreeBSD ## Notes for downstream diff --git a/naiveproxy/src/AUTHORS b/naiveproxy/src/AUTHORS index 6a21c8a495..897b6678b6 100644 --- a/naiveproxy/src/AUTHORS +++ b/naiveproxy/src/AUTHORS @@ -575,6 +575,7 @@ Ivan Naydonov Ivan Pavlotskiy Ivan Sham Ivan Sidorov +Jacek Fedoryński Jack Bates Jack Shi Jackson Loeffler @@ -1010,10 +1011,13 @@ Mitchell Cohen Miyoung Shin Mohamed I. Hammad Mohamed Mansour +Mohamed Hany Youns Mohammad Azam +MohammadSabri Mohammed Wajahat Ali Siddiqui Mohan Reddy Mohit Bhalla +Mohraiel Matta Moiseanu Rares-Marian Momoka Yamamoto Momoko Hattori @@ -1690,6 +1694,7 @@ NVIDIA Corporation <*@nvidia.com> OpenFin Inc. <*@openfin.co> Opera Software ASA <*@opera.com> Optical Tone Ltd <*@opticaltone.com> +Palo Alto Networks, Inc. <*@paloaltonetworks.com> Pengutronix e.K. <*@pengutronix.de> Quality First Software GmbH <*@qf-software.com> Rakuten Kobo Inc. <*@kobo.com> diff --git a/naiveproxy/src/DEPS b/naiveproxy/src/DEPS index 82e34b3581..52d2c6e300 100644 --- a/naiveproxy/src/DEPS +++ b/naiveproxy/src/DEPS @@ -206,20 +206,6 @@ vars = { 'checkout_simplechrome': '"{cros_boards}" != ""', 'checkout_simplechrome_with_vms': '"{cros_boards_with_qemu_images}" != ""', - # By default, do not check out versions of toolschains and sdks that are - # specifically only needed by Lacros. - 'checkout_lacros_sdk': False, - # To update the sdk version: - # 1 Choose a version that's not newer than the Ash side so it's thoroughly - # tested: - # https://chromium-review.googlesource.com/q/%2522Automated+Commit:+LKGM%2522+status:merged - # 2 CL description: - # Lacros SDK: Update version - # - # CQ_INCLUDE_TRYBOTS=luci.chrome.try:lacros-amd64-generic-chrome-skylab - # CQ_INCLUDE_TRYBOTS=luci.chrome.try:lacros-arm-generic-chrome-skylab - 'lacros_sdk_version': '16035.0.0-1063260', - # Generate location tag metadata to include in tests result data uploaded # to ResultDB. This isn't needed on some configs and the tool that generates # the data may not run on them, so we make it possible for this to be @@ -234,7 +220,7 @@ vars = { # luci-go CIPD package version. # Make sure the revision is uploaded by infra-packagers builder. # https://ci.chromium.org/p/infra-internal/g/infra-packagers/console - 'luci_go': 'git_revision:7dd39503276dfa4a920102ca77a2f409f2f67655', + 'luci_go': 'git_revision:a52658ecc54d0fa4ad0065918588c890982634b2', # This can be overridden, e.g. with custom_vars, to build clang from HEAD # instead of downloading the prebuilt pinned revision. @@ -253,17 +239,17 @@ vars = { # reclient CIPD package 'reclient_package': 'infra/rbe/client/', # reclient CIPD package version - 'reclient_version': 're_client_version:0.168.0.c46e68bc-gomaip', + 'reclient_version': 're_client_version:0.171.0.1869ad5c-gomaip', # screen-ai CIPD packages - 'screen_ai_linux': 'version:126.12', - 'screen_ai_macos_amd64': 'version:126.12', - 'screen_ai_macos_arm64': 'version:126.12', - 'screen_ai_windows_amd64': 'version:126.12', - 'screen_ai_windows_386': 'version:126.12', + 'screen_ai_linux': 'version:126.18', + 'screen_ai_macos_amd64': 'version:126.18', + 'screen_ai_macos_arm64': 'version:126.18', + 'screen_ai_windows_amd64': 'version:126.18', + 'screen_ai_windows_386': 'version:126.18', # siso CIPD package version. - 'siso_version': 'git_revision:6b2665e870db2df4da1c184a2aec2f98dcb75000', + 'siso_version': 'git_revision:aa31236f9e208039b6196cbae4318d56d4c30e3d', # download libaom test data 'download_libaom_testdata': False, @@ -286,35 +272,35 @@ vars = { # Three lines of non-changing comments so that # the commit queue can handle CLs rolling V8 # and whatever else without interference from each other. - 'src_internal_revision': '36858b7966e203f44a85ebb720aecec5e1013738', + 'src_internal_revision': 'e158e6d051ad38b413adc1e95e94de1ae2ab733b', # Three lines of non-changing comments so that # the commit queue can handle CLs rolling Skia # and whatever else without interference from each other. - 'skia_revision': '94631d9b9a10697325589e1642af63a0137cac94', + 'skia_revision': 'c17fe9bc158c29de3cdd655ac73d14f52c17810a', # Three lines of non-changing comments so that # the commit queue can handle CLs rolling V8 # and whatever else without interference from each other. - 'v8_revision': 'bd2671b973062afc614b852ec190524b80aaef8a', + 'v8_revision': 'e51f1d7dbd113aa01ddfb30890c8a89b11fcd96c', # Three lines of non-changing comments so that # the commit queue can handle CLs rolling ANGLE # and whatever else without interference from each other. - 'angle_revision': 'ac6cda4cbd716102ded6a965f79573b41581898d', + 'angle_revision': 'ce13a00a2b049a1ef5e0e70a3d333ce70838ef7b', # Three lines of non-changing comments so that # the commit queue can handle CLs rolling SwiftShader # and whatever else without interference from each other. - 'swiftshader_revision': '7a9a492a38b7c701f7c96a15a76046aed8f8c0c3', + 'swiftshader_revision': 'd5c4284774115bb1e32c012a2be1b5fbeb1ab1f9', # Three lines of non-changing comments so that # the commit queue can handle CLs rolling PDFium # and whatever else without interference from each other. - 'pdfium_revision': '7a8409531fbb58d7d15ae331e645977b113d7ced', + 'pdfium_revision': '84a8011ec69d0e2de271c05be7d62979608040d9', # Three lines of non-changing comments so that # the commit queue can handle CLs rolling BoringSSL # and whatever else without interference from each other. - 'boringssl_revision': 'cd95210465496ac2337b313cf49f607762abe286', + 'boringssl_revision': '571c76e919c0c48219ced35bef83e1fc83b00eed', # Three lines of non-changing comments so that # the commit queue can handle CLs rolling Fuchsia sdk # and whatever else without interference from each other. - 'fuchsia_version': 'version:24.20241014.3.1', + 'fuchsia_version': 'version:25.20241109.3.1', # Three lines of non-changing comments so that # the commit queue can handle CLs rolling google-toolbox-for-mac # and whatever else without interference from each other. @@ -322,7 +308,7 @@ vars = { # Three lines of non-changing comments so that # the commit queue can handle CLs rolling googletest # and whatever else without interference from each other. - 'googletest_revision': '62df7bdbc10887e094661e07ec2595b7920376fd', + 'googletest_revision': 'd144031940543e15423a25ae5a8a74141044862f', # Three lines of non-changing comments so that # the commit queue can handle CLs rolling lighttpd # and whatever else without interference from each other. @@ -338,7 +324,7 @@ vars = { # Three lines of non-changing comments so that # the commit queue can handle CLs rolling freetype # and whatever else without interference from each other. - 'freetype_revision': 'f02bffad0fd57f3acfa835c3f2899c5b71ff8be0', + 'freetype_revision': '0ae7e607370cc66218ccfacf5de4db8a35424c2f', # Three lines of non-changing comments so that # the commit queue can handle CLs rolling freetype # and whatever else without interference from each other. @@ -358,19 +344,19 @@ vars = { # Three lines of non-changing comments so that # the commit queue can handle CLs rolling catapult # and whatever else without interference from each other. - 'catapult_revision': '44791916611acec1cd74c492c7453e46d9b0dbd2', + 'catapult_revision': 'b91cf840ac3255ef03b23cc93621369627422a1a', # Three lines of non-changing comments so that # the commit queue can handle CLs rolling chromium_variations # and whatever else without interference from each other. - 'chromium_variations_revision': '7d681838b57a25ca6659b9cc0111f879147c416b', + 'chromium_variations_revision': 'c170abb48f7715c237f4c06eaed0fe6f8a4c6f8d', # Three lines of non-changing comments so that # the commit queue can handle CLs rolling CrossBench # and whatever else without interference from each other. - 'crossbench_revision': 'b4d7ae714c548c3e139b95a85582dc15ece1d2f7', + 'crossbench_revision': 'ae6f165652e0ea983d73f5d04b7470d08c869e4f', # Three lines of non-changing comments so that # the commit queue can handle CLs rolling libFuzzer # and whatever else without interference from each other. - 'libfuzzer_revision': '487e79376394754705984c5de7c4ce7f82f2bd7c', + 'libfuzzer_revision': 'a7128317fe7935a43d6c9f39df54f21113951941', # Three lines of non-changing comments so that # the commit queue can handle CLs rolling fuzztest # and whatever else without interference from each other. @@ -382,7 +368,7 @@ vars = { # Three lines of non-changing comments so that # the commit queue can handle CLs rolling devtools-frontend # and whatever else without interference from each other. - 'devtools_frontend_revision': '5284f1c63b2b08c47b8915ce713a1aace991dfe9', + 'devtools_frontend_revision': 'f2f3682c9db8ca427f8c64f0402cc2c5152c6c24', # Three lines of non-changing comments so that # the commit queue can handle CLs rolling libprotobuf-mutator # and whatever else without interference from each other. @@ -406,11 +392,11 @@ vars = { # Three lines of non-changing comments so that # the commit queue can handle CLs rolling feed # and whatever else without interference from each other. - 'dawn_revision': '7e742cac42c29a14ab7f54b134b2f17592711267', + 'dawn_revision': '73dbf565079c89a531e6e01c4e8fc048a8a9660b', # Three lines of non-changing comments so that # the commit queue can handle CLs rolling feed # and whatever else without interference from each other. - 'quiche_revision': 'e0175250977c2b2b95087afc0857883538a1386c', + 'quiche_revision': '9616efc903b7469161996006c8cf963238e26503', # Three lines of non-changing comments so that # the commit queue can handle CLs rolling ink # and whatever else without interference from each other. @@ -434,15 +420,11 @@ vars = { # Three lines of non-changing comments so that # the commit queue can handle CLs rolling libavif # and whatever else without interference from each other. - 'libavif_revision': '2c36aed375fff68611641b57d919b191f33431d5', + 'libavif_revision': '1cdeff7ecf456492c47cf48fc0cef6591cdc95da', # Three lines of non-changing comments so that # the commit queue can handle CLs rolling crabbyavif # and whatever else without interference from each other. - 'crabbyavif_revision': 'ffad64ff4e349f926ad5ffcc882e205a94156d77', - # Three lines of non-changing comments so that - # the commit queue can handle CLs rolling libavifinfo - # and whatever else without interference from each other. - 'libavifinfo_revision': '8d8b58a3f517ef8d1794baa28ca6ae7d19f65514', + 'crabbyavif_revision': 'c3548280e0a516ed7cad7ff1591b5807cef64aa4', # Three lines of non-changing comments so that # the commit queue can handle CLs rolling Speedometer v3.0 # and whatever else without interference from each other. @@ -450,7 +432,7 @@ vars = { # Three lines of non-changing comments so that # the commit queue can handle CLs rolling nearby # and whatever else without interference from each other. - 'nearby_revision': '1b382075dd1bd545655af7ebef949b3090061b74', + 'nearby_revision': '8e87a6e51c93e7836ecdbcc0a520c7992f3ece13', # Three lines of non-changing comments so that # the commit queue can handle CLs rolling securemessage # and whatever else without interference from each other. @@ -462,7 +444,7 @@ vars = { # Three lines of non-changing comments so that # the commit queue can handle CLs rolling feed # and whatever else without interference from each other. - 'cros_components_revision': '902e8ca804ae6c05f505e510c16647c32ce4d1cb', + 'cros_components_revision': '9129cf4b2a5ca775c280243257a0b4856a93c7fb', # Three lines of non-changing comments so that # the commit queue can handle CLs rolling feed # and whatever else without interference from each other. @@ -470,11 +452,11 @@ vars = { # Three lines of non-changing comments so that # the commit queue can handle CLs rolling feed # and whatever else without interference from each other. - 'libcxxabi_revision': '9a1d90c3b412d5ebeb97a6e33d98e1d0dd923221', + 'libcxxabi_revision': 'cec7f478354a8c8599f264ed8bb6043b5468f72d', # Three lines of non-changing comments so that # the commit queue can handle CLs rolling feed # and whatever else without interference from each other. - 'libunwind_revision': 'efc3baa2d1ece3630fcfa72bef93ed831bcaec4c', + 'libunwind_revision': '5b01ea4a6f3b666b7d190e7cb7c31db2ed4d94ce', # Three lines of non-changing comments so that # the commit queue can handle CLs rolling feed # and whatever else without interference from each other. @@ -482,22 +464,26 @@ vars = { # Three lines of non-changing comments so that # the commit queue can handle CLs rolling feed # and whatever else without interference from each other. - 'highway_revision': '8295336dd70f1201d42c22ab5b0861de38cf8fbf', + 'highway_revision': '00fe003dac355b979f36157f9407c7c46448958e', # Three lines of non-changing comments so that # the commit queue can handle CLs rolling ffmpeg # and whatever else without interference from each other. - 'ffmpeg_revision': '686d6944501a6ee9c849581e3fe343273d4af3f6', + 'ffmpeg_revision': '591ae4b02eaff9a03e2ec863da895128b0b49910', # Three lines of non-changing comments so that # the commit queue can handle CLs rolling beto-core # and whatever else without interference from each other. 'betocore_revision': '89563fec14c756482afa08b016eeba9087c8d1e3', + # Three lines of non-changing comments so that + # the commit queue can handle CLs rolling llvm-libc + # and whatever else without interference from each other. + 'llvm_libc_revision': 'ca74a72e2b32ad804522bbef04dfe32560a10206', # If you change this, also update the libc++ revision in # //buildtools/deps_revisions.gni. - 'libcxx_revision': '6a68fd412b9aecd515a20a7cf84d11b598bfaf96', + 'libcxx_revision': '8e31ad42561900383e10dbefc1d3e8f38cedfbe9', # GN CIPD package version. - 'gn_version': 'git_revision:95b0f8fe31a992a33c040bbe3867901335c12762', + 'gn_version': 'git_revision:feafd1012a32c05ec6095f69ddc3850afb621f3a', # ninja CIPD package. 'ninja_package': 'infra/3pp/tools/ninja/', @@ -538,6 +524,7 @@ allowed_hosts = [ 'chromium-ads-detection', 'chromium-browser-clang', 'chromium-clang-format', + 'chromium-doclava', 'chromium-nodejs', 'chrome-linux-sysroot', 'chromium-fonts', @@ -700,7 +687,7 @@ deps = { 'packages': [ { 'package': 'chrome_internal/third_party/google3/data_sharing_sdk', - 'version': 'WKt0eYdlCX5cNrxYptYakgWX2IbnYf8bg5GKH-Z0eGoC', + 'version': 'HAQZ7vmCc21oA10rsyKWcwSpXIxctI1_Ids7jIaMvZoC', }, ], 'condition': 'checkout_src_internal and non_git_source', @@ -716,10 +703,10 @@ deps = { 'bucket': 'chromium-nodejs', 'objects': [ { - 'object_name': '20.11.0/f9a337cfa0e2b92d3e5c671c26b454bd8e99769e', - 'sha256sum': '0ba9cc91698c1f833a1fdc1fe0cb392d825ad484c71b0d84388ac80bfd3d6079', - 'size_bytes': 43716484, - 'generation': 1711567575687220, + 'object_name': 'fa98c6432de572206bc5519f85e9c96bd518b039', + 'sha256sum': 'fb563633b5bfe2d4307075c54c6bb54664a3b5ec6bc811f5b15742720549007a', + 'size_bytes': 50288755, + 'generation': 1730835522207929, 'output_file': 'node-linux-x64.tar.gz', }, ], @@ -734,10 +721,10 @@ deps = { 'bucket': 'chromium-nodejs', 'objects': [ { - 'object_name': '20.11.0/e3c0fd53caae857309815f3f8de7c2dce49d7bca', - 'sha256sum': '20affacca2480c368b75a1d91ec1a2720604b325207ef0cf39cfef3c235dad19', - 'size_bytes': 40649378, - 'generation': 1711567481181885, + 'object_name': '4c8952a65a1ce7a2e4cff6db68f9b7454c46349f', + 'sha256sum': 'fadb4530fbe6e35ed298848c66102a0aa7d92974789e6222c4eadee26a381e7e', + 'size_bytes': 45672893, + 'generation': 1730835514382259, 'output_file': 'node-darwin-x64.tar.gz', }, ], @@ -748,10 +735,10 @@ deps = { 'bucket': 'chromium-nodejs', 'objects': [ { - 'object_name': '20.11.0/5b5681e12a21cda986410f69e03e6220a21dd4d2', - 'sha256sum': 'cecb99fbb369a9090dddc27e228b66335cd72555b44fa8839ef78e56c51682c5', - 'size_bytes': 38989321, - 'generation': 1711567557161126, + 'object_name': '0886aa6a146cb5c213cb09b59ed1075982e4cb57', + 'sha256sum': 'd39e2d44d58bb89740b9aca1073959fc92edbdbbe810a5e48448e331cf72c196', + 'size_bytes': 44929037, + 'generation': 1730835518292126, 'output_file': 'node-darwin-arm64.tar.gz', }, ], @@ -762,10 +749,10 @@ deps = { 'bucket': 'chromium-nodejs', 'objects': [ { - 'object_name': '20.11.0/2cb36010af52bc5e2a2d1e3675c10361c80d8f8d', - 'sha256sum': '5da5e201155bb3ea99134b404180adebcfa696b0dbc09571d01a09ca5489f53e', - 'size_bytes': 70017688, - 'generation': 1705443750949255, + 'object_name': '907d7e104e7389dc74cec7d32527c1db704b7f96', + 'sha256sum': '7447c4ece014aa41fb2ff866c993c708e5a8213a00913cc2ac5049ea3ffc230d', + 'size_bytes': 80511640, + 'generation': 1730835526374028, 'output_file': 'node.exe', }, ], @@ -777,10 +764,10 @@ deps = { 'condition': 'non_git_source', 'objects': [ { - 'object_name': '2f09ef382b6bc57db929ed7632af0ef86f7e036f', - 'sha256sum': '18b562b809c58b4779073813dce96d858d055ddc9adbe0a78dbd7f2f1310bbb6', - 'size_bytes': 8855233, - 'generation': 1726873853609712, + 'object_name': '8eb0a40003464becccc4da796843e35116d0aa2e', + 'sha256sum': 'cb5af9a19b3ec0a01717022bbaa3bd0974f21e18db5397c097af4a54c198080e', + 'size_bytes': 8877615, + 'generation': 1729559018744319, 'output_file': 'node_modules.tar.gz', }, ], @@ -791,143 +778,144 @@ deps = { 'condition': 'not llvm_force_head_revision', 'objects': [ { - 'object_name': 'Linux_x64/clang-llvmorg-20-init-6794-g3dbd929e-1.tar.xz', - 'sha256sum': 'ce5dea9d2f304d0f3ab07200cd2608711578f7254bf6e685bea8381c248b7686', - 'size_bytes': 53062808, - 'generation': 1727210784923499, - 'condition': 'host_os == "linux" and non_git_source', + # The Android libclang_rt.builtins libraries are currently only included in the Linux clang package. + 'object_name': 'Linux_x64/clang-llvmorg-20-init-9764-gb81d8e90-6.tar.xz', + 'sha256sum': '10fbc53c0730a50e2117b3414a45784667d6cf7d91a3bcaab2b3a78ede08c5d2', + 'size_bytes': 54119960, + 'generation': 1730990401272305, + 'condition': '(host_os == "linux" or checkout_android) and non_git_source', }, { - 'object_name': 'Linux_x64/clang-tidy-llvmorg-20-init-6794-g3dbd929e-1.tar.xz', - 'sha256sum': 'b4871c1dff4dcac751137aef9d7b1d347a38219a88c0cdaf1d6410e1dc8ee1f6', - 'size_bytes': 13269220, - 'generation': 1727210785016810, + 'object_name': 'Linux_x64/clang-tidy-llvmorg-20-init-9764-gb81d8e90-6.tar.xz', + 'sha256sum': 'b53177355aae0a5f8bf0cf230d8d783d7eb1dc32fb525175aa64ebe93a697d59', + 'size_bytes': 13409228, + 'generation': 1730990401560844, 'condition': 'host_os == "linux" and checkout_clang_tidy and non_git_source', }, { - 'object_name': 'Linux_x64/clangd-llvmorg-20-init-6794-g3dbd929e-1.tar.xz', - 'sha256sum': 'd653720d185f1cc09b28e166154a2081c5c4ca9ef0b1bd55abea70435d4e0b79', - 'size_bytes': 26414648, - 'generation': 1727210785028584, + 'object_name': 'Linux_x64/clangd-llvmorg-20-init-9764-gb81d8e90-6.tar.xz', + 'sha256sum': 'ea60c8ed153b175d60973203d4efd8e03627d5eee3f567dd61dcc66cb76af152', + 'size_bytes': 27940520, + 'generation': 1730990401938247, 'condition': 'host_os == "linux" and checkout_clangd and non_git_source', }, { - 'object_name': 'Linux_x64/llvm-code-coverage-llvmorg-20-init-6794-g3dbd929e-1.tar.xz', - 'sha256sum': '81e69a99a9afc556b20f72abb362dcc25667b6c4ff69cc32c85f7d4b0a3214e9', - 'size_bytes': 2384828, - 'generation': 1727210785256702, + 'object_name': 'Linux_x64/llvm-code-coverage-llvmorg-20-init-9764-gb81d8e90-6.tar.xz', + 'sha256sum': 'aab41caead88fbbec57a352e5ad540ebdd54eda869ea632cadc01882454df23b', + 'size_bytes': 2385012, + 'generation': 1730990403020118, 'condition': 'host_os == "linux" and checkout_clang_coverage_tools and non_git_source', }, { - 'object_name': 'Linux_x64/llvmobjdump-llvmorg-20-init-6794-g3dbd929e-1.tar.xz', - 'sha256sum': 'e862ecc3d0f7565b2a2ad011d9d82f898ba73bca3fb1ab0220808fddb42e7fb3', - 'size_bytes': 5439216, - 'generation': 1727210785089177, + 'object_name': 'Linux_x64/llvmobjdump-llvmorg-20-init-9764-gb81d8e90-6.tar.xz', + 'sha256sum': '16d08de19205ebd84e8fe5850132e29eb89c25ccd6ecd6cdf18ff0d6d5756047', + 'size_bytes': 5471316, + 'generation': 1730990402077586, 'condition': '(checkout_linux or checkout_mac or checkout_android and host_os != "mac") and non_git_source', }, { - 'object_name': 'Mac/clang-llvmorg-20-init-6794-g3dbd929e-1.tar.xz', - 'sha256sum': 'bd4b8d0f81944447e986ec6ff8a6a1ff9060a96ca19862e1bb0d4a802e081a03', - 'size_bytes': 47784656, - 'generation': 1727210786563334, + 'object_name': 'Mac/clang-llvmorg-20-init-9764-gb81d8e90-6.tar.xz', + 'sha256sum': 'cfc0c381a64b2770e1f3fe934dc08927b78cbe8204c4b145c175e1ac47a79b3f', + 'size_bytes': 48586148, + 'generation': 1730990404989096, 'condition': 'host_os == "mac" and host_cpu == "x64"', }, { - 'object_name': 'Mac/clang-mac-runtime-library-llvmorg-20-init-6794-g3dbd929e-1.tar.xz', - 'sha256sum': '1cbb7207792c7ee1084271a5763934e977b0a29ea2b4a19796f94483bff5f733', - 'size_bytes': 872916, - 'generation': 1727210793727116, + 'object_name': 'Mac/clang-mac-runtime-library-llvmorg-20-init-9764-gb81d8e90-6.tar.xz', + 'sha256sum': '994d94a647c818d28f9551d46e39637b4a9f9e72ae0f3d98f75db949decfc811', + 'size_bytes': 973888, + 'generation': 1730990424944699, 'condition': 'checkout_mac and not host_os == "mac"', }, { - 'object_name': 'Mac/clang-tidy-llvmorg-20-init-6794-g3dbd929e-1.tar.xz', - 'sha256sum': 'fc85b527355c4e8c131bfdd7042d899be178ffb47f7135cae9bb1a0b7a5e5776', - 'size_bytes': 12860844, - 'generation': 1727210786693842, + 'object_name': 'Mac/clang-tidy-llvmorg-20-init-9764-gb81d8e90-6.tar.xz', + 'sha256sum': 'e3e779988cfbc9443fe050a31f92f0b2bfc8b855a8fa0d50b39bda520214323f', + 'size_bytes': 12989428, + 'generation': 1730990405580532, 'condition': 'host_os == "mac" and host_cpu == "x64" and checkout_clang_tidy', }, { - 'object_name': 'Mac/clangd-llvmorg-20-init-6794-g3dbd929e-1.tar.xz', - 'sha256sum': 'a959d8f6b079728e81bd42c1902484b95d04d535a11545224f0e3666774b85a1', - 'size_bytes': 26572952, - 'generation': 1727210786771072, + 'object_name': 'Mac/clangd-llvmorg-20-init-9764-gb81d8e90-6.tar.xz', + 'sha256sum': 'fb3652a79650eb196f7229e8420d8482934db18ad899322a59d9532a967ba8f0', + 'size_bytes': 26917008, + 'generation': 1730990405502536, 'condition': 'host_os == "mac" and host_cpu == "x64" and checkout_clangd', }, { - 'object_name': 'Mac/llvm-code-coverage-llvmorg-20-init-6794-g3dbd929e-1.tar.xz', - 'sha256sum': '597edfeea109329f480aaa6f9465f3276db04b28109b7ceee56b26f4b0701b4a', - 'size_bytes': 2250932, - 'generation': 1727210787007276, + 'object_name': 'Mac/llvm-code-coverage-llvmorg-20-init-9764-gb81d8e90-6.tar.xz', + 'sha256sum': '366c73a45297d36c015eb046232cecd6bbbb8fe8a460761ea4a488427c934846', + 'size_bytes': 2252492, + 'generation': 1730990406483704, 'condition': 'host_os == "mac" and host_cpu == "x64" and checkout_clang_coverage_tools', }, { - 'object_name': 'Mac_arm64/clang-llvmorg-20-init-6794-g3dbd929e-1.tar.xz', - 'sha256sum': 'cc44b1d94c6573d3c3e689340d15cea7cdca8b686d598c06e327e5b39a8dbad8', - 'size_bytes': 41674272, - 'generation': 1727210795065382, + 'object_name': 'Mac_arm64/clang-llvmorg-20-init-9764-gb81d8e90-6.tar.xz', + 'sha256sum': '07ea023580ba850f1cfde29018c6094f19fa2f876949afdd9b7ceacd02614315', + 'size_bytes': 42643072, + 'generation': 1730990426320272, 'condition': 'host_os == "mac" and host_cpu == "arm64"', }, { - 'object_name': 'Mac_arm64/clang-tidy-llvmorg-20-init-6794-g3dbd929e-1.tar.xz', - 'sha256sum': '44e5e508028a5443401af13cf9857e3114fb5c1167464e18c713f8a7490faed3', - 'size_bytes': 11432628, - 'generation': 1727210795243186, + 'object_name': 'Mac_arm64/clang-tidy-llvmorg-20-init-9764-gb81d8e90-6.tar.xz', + 'sha256sum': '2ba853495a456c137a03615bc90c1dc13378a083cd245c752e5cdb32cc5d710b', + 'size_bytes': 11551140, + 'generation': 1730990427298192, 'condition': 'host_os == "mac" and host_cpu == "arm64" and checkout_clang_tidy', }, { - 'object_name': 'Mac_arm64/clangd-llvmorg-20-init-6794-g3dbd929e-1.tar.xz', - 'sha256sum': 'e988f29e06c24c93426641ee0806658e5b585b8f6ecdb80fbb025c7af8ded554', - 'size_bytes': 22660096, - 'generation': 1727210795321962, + 'object_name': 'Mac_arm64/clangd-llvmorg-20-init-9764-gb81d8e90-6.tar.xz', + 'sha256sum': '8bd0290834025283494137c71f21cc53e5180a0fe5526ce5fc1def6b71adf56d', + 'size_bytes': 22996480, + 'generation': 1730990427104379, 'condition': 'host_os == "mac" and host_cpu == "arm64" and checkout_clangd', }, { - 'object_name': 'Mac_arm64/llvm-code-coverage-llvmorg-20-init-6794-g3dbd929e-1.tar.xz', - 'sha256sum': '6404b9b282b667d2d4bc2284f5a76983513cb04bc81d0ff1f5e4dd3f74596472', - 'size_bytes': 1979184, - 'generation': 1727210795493077, + 'object_name': 'Mac_arm64/llvm-code-coverage-llvmorg-20-init-9764-gb81d8e90-6.tar.xz', + 'sha256sum': '009bf6dca60483ceef0f5b267bab206e71f70150f595dee378704ac1bab15810', + 'size_bytes': 1978164, + 'generation': 1730990428146704, 'condition': 'host_os == "mac" and host_cpu == "arm64" and checkout_clang_coverage_tools', }, { - 'object_name': 'Win/clang-llvmorg-20-init-6794-g3dbd929e-1.tar.xz', - 'sha256sum': '765213470ee5a5dccdf9c7522126cbc3442e141a3eca428ec833b059117f1089', - 'size_bytes': 44495472, - 'generation': 1727210804341709, + 'object_name': 'Win/clang-llvmorg-20-init-9764-gb81d8e90-6.tar.xz', + 'sha256sum': '307a92baa82c49a97fa342e836c7d99c461757e3c4992e525ec11946e7e0c273', + 'size_bytes': 45504620, + 'generation': 1730990452347678, 'condition': 'host_os == "win"', }, { - 'object_name': 'Win/clang-tidy-llvmorg-20-init-6794-g3dbd929e-1.tar.xz', - 'sha256sum': '28b9ec3f2b2b14282066f3f90216358f50acc1df8f32303f120acbccc9906443', - 'size_bytes': 13058060, - 'generation': 1727210804551567, + 'object_name': 'Win/clang-tidy-llvmorg-20-init-9764-gb81d8e90-6.tar.xz', + 'sha256sum': 'e38e29eb61f0907e43dd9e4b13f7b624e88577deadbe783d0b6f5ba0fe73470f', + 'size_bytes': 13198876, + 'generation': 1730990452638793, 'condition': 'host_os == "win" and checkout_clang_tidy', }, { - 'object_name': 'Win/clang-win-runtime-library-llvmorg-20-init-6794-g3dbd929e-1.tar.xz', - 'sha256sum': '2e793af2c890e2ab25ea60892d4410453be85f0d29c4885be2f759f205a412ff', - 'size_bytes': 2459532, - 'generation': 1727210811854279, + 'object_name': 'Win/clang-win-runtime-library-llvmorg-20-init-9764-gb81d8e90-6.tar.xz', + 'sha256sum': '7dada03189cd68e993f32d2f44ba60308c21d5aaff841072fb023f569f62981e', + 'size_bytes': 2481484, + 'generation': 1730990473380663, 'condition': 'checkout_win and not host_os == "win"', }, { - 'object_name': 'Win/clangd-llvmorg-20-init-6794-g3dbd929e-1.tar.xz', - 'sha256sum': '1eacff582a70419b14e4bc4ec5149e2d0db9a4fdb1a8754e82f2ac5dc33bbfee', - 'size_bytes': 25173604, - 'generation': 1727210804651089, + 'object_name': 'Win/clangd-llvmorg-20-init-9764-gb81d8e90-6.tar.xz', + 'sha256sum': '35d002034b9758bb22a81d68b29ef1fc8584bb8c80d8f8161daf811dd88af8c0', + 'size_bytes': 25507672, + 'generation': 1730990452771999, 'condition': 'host_os == "win" and checkout_clangd', }, { - 'object_name': 'Win/llvm-code-coverage-llvmorg-20-init-6794-g3dbd929e-1.tar.xz', - 'sha256sum': '225a2febc17880c6d54087a8d58fc171490156400f6606c7184b6fe42f032601', - 'size_bytes': 2391284, - 'generation': 1727210804861506, + 'object_name': 'Win/llvm-code-coverage-llvmorg-20-init-9764-gb81d8e90-6.tar.xz', + 'sha256sum': 'cec41d8e54630d4b4cc27c231af57f334c9149c0faeaf1f74bb4f258f47aee4d', + 'size_bytes': 2394780, + 'generation': 1730990453517854, 'condition': 'host_os == "win" and checkout_clang_coverage_tools', }, { - 'object_name': 'Win/llvmobjdump-llvmorg-20-init-6794-g3dbd929e-1.tar.xz', - 'sha256sum': 'dadc84a115c6a97254ab2b765173c6284cbf924ebb19668d70eae2a8e7959e96', - 'size_bytes': 5475784, - 'generation': 1727210804705480, + 'object_name': 'Win/llvmobjdump-llvmorg-20-init-9764-gb81d8e90-6.tar.xz', + 'sha256sum': 'b53acffcb3bf0ef000b8af31ee622c34da647ecec28fbf9777db4d4c31057dfd', + 'size_bytes': 5495104, + 'generation': 1730990453035029, 'condition': 'checkout_linux or checkout_mac or checkout_android and host_os == "win"', }, ] @@ -938,31 +926,31 @@ deps = { 'bucket': 'chromium-browser-clang', 'objects': [ { - 'object_name': 'Linux_x64/rust-toolchain-f5cd2c5888011d4d80311e5b771c6da507d860dd-2-llvmorg-20-init-6794-g3dbd929e.tar.xz', - 'sha256sum': '6487fc26114c84c5682c95dc7640ddaed9986f8ec7bd757481c1f682c1be0bf5', - 'size_bytes': 122848984, - 'generation': 1728580687453535, + 'object_name': 'Linux_x64/rust-toolchain-bca5fdebe0e539d123f33df5f2149d5976392e76-1-llvmorg-20-init-9764-gb81d8e90.tar.xz', + 'sha256sum': '0c4092f5769c5ececd096732b00f2c5c4e1741d4112881a2c83fe7e78271d792', + 'size_bytes': 122758604, + 'generation': 1729629177370195, 'condition': 'host_os == "linux" and non_git_source', }, { - 'object_name': 'Mac/rust-toolchain-f5cd2c5888011d4d80311e5b771c6da507d860dd-2-llvmorg-20-init-6794-g3dbd929e.tar.xz', - 'sha256sum': 'bc0dc3df6eded817d2287156c24fa49ccaad7459ca189e7e790a38c1aa64ab04', - 'size_bytes': 116147028, - 'generation': 1728580688787473, + 'object_name': 'Mac/rust-toolchain-bca5fdebe0e539d123f33df5f2149d5976392e76-1-llvmorg-20-init-9764-gb81d8e90.tar.xz', + 'sha256sum': '41c0265504ce0ace325f87e7db24329170fcc88d3931ff76e61126db46f2b5e1', + 'size_bytes': 115814060, + 'generation': 1729629179200874, 'condition': 'host_os == "mac" and host_cpu == "x64"', }, { - 'object_name': 'Mac_arm64/rust-toolchain-f5cd2c5888011d4d80311e5b771c6da507d860dd-2-llvmorg-20-init-6794-g3dbd929e.tar.xz', - 'sha256sum': '373e6dc1a99f07256deb1e03277713f79fd6e17e3e2b7a90fda1dff7eee39436', - 'size_bytes': 102761692, - 'generation': 1728580690192607, + 'object_name': 'Mac_arm64/rust-toolchain-bca5fdebe0e539d123f33df5f2149d5976392e76-1-llvmorg-20-init-9764-gb81d8e90.tar.xz', + 'sha256sum': '4c264b2fcc4a4bb7d908cf7838c70878cbcfa6dabec5b5b97a5fcfdab8658eb6', + 'size_bytes': 104504052, + 'generation': 1729629180998449, 'condition': 'host_os == "mac" and host_cpu == "arm64"', }, { - 'object_name': 'Win/rust-toolchain-f5cd2c5888011d4d80311e5b771c6da507d860dd-2-llvmorg-20-init-6794-g3dbd929e.tar.xz', - 'sha256sum': '43a111f3506b100cf909cfe0966f0c3fd5893a1995fc2800fccddb50b9d8a977', - 'size_bytes': 177928212, - 'generation': 1728580691519781, + 'object_name': 'Win/rust-toolchain-bca5fdebe0e539d123f33df5f2149d5976392e76-1-llvmorg-20-init-9764-gb81d8e90.tar.xz', + 'sha256sum': 'afade008b0eea5d8d30e19ceef22e9f9c4fe9b4cdcb9c61926665ec1658379cc', + 'size_bytes': 181085496, + 'generation': 1729629182819402, 'condition': 'host_os == "win"', }, ], @@ -1092,7 +1080,7 @@ deps = { }, 'src/chrome/browser/resources/preinstalled_web_apps/internal': { - 'url': Var('chrome_git') + '/chrome/components/default_apps.git' + '@' + '50762f173e27bc75555cc6aab7fd324cb30613a9', + 'url': Var('chrome_git') + '/chrome/components/default_apps.git' + '@' + 'ef722130bdfed458eb5380f10585b880ae5dff4e', 'condition': 'checkout_src_internal', }, @@ -1113,6 +1101,10 @@ deps = { Var('chromium_git') + '/external/github.com/llvm/llvm-project/libunwind.git' + '@' + Var('libunwind_revision'), + 'src/third_party/llvm-libc/src': + Var('chromium_git') + + '/external/github.com/llvm/llvm-project/libc.git' + '@' + + Var('llvm_libc_revision'), 'src/third_party/updater/chrome_linux64/cipd': { 'dep_type': 'cipd', @@ -1159,13 +1151,14 @@ deps = { ], }, + # version:2@131.0.6776.0 'src/third_party/updater/chrome_win_x86/cipd': { 'dep_type': 'cipd', 'condition': 'checkout_win', 'packages': [ { 'package': 'chromium/third_party/updater/chrome_win_x86', - 'version': 'BxagiWo5rzVep9rPqGaQqt1e_-MBhGaSCYgBrI_aQisC', + 'version': 'ZunaL0ySQ0b5WQqOPpKgTt3D0dAq2gE58WYhUeFllwMC', }, ], }, @@ -1216,46 +1209,49 @@ deps = { ], }, + # r1372006 'src/third_party/updater/chromium_win_arm64/cipd': { 'dep_type': 'cipd', 'condition': 'checkout_win', 'packages': [ { 'package': 'chromium/third_party/updater/chromium_win_arm64', - 'version': 'qm05-lSjvBHQOtnBXxv3SB4y-hxAOOURxyr8CXPvcfAC', + 'version': 'ksRzLnqewvz7P-YMX2e8mxZuDI1hgPtLNCuAXIisXhoC', }, ], }, + # r1372046 'src/third_party/updater/chromium_win_x86/cipd': { 'dep_type': 'cipd', 'condition': 'checkout_win', 'packages': [ { 'package': 'chromium/third_party/updater/chromium_win_x86', - 'version': '73PhAHTSsxwv6MlxgS7f2ZVOIeWabI66t1XuyGAq7k0C', + 'version': 'tcFWGGE3wmwKDhT_s-9mzPiQVYxMOI1U9sRAhm1_5QcC', }, ], }, + # r1372030 'src/third_party/updater/chromium_win_x86_64/cipd': { 'dep_type': 'cipd', 'condition': 'checkout_win', 'packages': [ { 'package': 'chromium/third_party/updater/chromium_win_x86_64', - 'version': 'MKwo9kpC2PHV2xIqkHameH_ha9QZ85MA1imi0wG1_8kC', + 'version': 'iXamEEmbStVBV_c-vEG4Xtrda8tTqSRCZ-tmE7VRHb0C', }, ], }, 'src/chrome/test/data/autofill/captured_sites/artifacts': { - 'url': Var('chrome_git') + '/chrome/test/captured_sites/autofill.git' + '@' + '27373ac4a9460f1864d1a142fca7f64efb23aa4f', + 'url': Var('chrome_git') + '/chrome/test/captured_sites/autofill.git' + '@' + 'f03bf2c01ce906c9e55bb339748fcc9aee9e3569', 'condition': 'checkout_chromium_autofill_test_dependencies', }, 'src/chrome/test/data/password/captured_sites/artifacts': { - 'url': Var('chrome_git') + '/chrome/test/captured_sites/password.git' + '@' + '89486886cbaf6319774585998566766a803037eb', + 'url': Var('chrome_git') + '/chrome/test/captured_sites/password.git' + '@' + '878100ee5ceacb182f148d68d4c8fb4c71099a90', 'condition': 'checkout_chromium_password_manager_test_dependencies', }, @@ -1281,21 +1277,21 @@ deps = { 'src/clank': { 'url': Var('chrome_git') + '/clank/internal/apps.git' + '@' + - '5e8fd8cbd84b124fd75aa3d3e0b8e7a4a87d336d', + 'af8bfbeaee8aeade4278f866b6a26073f4896f05', 'condition': 'checkout_android and checkout_src_internal', }, 'src/docs/website': { - 'url': Var('chromium_git') + '/website.git' + '@' + '4811f9e01c4cfcbf9c6957015063eaaa0d92be91', + 'url': Var('chromium_git') + '/website.git' + '@' + 'be9c3dfd3781964fc0bab0d6c91d9ad117b71b02', }, 'src/ios/third_party/earl_grey2/src': { - 'url': Var('chromium_git') + '/external/github.com/google/EarlGrey.git' + '@' + '8504ed1f0137efe021f1dab0ae8197bad54dbdbf', + 'url': Var('chromium_git') + '/external/github.com/google/EarlGrey.git' + '@' + '65067e3585d853f637cea4b8eb90ccc52c80c813', 'condition': 'checkout_ios', }, 'src/ios/third_party/edo/src': { - 'url': Var('chromium_git') + '/external/github.com/google/eDistantObject.git' + '@' + '8b0be005394ae1cd3635ed061c10b3206b4715de', + 'url': Var('chromium_git') + '/external/github.com/google/eDistantObject.git' + '@' + '8c825efc8ba6ca9147a148445449470a66b9dc54', 'condition': 'checkout_ios', }, @@ -1310,7 +1306,7 @@ deps = { }, 'src/ios/third_party/material_components_ios/src': { - 'url': Var('chromium_git') + '/external/github.com/material-components/material-components-ios.git' + '@' + '55edb9a9edebff7e832169233bf0d271833ecb16', + 'url': Var('chromium_git') + '/external/github.com/material-components/material-components-ios.git' + '@' + 'c4743a1951d448f2fcf67ea3b657fe4e0864e843', 'condition': 'checkout_ios', }, @@ -1377,7 +1373,7 @@ deps = { Var('quiche_git') + '/quiche.git' + '@' + Var('quiche_revision'), 'src/testing/libfuzzer/fuzzers/wasm_corpus': - Var('chromium_git') + '/v8/fuzzer_wasm_corpus.git' + '@' + 'f650ff816f2ef227f61ea2e9f222aa69708ab367', + Var('chromium_git') + '/v8/fuzzer_wasm_corpus.git' + '@' + '1df5e50a45db9518a56ebb42cb020a94a090258b', 'src/tools/copybara': { 'packages' : [ @@ -1435,7 +1431,7 @@ deps = { 'packages': [ { 'package': 'chromium/third_party/androidx', - 'version': 'k1wif7sS51pJGSFGN7FAeGWDorxgPart9E1f383TQL4C', + 'version': 'DNRcaJmAiSz4higrR9ExVm53a6g6FTonwmzgouFWloMC', }, ], 'condition': 'checkout_android and non_git_source', @@ -1443,7 +1439,7 @@ deps = { }, 'src/third_party/androidx_javascriptengine/src': { - 'url': Var('chromium_git') + '/aosp/platform/frameworks/support/javascriptengine/javascriptengine/src.git' + '@' + 'dd087a8dd0d118a819092356cf2cd671c56013aa', + 'url': Var('chromium_git') + '/aosp/platform/frameworks/support/javascriptengine/javascriptengine/src.git' + '@' + 'e3b6fc680728040f97442dc29d978ce5df6e76f4', 'condition': 'checkout_android', }, @@ -1484,7 +1480,7 @@ deps = { 'packages': [ { 'package': 'chromium/third_party/android_build_tools/bundletool', - 'version': 'sZ24OFOduSafn8fvR3ajsGS6KP_oS_Tq0Cw3SA8XiD0C', + 'version': 'Q-7KJYcc15Cn9iVy-7bk0tPH9-oUrhqHis6HmUzck80C', }, ], 'condition': 'checkout_android and non_git_source', @@ -1506,7 +1502,7 @@ deps = { 'packages': [ { 'package': 'chromium/third_party/android_build_tools/error_prone', - 'version': 'hUxlP8GvC1xhmZ6r9xjYau2laPlzHbs_P2emx4ZL4jgC', + 'version': 'DBKfaigj6AuTYPdN1_6jkOlQUuJa1szDRIMvHbtZrD8C', }, ], 'condition': 'checkout_android and non_git_source', @@ -1528,7 +1524,7 @@ deps = { 'packages': [ { 'package': 'chromium/third_party/android_build_tools/lint', - 'version': '8os9DzCgPex0dFtZslAlzowMLYeKXFCQHSJMJYTodZsC', + 'version': 'vBoRPSPyoHi8GYvjtidLlKAtqp5a-2CaHgpEZb16dAoC', }, ], 'condition': 'checkout_android and non_git_source', @@ -1539,7 +1535,7 @@ deps = { 'packages': [ { 'package': 'chromium/third_party/android_build_tools/manifest_merger', - 'version': 'rnIeJMlGw7adxOKZofLsm7tdYaOy1nHivJn9ck7ocVkC', + 'version': '1gDDnuAjB1-mlxlnLFAfx4h9f_hG3lEIIbwyYr86i1wC', }, ], 'condition': 'checkout_android and non_git_source', @@ -1654,7 +1650,7 @@ deps = { Var('chromium_git') + '/external/github.com/chromium/content_analysis_sdk.git' + '@' + '9a408736204513e0e95dd2ab3c08de0d95963efc', 'src/third_party/dav1d/libdav1d': - Var('chromium_git') + '/external/github.com/videolan/dav1d.git' + '@' + '389450f61ea0b2057fc9ea393d3065859c4ba7f2', + Var('chromium_git') + '/external/github.com/videolan/dav1d.git' + '@' + '93f12c117a4e1c0cc2b129dcc52e84dbd9b84200', 'src/third_party/dawn': Var('dawn_git') + '/dawn.git' + '@' + Var('dawn_revision'), @@ -1673,7 +1669,7 @@ deps = { }, 'src/third_party/google_benchmark/src': - Var('chromium_git') + '/external/github.com/google/benchmark.git' + '@' + '344117638c8ff7e239044fd0fa7085839fc03021', + Var('chromium_git') + '/external/github.com/google/benchmark.git' + '@' + '761305ec3b33abf30e08d50eb829e19a802581cc', # Download test data for Maps telemetry_gpu_integration_test. 'src/tools/perf/page_sets/maps_perf_test/dataset': { @@ -1695,10 +1691,10 @@ deps = { Var('boringssl_git') + '/boringssl.git' + '@' + Var('boringssl_revision'), 'src/third_party/breakpad/breakpad': - Var('chromium_git') + '/breakpad/breakpad.git' + '@' + '6b0c5b7ee1988a14a4af94564e8ae8bba8a94374', + Var('chromium_git') + '/breakpad/breakpad.git' + '@' + '47f7823bdf4b1f39e462b2a497a674860e922e38', 'src/third_party/cast_core/public/src': - Var('chromium_git') + '/cast_core/public' + '@' + '71f51fd6fa45fac73848f65421081edd723297cd', + Var('chromium_git') + '/cast_core/public' + '@' + 'fbc5e98031e1271a0a566fcd4d9092b2d3275d05', 'src/third_party/catapult': Var('chromium_git') + '/catapult.git' + '@' + Var('catapult_revision'), @@ -1730,7 +1726,7 @@ deps = { # Tools used when building Chrome for Chrome OS. This affects both the Simple # Chrome workflow, as well as the chromeos-chrome ebuild. 'src/third_party/chromite': { - 'url': Var('chromium_git') + '/chromiumos/chromite.git' + '@' + '85f5d16b197e707072fcd33fed323166c546bf94', + 'url': Var('chromium_git') + '/chromiumos/chromite.git' + '@' + 'f843e9572d9816e1193f7ff262263a415d5e0476', 'condition': 'checkout_chromeos', }, @@ -1744,14 +1740,14 @@ deps = { Var('chromium_git') + '/external/github.com/google/cpu_features.git' + '@' + '936b9ab5515dead115606559502e3864958f7f6e', 'src/third_party/cpuinfo/src': - Var('chromium_git') + '/external/github.com/pytorch/cpuinfo.git' + '@' + '1e83a2fdd3102f65c6f1fb602c1b320486218a99', + Var('chromium_git') + '/external/github.com/pytorch/cpuinfo.git' + '@' + '8df44962d437a0477f07ba6b8843d0b6a48646a4', 'src/third_party/crc32c/src': Var('chromium_git') + '/external/github.com/google/crc32c.git' + '@' + 'd3d60ac6e0f16780bcfcc825385e1d338801a558', # For Linux and Chromium OS. 'src/third_party/cros_system_api': { - 'url': Var('chromium_git') + '/chromiumos/platform2/system_api.git' + '@' + 'b08c5ad457bddea2664ba20fb25beb3d1799fed2', + 'url': Var('chromium_git') + '/chromiumos/platform2/system_api.git' + '@' + '554629b9242e6ae832ef14e3384654426f7fcc06', 'condition': 'checkout_linux or checkout_chromeos', }, @@ -1760,13 +1756,13 @@ deps = { 'src/third_party/depot_tools': - Var('chromium_git') + '/chromium/tools/depot_tools.git' + '@' + '20b9bdcace7ed561d6a75728c85373503473cb6b', + Var('chromium_git') + '/chromium/tools/depot_tools.git' + '@' + '41d43a2a2290450aeab946883542f8049b155c87', 'src/third_party/devtools-frontend/src': Var('chromium_git') + '/devtools/devtools-frontend' + '@' + Var('devtools_frontend_revision'), 'src/third_party/devtools-frontend-internal': { - 'url': Var('chrome_git') + '/devtools/devtools-internal.git' + '@' + '6dc6ccb0d196236a524f77894525e7e4eceb4877', + 'url': Var('chrome_git') + '/devtools/devtools-internal.git' + '@' + 'd53b91528791937d253f35cf889720af2c60aa43', 'condition': 'checkout_src_internal', }, @@ -1774,7 +1770,7 @@ deps = { Var('chromium_git') + '/chromium/dom-distiller/dist.git' + '@' + '199de96b345ada7c6e7e6ba3d2fa7a6911b8767d', 'src/third_party/eigen3/src': - Var('chromium_git') + '/external/gitlab.com/libeigen/eigen.git' + '@' + '7eea0a9213e801ad9479a6499fd0330ec1db8693', + Var('chromium_git') + '/external/gitlab.com/libeigen/eigen.git' + '@' + 'b396a6fbb2e173f52edb3360485dedf3389ef830', 'src/third_party/emoji-metadata/src': { 'url': Var('chromium_git') + '/external/github.com/googlefonts/emoji-metadata' + '@' + '045f146fca682a836e01cd265171312bfb300e06', @@ -1940,7 +1936,7 @@ deps = { Var('chromium_git') + '/chromium/deps/hunspell_dictionaries.git' + '@' + '41cdffd71c9948f63c7ad36e1fb0ff519aa7a37e', 'src/third_party/icu': - Var('chromium_git') + '/chromium/deps/icu.git' + '@' + '4239b1559d11d4fa66c100543eda4161e060311e', + Var('chromium_git') + '/chromium/deps/icu.git' + '@' + 'ba7ed88cc5ffa428a82a0f787dd61031aa5ef4ca', 'src/third_party/icu4j/cipd': { 'packages': [ @@ -1973,7 +1969,7 @@ deps = { 'packages': [ { 'package': 'chromium/third_party/jdk', - 'version': 'BXZwbslDFpYhPRuG8hBh2z7ApP36ZG-ZfkBWrkpnPl4C', + 'version': 'U-h0kbYoIUjL__n_sfiudzFLH7-C9vKVsLSOA2XHkBEC', }, ], # Needed on Linux for use on chromium_presubmit (for checkstyle). @@ -2007,7 +2003,7 @@ deps = { 'packages': [ { 'package': 'chromium/third_party/kotlin_stdlib', - 'version': 'XJ7_doI-Qt7GFaSQ9BNo-3qF7Gv2--9Sa8GEUdjxMTUC', + 'version': 'CFXTjDOsl73rwvFkJh_CDI0rdOfcGd0-9L7w4cc8Or8C', }, ], 'condition': 'checkout_android and non_git_source', @@ -2018,7 +2014,7 @@ deps = { 'packages': [ { 'package': 'chromium/third_party/kotlinc', - 'version': 'FNZSCjJ6yKsi6oRcgQrt-lX0MDlaWoxT7gPTz0CjLhMC', + 'version': 'oYVf7iZSwOgNvQfk3t2C29BC8rWmsU7709igdSmoTZQC', }, ], 'condition': 'checkout_android and non_git_source', @@ -2041,7 +2037,7 @@ deps = { Var('chromium_git') + '/external/libaddressinput.git' + '@' + 'e8712e415627f22d0b00ebee8db99547077f39bd', 'src/third_party/libaom/source/libaom': - Var('aomedia_git') + '/aom.git' + '@' + '840f8797871cc587f7113ea9d2483a1156d57c0e', + Var('aomedia_git') + '/aom.git' + '@' + 'be60f06ab420d6a65c477213f04c8b0f2e12ba2e', 'src/third_party/libavif/src': Var('chromium_git') + '/external/github.com/AOMediaCodec/libavif.git' + '@' + Var('libavif_revision'), @@ -2049,9 +2045,6 @@ deps = { 'src/third_party/crabbyavif/src': Var('chromium_git') + '/external/github.com/webmproject/CrabbyAvif.git' + '@' + Var('crabbyavif_revision'), - 'src/third_party/libavifinfo/src': - Var('aomedia_git') + '/libavifinfo.git' + '@' + Var('libavifinfo_revision'), - 'src/third_party/nearby/src': Var('chromium_git') + '/external/github.com/google/nearby-connections.git' + '@' + Var('nearby_revision'), @@ -2105,16 +2098,16 @@ deps = { # Android Explicit Synchronization. 'src/third_party/libsync/src': { 'url': Var('chromium_git') + '/aosp/platform/system/core/libsync.git' + '@' + 'f4f4387b6bf2387efbcfd1453af4892e8982faf6', - 'condition': 'checkout_linux', + 'condition': 'checkout_linux or checkout_android', }, 'src/third_party/libunwindstack': { - 'url': Var('chromium_git') + '/chromium/src/third_party/libunwindstack.git' + '@' + 'a3bb4cd02e0e984a235069f812cbef2b37c389e5', + 'url': Var('chromium_git') + '/chromium/src/third_party/libunwindstack.git' + '@' + '0c3e395835b0f6cb7a77eba94e23e5d8b9659f71', 'condition': 'checkout_android', }, 'src/third_party/libvpx/source/libvpx': - Var('chromium_git') + '/webm/libvpx.git' + '@' + '906334ac1de2b0afa666472dce5545b82c1251fb', + Var('chromium_git') + '/webm/libvpx.git' + '@' + '727319a77ffe68e9aacb08e09ae7151b3a8f70a3', 'src/third_party/libwebm/source': Var('chromium_git') + '/webm/libwebm.git' + '@' + '26d9f667170dc75e8d759a997bb61c64dec42dda', @@ -2123,7 +2116,7 @@ deps = { Var('chromium_git') + '/webm/libwebp.git' + '@' + '845d5476a866141ba35ac133f856fa62f0b7445f', 'src/third_party/libyuv': - Var('chromium_git') + '/libyuv/libyuv.git' + '@' + 'a8e59d207483f75b87dd5fc670e937672cdf5776', + Var('chromium_git') + '/libyuv/libyuv.git' + '@' + '6ac7c8f25170c85265fca69fd1fe5d31baf3344f', 'src/third_party/lighttpd': { 'url': Var('chromium_git') + '/chromium/deps/lighttpd.git' + '@' + Var('lighttpd_revision'), @@ -2232,7 +2225,7 @@ deps = { Var('chromium_git') + '/external/github.com/cisco/openh264' + '@' + '478e5ab3eca30e600006d5a0a08b176fd34d3bd1', 'src/third_party/openscreen/src': - Var('chromium_git') + '/openscreen' + '@' + '4f27c4f1698522dfcea36dca948a13e2eaf4c26c', + Var('chromium_git') + '/openscreen' + '@' + 'cb6fd42532fc3a831d6863d5006217e32a67c417', 'src/third_party/openxr/src': { 'url': Var('chromium_git') + '/external/github.com/KhronosGroup/OpenXR-SDK' + '@' + '288d3a7ebc1ad959f62d51da75baa3d27438c499', @@ -2258,7 +2251,7 @@ deps = { Var('pdfium_git') + '/pdfium.git' + '@' + Var('pdfium_revision'), 'src/third_party/perfetto': - Var('android_git') + '/platform/external/perfetto.git' + '@' + '24764a1d9c2fce1e9816ffae691f00353ade330d', + Var('android_git') + '/platform/external/perfetto.git' + '@' + 'ea011a2c2d3aecdc4f1674887e107a56d2905edd', 'src/base/tracing/test/data': { 'bucket': 'perfetto', @@ -2354,6 +2347,13 @@ deps = { 'generation': 1719520814352733, 'output_file': 'chrome_input_with_frame_view_new.pftrace' }, + { + 'object_name': 'test_data/scroll_m131.pftrace-14171c9e502a65a454f39fe14fce8b313c7012a2c14394bed496fc93b1644b0d', + 'sha256sum': '14171c9e502a65a454f39fe14fce8b313c7012a2c14394bed496fc93b1644b0d', + 'size_bytes': 1247290, + 'generation': 1729619115836875, + 'output_file': 'scroll_m131.pftrace' + } ], 'dep_type': 'gcs' }, @@ -2376,7 +2376,7 @@ deps = { }, 'src/third_party/quic_trace/src': - Var('chromium_git') + '/external/github.com/google/quic-trace.git' + '@' + 'caa0a6eaba816ecb737f9a70782b7c80b8ac8dbc', + Var('chromium_git') + '/external/github.com/google/quic-trace.git' + '@' + '413da873d93a03d3662f24b881ea459a79f9c589', 'src/third_party/pywebsocket3/src': Var('chromium_git') + '/external/github.com/GoogleChromeLabs/pywebsocket3.git' + '@' + '50602a14f1b6da17e0b619833a13addc6ea78bc2', @@ -2412,7 +2412,7 @@ deps = { 'packages': [ { 'package': 'chromium/third_party/r8', - 'version': '-i5fwP_NzM6Ylg5AsSGEotYN7hQgV852gXCslvXIrRwC', + 'version': '6tS5W0W6vy5TPDxAc-wTObNng6QBVt7cQr3lazvrbpEC', }, ], 'condition': 'checkout_android and non_git_source', @@ -2426,7 +2426,7 @@ deps = { 'packages': [ { 'package': 'chromium/third_party/r8', - 'version': '3KCj5eRYCvGGYs5i90pRaeihkzsqgUGc4OkICT8AOlIC', + 'version': 'MnTG4zEzUB1GchkIsnkYCRziw_tkkWGJ7v_T6NUJHksC', }, ], 'condition': 'checkout_android and non_git_source', @@ -2481,10 +2481,10 @@ deps = { 'bucket': 'chromium-ads-detection', 'objects': [ { - 'object_name': '7f7f432c27d97dee184dcd3ea20f731674c008be849c0136f9c5358e359f3ea9', - 'sha256sum': '7f7f432c27d97dee184dcd3ea20f731674c008be849c0136f9c5358e359f3ea9', - 'size_bytes': 74272, - 'generation': 1722882673054280, + 'object_name': '782009d9765c6104a1b4d1eac553834e7e399d749a082ead42bb47abb42895b5', + 'sha256sum': '782009d9765c6104a1b4d1eac553834e7e399d749a082ead42bb47abb42895b5', + 'size_bytes': 74598, + 'generation': 1728068518927575, 'output_file': 'UnindexedRules', }, ], @@ -2533,29 +2533,29 @@ deps = { Var('chromium_git') + '/external/github.com/GoogleChromeLabs/text-fragments-polyfill.git' + '@' + 'c036420683f672d685e27415de0a5f5e85bdc23f', 'src/third_party/tflite/src': - Var('chromium_git') + '/external/github.com/tensorflow/tensorflow.git' + '@' + '689e8a82f8070a372981b7476fb673e243330d71', + Var('chromium_git') + '/external/github.com/tensorflow/tensorflow.git' + '@' + '658227d3b535287dc6859788bde6076c4fe3fe7c', 'src/third_party/turbine/cipd': { 'packages': [ { 'package': 'chromium/third_party/turbine', - 'version': 'vSia3h9tzpwpP_goLj4HMdl7_FEB5iVCv9nU5ZXOfIMC', + 'version': '1iVaPZ0ts_R6ymFUftgOKVE50dXSx6duVZEOP891WCMC', }, ], 'condition': 'checkout_android and non_git_source', 'dep_type': 'cipd', }, - 'src/third_party/vulkan-deps': '{chromium_git}/vulkan-deps@73fd75175922012f21557239b7743a152ea7f1fd', - 'src/third_party/glslang/src': '{chromium_git}/external/github.com/KhronosGroup/glslang@2acc4ea0028bc703be2d4e9bc8a4032d015d6516', + 'src/third_party/vulkan-deps': '{chromium_git}/vulkan-deps@0b56dd5952b25fad65139b64096fcd187048ed38', + 'src/third_party/glslang/src': '{chromium_git}/external/github.com/KhronosGroup/glslang@9c644fcb5b9a1a9c975c50a790fd14c5451292b0', 'src/third_party/spirv-cross/src': '{chromium_git}/external/github.com/KhronosGroup/SPIRV-Cross@b8fcf307f1f347089e3c46eb4451d27f32ebc8d3', - 'src/third_party/spirv-headers/src': '{chromium_git}/external/github.com/KhronosGroup/SPIRV-Headers@50bc4debdc3eec5045edbeb8ce164090e29b91f3', - 'src/third_party/spirv-tools/src': '{chromium_git}/external/github.com/KhronosGroup/SPIRV-Tools@42b315c15b1ff941b46bb3949c105e5386be8717', - 'src/third_party/vulkan-headers/src': '{chromium_git}/external/github.com/KhronosGroup/Vulkan-Headers@14345dab231912ee9601136e96ca67a6e1f632e7', - 'src/third_party/vulkan-loader/src': '{chromium_git}/external/github.com/KhronosGroup/Vulkan-Loader@bd1c8ea9c6ac51e4c3a6ddb9d602bb204678eb5f', - 'src/third_party/vulkan-tools/src': '{chromium_git}/external/github.com/KhronosGroup/Vulkan-Tools@c9a5acda16dc2759457dc856b5d7df00ac5bf4a2', - 'src/third_party/vulkan-utility-libraries/src': '{chromium_git}/external/github.com/KhronosGroup/Vulkan-Utility-Libraries@8c907ea21fe0147f791d79051b18e21bc8c4ede0', - 'src/third_party/vulkan-validation-layers/src': '{chromium_git}/external/github.com/KhronosGroup/Vulkan-ValidationLayers@cbb4ab171fc7cd0b636a76ee542e238a8734f4be', + 'src/third_party/spirv-headers/src': '{chromium_git}/external/github.com/KhronosGroup/SPIRV-Headers@996c728cf7dcfb29845cfa15222822318f047810', + 'src/third_party/spirv-tools/src': '{chromium_git}/external/github.com/KhronosGroup/SPIRV-Tools@9117e042b93d4ff08d2406542708170f77aaa2a3', + 'src/third_party/vulkan-headers/src': '{chromium_git}/external/github.com/KhronosGroup/Vulkan-Headers@cbcad3c0587dddc768d76641ea00f5c45ab5a278', + 'src/third_party/vulkan-loader/src': '{chromium_git}/external/github.com/KhronosGroup/Vulkan-Loader@b0177a972b8d47e823a4500cf88df88a8c27add7', + 'src/third_party/vulkan-tools/src': '{chromium_git}/external/github.com/KhronosGroup/Vulkan-Tools@15f2de809304aba619ee327f3273425418ca83de', + 'src/third_party/vulkan-utility-libraries/src': '{chromium_git}/external/github.com/KhronosGroup/Vulkan-Utility-Libraries@87ab6b39a97d084a2ef27db85e3cbaf5d2622a09', + 'src/third_party/vulkan-validation-layers/src': '{chromium_git}/external/github.com/KhronosGroup/Vulkan-ValidationLayers@bc2c38412f739c298d6f5c076c064e6b5696959f', 'src/third_party/vulkan_memory_allocator': Var('chromium_git') + '/external/github.com/GPUOpen-LibrariesAndSDKs/VulkanMemoryAllocator.git' + '@' + '56300b29fbfcc693ee6609ddad3fdd5b7a449a21', @@ -2592,10 +2592,10 @@ deps = { Var('chromium_git') + '/external/khronosgroup/webgl.git' + '@' + '450cceb587613ac1469c5a131fac15935c99e0e7', 'src/third_party/webgpu-cts/src': - Var('chromium_git') + '/external/github.com/gpuweb/cts.git' + '@' + 'ae8b3ca40fbeee0bc67ef41a6c5b6dd5af839344', + Var('chromium_git') + '/external/github.com/gpuweb/cts.git' + '@' + 'b9f32fd2943dd2b3d0033bf938c9d843f4b5c9a9', 'src/third_party/webrtc': - Var('webrtc_git') + '/src.git' + '@' + '8445abdf8069cadcbd134369b70d0ebd436ef477', + Var('webrtc_git') + '/src.git' + '@' + 'afaf497805cbb502da89991c2dcd783201efdd08', # Wuffs' canonical repository is at github.com/google/wuffs, but we use # Skia's mirror of Wuffs, the same as in upstream Skia's DEPS file. @@ -2626,7 +2626,7 @@ deps = { }, 'src/third_party/xnnpack/src': - Var('chromium_git') + '/external/github.com/google/XNNPACK.git' + '@' + '3986629de01e518a3f2359bf5629ef2b7ef72330', + Var('chromium_git') + '/external/github.com/google/XNNPACK.git' + '@' + 'd1d33679661a34f03a806af2b813f699db3004f9', 'src/tools/page_cycler/acid3': Var('chromium_git') + '/chromium/deps/acid3.git' + '@' + 'a926d0a32e02c4c03ae95bb798e6c780e0e184ba', @@ -2645,13 +2645,13 @@ deps = { }, 'src/third_party/zstd/src': - Var('chromium_git') + '/external/github.com/facebook/zstd.git' + '@' + '20707e3718ee14250fb8a44b3bf023ea36bd88df', + Var('chromium_git') + '/external/github.com/facebook/zstd.git' + '@' + '7fb5347e88f10472226c9aa1962a148e55d8c480', 'src/tools/skia_goldctl/linux': { 'packages': [ { 'package': 'skia/tools/goldctl/linux-amd64', - 'version': 'PpuoaxFG9rnuDcsvax6FcKG2ZWKhNvsO7tqW6G70GXAC', + 'version': 'AiY7CO223oVpSMe9b7SwHVhQrF-ijgHEDzjsAV8SUKoC', }, ], 'dep_type': 'cipd', @@ -2661,7 +2661,7 @@ deps = { 'packages': [ { 'package': 'skia/tools/goldctl/windows-amd64', - 'version': 'tEJ0WAy5v1qaOQ_jBcMUj540tXs7W8JZOXUNJKKQNPYC', + 'version': 'EK_tQRk4h7ikvzyk5kFX_pkGw3gjHkP4QPmEjN8D54EC', }, ], 'dep_type': 'cipd', @@ -2672,7 +2672,7 @@ deps = { 'packages': [ { 'package': 'skia/tools/goldctl/mac-amd64', - 'version': 'RQRQgiXDQ-q73iA9ZFw7R00gRWhOTXu3l1ns3hede0AC', + 'version': 'aWw1JVWpKckecy3rBuN-5Y_osHIckC0ganu7xQ28f4UC', }, ], 'dep_type': 'cipd', @@ -2683,7 +2683,7 @@ deps = { 'packages': [ { 'package': 'skia/tools/goldctl/mac-arm64', - 'version': 'MU2sytEh51XCW0Nk_qOg2tC9GumCMAjxh-xg8tB0IYkC', + 'version': 'WnSB4H9RkKT6MKFpLZ9yfWPnBUeECncOVa3XuRnyTEEC', }, ], 'dep_type': 'cipd', @@ -2713,7 +2713,7 @@ deps = { 'packages': [ { 'package': 'chromeos_internal/apps/eche_app/app', - 'version': 'M9ZZ-xTrJhh0LRIw6HQBBKwtrTXyKtlP61e3Z6EcZx4C', + 'version': 'g2qgVbVmWuLNtrl4K0dJFPWk48zNZxWOT4-5bLFzboUC', }, ], 'condition': 'checkout_chromeos and checkout_src_internal', @@ -2724,7 +2724,7 @@ deps = { 'packages': [ { 'package': 'chromeos_internal/apps/boca_app/app', - 'version': '6PbTA7-VD50s4UfdQA2r0B7W4kVdJcH-MrbUZiVIBqcC', + 'version': '2dbOK28kFj1aMiBL5ZdjS-azTkgCmcWzh2M1QLLqxhcC', }, ], 'condition': 'checkout_chromeos and checkout_src_internal', @@ -2735,7 +2735,7 @@ deps = { 'packages': [ { 'package': 'chromeos_internal/apps/help_app/app', - 'version': 'rlyya7h4Qe2O6jb74yahFt5xAMT160Wd-nYhEtZghTwC', + 'version': 'qyixOjRLu0e0duF0cpNUnTvQXjvE85NTbMcuY5SCpXUC', }, ], 'condition': 'checkout_chromeos and checkout_src_internal', @@ -2746,7 +2746,7 @@ deps = { 'packages': [ { 'package': 'chromeos_internal/apps/media_app/app', - 'version': 'o9M_ej1oD7mW6h6ScM5Z44On8Ic8Qyoz5Md37MS4qP4C', + 'version': 'tgsX8wV0auv9Kzp6jHSMbboUTXUe6JmXPWAAzLzjuJcC', }, ], 'condition': 'checkout_chromeos and checkout_src_internal', @@ -2779,7 +2779,7 @@ deps = { 'packages': [ { 'package': 'chromeos_internal/apps/projector_app/app', - 'version': 'CU9rnaon3ovUxSTngg2bhmaIOrhJ6nMcrR9BZbBxu0cC', + 'version': 'hwy--OoqyMlYGskuNUsVDbSNNVcUk8Km72Xt-Prfa8gC', }, ], 'condition': 'checkout_chromeos and checkout_src_internal', @@ -2798,7 +2798,7 @@ deps = { }, 'src/third_party/android_prebuilts/build_tools': { - 'url': Var('android_git') + '/platform/prebuilts/build-tools.git' + '@' + '673c20b524a83b662d8c1057fd3eec8fd0f93f9d', + 'url': Var('android_git') + '/platform/prebuilts/build-tools.git' + '@' + '3fbcdf38727f967badc13f9537bda0b4392c1f74', 'condition': 'checkout_android_prebuilts_build_tools', }, @@ -2885,7 +2885,7 @@ deps = { 'packages': [ { 'package': 'chromium/third_party/android_deps/libs/com_google_android_gms_play_services_auth', - 'version': 'version:2@20.1.0.cr1', + 'version': 'version:2@21.1.1.cr1', }, ], 'condition': 'checkout_android and non_git_source', @@ -2896,7 +2896,7 @@ deps = { 'packages': [ { 'package': 'chromium/third_party/android_deps/libs/com_google_android_gms_play_services_auth_api_phone', - 'version': 'version:2@18.0.1.cr1', + 'version': 'version:2@18.0.2.cr1', }, ], 'condition': 'checkout_android and non_git_source', @@ -2907,7 +2907,18 @@ deps = { 'packages': [ { 'package': 'chromium/third_party/android_deps/libs/com_google_android_gms_play_services_auth_base', - 'version': 'version:2@18.0.2.cr1', + 'version': 'version:2@18.0.10.cr1', + }, + ], + 'condition': 'checkout_android and non_git_source', + 'dep_type': 'cipd', + }, + + 'src/third_party/android_deps/cipd/libs/com_google_android_gms_play_services_auth_blockstore': { + 'packages': [ + { + 'package': 'chromium/third_party/android_deps/libs/com_google_android_gms_play_services_auth_blockstore', + 'version': 'version:2@16.4.0.cr1', }, ], 'condition': 'checkout_android and non_git_source', @@ -2980,6 +2991,17 @@ deps = { 'dep_type': 'cipd', }, + 'src/third_party/android_deps/cipd/libs/com_google_android_gms_play_services_fido': { + 'packages': [ + { + 'package': 'chromium/third_party/android_deps/libs/com_google_android_gms_play_services_fido', + 'version': 'version:2@21.1.0.cr1', + }, + ], + 'condition': 'checkout_android and non_git_source', + 'dep_type': 'cipd', + }, + 'src/third_party/android_deps/cipd/libs/com_google_android_gms_play_services_flags': { 'packages': [ { @@ -3101,6 +3123,17 @@ deps = { 'dep_type': 'cipd', }, + 'src/third_party/android_deps/cipd/libs/com_google_android_libraries_identity_googleid_googleid': { + 'packages': [ + { + 'package': 'chromium/third_party/android_deps/libs/com_google_android_libraries_identity_googleid_googleid', + 'version': 'version:2@1.1.1.cr1', + }, + ], + 'condition': 'checkout_android and non_git_source', + 'dep_type': 'cipd', + }, + 'src/third_party/android_deps/cipd/libs/com_google_android_material_material': { 'packages': [ { @@ -3446,7 +3479,7 @@ deps = { 'packages': [ { 'package': 'chromium/third_party/android_deps/libs/com_squareup_okio_okio_jvm', - 'version': 'version:2@3.9.0.cr1', + 'version': 'version:2@3.9.1.cr1', }, ], 'condition': 'checkout_android and non_git_source', @@ -4063,7 +4096,7 @@ deps = { # Dependencies from src_internal 'src/chromeos/ash/resources/internal': { 'url': Var('chrome_git') + '/chrome/chromeos/ash/resources/internal.git' + '@' + - '82e2ef28a309f9451371a92276c238d569885ce0', + '35dd3a45e078691e7cbf973d155c4f235eaafc3c', 'condition': 'checkout_src_internal and checkout_chromeos', }, @@ -4081,6 +4114,19 @@ deps = { 'dep_type': 'cipd', 'condition': 'checkout_mac or checkout_ios', }, + 'src/buildtools/android/doclava': { + 'dep_type': 'gcs', + 'bucket': 'chromium-doclava', + 'condition': 'checkout_android and non_git_source', + 'objects': [ + { + 'object_name': '1931becb8a8e21685f39c62854e9e814d64ccf1a', + 'sha256sum': '935a602c0dda7f769fc48fc777697ea23ccead170fbc70d2d41af5713ef50bbf', + 'size_bytes': 3517760, + 'generation': 1516199210583319, + }, + ], + }, # Repositories from src_internal 'src/build/fuchsia/internal': { 'url': Var('chrome_git') + '/fuchsia/build.git' + '@' + @@ -4120,7 +4166,7 @@ deps = { 'src/chrome/browser/internal': { 'url': Var('chrome_git') + '/chrome/browser_internal.git' + '@' + - '02d051ccc882caa1a817e55849364557b6a07be3', + '5649dd0237ac7f75c2779ff757e8666bdb9d2674', 'condition': 'checkout_src_internal', }, @@ -4138,7 +4184,7 @@ deps = { 'src/chrome/browser/platform_experience/win': { 'url': Var('chrome_git') + '/chrome/browser/platform_experience/win.git' + '@' + - 'e1465d127c241349e6e37c1cc0e5e90386c3135a', + '89ea316ccb1d7b612a37f1d53399ef3d14fc9be3', 'condition': 'checkout_src_internal', }, @@ -4170,7 +4216,7 @@ deps = { 'packages' : [ { 'package': 'chromeos_internal/inputs/orca', - 'version': 'dssY_6R8RCEdhDRugvVTduqqeAMzWqzH8_jdn3nsb7gC' + 'version': 'nHZAB6k_K5IIS-x4cuGYQWvKRu_O6TT9WmmwT2jer4YC' } ], 'condition': 'checkout_chromeos and checkout_src_internal', @@ -4190,7 +4236,7 @@ deps = { 'src/chrome/elevation_service/internal': { 'url': Var('chrome_git') + '/chrome/elevation_service/internal.git' + '@' + - 'a6265c8870e39d7bdcb01e3f02b3d135968a1f0d', + '375eccc61c37c3b5026bcb704fc6c5d36d65a0fd', 'condition': 'checkout_src_internal and checkout_win', }, @@ -4269,7 +4315,7 @@ deps = { 'src/components/autofill/core/browser/form_parsing/internal_resources': { 'url': Var('chrome_git') + '/chrome/components/autofill_regex_patterns.git' + '@' + - '35cefa144aca75addaff2533722eb54dd09b3b15', + 'c751dd94cd94ac5c6b0e9e7a8be5853f254c3270', 'condition': 'checkout_src_internal', }, @@ -4280,7 +4326,7 @@ deps = { 'src/components/metrics/internal': { 'url': Var('chrome_git') + '/chrome/components/metrics/internal.git' + '@' + - 'ecbb0140bf2eece548399b71fc0c0005e15f7b46', + '8e91fd73c988a39117cb6cca252af1d8bb08129d', 'condition': 'checkout_src_internal', }, @@ -4292,13 +4338,13 @@ deps = { 'src/components/optimization_guide/internal': { 'url': Var('chrome_git') + '/chrome/components/optimization_guide.git' + '@' + - '82e62243cd4379c0ee02594c86caab5e979f5ced', + '0e0e274f159157125eca68faef8c8257211a8ea8', 'condition': 'checkout_src_internal', }, 'src/components/plus_addresses/resources/internal': { 'url': Var('chrome_git') + '/chrome/components/plus_addresses/resources.git' + '@' + - '75176cf861a20ffd9ad4fb140853e0983bf82944', + '896889722227d6b6a1b90187fcaffc084ada5932', 'condition': 'checkout_src_internal', }, @@ -4328,13 +4374,13 @@ deps = { 'src/components/test/data/autofill/heuristics-json/internal': { 'url': Var('chrome_git') + '/chrome/test/autofill/structured_forms.git' + '@' + - '1afb1620ddb2cda22393100a5eb9aa205336a2a9', + '482fcb02e341795240ec419db144ce4f344c1160', 'condition': 'checkout_chromium_autofill_test_dependencies', }, 'src/components/test/data/autofill/label-doms/internal': { 'url': Var('chrome_git') + '/chrome/test/autofill/field_labels.git' + '@' + - '932bfac96f5e5792bca46e9d1ae76a4fe36798c3', + 'c67083dbb39d4bd87d86c083fecbe35aa562c777', 'condition': 'checkout_chromium_autofill_test_dependencies', }, @@ -4358,7 +4404,7 @@ deps = { 'src/ios_internal': { 'url': Var('chrome_git') + '/chrome/ios_internal.git' + '@' + - 'b15ee9d5fa6fd47ef44dc4c967e9051646c2abcb', + '0a172a302797e91c866671c53cf2ebdd2e6e5f38', 'condition': 'checkout_ios and checkout_src_internal', }, @@ -4370,7 +4416,7 @@ deps = { 'src/remoting/internal': { 'url': Var('chrome_git') + '/chrome/remoting/internal.git' + '@' + - 'ad9475675170eae84481e06084c42eb31b15791b', + 'bc8e5dbe2ea801d77d77ed8400e752f631f352a8', 'condition': 'checkout_src_internal', }, @@ -5112,20 +5158,10 @@ hooks = [ '--gs_url_base=chromeos-prebuilt/afdo-job/vetted/release', ], }, - { - # Pull doclava binaries if building for Android. - 'name': 'doclava', - 'pattern': '.', - 'condition': 'checkout_android', - 'action': [ 'python3', - 'src/build/android/download_doclava.py', - ], - }, - { 'name': 'Download Fuchsia SDK', 'pattern': '.', - 'condition': 'checkout_fuchsia', + 'condition': 'checkout_fuchsia and not checkout_fuchsia_no_hooks', 'action': [ 'python3', 'src/build/fuchsia/update_sdk.py', @@ -5155,6 +5191,16 @@ hooks = [ '--internal'], }, + { + 'name': 'Create Fuchsia GN sdk build rules when not running update_sdk.py', + 'pattern': '.', + 'condition': 'checkout_fuchsia_no_hooks', + 'action': [ + 'python3', + 'src/build/fuchsia/gen_build_defs.py', + ], + }, + { 'name': 'cros_simplechrome_artifacts_with_vm', 'pattern': '.', @@ -5227,86 +5273,6 @@ hooks = [ '--download-vm', ], }, - # Download Lacros's version of the simplechrome sdks. VMs are disregarded - # because this version of sdk is only used for compiling Lacros. - { - 'name': 'cros_simplechrome_artifacts_with_vm for lacros', - 'pattern': '.', - 'condition': 'checkout_simplechrome_with_vms and not checkout_src_internal and checkout_lacros_sdk', - 'action': [ - 'vpython3', - 'src/third_party/chromite/bin/cros', - 'chrome-sdk', - '--fallback-versions=20', - '--no-use-remoteexec', - '--nogn-gen', - '--no-shell', - '--log-level=warning', - '--cache-dir=src/build/cros_cache/', - '--use-external-config', - '--boards={cros_boards_with_qemu_images}', - '--is-lacros', - '--version={lacros_sdk_version}', - ], - }, - { - 'name': 'cros_simplechrome_artifacts_with_no_vm for lacros', - 'pattern': '.', - 'condition': 'checkout_simplechrome and not checkout_src_internal and checkout_lacros_sdk', - 'action': [ - 'vpython3', - 'src/third_party/chromite/bin/cros', - 'chrome-sdk', - '--fallback-versions=20', - '--no-use-remoteexec', - '--nogn-gen', - '--no-shell', - '--log-level=warning', - '--cache-dir=src/build/cros_cache/', - '--use-external-config', - '--boards={cros_boards}', - '--is-lacros', - '--version={lacros_sdk_version}', - ], - }, - { - 'name': 'cros_simplechrome_artifacts_with_vm_internal for lacros', - 'pattern': '.', - 'condition': 'checkout_simplechrome_with_vms and checkout_src_internal and checkout_lacros_sdk', - 'action': [ - 'vpython3', - 'src/third_party/chromite/bin/cros', - 'chrome-sdk', - '--fallback-versions=20', - '--no-use-remoteexec', - '--nogn-gen', - '--no-shell', - '--log-level=warning', - '--cache-dir=src/build/cros_cache/', - '--boards={cros_boards_with_qemu_images}', - '--is-lacros', - '--version={lacros_sdk_version}', - ], - }, - { - 'name': 'cros_simplechrome_artifacts_with_no_vm_internal for lacros', - 'pattern': '.', - 'condition': 'checkout_simplechrome and checkout_src_internal and checkout_lacros_sdk', - 'action': [ - 'vpython3', - 'src/third_party/chromite/bin/cros', - 'chrome-sdk', - '--fallback-versions=20', - '--no-use-remoteexec', - '--nogn-gen', - '--no-shell', - '--log-level=warning', - '--cache-dir=src/build/cros_cache/', - '--boards={cros_boards}', - '--is-lacros', - '--version={lacros_sdk_version}', - ], - }, # Download PGO profiles. { @@ -5375,40 +5341,6 @@ hooks = [ '--gs-url-base=chromium-optimization-profiles/pgo_profiles', ], }, - { - 'name': 'Fetch PGO profiles for lacros amd64', - 'pattern': '.', - 'condition': 'checkout_pgo_profiles and checkout_lacros_sdk', - 'action': [ 'python3', - 'src/tools/update_pgo_profiles.py', - '--target=lacros64', - 'update', - '--gs-url-base=chromium-optimization-profiles/pgo_profiles', - ], - }, - { - 'name': 'Fetch PGO profiles for lacros arm', - 'pattern': '.', - 'condition': 'checkout_pgo_profiles and checkout_lacros_sdk', - 'action': [ 'python3', - 'src/tools/update_pgo_profiles.py', - # Use arm64 profile. - '--target=lacros-arm64', - 'update', - '--gs-url-base=chromium-optimization-profiles/pgo_profiles', - ], - }, - { - 'name': 'Fetch PGO profiles for lacros arm64', - 'pattern': '.', - 'condition': 'checkout_pgo_profiles and checkout_lacros_sdk', - 'action': [ 'python3', - 'src/tools/update_pgo_profiles.py', - '--target=lacros-arm64', - 'update', - '--gs-url-base=chromium-optimization-profiles/pgo_profiles', - ], - }, { 'name': 'Fetch PGO profiles for android arm32', 'pattern': '.', diff --git a/naiveproxy/src/base/BUILD.gn b/naiveproxy/src/base/BUILD.gn index 31c50ebb44..6412172d5d 100644 --- a/naiveproxy/src/base/BUILD.gn +++ b/naiveproxy/src/base/BUILD.gn @@ -101,30 +101,6 @@ if (is_fuchsia) { import("//third_party/fuchsia-gn-sdk/src/fidl_library.gni") } -# The Rust implementation of base::JSONReader. NaCl depends on base and doesn't -# have a Rust toolchain, so we need a fallback to C++ for it until it removes -# its dependency on //base. -# -# TODO(crbug.com/40811643): Drop toolchain_has_rust and move the C++ parser into -# components/nacl to just run in-process there. Don't compile base::JSONReader -# on NaCL at all. -build_rust_json_reader = toolchain_has_rust && enable_rust_json - -# Rust to C++ type conversions. Also can not be enabled while NaCl depends on -# //base. -build_rust_base_conversions = toolchain_has_rust && enable_rust_base_conversions - -assert(build_rust_base_conversions || !build_rust_json_reader, - "Cannot enable Rust JSON decoder without also base conversions") - -buildflag_header("rust_buildflags") { - header = "rust_buildflags.h" - flags = [ - "BUILD_RUST_JSON_READER=$build_rust_json_reader", - "BUILD_RUST_BASE_CONVERSIONS=$build_rust_base_conversions", - ] -} - if (is_win) { # This is in a separate config so the flags can be applied to dependents. # ldflags in GN aren't automatically inherited. @@ -358,6 +334,7 @@ component("base") { "location.h", "logging.cc", "logging.h", + "logging/log_severity.h", "macros/concat.h", "macros/if.h", "macros/is_empty.h", @@ -567,6 +544,7 @@ component("base") { "profiler/stack_unwind_data.h", "profiler/suspendable_thread_delegate.h", "profiler/thread_delegate.h", + "profiler/thread_group_profiler_client.h", "profiler/unwinder.cc", "profiler/unwinder.h", "rand_util.cc", @@ -1046,10 +1024,6 @@ component("base") { # to provide the appropriate `#define` here. defines += [ "IS_RAW_PTR_IMPL" ] - if (build_rust_json_reader) { - deps += [ "//third_party/rust/serde_json_lenient/v0_2/wrapper" ] - } - # native_unwinder_android is intended for use solely via a dynamic feature # module, to avoid increasing Chrome's executable size. assert_no_deps = [ ":native_unwinder_android" ] @@ -1063,12 +1037,10 @@ component("base") { ":debugging_buildflags", ":feature_list_buildflags", ":ios_cronet_buildflags", - ":logging_buildflags", ":orderfile_buildflags", ":power_monitor_buildflags", ":profiler_buildflags", ":protected_memory_buildflags", - ":rust_buildflags", ":sanitizer_buildflags", ":synchronization_buildflags", ":tracing_buildflags", @@ -1081,17 +1053,6 @@ component("base") { "//third_party/abseil-cpp:absl", ] - if (build_rust_base_conversions) { - sources += [ - "containers/span_rust.h", - "strings/string_view_rust.h", - ] - - # Base provides conversions between CXX types and base types (e.g. - # std::string_view). - public_deps += [ "//build/rust:cxx_cppdeps" ] - } - # Needed for if using newer C++ library than sysroot, except if # building inside the cros_sdk environment - use host_toolchain as a # more robust check for this. @@ -1481,6 +1442,8 @@ component("base") { "files/scoped_temp_file.h", "json/json_file_value_serializer.cc", "json/json_file_value_serializer.h", + "logging/rust_log_integration.cc", + "logging/rust_log_integration.h", "memory/discardable_memory.cc", "memory/discardable_memory.h", "memory/discardable_memory_allocator.cc", @@ -2477,12 +2440,6 @@ buildflag_header("feature_list_buildflags") { } } -buildflag_header("logging_buildflags") { - header = "logging_buildflags.h" - - flags = [ "ENABLE_LOG_ERROR_NOT_REACHED=$enable_log_error_not_reached" ] -} - buildflag_header("orderfile_buildflags") { header = "orderfile_buildflags.h" header_dir = "base/android/orderfile" diff --git a/naiveproxy/src/base/OWNERS b/naiveproxy/src/base/OWNERS index 92e5d2bde6..f7d4248fb7 100644 --- a/naiveproxy/src/base/OWNERS +++ b/naiveproxy/src/base/OWNERS @@ -4,7 +4,6 @@ set noparent # NOTE: keep this in sync with global-owners-override@chromium.org owners # by emailing lsc-policy@chromium.org when this list changes. altimin@chromium.org -danakj@chromium.org dcheng@chromium.org fdoray@chromium.org gab@chromium.org diff --git a/naiveproxy/src/base/allocator/partition_alloc_features.cc b/naiveproxy/src/base/allocator/partition_alloc_features.cc index 0da8bc14e1..2d22688688 100644 --- a/naiveproxy/src/base/allocator/partition_alloc_features.cc +++ b/naiveproxy/src/base/allocator/partition_alloc_features.cc @@ -56,6 +56,10 @@ const base::FeatureParam &kUnretainedDanglingPtrModeOption, }; +// Note: DPD conflicts with no-op `free()` (see +// `base::allocator::MakeFreeNoOp()`). No-op `free()` stands down in the +// presence of DPD, but hypothetically fully launching DPD should prompt +// a rethink of no-op `free()`. BASE_FEATURE(kPartitionAllocDanglingPtr, "PartitionAllocDanglingPtr", #if PA_BUILDFLAG(ENABLE_DANGLING_RAW_PTR_FEATURE_FLAG) @@ -142,6 +146,10 @@ const base::FeatureParam BASE_FEATURE(kPartitionAllocZappingByFreeFlags, "PartitionAllocZappingByFreeFlags", FEATURE_DISABLED_BY_DEFAULT); + +BASE_FEATURE(kPartitionAllocEventuallyZeroFreedMemory, + "PartitionAllocEventuallyZeroFreedMemory", + FEATURE_DISABLED_BY_DEFAULT); #endif // PA_BUILDFLAG(USE_PARTITION_ALLOC_AS_MALLOC) BASE_FEATURE(kPartitionAllocBackupRefPtr, @@ -182,7 +190,7 @@ const base::FeatureParam kBackupRefPtrModeParam{ BASE_FEATURE(kPartitionAllocMemoryTagging, "PartitionAllocMemoryTagging", -#if PA_BUILDFLAG(USE_FULL_MTE) +#if PA_BUILDFLAG(USE_FULL_MTE) || BUILDFLAG(IS_ANDROID) FEATURE_ENABLED_BY_DEFAULT #else FEATURE_DISABLED_BY_DEFAULT @@ -223,7 +231,7 @@ const base::FeatureParam #if PA_BUILDFLAG(USE_FULL_MTE) MemoryTaggingEnabledProcesses::kAllProcesses, #else - MemoryTaggingEnabledProcesses::kBrowserOnly, + MemoryTaggingEnabledProcesses::kNonRenderer, #endif &kMemoryTaggingEnabledProcessesOptions}; @@ -434,60 +442,6 @@ BASE_FEATURE(kUsePoolOffsetFreelists, base::FEATURE_DISABLED_BY_DEFAULT); #endif -BASE_FEATURE(kPartitionAllocMakeFreeNoOpOnShutdown, - "PartitionAllocMakeFreeNoOpOnShutdown", -#if PA_BUILDFLAG(IS_CHROMEOS) - FEATURE_ENABLED_BY_DEFAULT -#else - FEATURE_DISABLED_BY_DEFAULT -#endif -); - -constexpr FeatureParam::Option - kPartitionAllocMakeFreeNoOpOnShutdownOptions[] = { - {WhenFreeBecomesNoOp::kBeforePreShutdown, "before-preshutdown"}, - {WhenFreeBecomesNoOp::kBeforeHaltingStartupTracingController, - "before-halting-startup-tracing-controller"}, - { - WhenFreeBecomesNoOp::kBeforeShutDownThreads, - "before-shutdown-threads", - }, - { - WhenFreeBecomesNoOp::kInShutDownThreads, - "in-shutdown-threads", - }, - { - WhenFreeBecomesNoOp::kAfterShutDownThreads, - "after-shutdown-threads", - }, -}; - -const base::FeatureParam - kPartitionAllocMakeFreeNoOpOnShutdownParam{ - &kPartitionAllocMakeFreeNoOpOnShutdown, "callsite", - WhenFreeBecomesNoOp::kBeforePreShutdown, - &kPartitionAllocMakeFreeNoOpOnShutdownOptions}; - -void MakeFreeNoOp(WhenFreeBecomesNoOp callsite) { - CHECK(base::FeatureList::GetInstance()); - // Ignoring `free()` during Shutdown would allow developers to introduce new - // dangling pointers. So we want to avoid ignoring free when it is enabled. - // Note: For now, the DanglingPointerDetector is only enabled on 5 bots, and - // on linux non-official configuration. - // TODO(b/40802063): Reconsider this decision after the experiment. -#if PA_BUILDFLAG(ENABLE_DANGLING_RAW_PTR_CHECKS) - if (base::FeatureList::IsEnabled(features::kPartitionAllocDanglingPtr)) { - return; - } -#endif // PA_BUILDFLAG(ENABLE_DANGLING_RAW_PTR_CHECKS) -#if PA_BUILDFLAG(USE_ALLOCATOR_SHIM) - if (base::FeatureList::IsEnabled(kPartitionAllocMakeFreeNoOpOnShutdown) && - kPartitionAllocMakeFreeNoOpOnShutdownParam.Get() == callsite) { - allocator_shim::InsertNoOpOnFreeAllocatorShimOnShutDown(); - } -#endif // PA_BUILDFLAG(USE_ALLOCATOR_SHIM) -} - BASE_FEATURE(kPartitionAllocAdjustSizeWhenInForeground, "PartitionAllocAdjustSizeWhenInForeground", #if BUILDFLAG(IS_MAC) diff --git a/naiveproxy/src/base/allocator/partition_alloc_features.h b/naiveproxy/src/base/allocator/partition_alloc_features.h index fe856ca10a..619392da03 100644 --- a/naiveproxy/src/base/allocator/partition_alloc_features.h +++ b/naiveproxy/src/base/allocator/partition_alloc_features.h @@ -97,6 +97,11 @@ extern const BASE_EXPORT base::FeatureParam kPartitionAllocSchedulerLoopQuarantineBranchCapacity; BASE_EXPORT BASE_DECLARE_FEATURE(kPartitionAllocZappingByFreeFlags); + +// Eventually zero out most PartitionAlloc memory. This is not meant as a +// security guarantee, but to increase the compression ratio of PartitionAlloc's +// fragmented super pages. +BASE_EXPORT BASE_DECLARE_FEATURE(kPartitionAllocEventuallyZeroFreedMemory); #endif // PA_BUILDFLAG(USE_PARTITION_ALLOC_AS_MALLOC) using BackupRefPtrEnabledProcesses = internal::PAFeatureEnabledProcesses; @@ -133,24 +138,6 @@ enum class BucketDistributionMode : uint8_t { kDenser, }; -// Parameter for 'kPartitionAllocMakeFreeNoOpOnShutdown' feature which -// controls when free() becomes a no-op during Shutdown() -enum class WhenFreeBecomesNoOp { - kBeforePreShutdown, - kBeforeHaltingStartupTracingController, - kBeforeShutDownThreads, - kInShutDownThreads, - kAfterShutDownThreads, -}; - -// Inserts a no-op on 'free()' allocator shim at the front of the -// dispatch chain if called from the appropriate callsite. -BASE_EXPORT void MakeFreeNoOp(WhenFreeBecomesNoOp callsite); - -BASE_EXPORT BASE_DECLARE_FEATURE(kPartitionAllocMakeFreeNoOpOnShutdown); -extern const BASE_EXPORT base::FeatureParam - kPartitionAllocMakeFreeNoOpOnShutdownParam; - BASE_EXPORT BASE_DECLARE_FEATURE(kPartitionAllocBackupRefPtr); extern const BASE_EXPORT base::FeatureParam kBackupRefPtrEnabledProcessesParam; diff --git a/naiveproxy/src/base/allocator/partition_alloc_support.cc b/naiveproxy/src/base/allocator/partition_alloc_support.cc index f7338aae1a..16126ea8ed 100644 --- a/naiveproxy/src/base/allocator/partition_alloc_support.cc +++ b/naiveproxy/src/base/allocator/partition_alloc_support.cc @@ -58,6 +58,7 @@ #include "partition_alloc/pointers/raw_ptr.h" #include "partition_alloc/shim/allocator_shim.h" #include "partition_alloc/shim/allocator_shim_default_dispatch_to_partition_alloc.h" +#include "partition_alloc/shim/allocator_shim_dispatch_to_noop_on_free.h" #include "partition_alloc/stack/stack.h" #include "partition_alloc/thread_cache.h" @@ -782,6 +783,22 @@ void ReconfigurePartitionForKnownProcess(const std::string& process_type) { // experiments. } +void MakeFreeNoOp() { + // Ignoring `free()` during Shutdown would allow developers to introduce new + // dangling pointers. So we want to avoid ignoring free when it is enabled. + // Note: For now, the DanglingPointerDetector is only enabled on 5 bots, and + // on linux non-official configuration. +#if PA_BUILDFLAG(ENABLE_DANGLING_RAW_PTR_CHECKS) + CHECK(base::FeatureList::GetInstance()); + if (base::FeatureList::IsEnabled(features::kPartitionAllocDanglingPtr)) { + return; + } +#endif // PA_BUILDFLAG(ENABLE_DANGLING_RAW_PTR_CHECKS) +#if PA_BUILDFLAG(USE_ALLOCATOR_SHIM) + allocator_shim::InsertNoOpOnFreeAllocatorShimOnShutDown(); +#endif // PA_BUILDFLAG(USE_ALLOCATOR_SHIM) +} + PartitionAllocSupport* PartitionAllocSupport::Get() { static auto* singleton = new PartitionAllocSupport(); return singleton; @@ -1015,6 +1032,8 @@ void PartitionAllocSupport::ReconfigureAfterFeatureListInit( .Get()); const bool zapping_by_free_flags = base::FeatureList::IsEnabled( base::features::kPartitionAllocZappingByFreeFlags); + const bool eventually_zero_freed_memory = base::FeatureList::IsEnabled( + base::features::kPartitionAllocEventuallyZeroFreedMemory); #if PA_BUILDFLAG(USE_FREELIST_DISPATCHER) const bool use_pool_offset_freelists = @@ -1032,17 +1051,37 @@ void PartitionAllocSupport::ReconfigureAfterFeatureListInit( // check here too to wrap the GetMemoryTaggingModeForCurrentThread() call. if (!base::FeatureList::IsEnabled( base::features::kKillPartitionAllocMemoryTagging)) { - // If synchronous mode is enabled from startup it means this is a test and - // memory tagging should be enabled. - if (partition_alloc::internal::GetMemoryTaggingModeForCurrentThread() == + // If synchronous mode is enabled from startup it means this is a test or it + // was force enabled in Chrome some how so honor that choice. + partition_alloc::TagViolationReportingMode + startup_memory_tagging_reporting_mode = + partition_alloc::internal::GetMemoryTaggingModeForCurrentThread(); + if (startup_memory_tagging_reporting_mode == partition_alloc::TagViolationReportingMode::kSynchronous) { enable_memory_tagging = true; memory_tagging_reporting_mode = partition_alloc::TagViolationReportingMode::kSynchronous; + // Not enabling permissive mode as this config is used to crash and detect + // bugs. + VLOG(1) << "PartitionAlloc: Memory tagging enabled in SYNC mode at " + "startup (Process: " + << process_type << ")"; } else { enable_memory_tagging = ShouldEnableMemoryTagging(process_type); #if BUILDFLAG(IS_ANDROID) + // Android Scudo does not allow MTE to be re-enabled if MTE was disabled. + if (enable_memory_tagging && + startup_memory_tagging_reporting_mode == + partition_alloc::TagViolationReportingMode::kDisabled) { + LOG(ERROR) << "PartitionAlloc: Failed to enable memory tagging due to " + "MTE disabled at startup (Process: " + << process_type << ")"; + debug::DumpWithoutCrashing(); + enable_memory_tagging = false; + } + if (enable_memory_tagging) { + // Configure MTE. switch (base::features::kMemtagModeParam.Get()) { case base::features::MemtagMode::kSync: memory_tagging_reporting_mode = @@ -1053,15 +1092,28 @@ void PartitionAllocSupport::ReconfigureAfterFeatureListInit( partition_alloc::TagViolationReportingMode::kAsynchronous; break; } - partition_alloc::PermissiveMte::SetEnabled(base::FeatureList::IsEnabled( - base::features::kPartitionAllocPermissiveMte)); + bool enable_permissive_mte = base::FeatureList::IsEnabled( + base::features::kPartitionAllocPermissiveMte); + partition_alloc::PermissiveMte::SetEnabled(enable_permissive_mte); CHECK(partition_alloc::internal:: ChangeMemoryTaggingModeForAllThreadsPerProcess( memory_tagging_reporting_mode)); CHECK_EQ( partition_alloc::internal::GetMemoryTaggingModeForCurrentThread(), memory_tagging_reporting_mode); + VLOG(1) + << "PartitionAlloc: Memory tagging enabled in " + << (memory_tagging_reporting_mode == + partition_alloc::TagViolationReportingMode::kSynchronous + ? "SYNC" + : "ASYNC") + << " mode (Process: " << process_type << ")"; + if (enable_permissive_mte) { + VLOG(1) << "PartitionAlloc: Permissive MTE enabled (Process: " + << process_type << ")"; + } } else if (base::CPU::GetInstanceNoAllocation().has_mte()) { + // Disable MTE. memory_tagging_reporting_mode = partition_alloc::TagViolationReportingMode::kDisabled; CHECK(partition_alloc::internal:: @@ -1070,24 +1122,14 @@ void PartitionAllocSupport::ReconfigureAfterFeatureListInit( CHECK_EQ( partition_alloc::internal::GetMemoryTaggingModeForCurrentThread(), memory_tagging_reporting_mode); + VLOG(1) << "PartitionAlloc: Memory tagging disabled (Process: " + << process_type << ")"; } #endif // BUILDFLAG(IS_ANDROID) } } #endif // PA_BUILDFLAG(HAS_MEMORY_TAGGING) - if (enable_memory_tagging) { - CHECK((memory_tagging_reporting_mode == - partition_alloc::TagViolationReportingMode::kSynchronous) || - (memory_tagging_reporting_mode == - partition_alloc::TagViolationReportingMode::kAsynchronous)); - } else { - CHECK((memory_tagging_reporting_mode == - partition_alloc::TagViolationReportingMode::kUndefined) || - (memory_tagging_reporting_mode == - partition_alloc::TagViolationReportingMode::kDisabled)); - } - allocator_shim::UseSmallSingleSlotSpans use_small_single_slot_spans( base::FeatureList::IsEnabled( features::kPartitionAllocUseSmallSingleSlotSpans)); @@ -1099,6 +1141,7 @@ void PartitionAllocSupport::ReconfigureAfterFeatureListInit( allocator_shim::SchedulerLoopQuarantine(scheduler_loop_quarantine), scheduler_loop_quarantine_branch_capacity_in_bytes, allocator_shim::ZappingByFreeFlags(zapping_by_free_flags), + allocator_shim::EventuallyZeroFreedMemory(eventually_zero_freed_memory), allocator_shim::UsePoolOffsetFreelists(use_pool_offset_freelists), use_small_single_slot_spans); diff --git a/naiveproxy/src/base/allocator/partition_alloc_support.h b/naiveproxy/src/base/allocator/partition_alloc_support.h index b2de6be6d3..0fa5baec84 100644 --- a/naiveproxy/src/base/allocator/partition_alloc_support.h +++ b/naiveproxy/src/base/allocator/partition_alloc_support.h @@ -37,6 +37,13 @@ BASE_EXPORT std::map ProposeSyntheticFinchTrials(); BASE_EXPORT void InstallDanglingRawPtrChecks(); BASE_EXPORT void InstallUnretainedDanglingRawPtrChecks(); +// Once called, makes `free()` do nothing. This is done to reduce +// shutdown hangs on CrOS. +// Does nothing if Dangling Pointer Detector (`docs/dangling_ptr.md`) +// is not active. +// Does nothing if allocator shim support is not built. +BASE_EXPORT void MakeFreeNoOp(); + // Allows to re-configure PartitionAlloc at run-time. class BASE_EXPORT PartitionAllocSupport { public: diff --git a/naiveproxy/src/base/allocator/partition_allocator/.clang-tidy b/naiveproxy/src/base/allocator/partition_allocator/.clang-tidy index be0f83acf9..c4aff2215d 100644 --- a/naiveproxy/src/base/allocator/partition_allocator/.clang-tidy +++ b/naiveproxy/src/base/allocator/partition_allocator/.clang-tidy @@ -1,6 +1,7 @@ --- Checks: 'google-build-namespaces, - readability-redundant-smartptr-get' + readability-redundant-smartptr-get, + readability-static-accessed-through-instance' InheritParentConfig: true HeaderFilterRegex: 'partition_alloc/*' ... diff --git a/naiveproxy/src/base/allocator/partition_allocator/src/partition_alloc/lightweight_quarantine.cc b/naiveproxy/src/base/allocator/partition_allocator/src/partition_alloc/lightweight_quarantine.cc index 5f8727b304..12be208e13 100644 --- a/naiveproxy/src/base/allocator/partition_allocator/src/partition_alloc/lightweight_quarantine.cc +++ b/naiveproxy/src/base/allocator/partition_allocator/src/partition_alloc/lightweight_quarantine.cc @@ -9,19 +9,48 @@ #include "partition_alloc/partition_root.h" namespace partition_alloc::internal { -namespace { -// An utility to lock only if a condition is met. -class PA_SCOPED_LOCKABLE ConditionalScopedGuard { +// Utility classes to lock only if a condition is met. + +template <> +class PA_SCOPED_LOCKABLE + LightweightQuarantineBranch::CompileTimeConditionalScopedGuard< + LightweightQuarantineBranch::LockRequired::kNotRequired> { public: - PA_ALWAYS_INLINE ConditionalScopedGuard(bool condition, Lock& lock) + PA_ALWAYS_INLINE explicit CompileTimeConditionalScopedGuard(Lock& lock) + PA_EXCLUSIVE_LOCK_FUNCTION(lock) {} + PA_ALWAYS_INLINE ~CompileTimeConditionalScopedGuard() PA_UNLOCK_FUNCTION() {} +}; + +template <> +class PA_SCOPED_LOCKABLE + LightweightQuarantineBranch::CompileTimeConditionalScopedGuard< + LightweightQuarantineBranch::LockRequired::kRequired> { + public: + PA_ALWAYS_INLINE explicit CompileTimeConditionalScopedGuard(Lock& lock) + PA_EXCLUSIVE_LOCK_FUNCTION(lock) + : lock_(lock) { + lock_.Acquire(); + } + PA_ALWAYS_INLINE ~CompileTimeConditionalScopedGuard() PA_UNLOCK_FUNCTION() { + lock_.Release(); + } + + private: + Lock& lock_; +}; + +class PA_SCOPED_LOCKABLE + LightweightQuarantineBranch::RuntimeConditionalScopedGuard { + public: + PA_ALWAYS_INLINE RuntimeConditionalScopedGuard(bool condition, Lock& lock) PA_EXCLUSIVE_LOCK_FUNCTION(lock) : condition_(condition), lock_(lock) { if (condition_) { lock_.Acquire(); } } - PA_ALWAYS_INLINE ~ConditionalScopedGuard() PA_UNLOCK_FUNCTION() { + PA_ALWAYS_INLINE ~RuntimeConditionalScopedGuard() PA_UNLOCK_FUNCTION() { if (condition_) { lock_.Release(); } @@ -32,8 +61,6 @@ class PA_SCOPED_LOCKABLE ConditionalScopedGuard { Lock& lock_; }; -} // namespace - LightweightQuarantineBranch LightweightQuarantineRoot::CreateBranch( const LightweightQuarantineBranchConfig& config) { return LightweightQuarantineBranch(*this, config); @@ -61,51 +88,8 @@ LightweightQuarantineBranch::~LightweightQuarantineBranch() { Purge(); } -bool LightweightQuarantineBranch::Quarantine( - void* object, - SlotSpanMetadata* slot_span, - uintptr_t slot_start, - size_t usable_size) { - PA_DCHECK(usable_size == root_.allocator_root_.GetSlotUsableSize(slot_span)); - - const size_t capacity_in_bytes = - branch_capacity_in_bytes_.load(std::memory_order_relaxed); - - if (capacity_in_bytes < usable_size) [[unlikely]] { - // Even if this branch dequarantines all entries held by it, this entry - // cannot fit within the capacity. - root_.allocator_root_.FreeNoHooksImmediate(object, slot_span, slot_start); - root_.quarantine_miss_count_.fetch_add(1u, std::memory_order_relaxed); - return false; - } - - { - ConditionalScopedGuard guard(lock_required_, lock_); - - // Dequarantine some entries as required. - PurgeInternal(capacity_in_bytes - usable_size); - - // Put the entry onto the list. - branch_size_in_bytes_ += usable_size; - slots_.push_back({slot_start, usable_size}); - - // Swap randomly so that the quarantine list remain shuffled. - // This is not uniformly random, but sufficiently random. - const size_t random_index = random_.RandUint32() % slots_.size(); - std::swap(slots_[random_index], slots_.back()); - } - - // Update stats (not locked). - root_.count_.fetch_add(1, std::memory_order_relaxed); - root_.size_in_bytes_.fetch_add(usable_size, std::memory_order_relaxed); - root_.cumulative_count_.fetch_add(1, std::memory_order_relaxed); - root_.cumulative_size_in_bytes_.fetch_add(usable_size, - std::memory_order_relaxed); - return true; -} - bool LightweightQuarantineBranch::IsQuarantinedForTesting(void* object) { - ConditionalScopedGuard guard(lock_required_, lock_); + RuntimeConditionalScopedGuard guard(lock_required_, lock_); uintptr_t slot_start = root_.allocator_root_.ObjectToSlotStartUnchecked(object); for (const auto& slot : slots_) { @@ -121,12 +105,100 @@ void LightweightQuarantineBranch::SetCapacityInBytes(size_t capacity_in_bytes) { } void LightweightQuarantineBranch::Purge() { - ConditionalScopedGuard guard(lock_required_, lock_); + RuntimeConditionalScopedGuard guard(lock_required_, lock_); PurgeInternal(0); - PA_DCHECK(slots_.empty()); slots_.shrink_to_fit(); } +template +bool LightweightQuarantineBranch::QuarantineInternal( + void* object, + SlotSpanMetadata* slot_span, + uintptr_t slot_start, + size_t usable_size) { + PA_DCHECK(lock_required_ ? lock_required == LockRequired::kRequired + : lock_required == LockRequired::kNotRequired); + PA_DCHECK(usable_size == root_.allocator_root_.GetSlotUsableSize(slot_span)); + + const size_t capacity_in_bytes = + branch_capacity_in_bytes_.load(std::memory_order_relaxed); + if (capacity_in_bytes < usable_size) [[unlikely]] { + // Even if this branch dequarantines all entries held by it, this entry + // cannot fit within the capacity. + root_.allocator_root_.FreeNoHooksImmediate(object, slot_span, slot_start); + root_.quarantine_miss_count_.fetch_add(1u, std::memory_order_relaxed); + return false; + } + + if constexpr (lock_required == LockRequired::kNotRequired) { + // Although there is no need to actually acquire the lock as + // LockRequired::kNotRequired is specified, + // a CompileTimeConditionalScopedGuard is necessary in order to touch + // `slots_` as `slots_` is annotated with `PA_GUARDED_BY(lock_)`. + // CompileTimeConditionalScopedGuard's ctor and dtor behave as + // PA_EXCLUSIVE_LOCK_FUNCTION and PA_UNLOCK_FUNCTION. + CompileTimeConditionalScopedGuard guard(lock_); + + // Dequarantine some entries as required. + PurgeInternal(capacity_in_bytes - usable_size); + + // Put the entry onto the list. + branch_size_in_bytes_ += usable_size; + slots_.push_back({slot_start, usable_size}); + + // Swap randomly so that the quarantine list remain shuffled. + // This is not uniformly random, but sufficiently random. + const size_t random_index = random_.RandUint32() % slots_.size(); + std::swap(slots_[random_index], slots_.back()); + } else { + ToBeFreedArray to_be_freed; + size_t num_of_slots = 0; + + { + CompileTimeConditionalScopedGuard guard(lock_); + + // Dequarantine some entries as required. Save the objects to be + // deallocated into `to_be_freed`. + PurgeInternalWithDefferedFree(capacity_in_bytes - usable_size, + to_be_freed, num_of_slots); + + // Put the entry onto the list. + branch_size_in_bytes_ += usable_size; + slots_.push_back({slot_start, usable_size}); + + // Swap randomly so that the quarantine list remain shuffled. + // This is not uniformly random, but sufficiently random. + const size_t random_index = random_.RandUint32() % slots_.size(); + std::swap(slots_[random_index], slots_.back()); + } + + // Actually deallocate the dequarantined objects. + BatchFree(to_be_freed, num_of_slots); + } + + // Update stats (not locked). + root_.count_.fetch_add(1, std::memory_order_relaxed); + root_.size_in_bytes_.fetch_add(usable_size, std::memory_order_relaxed); + root_.cumulative_count_.fetch_add(1, std::memory_order_relaxed); + root_.cumulative_size_in_bytes_.fetch_add(usable_size, + std::memory_order_relaxed); + return true; +} + +template bool LightweightQuarantineBranch::QuarantineInternal< + LightweightQuarantineBranch::LockRequired::kNotRequired>( + void* object, + SlotSpanMetadata* slot_span, + uintptr_t slot_start, + size_t usable_size); + +template bool LightweightQuarantineBranch::QuarantineInternal< + LightweightQuarantineBranch::LockRequired::kRequired>( + void* object, + SlotSpanMetadata* slot_span, + uintptr_t slot_start, + size_t usable_size); + PA_ALWAYS_INLINE void LightweightQuarantineBranch::PurgeInternal( size_t target_size_in_bytes) { int64_t freed_count = 0; @@ -163,4 +235,53 @@ PA_ALWAYS_INLINE void LightweightQuarantineBranch::PurgeInternal( root_.count_.fetch_sub(freed_count, std::memory_order_relaxed); } +PA_ALWAYS_INLINE void +LightweightQuarantineBranch::PurgeInternalWithDefferedFree( + size_t target_size_in_bytes, + ToBeFreedArray& to_be_freed, + size_t& num_of_slots) { + num_of_slots = 0; + + int64_t freed_size_in_bytes = 0; + + // Dequarantine some entries as required. + while (target_size_in_bytes < branch_size_in_bytes_) { + PA_DCHECK(!slots_.empty()); + + // As quarantined entries are shuffled, picking last entry is equivalent to + // picking random entry. + const QuarantineSlot& to_free = slots_.back(); + const size_t to_free_size = to_free.usable_size; + + to_be_freed[num_of_slots++] = to_free.slot_start; + slots_.pop_back(); + + freed_size_in_bytes += to_free_size; + branch_size_in_bytes_ -= to_free_size; + + if (num_of_slots >= kMaxFreeTimesPerPurge) { + break; + } + } + + root_.size_in_bytes_.fetch_sub(freed_size_in_bytes, + std::memory_order_relaxed); + root_.count_.fetch_sub(num_of_slots, std::memory_order_relaxed); +} + +PA_ALWAYS_INLINE void LightweightQuarantineBranch::BatchFree( + const ToBeFreedArray& to_be_freed, + size_t num_of_slots) { + for (size_t i = 0; i < num_of_slots; ++i) { + const uintptr_t slot_start = to_be_freed[i]; + PA_DCHECK(slot_start); + auto* slot_span = + SlotSpanMetadata::FromSlotStart(slot_start); + void* object = root_.allocator_root_.SlotStartToObject(slot_start); + PA_DCHECK(slot_span == + SlotSpanMetadata::FromObject(object)); + root_.allocator_root_.FreeNoHooksImmediate(object, slot_span, slot_start); + } +} + } // namespace partition_alloc::internal diff --git a/naiveproxy/src/base/allocator/partition_allocator/src/partition_alloc/lightweight_quarantine.h b/naiveproxy/src/base/allocator/partition_allocator/src/partition_alloc/lightweight_quarantine.h index 701c0e3213..315b7e6c49 100644 --- a/naiveproxy/src/base/allocator/partition_allocator/src/partition_alloc/lightweight_quarantine.h +++ b/naiveproxy/src/base/allocator/partition_allocator/src/partition_alloc/lightweight_quarantine.h @@ -108,10 +108,35 @@ class PA_COMPONENT_EXPORT(PARTITION_ALLOC) LightweightQuarantineBranch { // as much as possible. If the object is too large, this may return // `false`, meaning that quarantine request has failed (and freed // immediately). Otherwise, returns `true`. - bool Quarantine(void* object, - SlotSpanMetadata* slot_span, - uintptr_t slot_start, - size_t usable_size); + PA_ALWAYS_INLINE bool Quarantine( + void* object, + SlotSpanMetadata* slot_span, + uintptr_t slot_start, + size_t usable_size) { + return lock_required_ ? QuarantineWithAcquiringLock(object, slot_span, + slot_start, usable_size) + : QuarantineWithoutAcquiringLock( + object, slot_span, slot_start, usable_size); + } + // Despite that LightweightQuarantineBranchConfig::lock_required_ is already + // specified, we provide two versions `With/WithoutAcquiringLock` so that we + // can avoid the overhead of runtime conditional branches. + PA_ALWAYS_INLINE bool QuarantineWithAcquiringLock( + void* object, + SlotSpanMetadata* slot_span, + uintptr_t slot_start, + size_t usable_size) { + PA_MUSTTAIL return QuarantineInternal( + object, slot_span, slot_start, usable_size); + } + PA_ALWAYS_INLINE bool QuarantineWithoutAcquiringLock( + void* object, + SlotSpanMetadata* slot_span, + uintptr_t slot_start, + size_t usable_size) { + PA_MUSTTAIL return QuarantineInternal( + object, slot_span, slot_start, usable_size); + } // Dequarantine all entries **held by this branch**. // It is possible that another branch with entries and it remains untouched. @@ -130,9 +155,27 @@ class PA_COMPONENT_EXPORT(PARTITION_ALLOC) LightweightQuarantineBranch { void SetCapacityInBytes(size_t capacity_in_bytes); private: + enum class LockRequired { kNotRequired, kRequired }; + template + class PA_SCOPED_LOCKABLE CompileTimeConditionalScopedGuard; + class PA_SCOPED_LOCKABLE RuntimeConditionalScopedGuard; + // `ToBeFreedArray` is used in `PurgeInternalInTwoPhases1of2` and + // `PurgeInternalInTwoPhases2of2`. See the function comment about the purpose. + // In order to avoid reentrancy issues, we must not deallocate any object in + // `Quarantine`. So, std::vector is not an option. std::array doesn't + // deallocate, plus, std::array has perf advantages. + static constexpr size_t kMaxFreeTimesPerPurge = 1024; + using ToBeFreedArray = std::array; + LightweightQuarantineBranch(Root& root, const LightweightQuarantineBranchConfig& config); + template + bool QuarantineInternal(void* object, + SlotSpanMetadata* slot_span, + uintptr_t slot_start, + size_t usable_size); + // Try to dequarantine entries to satisfy below: // root_.size_in_bytes_ <= target_size_in_bytes // It is possible that this branch cannot satisfy the @@ -140,6 +183,19 @@ class PA_COMPONENT_EXPORT(PARTITION_ALLOC) LightweightQuarantineBranch { // constraint, call `Purge()` for each branch in sequence, synchronously. PA_ALWAYS_INLINE void PurgeInternal(size_t target_size_in_bytes) PA_EXCLUSIVE_LOCKS_REQUIRED(lock_); + // In order to reduce thread contention, dequarantines entries in two phases: + // Phase 1) With the lock acquired, saves `slot_start`s of the quarantined + // objects in an array, and shrinks `slots_`. Then, releases the lock so + // that another thread can quarantine an object. + // Phase 2) Without the lock acquired, deallocates objects saved in the + // array in Phase 1. This may take some time, but doesn't block other + // threads. + PA_ALWAYS_INLINE void PurgeInternalWithDefferedFree( + size_t target_size_in_bytes, + ToBeFreedArray& to_be_freed, + size_t& num_of_slots) PA_EXCLUSIVE_LOCKS_REQUIRED(lock_); + PA_ALWAYS_INLINE void BatchFree(const ToBeFreedArray& to_be_freed, + size_t num_of_slots); Root& root_; @@ -164,6 +220,21 @@ class PA_COMPONENT_EXPORT(PARTITION_ALLOC) LightweightQuarantineBranch { friend class LightweightQuarantineRoot; }; +extern template PA_COMPONENT_EXPORT( + PARTITION_ALLOC) bool LightweightQuarantineBranch:: + QuarantineInternal( + void* object, + SlotSpanMetadata* slot_span, + uintptr_t slot_start, + size_t usable_size); +extern template PA_COMPONENT_EXPORT( + PARTITION_ALLOC) bool LightweightQuarantineBranch:: + QuarantineInternal( + void* object, + SlotSpanMetadata* slot_span, + uintptr_t slot_start, + size_t usable_size); + } // namespace internal } // namespace partition_alloc diff --git a/naiveproxy/src/base/allocator/partition_allocator/src/partition_alloc/page_allocator_internals_posix.cc b/naiveproxy/src/base/allocator/partition_allocator/src/partition_alloc/page_allocator_internals_posix.cc index 02c3de2e17..8511f7265c 100644 --- a/naiveproxy/src/base/allocator/partition_allocator/src/partition_alloc/page_allocator_internals_posix.cc +++ b/naiveproxy/src/base/allocator/partition_allocator/src/partition_alloc/page_allocator_internals_posix.cc @@ -39,7 +39,7 @@ uint32_t SecTaskGetCodeSignStatus(SecTaskRef task) API_AVAILABLE(macos(10.12)); #if PA_BUILDFLAG(HAS_MEMORY_TAGGING) || \ (defined(__ARM_FEATURE_BTI_DEFAULT) && (__ARM_FEATURE_BTI_DEFAULT == 1) && \ - !defined(__MUSL__)) + __has_include()) struct __ifunc_arg_t; #include "partition_alloc/aarch64_support.h" diff --git a/naiveproxy/src/base/allocator/partition_allocator/src/partition_alloc/partition_root.cc b/naiveproxy/src/base/allocator/partition_allocator/src/partition_alloc/partition_root.cc index 836b04dd26..b5cf7e543a 100644 --- a/naiveproxy/src/base/allocator/partition_allocator/src/partition_alloc/partition_root.cc +++ b/naiveproxy/src/base/allocator/partition_allocator/src/partition_alloc/partition_root.cc @@ -1153,6 +1153,8 @@ void PartitionRoot::Init(PartitionOptions opts) { PA_DCHECK(!settings.use_configurable_pool || IsConfigurablePoolAvailable()); settings.zapping_by_free_flags = opts.zapping_by_free_flags == PartitionOptions::kEnabled; + settings.eventually_zero_freed_memory = + opts.eventually_zero_freed_memory == PartitionOptions::kEnabled; settings.scheduler_loop_quarantine = opts.scheduler_loop_quarantine == PartitionOptions::kEnabled; @@ -1209,7 +1211,7 @@ void PartitionRoot::Init(PartitionOptions opts) { #if PA_CONFIG(EXTRAS_REQUIRED) settings.extras_size = 0; - if (settings.use_cookie) { + if (Settings::use_cookie) { settings.extras_size += internal::kPartitionCookieSizeAdjustment; } @@ -1475,7 +1477,7 @@ bool PartitionRoot::TryReallocInPlaceForDirectMap( } // Write a new trailing cookie. - if (settings.use_cookie) { + if (Settings::use_cookie) { auto* object = static_cast(SlotStartToObject(slot_start)); internal::PartitionCookieWriteValue(object + GetSlotUsableSize(slot_span)); } @@ -1524,7 +1526,7 @@ bool PartitionRoot::TryReallocInPlaceForNormalBuckets( // PA_BUILDFLAG(DCHECKS_ARE_ON) // Write a new trailing cookie only when it is possible to keep track // raw size (otherwise we wouldn't know where to look for it later). - if (settings.use_cookie) { + if (Settings::use_cookie) { internal::PartitionCookieWriteValue(static_cast(object) + GetSlotUsableSize(slot_span)); } diff --git a/naiveproxy/src/base/allocator/partition_allocator/src/partition_alloc/partition_root.h b/naiveproxy/src/base/allocator/partition_allocator/src/partition_alloc/partition_root.h index e50f94a87c..fb51a53240 100644 --- a/naiveproxy/src/base/allocator/partition_allocator/src/partition_alloc/partition_root.h +++ b/naiveproxy/src/base/allocator/partition_allocator/src/partition_alloc/partition_root.h @@ -173,6 +173,12 @@ struct PartitionOptions { size_t scheduler_loop_quarantine_branch_capacity_in_bytes = 0; EnableToggle zapping_by_free_flags = kDisabled; + // As the name implies, this is not a security measure, as there is no + // guarantee that memorys has been zeroed out when handed back to the + // application, or when free() returns. This is intended to improve the + // compression ratio of freed memory inside partially allocated pages (due to + // fragmentation). + EnableToggle eventually_zero_freed_memory = kDisabled; struct { EnableToggle enabled = kDisabled; @@ -253,6 +259,7 @@ struct alignas(64) PA_COMPONENT_EXPORT(PARTITION_ALLOC) PartitionRoot { #endif // PA_BUILDFLAG(ENABLE_BACKUP_REF_PTR_SUPPORT) bool use_configurable_pool = false; bool zapping_by_free_flags = false; + bool eventually_zero_freed_memory = false; bool scheduler_loop_quarantine = false; #if PA_BUILDFLAG(HAS_MEMORY_TAGGING) bool memory_tagging_enabled_ = false; @@ -752,6 +759,13 @@ struct alignas(64) PA_COMPONENT_EXPORT(PARTITION_ALLOC) PartitionRoot { internal::DirectMapAllocationGranularity()); } + PA_ALWAYS_INLINE bool IsDirectMapped( + partition_alloc::internal::SlotSpanMetadata< + partition_alloc::internal::MetadataKind::kReadOnly>* slot_span) + const { + return IsDirectMappedBucket(slot_span->bucket); + } + PA_ALWAYS_INLINE size_t AdjustSize0IfNeeded(size_t size) const { // There are known cases where allowing size 0 would lead to problems: // 1. If extras are present only before allocation (e.g. in-slot metadata), @@ -1485,8 +1499,21 @@ PA_ALWAYS_INLINE void PartitionRoot::FreeInline(void* object) { // cacheline ping-pong. PA_PREFETCH(slot_span); + // Further down, we may zap the memory, no point in doing it twice. We may + // zap twice if kZap is enabled without kSchedulerLoopQuarantine. Make sure it + // does not happen. This is not a hard requirement: if this is deemed cheap + // enough, it can be relaxed, the static_assert() is here to make it a + // conscious decision. + static_assert(!ContainsFlags(flags, FreeFlags::kZap) || + ContainsFlags(flags, FreeFlags::kSchedulerLoopQuarantine), + "kZap and kSchedulerLoopQuarantine should be used together to " + "avoid double zapping"); if constexpr (ContainsFlags(flags, FreeFlags::kZap)) { - if (settings.zapping_by_free_flags) { + // No need to zap direct mapped allocations, as they are unmapped right + // away. This also ensures that we don't needlessly memset() very large + // allocations. + if (settings.zapping_by_free_flags && + !IsDirectMappedBucket(slot_span->bucket)) { internal::SecureMemset(object, internal::kFreedByte, GetSlotUsableSize(slot_span)); } @@ -1548,7 +1575,7 @@ PA_ALWAYS_INLINE void PartitionRoot::FreeNoHooksImmediate( // For more context, see the other "Layout inside the slot" comment inside // AllocInternalNoHooks(). - if (settings.use_cookie) { + if (Settings::use_cookie) { // Verify the cookie after the allocated region. // If this assert fires, you probably corrupted memory. const size_t usable_size = GetSlotUsableSize(slot_span); @@ -1566,11 +1593,14 @@ PA_ALWAYS_INLINE void PartitionRoot::FreeNoHooksImmediate( // complete before we clear kMemoryHeldByAllocatorBit in // ReleaseFromAllocator(), otherwise another thread may allocate and start // using the slot in the middle of zapping. + bool was_zapped = false; if (!ref_count->IsAliveWithNoKnownRefs()) [[unlikely]] { + was_zapped = true; QuarantineForBrp(slot_span, object); } if (!(ref_count->ReleaseFromAllocator())) [[unlikely]] { + PA_CHECK(was_zapped); total_size_of_brp_quarantined_bytes.fetch_add( slot_span->GetSlotSizeForBookkeeping(), std::memory_order_relaxed); total_count_of_brp_quarantined_slots.fetch_add(1, @@ -1634,6 +1664,7 @@ PA_ALWAYS_INLINE void PartitionRoot::RawFree(uintptr_t slot_start) { PA_ALWAYS_INLINE void PartitionRoot::RawFree( uintptr_t slot_start, ReadOnlySlotSpanMetadata* slot_span) { + void* ptr = internal::SlotStartAddr2Ptr(slot_start); // At this point we are about to acquire the lock, so we try to minimize the // risk of blocking inside the locked section. // @@ -1658,8 +1689,7 @@ PA_ALWAYS_INLINE void PartitionRoot::RawFree( // RawFreeLocked()). This is intentional, as the thread cache is purged often, // and the memory has a consequence the memory has already been touched // recently (to link the thread cache freelist). - *static_cast(internal::SlotStartAddr2Ptr(slot_start)) = - 0; + *static_cast(ptr) = 0; // Note: even though we write to slot_start + sizeof(void*) as well, due to // alignment constraints, the two locations are always going to be in the same // OS page. No need to write to the second one as well. @@ -1668,6 +1698,21 @@ PA_ALWAYS_INLINE void PartitionRoot::RawFree( #if !(PA_CONFIG(IS_NONCLANG_MSVC)) __asm__ __volatile__("" : : "r"(slot_start) : "memory"); #endif + // This is done for memory usage (by improving the compression ratio of heap + // pages), not for security, so we care more about being affordable than + // prompt. This is done after the thread cache, so most deallocation do not + // end up here. Nevertheless, we do not need to memset() direct-mapped + // allocations, as they are released right away. And single-slot slot spans + // are also excluded, because they can be entirely decommitted once leaving + // the global ring. + // + // This is done before acquiring the lock, to prevent page faults causing + // issues there. + if (settings.eventually_zero_freed_memory && + !IsDirectMappedBucket(slot_span->bucket) && + slot_span->bucket->get_slots_per_span() > 1) { + internal::SecureMemset(ptr, 0, GetSlotUsableSize(slot_span)); + } ::partition_alloc::internal::ScopedGuard guard{ internal::PartitionRootLock(this)}; @@ -2243,7 +2288,7 @@ PA_ALWAYS_INLINE void* PartitionRoot::AllocInternalNoHooks( void* object = SlotStartToObject(slot_start); // Add the cookie after the allocation. - if (settings.use_cookie) { + if (Settings::use_cookie) { internal::PartitionCookieWriteValue(static_cast(object) + usable_size); } diff --git a/naiveproxy/src/base/allocator/partition_allocator/src/partition_alloc/shim/allocator_shim.h b/naiveproxy/src/base/allocator/partition_allocator/src/partition_alloc/shim/allocator_shim.h index 074bb06c06..a790b31acb 100644 --- a/naiveproxy/src/base/allocator/partition_allocator/src/partition_alloc/shim/allocator_shim.h +++ b/naiveproxy/src/base/allocator/partition_allocator/src/partition_alloc/shim/allocator_shim.h @@ -148,7 +148,8 @@ using SchedulerLoopQuarantine = partition_alloc::internal::base:: using ZappingByFreeFlags = partition_alloc::internal::base::StrongAlias; - +using EventuallyZeroFreedMemory = partition_alloc::internal::base:: + StrongAlias; using UsePoolOffsetFreelists = partition_alloc::internal::base:: StrongAlias; @@ -167,6 +168,7 @@ void ConfigurePartitions( SchedulerLoopQuarantine scheduler_loop_quarantine, size_t scheduler_loop_quarantine_branch_capacity_in_bytes, ZappingByFreeFlags zapping_by_free_flags, + EventuallyZeroFreedMemory eventually_zero_freed_memory, UsePoolOffsetFreelists use_pool_offset_freelists, UseSmallSingleSlotSpans use_small_single_slot_spans); diff --git a/naiveproxy/src/base/allocator/partition_allocator/src/partition_alloc/shim/allocator_shim_default_dispatch_to_partition_alloc.cc b/naiveproxy/src/base/allocator/partition_allocator/src/partition_alloc/shim/allocator_shim_default_dispatch_to_partition_alloc.cc index 945892bf0c..e0b6b89f3d 100644 --- a/naiveproxy/src/base/allocator/partition_allocator/src/partition_alloc/shim/allocator_shim_default_dispatch_to_partition_alloc.cc +++ b/naiveproxy/src/base/allocator/partition_allocator/src/partition_alloc/shim/allocator_shim_default_dispatch_to_partition_alloc.cc @@ -618,6 +618,7 @@ void ConfigurePartitions( SchedulerLoopQuarantine scheduler_loop_quarantine, size_t scheduler_loop_quarantine_branch_capacity_in_bytes, ZappingByFreeFlags zapping_by_free_flags, + EventuallyZeroFreedMemory eventually_zero_freed_memory, UsePoolOffsetFreelists use_pool_offset_freelists, UseSmallSingleSlotSpans use_small_single_slot_spans) { // Calling Get() is actually important, even if the return value isn't @@ -647,6 +648,10 @@ void ConfigurePartitions( zapping_by_free_flags ? partition_alloc::PartitionOptions::kEnabled : partition_alloc::PartitionOptions::kDisabled; + opts.eventually_zero_freed_memory = + eventually_zero_freed_memory + ? partition_alloc::PartitionOptions::kEnabled + : partition_alloc::PartitionOptions::kDisabled; opts.scheduler_loop_quarantine = scheduler_loop_quarantine ? partition_alloc::PartitionOptions::kEnabled diff --git a/naiveproxy/src/base/allocator/partition_allocator/src/partition_alloc/shim/allocator_shim_default_dispatch_to_partition_alloc.h b/naiveproxy/src/base/allocator/partition_allocator/src/partition_alloc/shim/allocator_shim_default_dispatch_to_partition_alloc.h index 4fbd7092eb..129037c0e0 100644 --- a/naiveproxy/src/base/allocator/partition_allocator/src/partition_alloc/shim/allocator_shim_default_dispatch_to_partition_alloc.h +++ b/naiveproxy/src/base/allocator/partition_allocator/src/partition_alloc/shim/allocator_shim_default_dispatch_to_partition_alloc.h @@ -180,14 +180,16 @@ PA_ALWAYS_INLINE void ConfigurePartitionsForTesting() { auto scheduler_loop_quarantine = SchedulerLoopQuarantine(false); size_t scheduler_loop_quarantine_capacity_in_bytes = 0; auto zapping_by_free_flags = ZappingByFreeFlags(false); + auto eventually_zero_freed_memory = EventuallyZeroFreedMemory(false); auto use_pool_offset_freelists = UsePoolOffsetFreelists(true); auto use_small_single_slot_spans = UseSmallSingleSlotSpans(true); - ConfigurePartitions( - enable_brp, enable_memory_tagging, memory_tagging_reporting_mode, - distribution, scheduler_loop_quarantine, - scheduler_loop_quarantine_capacity_in_bytes, zapping_by_free_flags, - use_pool_offset_freelists, use_small_single_slot_spans); + ConfigurePartitions(enable_brp, enable_memory_tagging, + memory_tagging_reporting_mode, distribution, + scheduler_loop_quarantine, + scheduler_loop_quarantine_capacity_in_bytes, + zapping_by_free_flags, eventually_zero_freed_memory, + use_pool_offset_freelists, use_small_single_slot_spans); } #endif // PA_BUILDFLAG(USE_PARTITION_ALLOC_AS_MALLOC) diff --git a/naiveproxy/src/base/allocator/partition_allocator/src/partition_alloc/shim/allocator_shim_override_linker_wrapped_symbols.h b/naiveproxy/src/base/allocator/partition_allocator/src/partition_alloc/shim/allocator_shim_override_linker_wrapped_symbols.h index 93c91be519..44d6be9c9e 100644 --- a/naiveproxy/src/base/allocator/partition_allocator/src/partition_alloc/shim/allocator_shim_override_linker_wrapped_symbols.h +++ b/naiveproxy/src/base/allocator/partition_allocator/src/partition_alloc/shim/allocator_shim_override_linker_wrapped_symbols.h @@ -18,6 +18,8 @@ #include "partition_alloc/buildflags.h" #if PA_BUILDFLAG(USE_ALLOCATOR_SHIM) +#include + #include #include diff --git a/naiveproxy/src/base/allocator/partition_allocator/src/partition_alloc/thread_cache.cc b/naiveproxy/src/base/allocator/partition_allocator/src/partition_alloc/thread_cache.cc index f02fe775da..f20c9248fb 100644 --- a/naiveproxy/src/base/allocator/partition_allocator/src/partition_alloc/thread_cache.cc +++ b/naiveproxy/src/base/allocator/partition_allocator/src/partition_alloc/thread_cache.cc @@ -341,8 +341,7 @@ void ThreadCacheRegistry::ResetForTesting() { void ThreadCache::EnsureThreadSpecificDataInitialized() { // Using the registry lock to protect from concurrent initialization without // adding a special-pupose lock. - internal::ScopedGuard scoped_locker( - ThreadCacheRegistry::Instance().GetLock()); + internal::ScopedGuard scoped_locker(ThreadCacheRegistry::GetLock()); if (g_thread_cache_key_created) { return; } diff --git a/naiveproxy/src/base/android/content_uri_utils.cc b/naiveproxy/src/base/android/content_uri_utils.cc index bff1d89b09..8bdb7f99a7 100644 --- a/naiveproxy/src/base/android/content_uri_utils.cc +++ b/naiveproxy/src/base/android/content_uri_utils.cc @@ -70,24 +70,23 @@ int OpenContentUri(const FilePath& content_uri, uint32_t open_flags) { return Java_ContentUriUtils_openContentUri(env, content_uri.value(), *mode); } -bool ContentUriGetFileInfo(const FilePath& content_uri, File::Info* results) { +bool ContentUriGetFileInfo(const FilePath& content_uri, + FileEnumerator::FileInfo* info) { JNIEnv* env = android::AttachCurrentThread(); - std::vector result; + std::vector list; Java_ContentUriUtils_getFileInfo(env, content_uri.value(), - reinterpret_cast(&result)); - // Java will call back sync to AddFileInfoToVector(&result). - if (result.empty()) { + reinterpret_cast(&list)); + // Java will call back sync to AddFileInfoToVector(&list). + if (list.empty()) { return false; } // Android can return -1 for unknown size, which // we can't deal with, so we will consider that the file wasn't found. - if (result[0].GetSize() < 0) { + if (list[0].GetSize() < 0) { LOG(ERROR) << "Unknown file length for " << content_uri; return false; } - results->size = result[0].GetSize(); - results->is_directory = result[0].IsDirectory(); - results->last_modified = result[0].GetLastModifiedTime(); + *info = std::move(list[0]); return true; } @@ -107,6 +106,12 @@ bool DeleteContentUri(const FilePath& content_uri) { return Java_ContentUriUtils_delete(env, content_uri.value()); } +bool IsDocumentUri(const FilePath& content_uri) { + DCHECK(content_uri.IsContentUri()); + JNIEnv* env = android::AttachCurrentThread(); + return Java_ContentUriUtils_isDocumentUri(env, content_uri.value()); +} + } // namespace internal void JNI_ContentUriUtils_AddFileInfoToVector( @@ -160,4 +165,30 @@ FilePath ContentUriBuildDocumentUriUsingTree( return FilePath(SafeConvertJavaStringToUTF8(env, j_uri)); } +FilePath ContentUriGetChildDocumentOrQuery(const FilePath& parent, + const std::string& display_name, + const std::string& mime_type, + bool is_directory, + bool create) { + JNIEnv* env = android::AttachCurrentThread(); + ScopedJavaLocalRef j_uri = + Java_ContentUriUtils_getChildDocumentOrQuery( + env, parent.value(), display_name, mime_type, is_directory, create); + return FilePath(SafeConvertJavaStringToUTF8(env, j_uri)); +} + +bool ContentUriIsCreateChildDocumentQuery(const FilePath& content_uri) { + JNIEnv* env = android::AttachCurrentThread(); + return Java_ContentUriUtils_isCreateChildDocumentQuery(env, + content_uri.value()); +} + +FilePath ContentUriGetDocumentFromQuery(const FilePath& content_uri, + bool create) { + JNIEnv* env = android::AttachCurrentThread(); + ScopedJavaLocalRef j_uri = Java_ContentUriUtils_getDocumentFromQuery( + env, content_uri.value(), create); + return FilePath(SafeConvertJavaStringToUTF8(env, j_uri)); +} + } // namespace base diff --git a/naiveproxy/src/base/android/content_uri_utils.h b/naiveproxy/src/base/android/content_uri_utils.h index 2f58a463cf..9663cd4f3c 100644 --- a/naiveproxy/src/base/android/content_uri_utils.h +++ b/naiveproxy/src/base/android/content_uri_utils.h @@ -19,7 +19,7 @@ namespace base { namespace internal { // Check whether a content URI exists. -bool ContentUriExists(const FilePath& content_uri); +BASE_EXPORT bool ContentUriExists(const FilePath& content_uri); // Translates File::FLAG_* `open_flags` bitset to Java mode from // ParcelFileDescriptor#parseMode(): ("r", "w", "wt", "wa", "rw" or "rwt"). @@ -34,11 +34,8 @@ BASE_EXPORT std::optional TranslateOpenFlagsToJavaMode( int OpenContentUri(const FilePath& content_uri, uint32_t open_flags); // Returns true if file exists and results are populated, else returns false. -// Java code requires a Content-URI to look up file info such as is-dir, size, -// and last-mod, so code that needs to support Content-URI should use -// base::GetFileInfo(FilePath) which calls to this function rather than -// File::GetInfo() which cannot call this. -bool ContentUriGetFileInfo(const FilePath& content_uri, File::Info* results); +bool ContentUriGetFileInfo(const FilePath& content_uri, + FileEnumerator::FileInfo* results); // Returns list of files in `content_uri` directory. std::vector ListContentUriDirectory( @@ -47,6 +44,9 @@ std::vector ListContentUriDirectory( // Deletes a content URI. bool DeleteContentUri(const FilePath& content_uri); +// Returns whether `content_uri` is a Document URI. +bool IsDocumentUri(const FilePath& content_uri); + } // namespace internal // Gets MIME type from a content URI. Returns an empty string if the URI is @@ -62,6 +62,28 @@ BASE_EXPORT FilePath ContentUriBuildDocumentUriUsingTree(const FilePath& tree_uri, const std::string& encoded_document_id); +// Returns the URI of the matching document, or if document does not exist and +// `create` is true then returns a URI that can be used with +// ContentUriGetDocumentFromQuery() to create the specified document under +// `parent` directory with the specified `display_name` and `mime_type`. +BASE_EXPORT FilePath +ContentUriGetChildDocumentOrQuery(const FilePath& parent, + const std::string& display_name, + const std::string& mime_type, + bool is_directory, + bool create); + +// Returns whether this is a create-child-document query returned by +// ContentUriGetChildDocumentOrQuery(). +BASE_EXPORT bool ContentUriIsCreateChildDocumentQuery( + const FilePath& content_uri); + +// Gets a document with the details encoded in `document_query` which must be +// the result of calling ContentUriGetChildDocumentOrQuery(). If `create` is +// true, the document will be created if it does not exist. +BASE_EXPORT FilePath +ContentUriGetDocumentFromQuery(const FilePath& document_query, bool create); + } // namespace base #endif // BASE_ANDROID_CONTENT_URI_UTILS_H_ diff --git a/naiveproxy/src/base/android/content_uri_utils_stub.cc b/naiveproxy/src/base/android/content_uri_utils_stub.cc index c799c16303..b2cfc6545f 100644 --- a/naiveproxy/src/base/android/content_uri_utils_stub.cc +++ b/naiveproxy/src/base/android/content_uri_utils_stub.cc @@ -19,7 +19,7 @@ int OpenContentUri(const FilePath&, uint32_t) { return -1; } -bool ContentUriGetFileInfo(const FilePath&, File::Info*) { +bool ContentUriGetFileInfo(const FilePath&, FileEnumerator::FileInfo*) { return false; } @@ -31,6 +31,9 @@ bool DeleteContentUri(const FilePath& content_uri) { return false; } +bool IsDocumentUri(const FilePath& content_uri) { + return false; +} } // namespace internal std::string GetContentUriMimeType(const FilePath& content_uri) { diff --git a/naiveproxy/src/base/android/input_hint_checker.cc b/naiveproxy/src/base/android/input_hint_checker.cc index d60bd79fba..3c9dcb3c88 100644 --- a/naiveproxy/src/base/android/input_hint_checker.cc +++ b/naiveproxy/src/base/android/input_hint_checker.cc @@ -12,6 +12,7 @@ #include "base/feature_list.h" #include "base/metrics/field_trial_params.h" #include "base/metrics/histogram_functions.h" +#include "base/metrics/histogram_macros.h" #include "base/no_destructor.h" #include "base/time/time.h" @@ -304,11 +305,25 @@ InputHintChecker::ScopedOverrideInstance::~ScopedOverrideInstance() { g_test_instance = nullptr; } +// static +void InputHintChecker::RecordInputHintResult(InputHintResult result) { + UMA_HISTOGRAM_ENUMERATION("Android.InputHintChecker.InputHintResult", result); +} + void JNI_InputHintChecker_SetView(_JNIEnv* env, const jni_zero::JavaParamRef& v) { InputHintChecker::GetInstance().SetView(env, v); } +void JNI_InputHintChecker_OnCompositorViewHolderTouchEvent(_JNIEnv* env) { + auto& checker = InputHintChecker::GetInstance(); + if (checker.is_after_input_yield()) { + InputHintChecker::RecordInputHintResult( + InputHintResult::kCompositorViewTouchEvent); + } + checker.set_is_after_input_yield(false); +} + jboolean JNI_InputHintChecker_IsInitializedForTesting(_JNIEnv* env) { return InputHintChecker::GetInstance().IsInitializedForTesting(); // IN-TEST } @@ -328,4 +343,10 @@ jboolean JNI_InputHintChecker_HasInputWithThrottlingForTesting(_JNIEnv* env) { return checker.HasInputImplWithThrottlingForTesting(env); // IN-TEST } +void JNI_InputHintChecker_SetIsAfterInputYieldForTesting( // IN-TEST + _JNIEnv* env, + jboolean after) { + InputHintChecker::GetInstance().set_is_after_input_yield(after); +} + } // namespace base::android diff --git a/naiveproxy/src/base/android/input_hint_checker.h b/naiveproxy/src/base/android/input_hint_checker.h index 5bc7bc7bd7..2358b90106 100644 --- a/naiveproxy/src/base/android/input_hint_checker.h +++ b/naiveproxy/src/base/android/input_hint_checker.h @@ -19,6 +19,22 @@ namespace base::android { BASE_DECLARE_FEATURE(kYieldWithInputHint); +// These values are persisted to logs. Entries should not be renumbered and +// numeric values should never be reused. +// Distinguishes outcomes of returning |true| from HasInput() below. +enum class InputHintResult { + // The yield went through the Looper and dispatched input in + // CompositorViewHolder. This path probably reduces touch latency in the + // web contents area. + kCompositorViewTouchEvent = 0, + // The yield returned back from the Looper to continue with native tasks. It + // can happen because the Looper did not prioritize input handling or + // because the input events were hitting the parts of the UI outside of the + // renderer compositor view. + kBackToNative = 1, + kMaxValue = kBackToNative, +}; + // A class to track a single global root View object and ask it for presence of // new unhandled input events. // @@ -62,6 +78,14 @@ class BASE_EXPORT InputHintChecker { ~ScopedOverrideInstance(); }; + // Used for UMA metrics to remember that the input hint was used to yield + // recently. + void set_is_after_input_yield(bool after) { is_after_input_yield_ = after; } + bool is_after_input_yield() { return is_after_input_yield_; } + + // Records the UMA metric based on the InputHintResult. + static void RecordInputHintResult(InputHintResult result); + bool IsInitializedForTesting(); bool FailedToInitializeForTesting(); bool HasInputImplNoThrottlingForTesting(_JNIEnv* env); @@ -80,6 +104,9 @@ class BASE_EXPORT InputHintChecker { void InitGlobalRefsAndMethodIds(JNIEnv* env); bool HasInputImpl(JNIEnv* env, jobject o); + bool is_after_input_yield_ = false; + + // Last time the input hint was requested. Used for throttling. base::TimeTicks last_checked_; // Initialization state. It is made atomic because part of the initialization diff --git a/naiveproxy/src/base/android/pre_freeze_background_memory_trimmer.cc b/naiveproxy/src/base/android/pre_freeze_background_memory_trimmer.cc index a1f13da502..c162ac32a1 100644 --- a/naiveproxy/src/base/android/pre_freeze_background_memory_trimmer.cc +++ b/naiveproxy/src/base/android/pre_freeze_background_memory_trimmer.cc @@ -4,6 +4,9 @@ #include "base/android/pre_freeze_background_memory_trimmer.h" +#include +#include + #include #include @@ -15,12 +18,14 @@ #include "base/feature_list.h" #include "base/functional/bind.h" #include "base/logging.h" +#include "base/memory/page_size.h" #include "base/metrics/histogram_functions.h" #include "base/strings/strcat.h" #include "base/task/sequenced_task_runner.h" #include "base/task/thread_pool.h" #include "base/task/thread_pool/thread_pool_instance.h" #include "base/time/time.h" +#include "base/trace_event/base_tracing.h" namespace base::android { namespace { @@ -104,6 +109,29 @@ std::optional Diff(std::optional before, return after_value < before_value ? before_value - after_value : 0; } +bool IsMadvisePageoutSupported() { + static bool supported = []() -> bool { +#if defined(MADV_PAGEOUT) + // To determine if MADV_PAGEOUT is supported we will try calling it with an + // invalid memory area. + // madvise(2) first checks the mode first, returning -EINVAL if it's + // unknown. Next, it will always return 0 for a zero length VMA before + // validating if it's mapped. + // So, in this case, we can test for support with any page aligned address + // with a zero length. + int res = + madvise(reinterpret_cast(base::GetPageSize()), 0, MADV_PAGEOUT); + if (res < 0 && errno == -EINVAL) + return false; + PLOG_IF(ERROR, res < 0) << "Unexpected return from madvise"; + if (res == 0) + return true; +#endif + return false; + }(); + return supported; +} + } // namespace BASE_FEATURE(kOnPreFreezeMemoryTrim, @@ -316,6 +344,91 @@ void PreFreezeBackgroundMemoryTrimmer::UnregisterMemoryMetricInternal( metrics_.erase(metrics_.begin() + index); } +// static +bool PreFreezeBackgroundMemoryTrimmer::SelfCompactionIsSupported() { + return IsMadvisePageoutSupported(); +} + +// static +std::optional PreFreezeBackgroundMemoryTrimmer::CompactSelf() { + // MADV_PAGEOUT was only added in Linux 5.4, so do nothing in earlier + // versions. + if (!SelfCompactionIsSupported()) { + return std::nullopt; + } + + std::vector regions; + + std::string proc_maps; + if (!debug::ReadProcMaps(&proc_maps) || !ParseProcMaps(proc_maps, ®ions)) { + return std::nullopt; + } + + if (regions.size() == 0) { + return std::nullopt; + } + + // TODO(crbug.com/344547190): This may run for a long time. Add a way to + // cancel this part-way through if we return to the foreground while this is + // running. + return CompactMemory(std::move(regions)); +} + +// static +std::optional PreFreezeBackgroundMemoryTrimmer::CompactRegion( + debug::MappedMemoryRegion region) { +#if defined(MADV_PAGEOUT) + // Skip file-backed regions + if (region.inode != 0 || region.dev_major != 0) { + return 0; + } + // Skip shared regions + if ((region.permissions & debug::MappedMemoryRegion::Permission::PRIVATE) == + 0) { + return 0; + } + + TRACE_EVENT1("base", __PRETTY_FUNCTION__, "size", region.end - region.start); + + int error = madvise(reinterpret_cast(region.start), + region.end - region.start, MADV_PAGEOUT); + + if (error < 0) { + // We may fail on some regions, such as [vvar], or a locked region. It's + // not worth it to try to filter these all out, so we just skip them, and + // rely on metrics to verify that this is working correctly for most + // regions. + // + // EINVAL could be [vvar] or a locked region. ENOMEM would be a moved or + // unmapped region. + if (errno != EINVAL && errno != ENOMEM) { + PLOG(ERROR) << "Unexpected error from madvise."; + return std::nullopt; + } + return 0; + } + + return region.end - region.start; +#else + return std::nullopt; +#endif +} + +// static +std::optional PreFreezeBackgroundMemoryTrimmer::CompactMemory( + std::vector regions) { + TRACE_EVENT1("base", __PRETTY_FUNCTION__, "count", regions.size()); + int64_t total_bytes_processed = 0; + for (const auto& region : regions) { + const auto bytes_processed = CompactRegion(region); + if (!bytes_processed) { + return std::nullopt; + } + total_bytes_processed += bytes_processed.value(); + } + return total_bytes_processed; +} + void PreFreezeBackgroundMemoryTrimmer::PostMetricsTasksIfModern() { if (!SupportsModernTrim()) { return; diff --git a/naiveproxy/src/base/android/pre_freeze_background_memory_trimmer.h b/naiveproxy/src/base/android/pre_freeze_background_memory_trimmer.h index fefc09ac7d..783b1a339c 100644 --- a/naiveproxy/src/base/android/pre_freeze_background_memory_trimmer.h +++ b/naiveproxy/src/base/android/pre_freeze_background_memory_trimmer.h @@ -7,6 +7,8 @@ #include +#include "base/compiler_specific.h" +#include "base/debug/proc_maps_linux.h" #include "base/feature_list.h" #include "base/functional/callback.h" #include "base/memory/post_delayed_memory_reduction_task.h" @@ -69,7 +71,7 @@ class BASE_EXPORT PreFreezeBackgroundMemoryTrimmer { // when unregistering metrics). virtual std::optional Measure() const = 0; - const std::string& name() const { return name_; } + const std::string& name() const LIFETIME_BOUND { return name_; } protected: friend class PreFreezeBackgroundMemoryTrimmer; @@ -104,6 +106,12 @@ class BASE_EXPORT PreFreezeBackgroundMemoryTrimmer { static void UnregisterMemoryMetric(const PreFreezeMetric* metric) LOCKS_EXCLUDED(Instance().lock_); + static bool SelfCompactionIsSupported(); + + // Compacts the memory for the process, and returns the number of bytes + // processed on success. + static std::optional CompactSelf(); + static void SetSupportsModernTrimForTesting(bool is_supported); static void ClearMetricsForTesting() LOCKS_EXCLUDED(lock_); size_t GetNumberOfPendingBackgroundTasksForTesting() const @@ -114,6 +122,8 @@ class BASE_EXPORT PreFreezeBackgroundMemoryTrimmer { static void OnPreFreezeForTesting() LOCKS_EXCLUDED(lock_) { OnPreFreeze(); } + static std::optional CompactRegion(debug::MappedMemoryRegion region); + // Called when Chrome is about to be frozen. Runs as many delayed tasks as // possible immediately, before we are frozen. static void OnPreFreeze() LOCKS_EXCLUDED(lock_); @@ -128,6 +138,8 @@ class BASE_EXPORT PreFreezeBackgroundMemoryTrimmer { JNIEnv* env); friend class base::android::MemoryPurgeManagerAndroid; friend class base::OneShotDelayedBackgroundTimer; + friend class PreFreezeBackgroundMemoryTrimmerTest; + friend class PreFreezeSelfCompactionTest; // We use our own implementation here, based on |PostCancelableDelayedTask|, // rather than relying on something like |base::OneShotTimer|, since @@ -168,6 +180,9 @@ class BASE_EXPORT PreFreezeBackgroundMemoryTrimmer { PreFreezeBackgroundMemoryTrimmer(); + static std::optional CompactMemory( + std::vector regions); + void RegisterMemoryMetricInternal(const PreFreezeMetric* metric) EXCLUSIVE_LOCKS_REQUIRED(lock_); diff --git a/naiveproxy/src/base/android/trace_event_binding.cc b/naiveproxy/src/base/android/trace_event_binding.cc index b20c8e05c7..637703619c 100644 --- a/naiveproxy/src/base/android/trace_event_binding.cc +++ b/naiveproxy/src/base/android/trace_event_binding.cc @@ -9,6 +9,7 @@ #include #include "base/android/jni_string.h" +#include "base/compiler_specific.h" #include "base/metrics/histogram_macros.h" #include "base/trace_event/base_tracing.h" #include "base/tracing_buildflags.h" @@ -203,7 +204,7 @@ class TraceEventDataConverter { // Return saved values to pass to TRACE_EVENT macros. const char* arg_name() { return has_arg_ ? "arg" : nullptr; } - const std::string& arg() { return arg_; } + const std::string& arg() const LIFETIME_BOUND { return arg_; } private: bool has_arg_; diff --git a/naiveproxy/src/base/apple/mach_port_rendezvous.cc b/naiveproxy/src/base/apple/mach_port_rendezvous.cc index c510f279d8..3c3f84d408 100644 --- a/naiveproxy/src/base/apple/mach_port_rendezvous.cc +++ b/naiveproxy/src/base/apple/mach_port_rendezvous.cc @@ -35,6 +35,7 @@ #include #include +#include "base/apple/scoped_dispatch_object.h" #include "base/environment.h" #include "base/mac/info_plist_data.h" #include "base/strings/string_number_conversions.h" @@ -325,6 +326,19 @@ MachPortRendezvousServerIOS::~MachPortRendezvousServerIOS() = default; #if BUILDFLAG(IS_MAC) +struct MachPortRendezvousServerMac::ClientData { + ClientData(); + ClientData(ClientData&&); + ~ClientData(); + + // A DISPATCH_SOURCE_TYPE_PROC / DISPATCH_PROC_EXIT dispatch source. When + // the source is triggered, it calls OnClientExited(). + apple::ScopedDispatchObject exit_watcher; + + MachPortsForRendezvous ports; + std::optional requirement; +}; + // static MachPortRendezvousServerMac* MachPortRendezvousServerMac::GetInstance() { static auto* instance = new MachPortRendezvousServerMac(); @@ -407,6 +421,10 @@ MachPortRendezvousServerMac::MachPortRendezvousServerMac() { MachPortRendezvousServerMac::~MachPortRendezvousServerMac() = default; +void MachPortRendezvousServerMac::ClearClientDataForTesting() { + client_data_.clear(); +} + std::optional MachPortRendezvousServerMac::PortsForClient(audit_token_t audit_token) { pid_t pid = audit_token_to_pid(audit_token); diff --git a/naiveproxy/src/base/apple/mach_port_rendezvous.h b/naiveproxy/src/base/apple/mach_port_rendezvous.h index 00d45047af..0573a0bbb5 100644 --- a/naiveproxy/src/base/apple/mach_port_rendezvous.h +++ b/naiveproxy/src/base/apple/mach_port_rendezvous.h @@ -25,7 +25,6 @@ #include "build/ios_buildflags.h" #if BUILDFLAG(IS_MAC) -#include "base/apple/scoped_dispatch_object.h" #include "base/environment.h" #include "base/mac/process_requirement.h" #endif @@ -206,6 +205,8 @@ class BASE_EXPORT MachPortRendezvousServerMac final // registered. Lock& GetLock() LOCK_RETURNED(lock_) { return lock_; } + void ClearClientDataForTesting() EXCLUSIVE_LOCKS_REQUIRED(GetLock()); + protected: // Returns the registered collection of ports for the specified `audit_token`. // `std::nullopt` indicates that the client is not authorized to retrieve the @@ -225,18 +226,7 @@ class BASE_EXPORT MachPortRendezvousServerMac final MachPortRendezvousServerMac(); ~MachPortRendezvousServerMac() override; - struct ClientData { - ClientData(); - ClientData(ClientData&&); - ~ClientData(); - - // A DISPATCH_SOURCE_TYPE_PROC / DISPATCH_PROC_EXIT dispatch source. When - // the source is triggered, it calls OnClientExited(). - apple::ScopedDispatchObject exit_watcher; - - MachPortsForRendezvous ports; - std::optional requirement; - }; + struct ClientData; // Returns the `ClientData` for `pid`, creating it if necessary. // It will be cleaned up automatically when `pid` exits. diff --git a/naiveproxy/src/base/base_switches.cc b/naiveproxy/src/base/base_switches.cc index 508a8afb5b..37a846dd2d 100644 --- a/naiveproxy/src/base/base_switches.cc +++ b/naiveproxy/src/base/base_switches.cc @@ -154,9 +154,6 @@ const char kDefaultCountryCodeAtInstall[] = "default-country-code"; // Adds additional thread idle time information into the trace event output. const char kEnableIdleTracing[] = "enable-idle-tracing"; -// The field trial parameters and their values when testing changes locally. -const char kForceFieldTrialParams[] = "force-fieldtrial-params"; - // When we retrieve the package name within the SDK Runtime, we need to use // a bit of a hack to do this by taking advantage of the fact that the pid // is the same pid as the application's pid + 10000. diff --git a/naiveproxy/src/base/base_switches.h b/naiveproxy/src/base/base_switches.h index ce8d11d28a..a233ef2dba 100644 --- a/naiveproxy/src/base/base_switches.h +++ b/naiveproxy/src/base/base_switches.h @@ -52,7 +52,6 @@ extern const char kEnableCrashReporterForTesting[]; #if BUILDFLAG(IS_ANDROID) extern const char kDefaultCountryCodeAtInstall[]; extern const char kEnableIdleTracing[]; -extern const char kForceFieldTrialParams[]; extern const char kHostPackageName[]; extern const char kHostPackageLabel[]; extern const char kHostVersionCode[]; diff --git a/naiveproxy/src/base/check_op.cc b/naiveproxy/src/base/check_op.cc index bc0e1c4f65..1fb12c7e89 100644 --- a/naiveproxy/src/base/check_op.cc +++ b/naiveproxy/src/base/check_op.cc @@ -76,7 +76,7 @@ char* CheckOpValueStr(std::string_view v) { // SAFETY: We allocated `ret` as `v.size() + 1` bytes above. UNSAFE_BUFFERS(base::span(ret, v.size() + 1u)).split_at(v.size()); val.copy_from(v); - nul.copy_from({{'\0'}}); + nul.copy_from(base::span_from_ref('\0')); return ret; } diff --git a/naiveproxy/src/base/command_line.h b/naiveproxy/src/base/command_line.h index 7508abd0c5..1e9bcdaeb8 100644 --- a/naiveproxy/src/base/command_line.h +++ b/naiveproxy/src/base/command_line.h @@ -27,6 +27,7 @@ #include "base/base_export.h" #include "base/containers/span.h" +#include "base/compiler_specific.h" #include "base/debug/debugging_buildflags.h" #include "build/build_config.h" @@ -178,7 +179,7 @@ class BASE_EXPORT CommandLine { StringType GetArgumentsString() const; // Returns the original command line string as a vector of strings. - const StringVector& argv() const { return argv_; } + const StringVector& argv() const LIFETIME_BOUND { return argv_; } // Get and Set the program part of the command line string (the first item). FilePath GetProgram() const; @@ -200,7 +201,7 @@ class BASE_EXPORT CommandLine { StringType GetSwitchValueNative(std::string_view switch_string) const; // Get a copy of all switches, along with their values. - const SwitchMap& GetSwitches() const { return switches_; } + const SwitchMap& GetSwitches() const LIFETIME_BOUND { return switches_; } // Append a switch [with optional value] to the command line. // Note: Switches will precede arguments regardless of appending order. diff --git a/naiveproxy/src/base/compiler_specific.h b/naiveproxy/src/base/compiler_specific.h index 35821d4c7d..2e2c21f92b 100644 --- a/naiveproxy/src/base/compiler_specific.h +++ b/naiveproxy/src/base/compiler_specific.h @@ -903,31 +903,44 @@ inline constexpr bool AnalyzerAssumeTrue(bool arg) { #define PURE_FUNCTION #endif -// Annotates a function indicating it can lead to out-of-bounds accesses (OOB) -// if called with incorrect inputs. Commonly this includes functions which take -// pointers, sizes, iterators, sentinels, etc. and cannot fully check their -// preconditions (e.g. that the provided pointer actually points to an -// allocation of at least the provided size). Useful to diagnose potential -// misuse via `-Wunsafe-buffer-usage`, as well as to mark functions potentially -// in need of safer alternatives. +// Annotates a function or class data member indicating it can lead to +// out-of-bounds accesses (OOB) if given incorrect inputs. // -// All functions annotated with this macro should come with a `# Safety` comment -// that explains what the caller must guarantee to prevent OOB. Ideally, such -// functions should also be paired with a safer version, e.g. one that replaces -// pointer parameters with `span`s; otherwise, document safer replacement coding -// patterns callers can migrate to. +// For functions, this commonly includes functions which take pointers, sizes, +// iterators, sentinels, etc. and cannot fully check their preconditions (e.g. +// that the provided pointer actually points to an allocation of at least the +// provided size). Useful to diagnose potential misuse via +// `-Wunsafe-buffer-usage`, as well as to mark functions potentially in need of +// safer alternatives. +// +// For fields, this would be used to annotate both pointer and size fields that +// have not yet been converted to a span. +// +// All functions or fields annotated with this macro should come with a `# +// Safety` comment that explains what the caller must guarantee to prevent OOB. +// Ideally, unsafe functions should also be paired with a safer version, e.g. +// one that replaces pointer parameters with `span`s; otherwise, document safer +// replacement coding patterns callers can migrate to. // // Annotating a function `UNSAFE_BUFFER_USAGE` means all call sites (that do not // disable the warning) must wrap calls in `UNSAFE_BUFFERS()`; see documentation -// there. +// there. Annotating a field `UNSAFE_BUFFER_USAGE` means that `UNSAFE_BUFFERS()` +// must wrap expressions that mutate of the field. // // See also: +// https://chromium.googlesource.com/chromium/src/+/main/docs/unsafe_buffers.md +// https://clang.llvm.org/docs/SafeBuffers.html // https://clang.llvm.org/docs/DiagnosticsReference.html#wunsafe-buffer-usage // // Usage: // ``` // // Calls to this function must be wrapped in `UNSAFE_BUFFERS()`. // UNSAFE_BUFFER_USAGE void Func(T* input, T* end); +// +// struct S { +// // Changing this pointer requires `UNSAFE_BUFFERS()`. +// UNSAFE_BUFFER_USAGE int* p; +// }; // ``` #if __has_cpp_attribute(clang::unsafe_buffer_usage) #define UNSAFE_BUFFER_USAGE [[clang::unsafe_buffer_usage]] @@ -960,6 +973,11 @@ inline constexpr bool AnalyzerAssumeTrue(bool arg) { // - Caller requirements, if the containing function is itself annotated with // `UNSAFE_BUFFER_USAGE`; this is less safe and should be a last resort // +// See also: +// https://chromium.googlesource.com/chromium/src/+/main/docs/unsafe_buffers.md +// https://clang.llvm.org/docs/SafeBuffers.html +// https://clang.llvm.org/docs/DiagnosticsReference.html#wunsafe-buffer-usage +// // Usage: // ``` // // The following call will not trigger a compiler warning even if `Func()` diff --git a/naiveproxy/src/base/containers/OWNERS b/naiveproxy/src/base/containers/OWNERS index 86b77819f5..3c2fb64008 100644 --- a/naiveproxy/src/base/containers/OWNERS +++ b/naiveproxy/src/base/containers/OWNERS @@ -1,5 +1,2 @@ -danakj@chromium.org -dcheng@chromium.org - per-file enum_set.h=file://components/sync/OWNERS per-file enum_set_unittest.cc=file://components/sync/OWNERS diff --git a/naiveproxy/src/base/containers/circular_deque.h b/naiveproxy/src/base/containers/circular_deque.h index 4b0cafe4f3..1e46f21f57 100644 --- a/naiveproxy/src/base/containers/circular_deque.h +++ b/naiveproxy/src/base/containers/circular_deque.h @@ -820,11 +820,7 @@ class circular_deque { iterator insert_end; MakeRoomFor(count, &insert_cur, &insert_end); while (insert_cur < insert_end) { - std::construct_at( - // SAFETY: insert_cur is a valid iterator into the container, which - // means its index is less than capacity_. This is checked for above - // explicitly, and MakeRoomFor maintains it. - UNSAFE_BUFFERS(buffer_.begin() + insert_cur.index_), value); + std::construct_at(buffer_.get_at(insert_cur.index_), value); ++insert_cur; } @@ -862,11 +858,7 @@ class circular_deque { // Copy the items. while (insert_cur < insert_end) { - std::construct_at( - // SAFETY: insert_cur.index_ is either `begin_` or `pos.index`. This - // class maintains the invariant that `begin_ < capacity_`. In the - // latter case, we check above that `pos.index_ < capacity_`. - UNSAFE_BUFFERS(buffer_.begin() + insert_cur.index_), *first); + std::construct_at(buffer_.get_at(insert_cur.index_), *first); ++insert_cur; // SAFETY: The input iterator may be a pointer, in which case we will // produce UB if `first` is incremented past `last`. We use checked_cast @@ -911,12 +903,8 @@ class circular_deque { iterator insert_begin(this, pos.index_); iterator insert_end; MakeRoomFor(1, &insert_begin, &insert_end); - std::construct_at( - // SAFETY: insert_cur is a valid iterator into the container, which - // means its index is less than capacity_. This is checked for above - // explicitly, and MakeRoomFor maintains it. - UNSAFE_BUFFERS(buffer_.begin() + insert_begin.index_), - std::forward(args)...); + std::construct_at(buffer_.get_at(insert_begin.index_), + std::forward(args)...); return insert_begin; } @@ -995,20 +983,14 @@ class circular_deque { begin_--; } IncrementGeneration(); - std::construct_at( - // SAFETY: This class maintains an invariant that `begin_` is less than - // `buffer_`'s capacity. - UNSAFE_BUFFERS(buffer_.begin() + begin_), std::forward(args)...); + std::construct_at(buffer_.get_at(begin_), std::forward(args)...); return front(); } template reference emplace_back(Args&&... args) { ExpandCapacityIfNecessary(1); - std::construct_at( - // SAFETY: This class maintains an invariant that `end_` is less than - // `buffer_`'s capacity. - UNSAFE_BUFFERS(buffer_.begin() + end_), std::forward(args)...); + std::construct_at(buffer_.get_at(end_), std::forward(args)...); if (end_ == buffer_.capacity() - 1) { end_ = 0; } else { diff --git a/naiveproxy/src/base/containers/intrusive_heap.h b/naiveproxy/src/base/containers/intrusive_heap.h index fcdf3bbbbf..4bbab74c83 100644 --- a/naiveproxy/src/base/containers/intrusive_heap.h +++ b/naiveproxy/src/base/containers/intrusive_heap.h @@ -729,8 +729,8 @@ class WithHeapHandle : public InternalHeapHandleStorage { WithHeapHandle& operator=(const WithHeapHandle&) = delete; WithHeapHandle& operator=(WithHeapHandle&& other) = default; - T& value() { return value_; } - const T& value() const { return value_; } + T& value() LIFETIME_BOUND { return value_; } + const T& value() const LIFETIME_BOUND { return value_; } // Utility functions. void swap(WithHeapHandle& other) noexcept; diff --git a/naiveproxy/src/base/containers/span.h b/naiveproxy/src/base/containers/span.h index 631d02505e..6ee0802cbd 100644 --- a/naiveproxy/src/base/containers/span.h +++ b/naiveproxy/src/base/containers/span.h @@ -12,11 +12,13 @@ #include #include #include +#include #include #include #include #include #include +#include #include #include #include @@ -27,97 +29,6 @@ #include "base/numerics/safe_conversions.h" #include "base/types/to_address.h" -namespace base { - -// [span.syn]: Constants -inline constexpr size_t dynamic_extent = std::numeric_limits::max(); - -template -class span; - -namespace internal { - -template -concept LegalDataConversion = - std::convertible_to (*)[], - std::remove_reference_t (*)[]>; - -template -concept CompatibleIter = std::contiguous_iterator && - LegalDataConversion, T>; - -template -concept CompatibleRange = - std::ranges::contiguous_range && std::ranges::sized_range && - LegalDataConversion, T> && - (std::ranges::borrowed_range || std::is_const_v); - -template -concept LegacyRangeDataIsPointer = std::is_pointer_v; - -template -concept LegacyRange = requires(R& r) { - { std::ranges::data(r) } -> LegacyRangeDataIsPointer; - { std::ranges::size(r) } -> std::convertible_to; -}; - -// NOTE: Ideally we'd just use `CompatibleRange`, however this currently breaks -// code that was written prior to C++20 being standardized and assumes providing -// .data() and .size() is sufficient. -// TODO: https://crbug.com/1504998 - Remove in favor of CompatibleRange and fix -// callsites. -template -concept LegacyCompatibleRange = LegacyRange && requires(R& r) { - { *std::ranges::data(r) } -> LegalDataConversion; -}; - -template -using size_constant = std::integral_constant; - -template -struct ExtentImpl : size_constant {}; - -template -struct ExtentImpl : size_constant {}; - -template -struct ExtentImpl> : size_constant {}; - -template -struct ExtentImpl> : size_constant {}; - -template -using Extent = ExtentImpl>; - -template -inline constexpr size_t ExtentV = Extent::value; - -// must_not_be_dynamic_extent prevents |dynamic_extent| from being returned in a -// constexpr context. -template -constexpr size_t must_not_be_dynamic_extent() { - static_assert( - kExtent != dynamic_extent, - "EXTENT should only be used for containers with a static extent."); - return kExtent; -} - -template - requires((N == M || N == dynamic_extent || M == dynamic_extent) && - std::equality_comparable_with) -constexpr bool span_eq(span l, span r); -template - requires((N == M || N == dynamic_extent || M == dynamic_extent) && - std::three_way_comparable_with) -constexpr auto span_cmp(span l, span r) - -> decltype(l[0u] <=> r[0u]); -template -constexpr std::ostream& span_stream(std::ostream& l, span r); - -} // namespace internal - // A span is a value type that represents an array of elements of type T. Since // it only consists of a pointer to memory with an associated size, it is very // light-weight. It is cheap to construct, copy, move and use spans, so that @@ -217,22 +128,12 @@ constexpr std::ostream& span_stream(std::ostream& l, span r); // std::byte. // // Differences from [span.cons]: -// - The constructors from a contiguous range apart from a C array are folded -// into a single one, using a construct similarly to the one proposed -// (but not standardized) in https://wg21.link/P1419. -// The C array constructor is kept so that a span can be constructed from -// an init list like {{1, 2, 3}}. -// TODO: https://crbug.com/828324 - Consider adding C++26's constructor from -// a std::initializer_list instead. -// - The conversion constructors from a contiguous range into a dynamic span -// don't check for the range concept, but rather whether std::ranges::data -// and std::ranges::size are well formed. This is due to legacy reasons and -// should be fixed. -// -// Differences from [span.deduct]: -// - The deduction guides from a contiguous range are folded into a single one, -// and treat borrowed ranges correctly. -// - Add deduction guide from rvalue array. +// - Omits constructors from `std::array`, since separating these from the range +// constructor is only useful to mark them `noexcept`, and Chromium doesn't +// care about that. +// - Provides implicit conversion from fixed-extent `span` to `std::span`. +// `std::span`'s general-purpose range constructor is explicit in this case +// because it does not have a carve-out for `span`. // // Other differences: // - Using StrictNumeric instead of size_t where possible. @@ -252,16 +153,124 @@ constexpr std::ostream& span_stream(std::ostream& l, span r); // - byte_span_with_nul_from_cstring() function. // - split_at() method. // - to_fixed_extent() method. +// - get_at() method. // - operator==() comparator function. // - operator<=>() comparator function. // - operator<<() printing function. // -// Furthermore, all constructors and methods are marked noexcept due to the lack -// of exceptions in Chromium. -// // Due to the lack of class template argument deduction guides in C++14 // appropriate make_span() utility functions are provided for historic reasons. +namespace base { + +// [span.syn]: Constants +inline constexpr size_t dynamic_extent = std::numeric_limits::max(); + +template +class span; + +} // namespace base + +// Mark `span` as satisfying the `view` and `borrowed_range` concepts. This +// should be done before the definition of `span`, so that any inlined calls to +// range functionality use the correct specializations. +template +inline constexpr bool std::ranges::enable_view> = true; +template +inline constexpr bool + std::ranges::enable_borrowed_range> = true; + +namespace base { + +namespace internal { + +// Exposition-only concept from [span.syn] +template +concept IntegralConstantLike = + std::is_integral_v && + !std::is_same_v> && + std::convertible_to && + std::equality_comparable_with && + std::bool_constant::value && + std::bool_constant(T()) == T::value>::value; + +// Exposition-only concept from [span.syn] +template +inline constexpr size_t MaybeStaticExt = dynamic_extent; +template + requires IntegralConstantLike +inline constexpr size_t MaybeStaticExt = {T::value}; + +template +concept LegalDataConversion = std::is_convertible_v; + +// Akin to `std::constructible_from`, but meant to be used in a +// type-deducing context where we don't know what args would be deduced; +// `std::constructible_from` can't be directly used in such a case since the +// type parameters must be fully-specified (e.g. `span`), requiring us to +// have that knowledge already. +template +concept SpanConstructibleFrom = requires(T&& t) { span(std::forward(t)); }; + +template +concept CompatibleIter = + std::contiguous_iterator && + LegalDataConversion>, T>; + +// Disallow general-purpose range construction from types that have dedicated +// constructors. +// Arrays should go through the array constructors. +template +inline constexpr bool kCompatibleRangeType = !std::is_array_v; +// `span`s should go through the copy constructor. +template +inline constexpr bool kCompatibleRangeType> = false; + +template +concept CompatibleRange = + std::ranges::contiguous_range && std::ranges::sized_range && + (std::ranges::borrowed_range || + std::is_const_v)&&kCompatibleRangeType> && + LegalDataConversion< + std::remove_reference_t>, + T>; + +// Whether source object extent `X` will work to create a span of fixed extent +// `N`. This is not intended for use in dynamic-extent spans. +template +concept FixedExtentConstructibleFromExtent = X == N || X == dynamic_extent; + +// Computes a fixed extent if possible from a source container type `T`. +template +inline constexpr size_t kComputedExtentImpl = dynamic_extent; +template +inline constexpr size_t kComputedExtentImpl = N; +template +inline constexpr size_t kComputedExtentImpl> = N; +template +inline constexpr size_t kComputedExtentImpl> = N; +template +inline constexpr size_t kComputedExtentImpl> = N; +template +inline constexpr size_t kComputedExtent = + kComputedExtentImpl>; + +template + requires((N == M || N == dynamic_extent || M == dynamic_extent) && + std::equality_comparable_with) +constexpr bool span_eq(span l, span r); +template + requires((N == M || N == dynamic_extent || M == dynamic_extent) && + std::three_way_comparable_with) +constexpr auto span_cmp(span l, span r) + -> decltype(l[0u] <=> r[0u]); +template +constexpr std::ostream& span_stream(std::ostream& l, span r); + +} // namespace internal + // [span], class template span template class GSL_POINTER span { @@ -295,9 +304,8 @@ class GSL_POINTER span { // valid range of the collection pointed to by the iterator. template requires(internal::CompatibleIter) - UNSAFE_BUFFER_USAGE explicit constexpr span( - It first, - StrictNumeric count) noexcept + UNSAFE_BUFFER_USAGE constexpr explicit span(It first, + StrictNumeric count) : // The use of to_address() here is to handle the case where the // iterator `first` is pointing to the container's `end()`. In that // case we can not use the address returned from the iterator, or @@ -340,8 +348,8 @@ class GSL_POINTER span { template requires(internal::CompatibleIter && std::sized_sentinel_for && - !std::convertible_to) - UNSAFE_BUFFER_USAGE explicit constexpr span(It begin, End end) noexcept + !std::is_convertible_v) + UNSAFE_BUFFER_USAGE constexpr explicit span(It begin, End end) // SAFETY: The caller must guarantee that the iterator and end sentinel // are part of the same allocation, in which case it is the number of // elements between the iterators and thus a valid size for the pointer to @@ -357,32 +365,50 @@ class GSL_POINTER span { } // NOLINTNEXTLINE(google-explicit-constructor) - constexpr span(T (&arr)[N]) noexcept - // SAFETY: The std::ranges::size() function gives the number of elements - // pointed to by the std::ranges::data() function, which meets the - // requirement of span. - : UNSAFE_BUFFERS(span(std::ranges::data(arr), std::ranges::size(arr))) {} + constexpr span(std::type_identity_t (&arr LIFETIME_BOUND)[N]) noexcept + // SAFETY: The type signature guarantees `arr` contains `N` elements. + : UNSAFE_BUFFERS(span(arr, N)) {} - template > - requires(internal::CompatibleRange && (X == N || X == dynamic_extent)) + template > + requires(internal::CompatibleRange && + internal::FixedExtentConstructibleFromExtent) // NOLINTNEXTLINE(google-explicit-constructor) - explicit(X == dynamic_extent) constexpr span(R&& range) noexcept - // SAFETY: The std::ranges::begin() and std::ranges:end() functions always - // give a valid iterator pair. - : UNSAFE_BUFFERS( - span(std::ranges::begin(range), std::ranges::end(range))) {} - - template > - requires(internal::LegacyCompatibleRange && - (X == N || X == dynamic_extent) && - !internal::CompatibleRange) - // NOLINTNEXTLINE(google-explicit-constructor) - explicit(X == dynamic_extent) constexpr span(R&& range) noexcept - // SAFETY: The std::ranges::size() function gives the number of elements - // pointed to by the std::ranges::data() function, which meets the - // requirement of span. + constexpr explicit(X != N) span(R&& range LIFETIME_BOUND) + // SAFETY: `std::ranges::size()` returns the number of elements + // `std::ranges::data()` will point to, so accessing those elements will + // be safe. : UNSAFE_BUFFERS( span(std::ranges::data(range), std::ranges::size(range))) {} + template > + requires(internal::CompatibleRange && + internal::FixedExtentConstructibleFromExtent && + std::ranges::borrowed_range) + // NOLINTNEXTLINE(google-explicit-constructor) + constexpr explicit(X != N) span(R&& range) + // SAFETY: `std::ranges::size()` returns the number of elements + // `std::ranges::data()` will point to, so accessing those elements will + // be safe. + : UNSAFE_BUFFERS( + span(std::ranges::data(range), std::ranges::size(range))) {} + + // NOLINTNEXTLINE(google-explicit-constructor) + constexpr explicit span(std::initializer_list il LIFETIME_BOUND) + requires(std::is_const_v) + // SAFETY: `size()` is exactly the number of elements in the initializer + // list, so accessing that many will be safe. + : UNSAFE_BUFFERS(span(il.begin(), il.size())) {} + + constexpr span(const span& other) noexcept = default; + template + requires((OtherN == dynamic_extent || N == OtherN) && + internal::LegalDataConversion) + constexpr explicit(OtherN == dynamic_extent) + span(const span& s) noexcept + // SAFETY: `size()` is the number of elements that can be safely accessed + // at `data()`. + : UNSAFE_BUFFERS(span(s.data(), s.size())) {} + + constexpr span& operator=(const span& other) noexcept = default; // [span.sub], span subviews template @@ -416,7 +442,7 @@ class GSL_POINTER span { // SAFETY: span provides that data() points to at least `N` many elements. // `count` is non-negative by its type and `count <= N` from the CHECK // above. So `count` is a valid new size for `data()`. - return UNSAFE_BUFFERS({data(), count}); + return UNSAFE_BUFFERS(span(data(), count)); } // Returns a span over the last `count` elements. @@ -430,7 +456,7 @@ class GSL_POINTER span { // `count` is non-negative by its type and `count <= N` from the CHECK // above. So `0 <= N - count <= N`, meaning `N - count` is a valid new size // for `data()` and it will point to `count` many elements. - return UNSAFE_BUFFERS({data() + (N - size_t{count}), count}); + return UNSAFE_BUFFERS(span(data() + (N - size_t{count}), count)); } template @@ -484,7 +510,7 @@ class GSL_POINTER span { // and since `new_extent` is non-negative, `offset + new_extent` is not // before `offset` so `new_extent` is a valid size for the span at `data() + // offset`. - return UNSAFE_BUFFERS({data() + offset, new_extent}); + return UNSAFE_BUFFERS(span(data() + offset, new_extent)); } // Splits a span into two at the given `offset`, returning two spans that @@ -532,6 +558,25 @@ class GSL_POINTER span { return UNSAFE_BUFFERS(data()[idx]); } + // Returns a pointer to an element in the span. + // + // This avoids the construction of a reference to the element, which is + // important for cases such as in-place new, where the memory is + // uninitialized. + // + // This is sugar for `span.subspan(idx, 1u).data()` which also ensures the + // returned span has a pointer into and not past the end of the original span. + // + // # Checks + // The function CHECKs that the `idx` is inside the span and will terminate + // otherwise. + constexpr T* get_at(size_t idx) const noexcept { + CHECK_LT(idx, size()); + // SAFETY: Since data() always points to at least `N` elements, the check + // above ensures `idx < N` and is thus in range for data(). + return UNSAFE_BUFFERS(data() + idx); + } + constexpr T& front() const noexcept requires(N > 0) { @@ -636,7 +681,7 @@ class GSL_POINTER span { // span can also be constructed from it. If the input is a fixed-length // span then we want to use the other overload and reject sizes that don't // match at compile time. - template > + template > requires(X == dynamic_extent && std::convertible_to>) constexpr void copy_from(const R& other) requires(!std::is_const_v) @@ -714,7 +759,7 @@ class GSL_POINTER span { // span can also be constructed from it. If the input is a fixed-length // span then we want to use the other overload and reject sizes that don't // match at compile time. - template > + template > requires(X == dynamic_extent && std::convertible_to>) UNSAFE_BUFFER_USAGE constexpr void copy_from_nonoverlapping(const R& other) requires(!std::is_const_v) @@ -739,7 +784,7 @@ class GSL_POINTER span { // If `other` is dynamic-sized, then this function CHECKs if `other` is larger // than this span. If `other` is fixed-size, then the same verification is // done at compile time. - template > + template > requires((X <= N || X == dynamic_extent) && std::convertible_to>) constexpr void copy_prefix_from(const R& other) @@ -753,22 +798,6 @@ class GSL_POINTER span { } } - // Implicit conversion from std::span to base::span. - // - // We get other conversions for free from std::span's constructors, but it - // does not deduce N on its range constructor. - span(std::span, N> other) - : // SAFETY: std::span contains a valid data pointer and size such - // that pointer+size remains valid. - UNSAFE_BUFFERS( - span(std::ranges::data(other), std::ranges::size(other))) {} - span(std::span other) - requires(std::is_const_v) - : // SAFETY: std::span contains a valid data pointer and size such - // that pointer+size remains valid. - UNSAFE_BUFFERS( - span(std::ranges::data(other), std::ranges::size(other))) {} - // Implicit conversion from base::span to std::span. // // We get other conversions for free from std::span's constructors, but it @@ -877,8 +906,7 @@ class GSL_POINTER span { // valid range of the collection pointed to by the iterator. template requires(internal::CompatibleIter) - UNSAFE_BUFFER_USAGE constexpr span(It first, - StrictNumeric count) noexcept + UNSAFE_BUFFER_USAGE constexpr span(It first, StrictNumeric count) // The use of to_address() here is to handle the case where the iterator // `first` is pointing to the container's `end()`. In that case we can // not use the address returned from the iterator, or dereference it @@ -914,8 +942,8 @@ class GSL_POINTER span { template requires(internal::CompatibleIter && std::sized_sentinel_for && - !std::convertible_to) - UNSAFE_BUFFER_USAGE constexpr span(It begin, End end) noexcept + !std::is_convertible_v) + UNSAFE_BUFFER_USAGE constexpr span(It begin, End end) // SAFETY: The caller must guarantee that the iterator and end sentinel // are part of the same allocation, in which case it is the number of // elements between the iterators and thus a valid size for the pointer to @@ -932,21 +960,43 @@ class GSL_POINTER span { template // NOLINTNEXTLINE(google-explicit-constructor) - constexpr span(T (&arr)[N]) noexcept - // SAFETY: The std::ranges::size() function gives the number of elements - // pointed to by the std::ranges::data() function, which meets the - // requirement of span. - : UNSAFE_BUFFERS(span(std::ranges::data(arr), std::ranges::size(arr))) {} + constexpr span(std::type_identity_t (&arr LIFETIME_BOUND)[N]) noexcept + // SAFETY: The type signature guarantees `arr` contains `N` elements. + : UNSAFE_BUFFERS(span(arr, N)) {} template - requires(internal::LegacyCompatibleRange) + requires(internal::CompatibleRange) // NOLINTNEXTLINE(google-explicit-constructor) - constexpr span(R&& range) noexcept - // SAFETY: The std::ranges::size() function gives the number of elements - // pointed to by the std::ranges::data() function, which meets the - // requirement of span. + constexpr span(R&& range LIFETIME_BOUND) + // SAFETY: `std::ranges::size()` returns the number of elements + // `std::ranges::data()` will point to, so accessing those elements will + // be safe. : UNSAFE_BUFFERS( span(std::ranges::data(range), std::ranges::size(range))) {} + template + requires(internal::CompatibleRange && std::ranges::borrowed_range) + // NOLINTNEXTLINE(google-explicit-constructor) + constexpr span(R&& range) + // SAFETY: `std::ranges::size()` returns the number of elements + // `std::ranges::data()` will point to, so accessing those elements will + // be safe. + : UNSAFE_BUFFERS( + span(std::ranges::data(range), std::ranges::size(range))) {} + + constexpr span(std::initializer_list il LIFETIME_BOUND) + requires(std::is_const_v) + // SAFETY: `size()` is exactly the number of elements in the initializer + // list, so accessing that many will be safe. + : UNSAFE_BUFFERS(span(il.begin(), il.size())) {} + + constexpr span(const span& other) noexcept = default; + template + requires(internal::LegalDataConversion) + // NOLINTNEXTLINE(google-explicit-constructor) + constexpr span(const span& s) noexcept + : data_(s.data()), size_(s.size()) {} + + constexpr span& operator=(const span& other) noexcept = default; // [span.sub], span subviews template @@ -979,7 +1029,7 @@ class GSL_POINTER span { // SAFETY: span provides that data() points to at least `size()` many // elements. `count` is non-negative by its type and `count <= size()` from // the CHECK above. So `count` is a valid new size for `data()`. - return UNSAFE_BUFFERS({data(), count}); + return UNSAFE_BUFFERS(span(data(), count)); } // Returns a span over the last `count` elements. @@ -994,7 +1044,7 @@ class GSL_POINTER span { // the CHECK above. So `0 <= size() - count <= size()`, meaning // `size() - count` is a valid new size for `data()` and it will point to // `count` many elements. - return UNSAFE_BUFFERS({data() + (size() - size_t{count}), count}); + return UNSAFE_BUFFERS(span(data() + (size() - size_t{count}), count)); } template @@ -1032,7 +1082,8 @@ class GSL_POINTER span { constexpr span subspan(size_t offset, size_t count = dynamic_extent) const noexcept { CHECK_LE(offset, size()); - CHECK(count == dynamic_extent || count <= size() - offset); + CHECK(count == dynamic_extent || count <= size() - offset) + << " count: " << count << " offset: " << offset << " size: " << size(); const size_t new_extent = count != dynamic_extent ? count : size() - offset; // SAFETY: span provides that data() points to at least `size()` many // elements. @@ -1051,7 +1102,7 @@ class GSL_POINTER span { // valid offsets for data(), and since `new_extent` is non-negative, `offset // + new_extent` is not before `offset` so `new_extent` is a valid size for // the span at `data() + offset`. - return UNSAFE_BUFFERS({data() + offset, new_extent}); + return UNSAFE_BUFFERS(span(data() + offset, new_extent)); } // Convert a dynamic-extent span to a fixed-extent span. Returns a @@ -1112,6 +1163,25 @@ class GSL_POINTER span { return UNSAFE_BUFFERS(data()[idx]); } + // Returns a pointer to an element in the span. + // + // This avoids the construction of a reference to the element, which is + // important for cases such as in-place new, where the memory is + // uninitialized. + // + // This is sugar for `span.subspan(idx, 1u).data()` which also ensures the + // returned span has a pointer into and not past the end of the original span. + // + // # Checks + // The function CHECKs that the `idx` is inside the span and will terminate + // otherwise. + constexpr T* get_at(size_t idx) const noexcept { + CHECK_LT(idx, size()); + // SAFETY: Since data() always points to at least `N` elements, the check + // above ensures `idx < N` and is thus in range for data(). + return UNSAFE_BUFFERS(data() + idx); + } + // Returns a reference to the first element in the span. // // # Checks @@ -1356,26 +1426,16 @@ class GSL_POINTER span { // [span.deduct], deduction guides. template requires(std::contiguous_iterator) -span(It, EndOrSize) -> span>>; - -template < - typename R, - typename T = std::remove_reference_t>> - requires(std::ranges::contiguous_range) -span(R&&) - -> span, T, const T>, - internal::ExtentV>; - -// This guide prefers to let the contiguous_range guide match, since it can -// produce a fixed-size span. Whereas, LegacyRange only produces a dynamic-sized -// span. -template - requires(!std::ranges::contiguous_range && internal::LegacyRange) -span(R&& r) noexcept - -> span>; +span(It, EndOrSize) -> span>, + internal::MaybeStaticExt>; template -span(const T (&)[N]) -> span; +span(T (&)[N]) -> span; + +template + requires(std::ranges::contiguous_range) +span(R&&) -> span>, + internal::kComputedExtent>; // [span.objectrep], views of object representation template @@ -1468,56 +1528,52 @@ auto as_writable_chars(span s) noexcept { } // Type-deducing helper for constructing a span. +// Deprecated: Use CTAD (i.e. use `span()` directly without template arguments). +// TODO(crbug.com/341907909): Remove. // -// # Safety -// The contiguous iterator `it` must point to the first element of at least -// `size` many elements or Undefined Behaviour may result as the span may give -// access beyond the bounds of the collection pointed to by `it`. -template -UNSAFE_BUFFER_USAGE constexpr auto make_span( - It it, - StrictNumeric size) noexcept { - using T = std::remove_reference_t>; - // SAFETY: The caller guarantees that `it` is the first of at least `size` - // many elements. - return UNSAFE_BUFFERS(span(it, size)); -} - -// Type-deducing helper for constructing a span. -// -// # Checks -// The function CHECKs that `it <= end` and will terminate otherwise. -// -// # Safety -// The contiguous iterator `it` and its end sentinel `end` must be for the same -// allocation or Undefined Behaviour may result as the span may give access -// beyond the bounds of the collection pointed to by `it`. -template >> -UNSAFE_BUFFER_USAGE constexpr auto make_span(It it, End end) noexcept { - using T = std::remove_reference_t>; - // SAFETY: The caller guarantees that `it` and `end` are iterators of the - // same allocation. - return UNSAFE_BUFFERS(span(it, end)); +// SAFETY: `it` must point to the first of a (possibly-empty) series of +// contiguous valid elements. If `end_or_size` is a size, the series must +// contain at least that many valid elements; if it is an iterator or sentinel, +// it must refer to the same allocation, and all elements in the range [it, +// end_or_size) must be valid. Otherwise, the span will allow access to invalid +// elements, resulting in UB. +template + requires(std::contiguous_iterator) +UNSAFE_BUFFER_USAGE constexpr auto make_span(It it, EndOrSize end_or_size) { + return UNSAFE_BUFFERS(span(it, end_or_size)); } // make_span utility function that deduces both the span's value_type and extent // from the passed in argument. // // Usage: auto span = base::make_span(...); +// Deprecated: Use CTAD (i.e. use `span()` directly without template arguments). +// TODO(crbug.com/341907909): Remove. template -constexpr auto make_span(Container&& container) noexcept { - using T = - std::remove_pointer_t()))>; - using Extent = internal::Extent; - return span(std::forward(container)); + requires(internal::SpanConstructibleFrom) +constexpr auto make_span(Container&& container LIFETIME_BOUND) { + return span(std::forward(container)); +} +template + requires(internal::SpanConstructibleFrom && + std::ranges::borrowed_range) +constexpr auto make_span(Container&& container) { + return span(std::forward(container)); } // `span_from_ref` converts a reference to T into a span of length 1. This is a // non-std helper that is inspired by the `std::slice::from_ref()` function from // Rust. +// +// Const references are turned into a `span` while mutable +// references are turned into a `span`. +template +constexpr span span_from_ref( + const T& single_object LIFETIME_BOUND) noexcept { + // SAFETY: Given a valid reference to `single_object` the span of size 1 will + // be a valid span that points to the `single_object`. + return UNSAFE_BUFFERS(span(std::addressof(single_object), 1u)); +} template constexpr span span_from_ref(T& single_object LIFETIME_BOUND) noexcept { // SAFETY: Given a valid reference to `single_object` the span of size 1 will @@ -1632,9 +1688,15 @@ constexpr span byte_span_with_nul_from_cstring( // or vector-like objects holding other scalar types, prior to passing them // into an API that requires byte spans. template - requires requires(const Spannable& arg) { make_span(arg); } + requires(internal::SpanConstructibleFrom) +constexpr auto as_byte_span(const Spannable& arg LIFETIME_BOUND) { + return as_bytes(span(arg)); +} +template + requires(internal::SpanConstructibleFrom && + std::ranges::borrowed_range) constexpr auto as_byte_span(const Spannable& arg) { - return as_bytes(make_span(arg)); + return as_bytes(span(arg)); } template @@ -1649,26 +1711,23 @@ constexpr span as_byte_span( // or vector-like objects holding other scalar types, prior to passing them // into an API that requires mutable byte spans. template - requires requires(Spannable&& arg) { - make_span(arg); - requires !std::is_const_v; - } + requires(internal::SpanConstructibleFrom && + !std::is_const_v()))::element_type>) +// NOTE: `arg` is not marked as lifetimebound because the "non-const +// `element_type`" requirement above will in turn require `Spannable` to be a +// borrowed range. constexpr auto as_writable_byte_span(Spannable&& arg) { - return as_writable_bytes(make_span(std::forward(arg))); + return as_writable_bytes(span(std::forward(arg))); } // This overload for arrays preserves the compile-time size N of the array in // the span type signature span. template + requires(!std::is_const_v) constexpr span as_writable_byte_span( T (&arr LIFETIME_BOUND)[N]) { - return as_writable_bytes(make_span(arr)); -} - -template -constexpr span as_writable_byte_span( - T (&&arr LIFETIME_BOUND)[N]) { - return as_writable_bytes(make_span(arr)); + return as_writable_bytes(span(arr)); } namespace internal { @@ -1751,22 +1810,4 @@ constexpr std::ostream& operator<<(std::ostream& l, span r) { } // namespace base -template -inline constexpr bool - std::ranges::enable_borrowed_range> = true; - -template -inline constexpr bool std::ranges::enable_view> = true; - -// EXTENT returns the size of any type that can be converted to a |base::span| -// with definite extent, i.e. everything that is a contiguous storage of some -// sort with static size. Specifically, this works for std::array in a constexpr -// context. Note: -// * |std::size| should be preferred for plain arrays. -// * In run-time contexts, functions such as |std::array::size| should be -// preferred. -#define EXTENT(x) \ - ::base::internal::must_not_be_dynamic_extent() - #endif // BASE_CONTAINERS_SPAN_H_ diff --git a/naiveproxy/src/base/containers/span_nocompile.nc b/naiveproxy/src/base/containers/span_nocompile.nc index 6388e7d40d..5ea9657235 100644 --- a/naiveproxy/src/base/containers/span_nocompile.nc +++ b/naiveproxy/src/base/containers/span_nocompile.nc @@ -9,11 +9,10 @@ #include #include +#include #include #include - - namespace base { class Base { @@ -70,7 +69,9 @@ void PtrToConstPtrConversionDisallowed() { // A const container should not be convertible to a mutable span. void ConstContainerToMutableConversionDisallowed() { const std::vector v = {1, 2, 3}; - span span(v); // expected-error {{no matching constructor for initialization of 'span'}} + span span1(v); // expected-error {{no matching constructor for initialization of 'span'}} + span span2({1, 2}); // expected-error {{no matching constructor for initialization of 'span'}} + span span3(make_span(v)); // expected-error {{no matching constructor for initialization of 'span'}} } // A dynamic const container should not be implicitly convertible to a static span. @@ -85,15 +86,20 @@ void ImplicitConversionFromDynamicMutableContainerToStaticSpanDisallowed() { span span = v; // expected-error {{no viable conversion from 'std::vector' to 'span'}} } +// Fixed-extent span construction from an initializer list is explicit. +void InitializerListConstructionIsExplicit() { + span s = {{1, 2, 3}}; // expected-error {{chosen constructor is explicit in copy-initialization}} +} + // A std::set() should not satisfy the requirements for conversion to a span. void StdSetConversionDisallowed() { std::set set; span span1(set.begin(), 0u); // expected-error {{no matching constructor for initialization of 'span'}} span span2(set.begin(), set.end()); // expected-error {{no matching constructor for initialization of 'span'}} span span3(set); // expected-error {{no matching constructor for initialization of 'span'}} - auto span4 = make_span(set.begin(), 0u); // expected-error@*:* {{no matching constructor for initialization of 'span' (aka 'span')}} - auto span5 = make_span(set.begin(), set.end()); // expected-error@*:* {{no matching constructor for initialization of 'span' (aka 'span')}} - auto span6 = make_span(set); // expected-error@*:* {{no matching function for call to 'data'}} + auto span4 = make_span(set.begin(), 0u); // expected-error@*:* {{no matching function for call to 'make_span'}} + auto span5 = make_span(set.begin(), set.end()); // expected-error@*:* {{no matching function for call to 'make_span'}} + auto span6 = make_span(set); // expected-error@*:* {{no matching function for call to 'make_span'}} } // Static views of spans with static extent must not exceed the size. @@ -138,16 +144,100 @@ void ConstVectorDeducesAsConstSpan() { span s = make_span(v); // expected-error-re@*:* {{no viable conversion from 'span<{{.*}}, [...]>' to 'span'}} } -// EXTENT should not result in |dynamic_extent|, it should be a compile-time -// error. -void ExtentNoDynamicExtent() { - std::vector vector; - constexpr size_t extent = EXTENT(vector); // expected-error@*:* {{EXTENT should only be used for containers with a static extent}} +// A span can only be constructed from a range rvalue when the element type is +// read-only or the range is a borrowed range. +void SpanFromNonConstRvalueRange() { + std::array arr = {true, false, true}; + [[maybe_unused]] auto a = span(std::move(arr)); // expected-error {{no matching conversion}} + + std::string str = "ok"; + [[maybe_unused]] auto b = span(std::move(str)); // expected-error {{no matching conversion}} + + std::u16string str16 = u"ok"; + [[maybe_unused]] auto c = span(std::move(str16)); // expected-error {{no matching conversion}} + + std::vector vec = {1, 2, 3, 4, 5}; + [[maybe_unused]] auto d = span(std::move(vec)); // expected-error {{no matching conversion}} +} + +// make_span can only be called on a range rvalue when the element type is +// read-only or the range is a borrowed range. +void MakeSpanFromNonConstRvalueRange() { + std::array arr = {true, false, true}; + [[maybe_unused]] auto a = make_span(std::move(arr)); // expected-error {{no matching function for call to 'make_span'}} + + std::string str = "ok"; + [[maybe_unused]] auto b = make_span(std::move(str)); // expected-error {{no matching function for call to 'make_span'}} + + std::u16string str16 = u"ok"; + [[maybe_unused]] auto c = make_span(std::move(str16)); // expected-error {{no matching function for call to 'make_span'}} + + std::vector vec = {1, 2, 3, 4, 5}; + [[maybe_unused]] auto d = make_span(std::move(vec)); // expected-error {{no matching function for call to 'make_span'}} } void Dangling() { - span s1{std::array()}; // expected-error {{object backing the pointer will be destroyed at the end of the full-expression}} - span s2{std::vector({1, 2, 3})}; // expected-error {{object backing the pointer will be destroyed at the end of the full-expression}} + // `std::array` destroyed at the end of the full expression. + [[maybe_unused]] auto a = span(std::to_array({1, 2, 3})); // expected-error-re {{temporary whose address is used as value of local variable {{.*}}will be destroyed at the end of the full-expression}} + [[maybe_unused]] auto b = span(std::to_array({1, 2, 3})); // expected-error-re {{temporary whose address is used as value of local variable {{.*}}will be destroyed at the end of the full-expression}} + + // Range destroyed at the end of the full expression. + [[maybe_unused]] auto c = span(std::vector({1, 2, 3})); // expected-error-re {{temporary whose address is used as value of local variable {{.*}}will be destroyed at the end of the full-expression}} + [[maybe_unused]] auto d = span(std::vector({1, 2, 3})); // expected-error-re {{temporary whose address is used as value of local variable {{.*}}will be destroyed at the end of the full-expression}} + + // Here the `std::string` is an lvalue, but the `std::vector`s that copy its + // data aren't. + std::string str = "123"; + [[maybe_unused]] auto e = + span(std::vector(str.begin(), str.end())); // expected-error-re {{temporary whose address is used as value of local variable {{.*}}will be destroyed at the end of the full-expression}} + [[maybe_unused]] auto f = + span(std::vector(str.begin(), str.end())); // expected-error-re {{temporary whose address is used as value of local variable {{.*}}will be destroyed at the end of the full-expression}} + + // `std::string_view`'s safety depends on the life of the referred-to buffer. + // Here the underlying data is destroyed before the end of the full + // expression. + [[maybe_unused]] auto g = + span(std::string_view(std::string("123"))); // expected-error {{object backing the pointer will be destroyed at the end of the full-expression}} + [[maybe_unused]] auto h = + span(std::string_view(std::string("123"))); // expected-error {{object backing the pointer will be destroyed at the end of the full-expression}} + // TODO(https://github.com/llvm/llvm-project/issues/111768) Detect dangling + // usage sufficient to enable this testcase. +#if 0 + [[maybe_unused]] auto i = as_byte_span(std::string_view(std::string("123"))); // expected-error {{object backing the pointer will be destroyed at the end of the full-expression}} +#endif + + // Spans must not outlast a referred-to C-style array. It's tricky to create + // an object of C-style array type (not an initializer list) that is destroyed + // before the end of the full expression, so instead test the case where the + // referred-to array goes out of scope before the referring span. + [] { + int arr[3] = {1, 2, 3}; + return span(arr); // expected-error-re {{address of stack memory associated with local variable {{.*}}returned}} + }(); + [] { + int arr[3] = {1, 2, 3}; + return span(arr); // expected-error-re {{address of stack memory associated with local variable {{.*}}returned}} + }(); + + // TODO(https://github.com/llvm/llvm-project/issues/99685) Detect dangling + // usage sufficient to enable this testcase. +#if 0 + []() -> std::optional> { + int arr[3] = {1, 2, 3}; + return span(arr); // expected-error-re {{address of stack memory associated with local variable {{.*}}returned}} + }(); +#endif + + // span's `std::array` constructor takes lvalue refs, so to test the non-const + // `element_type` case, use the same technique as above. + [] { + std::array arr{1, 2, 3}; + return span(arr); // expected-error-re + {{address of stack memory associated with local variable {{.*}}returned}} + }(); + [] { + std::array arr{1, 2, 3}; + return span(arr); // expected-error-re + {{address of stack memory associated with local variable {{.*}}returned}} + }(); } void NotSizeTSize() { @@ -198,38 +288,30 @@ void FixedSizeSplitAtOutOfBounds() { base::span(arr).split_at<4u>(); // expected-error@*:* {{no matching member function for call to 'split_at'}} } -void FromRefNoSuchFunctionForIntLiteral() { - // Expectations of this test just capture the current behavior which is not - // necessarily desirable or required. This test expects that when we ask the - // compiler to deduce the template arguments for `span_from_ref` (the only - // difference from `FromRefLifetimeBoundErrorForIntLiteral` below) then it - // will fail to find a suitable function to invoke. - auto wont_work = span_from_ref(123); // expected-error@*:* {{no matching function for call to 'span_from_ref'}} -} - void FromRefLifetimeBoundErrorForIntLiteral() { // Testing that `LIFETIME_BOUND` works as intended. - [[maybe_unused]] auto wont_work = - span_from_ref(123); // expected-error@*:* {{temporary whose address is used as value of local variable 'wont_work' will be destroyed at the end of the full-expression}} + [[maybe_unused]] auto wont_work = span_from_ref(123); // expected-error-re {{temporary whose address is used as value of local variable {{.*}}will be destroyed at the end of the full-expression}} + [[maybe_unused]] auto wont_work2 = byte_span_from_ref(123); // expected-error-re {{temporary whose address is used as value of local variable {{.*}}will be destroyed at the end of the full-expression}} } void FromRefLifetimeBoundErrorForTemporaryStringObject() { // Testing that `LIFETIME_BOUND` works as intended. [[maybe_unused]] auto wont_work = - span_from_ref("temporary string"); // expected-error@*:* {{temporary whose address is used as value of local variable 'wont_work' will be destroyed at the end of the full-expression}} + span_from_ref("temporary string"); // expected-error-re {{temporary whose address is used as value of local variable {{.*}}will be destroyed at the end of the full-expression}} + [[maybe_unused]] auto wont_work2 = + as_byte_span(std::string("temporary string")); // expected-error-re {{temporary whose address is used as value of local variable {{.*}}will be destroyed at the end of the full-expression}} } -void RvalueArrayLifetime() { - [[maybe_unused]] auto wont_work = - as_byte_span({1, 2}); // expected-error@*:* {{temporary whose address is used as value of local variable 'wont_work' will be destroyed at the end of the full-expression}} +void InitializerListLifetime() { + // `std::initializer_list` destroyed at the end of the full expression. + [[maybe_unused]] auto wont_work = span({1, 2}); // expected-error-re {{array backing local initializer list {{.*}}will be destroyed at the end of the full-expression}} + [[maybe_unused]] auto wont_work2 = span({1, 2}); // expected-error-re {{array backing local initializer list {{.*}}will be destroyed at the end of the full-expression}} + [[maybe_unused]] auto wont_work3 = as_byte_span({1, 2}); // expected-error-re {{temporary whose address is used as value of local variable {{.*}}will be destroyed at the end of the full-expression}} } void FromCStringThatIsntStaticLifetime() { - [[maybe_unused]] auto wont_work = - span_from_cstring({'a', 'b', '\0'}); // expected-error@*:* {{temporary whose address is used as value of local variable 'wont_work' will be destroyed at the end of the full-expression}} - - [[maybe_unused]] auto wont_work2 = - byte_span_from_cstring({'a', 'b', '\0'}); // expected-error@*:* {{temporary whose address is used as value of local variable 'wont_work2' will be destroyed at the end of the full-expression}} + [[maybe_unused]] auto wont_work = span_from_cstring({'a', 'b', '\0'}); // expected-error-re {{temporary whose address is used as value of local variable {{.*}}will be destroyed at the end of the full-expression}} + [[maybe_unused]] auto wont_work2 = byte_span_from_cstring({'a', 'b', '\0'}); // expected-error-re {{temporary whose address is used as value of local variable {{.*}}will be destroyed at the end of the full-expression}} } void CompareFixedSizeMismatch() { diff --git a/naiveproxy/src/base/containers/span_reader.h b/naiveproxy/src/base/containers/span_reader.h index aacb2de004..a9bc640296 100644 --- a/naiveproxy/src/base/containers/span_reader.h +++ b/naiveproxy/src/base/containers/span_reader.h @@ -281,8 +281,8 @@ class SpanReader { size_t original_size_; }; -template -SpanReader(span) -> SpanReader; +template +SpanReader(span) -> SpanReader; } // namespace base diff --git a/naiveproxy/src/base/containers/span_rust.h b/naiveproxy/src/base/containers/span_rust.h index 8deaa29dbc..2ecbc7fc77 100644 --- a/naiveproxy/src/base/containers/span_rust.h +++ b/naiveproxy/src/base/containers/span_rust.h @@ -8,11 +8,11 @@ #include #include "base/containers/span.h" -#include "base/rust_buildflags.h" +#include "build/build_config.h" #include "third_party/rust/cxx/v1/cxx.h" -#if !BUILDFLAG(BUILD_RUST_BASE_CONVERSIONS) -#error "span_rust.h included without BUILD_RUST_BASE_CONVERSIONS" +#if BUILDFLAG(IS_NACL) +#error "span_rust.h included under IS_NACL" #endif namespace base { diff --git a/naiveproxy/src/base/containers/vector_buffer.h b/naiveproxy/src/base/containers/vector_buffer.h index a0ff29cabb..1304daa085 100644 --- a/naiveproxy/src/base/containers/vector_buffer.h +++ b/naiveproxy/src/base/containers/vector_buffer.h @@ -116,6 +116,8 @@ class VectorBuffer { return as_span().subspan(index, size); } + T* get_at(size_t index) { return as_span().get_at(index); } + // DestructRange ------------------------------------------------------------ static void DestructRange(span range) { diff --git a/naiveproxy/src/base/debug/allocation_trace.h b/naiveproxy/src/base/debug/allocation_trace.h index 96d0911c0e..d1c729fd04 100644 --- a/naiveproxy/src/base/debug/allocation_trace.h +++ b/naiveproxy/src/base/debug/allocation_trace.h @@ -66,7 +66,7 @@ class BASE_EXPORT OperationRecord { // Number of allocated bytes. Returns 0 for free operations. size_t GetSize() const; // The stacktrace as taken by the Initialize*-functions. - const StackTraceContainer& GetStackTrace() const; + const StackTraceContainer& GetStackTrace() const LIFETIME_BOUND; // Initialize the record with data for another operation. Data from any // previous operation will be silently overwritten. These functions are diff --git a/naiveproxy/src/base/debug/proc_maps_linux.cc b/naiveproxy/src/base/debug/proc_maps_linux.cc index 421ee2c802..c14f985072 100644 --- a/naiveproxy/src/base/debug/proc_maps_linux.cc +++ b/naiveproxy/src/base/debug/proc_maps_linux.cc @@ -14,7 +14,9 @@ #include "base/files/file_util.h" #include "base/files/scoped_file.h" +#include "base/format_macros.h" #include "base/logging.h" +#include "base/memory/page_size.h" #include "base/strings/string_split.h" #include "build/build_config.h" @@ -22,12 +24,11 @@ #include #endif -namespace base { -namespace debug { +namespace base::debug { MappedMemoryRegion::MappedMemoryRegion() = default; MappedMemoryRegion::MappedMemoryRegion(const MappedMemoryRegion&) = default; -MappedMemoryRegion::MappedMemoryRegion(MappedMemoryRegion&&) = default; +MappedMemoryRegion::MappedMemoryRegion(MappedMemoryRegion&&) noexcept = default; // Scans |proc_maps| starting from |pos| returning true if the gate VMA was // found, otherwise returns false. @@ -170,5 +171,71 @@ bool ParseProcMaps(const std::string& input, return true; } -} // namespace debug -} // namespace base +std::optional ParseSmapsRollup(const std::string& buffer) { + std::vector lines = + SplitString(buffer, "\n", base::TRIM_WHITESPACE, base::SPLIT_WANT_ALL); + + std::unordered_map tmp; + for (const auto& line : lines) { + // This should be more than enough space for any output we get (but we also + // verify the size below). + std::string key; + key.resize(100); + size_t val; + if (sscanf(line.c_str(), "%99s %" PRIuS " kB", key.data(), &val) == 2) { + // sscanf writes a nul-byte at the end of the result, so |strlen| is safe + // here. |resize| does not count the length of the nul-byte, and we want + // to trim off the trailing colon at the end, so we use |strlen - 1| here. + key.resize(strlen(key.c_str()) - 1); + tmp[key] = val * 1024; + } + } + + SmapsRollup smaps_rollup; + + smaps_rollup.rss = tmp["Rss"]; + smaps_rollup.pss = tmp["Pss"]; + smaps_rollup.pss_anon = tmp["Pss_Anon"]; + smaps_rollup.pss_file = tmp["Pss_File"]; + smaps_rollup.pss_shmem = tmp["Pss_Shmem"]; + smaps_rollup.private_dirty = tmp["Private_Dirty"]; + smaps_rollup.swap = tmp["Swap"]; + smaps_rollup.swap_pss = tmp["SwapPss"]; + + return smaps_rollup; +} + +std::optional ReadAndParseSmapsRollup() { + const size_t read_size = base::GetPageSize(); + + base::ScopedFD fd(HANDLE_EINTR(open("/proc/self/smaps_rollup", O_RDONLY))); + if (!fd.is_valid()) { + DPLOG(ERROR) << "Couldn't open /proc/self/smaps_rollup"; + return std::nullopt; + } + + std::string buffer; + buffer.resize(read_size); + + ssize_t bytes_read = HANDLE_EINTR( + read(fd.get(), static_cast(buffer.data()), read_size)); + if (bytes_read < 0) { + DPLOG(ERROR) << "Couldn't read /proc/self/smaps_rollup"; + return std::nullopt; + } + + // We expect to read a few hundred bytes, which should be significantly less + // the page size. + DCHECK(static_cast(bytes_read) < read_size); + + buffer.resize(static_cast(bytes_read)); + + return ParseSmapsRollup(buffer); +} + +std::optional ParseSmapsRollupForTesting( + const std::string& smaps_rollup) { + return ParseSmapsRollup(smaps_rollup); +} + +} // namespace base::debug diff --git a/naiveproxy/src/base/debug/proc_maps_linux.h b/naiveproxy/src/base/debug/proc_maps_linux.h index ffa74c63f5..2fb43c7b24 100644 --- a/naiveproxy/src/base/debug/proc_maps_linux.h +++ b/naiveproxy/src/base/debug/proc_maps_linux.h @@ -7,16 +7,16 @@ #include +#include #include #include #include "base/base_export.h" -namespace base { -namespace debug { +namespace base::debug { // Describes a region of mapped memory and the path of the file mapped. -struct MappedMemoryRegion { +struct BASE_EXPORT MappedMemoryRegion { enum Permission { READ = 1 << 0, WRITE = 1 << 1, @@ -26,7 +26,7 @@ struct MappedMemoryRegion { MappedMemoryRegion(); MappedMemoryRegion(const MappedMemoryRegion&); - MappedMemoryRegion(MappedMemoryRegion&&); + MappedMemoryRegion(MappedMemoryRegion&&) noexcept; // The address range [start,end) of mapped memory. uintptr_t start; @@ -41,8 +41,11 @@ struct MappedMemoryRegion { // Bitmask of read/write/execute/private/shared permissions. uint8_t permissions; + // Major and minor device numbers for the region. uint8_t dev_major; uint8_t dev_minor; + + // Inode for the region. long inode; // Name of the file mapped into memory. @@ -96,7 +99,24 @@ BASE_EXPORT bool ReadProcMaps(std::string* proc_maps); BASE_EXPORT bool ParseProcMaps(const std::string& input, std::vector* regions); -} // namespace debug -} // namespace base +struct SmapsRollup { + size_t rss = 0; + size_t pss = 0; + size_t pss_anon = 0; + size_t pss_file = 0; + size_t pss_shmem = 0; + size_t private_dirty = 0; + size_t swap = 0; + size_t swap_pss = 0; +}; + +// Attempts to read /proc/self/smaps_rollup. Returns nullopt on error. +BASE_EXPORT std::optional ReadAndParseSmapsRollup(); + +// |smaps_rollup| should be the result of reading /proc/*/smaps_rollup. +BASE_EXPORT std::optional ParseSmapsRollupForTesting( + const std::string& smaps_rollup); + +} // namespace base::debug #endif // BASE_DEBUG_PROC_MAPS_LINUX_H_ diff --git a/naiveproxy/src/base/debug/stack_trace_fuchsia.cc b/naiveproxy/src/base/debug/stack_trace_fuchsia.cc index 25928d13e3..59f4ba2158 100644 --- a/naiveproxy/src/base/debug/stack_trace_fuchsia.cc +++ b/naiveproxy/src/base/debug/stack_trace_fuchsia.cc @@ -2,6 +2,8 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. +#include "base/memory/raw_ptr.h" + #ifdef UNSAFE_BUFFERS_BUILD // TODO(crbug.com/40284755): Remove this and spanify to fix the errors. #pragma allow_unsafe_buffers @@ -75,7 +77,7 @@ const char* PermissionFlagsToString(int flags, char permission_buf[4]) { class SymbolMap { public: struct Segment { - const void* addr = nullptr; + raw_ptr addr = nullptr; size_t relative_addr = 0; int permission_flags = 0; size_t size = 0; @@ -86,7 +88,7 @@ class SymbolMap { // binaries have only 2-3 such segments. static constexpr size_t kMaxSegmentCount = 8; - const void* addr = nullptr; + raw_ptr addr = nullptr; std::array segments; size_t segment_count = 0; char name[ZX_MAX_NAME_LEN + 1] = {0}; @@ -165,7 +167,7 @@ void SymbolMap::Populate() { Segment segment; segment.addr = - reinterpret_cast(next_entry.addr) + phdr.p_vaddr; + reinterpret_cast(next_entry.addr.get()) + phdr.p_vaddr; segment.relative_addr = phdr.p_vaddr; segment.size = phdr.p_memsz; segment.permission_flags = static_cast(phdr.p_flags); @@ -214,7 +216,7 @@ bool ModuleContainsFrameAddress(const void* address, for (size_t i = 0; i < module_entry.segment_count; ++i) { const SymbolMap::Segment& segment = module_entry.segments[i]; const void* segment_end = reinterpret_cast( - reinterpret_cast(segment.addr) + segment.size - 1); + reinterpret_cast(segment.addr.get()) + segment.size - 1); if (address >= segment.addr && address <= segment_end) { return true; diff --git a/naiveproxy/src/base/feature_list.cc b/naiveproxy/src/base/feature_list.cc index 75dc0b1f1f..8a2aa7acdb 100644 --- a/naiveproxy/src/base/feature_list.cc +++ b/naiveproxy/src/base/feature_list.cc @@ -242,8 +242,8 @@ bool ParseEnableFeatures(const std::string& enable_features, force_fieldtrial_params_list.push_back(study + "." + group + ":" + feature_params); } - enable_features_list.push_back( - study.empty() ? feature_name : (feature_name + "<" + study)); + enable_features_list.push_back(study.empty() ? std::move(feature_name) + : feature_name + "<" + study); } *parsed_enable_features = JoinString(enable_features_list, ","); @@ -533,8 +533,8 @@ bool FeatureList::ParseEnableFeatureString(std::string_view enable_feature, // feature and its feature params to a synthetic field trial as the // feature params only make sense when it's combined with a field trial. if (!feature_params.empty()) { - study = study.empty() ? "Study" + enable_feature_name : study; - group = group.empty() ? "Group" + enable_feature_name : group; + study = study.empty() ? "Study" + enable_feature_name : std::move(study); + group = group.empty() ? "Group" + enable_feature_name : std::move(group); } feature_name->swap(enable_feature_name); @@ -615,10 +615,6 @@ void FeatureList::SetInstance(std::unique_ptr instance) { // Configured first because it takes precedence over the getrandom() trial. internal::ConfigureBoringSSLBackedRandBytesFieldTrial(); #endif - -#if BUILDFLAG(IS_ANDROID) - internal::ConfigureRandBytesFieldTrial(); -#endif } #if BUILDFLAG(DCHECK_IS_CONFIGURABLE) diff --git a/naiveproxy/src/base/features.cc b/naiveproxy/src/base/features.cc index 3311963935..6c64e3d8da 100644 --- a/naiveproxy/src/base/features.cc +++ b/naiveproxy/src/base/features.cc @@ -33,12 +33,6 @@ namespace base::features { // Alphabetical: -// Enforce that writeable file handles passed to untrusted processes are not -// backed by executable files. -BASE_FEATURE(kEnforceNoExecutableFileHandles, - "EnforceNoExecutableFileHandles", - FEATURE_ENABLED_BY_DEFAULT); - // Activate base::FeatureParamWithCache internal cache. // TODO(https://crbug.com/340824113): Remove the feature flag below. BASE_FEATURE(kFeatureParamWithCache, @@ -114,7 +108,7 @@ BASE_FEATURE(kCollectAndroidFrameTimelineMetrics, // thread, BASE_FEATURE(kPostPowerMonitorBroadcastReceiverInitToBackground, "PostPowerMonitorBroadcastReceiverInitToBackground", - FEATURE_DISABLED_BY_DEFAULT); + FEATURE_ENABLED_BY_DEFAULT); // If enabled, getMyMemoryState IPC will be posted to background. BASE_FEATURE(kPostGetMyMemoryStateToBackground, "PostGetMyMemoryStateToBackground", diff --git a/naiveproxy/src/base/features.h b/naiveproxy/src/base/features.h index a4555cbeea..c2bf772de2 100644 --- a/naiveproxy/src/base/features.h +++ b/naiveproxy/src/base/features.h @@ -15,8 +15,6 @@ namespace base::features { // alongside the definition of their values in the .cc file. // Alphabetical: -BASE_EXPORT BASE_DECLARE_FEATURE(kEnforceNoExecutableFileHandles); - BASE_EXPORT BASE_DECLARE_FEATURE(kFeatureParamWithCache); BASE_EXPORT BASE_DECLARE_FEATURE(kUseRustJsonParser); diff --git a/naiveproxy/src/base/files/file_enumerator.cc b/naiveproxy/src/base/files/file_enumerator.cc index 1f08866bcb..28dbb4a256 100644 --- a/naiveproxy/src/base/files/file_enumerator.cc +++ b/naiveproxy/src/base/files/file_enumerator.cc @@ -11,8 +11,19 @@ namespace base { FileEnumerator::FileInfo::~FileInfo() = default; +FileEnumerator::FileInfo::FileInfo(const FileEnumerator::FileInfo&) = default; + +FileEnumerator::FileInfo::FileInfo(FileEnumerator::FileInfo&&) = default; + +FileEnumerator::FileInfo& FileEnumerator::FileInfo::operator=( + const FileEnumerator::FileInfo& that) = default; + +FileEnumerator::FileInfo& FileEnumerator::FileInfo::operator=( + FileEnumerator::FileInfo&& that) = default; + bool FileEnumerator::ShouldSkip(const FilePath& path) { - FilePath::StringType basename = path.BaseName().value(); + FilePath base_path = path.BaseName(); + const FilePath::StringType& basename = base_path.value(); return basename == FILE_PATH_LITERAL(".") || (basename == FILE_PATH_LITERAL("..") && !(INCLUDE_DOT_DOT & file_type_)); diff --git a/naiveproxy/src/base/files/file_enumerator.h b/naiveproxy/src/base/files/file_enumerator.h index 207ab5e62a..0e2d69fcb4 100644 --- a/naiveproxy/src/base/files/file_enumerator.h +++ b/naiveproxy/src/base/files/file_enumerator.h @@ -62,6 +62,10 @@ class BASE_EXPORT FileEnumerator { off_t size, Time time); #endif + FileInfo(const FileInfo& that); + FileInfo& operator=(const FileInfo& that); + FileInfo(FileInfo&& that); + FileInfo& operator=(FileInfo&& that); ~FileInfo(); bool IsDirectory() const; @@ -71,6 +75,11 @@ class BASE_EXPORT FileEnumerator { // includes the |root_path| passed into the FileEnumerator constructor. FilePath GetName() const; +#if BUILDFLAG(IS_ANDROID) + // Display names of subdirs. + const std::vector& subdirs() const { return subdirs_; } +#endif + int64_t GetSize() const; // On POSIX systems, this is rounded down to the second. @@ -92,6 +101,7 @@ class BASE_EXPORT FileEnumerator { #if BUILDFLAG(IS_ANDROID) FilePath content_uri_; + std::vector subdirs_; #endif #if BUILDFLAG(IS_WIN) CHROME_WIN32_FIND_DATA find_data_; @@ -268,6 +278,12 @@ class BASE_EXPORT FileEnumerator { // A stack that keeps track of which subdirectories we still need to // enumerate in the breadth-first search. base::stack pending_paths_; +#if BUILDFLAG(IS_ANDROID) + // Matches pending_paths_, but with display names. + base::stack> pending_subdirs_; + // Display names of subdirs of the current entry. + std::vector subdirs_; +#endif }; } // namespace base diff --git a/naiveproxy/src/base/files/file_enumerator_posix.cc b/naiveproxy/src/base/files/file_enumerator_posix.cc index 4c109d5e6d..1a22b15238 100644 --- a/naiveproxy/src/base/files/file_enumerator_posix.cc +++ b/naiveproxy/src/base/files/file_enumerator_posix.cc @@ -146,8 +146,12 @@ FileEnumerator::FileEnumerator(const FilePath& root_path, #if BUILDFLAG(IS_ANDROID) // Content-URIs have limited support. if (root_path.IsContentUri()) { - CHECK(!recursive); CHECK_EQ(file_type_, FileType::FILES | FileType::DIRECTORIES); + // Get display-name of root path. + FileInfo root_info; + internal::ContentUriGetFileInfo(root_path, &root_info); + pending_subdirs_.push( + std::vector({root_info.GetName().value()})); } #endif @@ -185,10 +189,22 @@ FilePath FileEnumerator::Next() { #if BUILDFLAG(IS_ANDROID) if (root_path_.IsContentUri()) { + subdirs_ = pending_subdirs_.top(); + pending_subdirs_.pop(); directory_entries_ = internal::ListContentUriDirectory(root_path_); current_directory_entry_ = 0; if (directory_entries_.empty()) { - return base::FilePath(); + continue; + } + if (recursive_) { + for (auto& info : directory_entries_) { + info.subdirs_ = subdirs_; + if (info.IsDirectory()) { + pending_paths_.push(info.content_uri_); + pending_subdirs_.push(subdirs_); + pending_subdirs_.top().push_back(info.GetName().value()); + } + } } break; } diff --git a/naiveproxy/src/base/files/file_path.cc b/naiveproxy/src/base/files/file_path.cc index 4ce7df1604..33d0948c2c 100644 --- a/naiveproxy/src/base/files/file_path.cc +++ b/naiveproxy/src/base/files/file_path.cc @@ -621,21 +621,20 @@ bool FilePath::ReferencesParent() const { return false; } - std::vector components = GetComponents(); - std::vector::const_iterator it = components.begin(); - for (; it != components.end(); ++it) { - const StringType& component = *it; - // Windows has odd, undocumented behavior with path components containing - // only whitespace and . characters. So, if all we see is . and - // whitespace, then we treat any .. sequence as referencing parent. - // For simplicity we enforce this on all platforms. - if (component.find_first_not_of(FILE_PATH_LITERAL(". \n\r\t")) == - std::string::npos && - component.find(kParentDirectory) != std::string::npos) { - return true; - } - } - return false; + const std::vector components = GetComponents(); + return std::any_of( + components.begin(), components.end(), [](const StringType& component) { +#if BUILDFLAG(IS_WIN) + // Windows has odd, undocumented behavior with path components + // containing only whitespace and . characters. So, if all we see is . + // and whitespace, then we treat any .. sequence as referencing parent. + return component.find_first_not_of(FILE_PATH_LITERAL(". \n\r\t")) == + std::string::npos && + component.find(kParentDirectory) != std::string::npos; +#else + return component == kParentDirectory; +#endif + }); } #if BUILDFLAG(IS_WIN) diff --git a/naiveproxy/src/base/files/file_path.h b/naiveproxy/src/base/files/file_path.h index 837a2e4874..5d14b7721c 100644 --- a/naiveproxy/src/base/files/file_path.h +++ b/naiveproxy/src/base/files/file_path.h @@ -109,6 +109,7 @@ #include #include "base/base_export.h" +#include "base/compiler_specific.h" #include "base/trace_event/base_tracing_forward.h" #include "build/build_config.h" @@ -217,7 +218,7 @@ class BASE_EXPORT FilePath { return path_ < that.path_; } - const StringType& value() const { return path_; } + const StringType& value() const LIFETIME_BOUND { return path_; } [[nodiscard]] bool empty() const { return path_.empty(); } diff --git a/naiveproxy/src/base/files/file_posix.cc b/naiveproxy/src/base/files/file_posix.cc index 679e610e01..ae70271c6e 100644 --- a/naiveproxy/src/base/files/file_posix.cc +++ b/naiveproxy/src/base/files/file_posix.cc @@ -161,6 +161,17 @@ File::Error CallFcntlFlock(PlatformFile file, } #endif // BUILDFLAG(IS_NACL) +#if BUILDFLAG(IS_ANDROID) +bool GetContentUriInfo(const base::FilePath& path, File::Info* info) { + FileEnumerator::FileInfo file_info; + bool result = internal::ContentUriGetFileInfo(path, &file_info); + if (result) { + info->FromStat(file_info.stat()); + } + return result; +} +#endif + } // namespace void File::Info::FromStat(const stat_wrapper_t& stat_info) { @@ -448,12 +459,20 @@ bool File::GetInfo(Info* info) const { #if BUILDFLAG(IS_ANDROID) if (path_.IsContentUri()) { // Content-URIs may represent files on the local disk, or may be virtual - // files backed by a ContentProvider. First attempt to use fstat(fd) with a - // FD from ContentResolver#openAssetFileDescriptor(). Some files may not - // succeed at all, or may have size=0 in which case we will attempt to get - // info via DocumentFile. - return (success && info->size > 0) || - internal::ContentUriGetFileInfo(path_, info); + // files backed by a ContentProvider which may or may not use FUSE to back + // the FDs. + // + // For Document URIs, always use ContentUriGetFileInfo() since it will + // succeed by using the Java API DocumentFile, which can provide + // last-modified where FUSE cannot. FUSE always returns the current-time + // which is problematic because Blobs are registered with an + // expected-last-modified, and will fail if it changes by the time a client + // accesses it. + // + // For other Content-URIS, if fstat() succeeded with a non-zero size, then + // use the result, otherwise try via the Java APIs. + return (success && info->size > 0 && !internal::IsDocumentUri(path_)) || + GetContentUriInfo(path_, info); } #endif return success; @@ -712,14 +731,21 @@ int File::Stat(const FilePath& path, stat_wrapper_t* sb) { File file(path, base::File::FLAG_OPEN | base::File::FLAG_READ); Info info; if ((file.IsValid() && file.GetInfo(&info)) || - internal::ContentUriGetFileInfo(path, &info)) { + GetContentUriInfo(path, &info)) { memset(sb, 0, sizeof(*sb)); sb->st_mode = info.is_directory ? S_IFDIR : S_IFREG; sb->st_size = info.size; sb->st_mtime = info.last_modified.ToTimeT(); + // Time internally is stored as microseconds since windows epoch, so first + // get subsecond time, and then convert to nanos. Do not subtract + // Time::UnixEpoch() (which is a little bigger than 2^53), or convert to + // nanos (multiply by 10^3 which is just under 2^10) prior to doing + // modulo as these can cause overflow / clamping at [-2^63, 2^63) which + // will corrupt the result. sb->st_mtime_nsec = - (info.last_modified - Time::UnixEpoch()).InNanoseconds() % - Time::kNanosecondsPerSecond; + (info.last_modified.ToDeltaSinceWindowsEpoch().InMicroseconds() % + Time::kMicrosecondsPerSecond) * + Time::kNanosecondsPerMicrosecond; return 0; } } diff --git a/naiveproxy/src/base/files/file_util.cc b/naiveproxy/src/base/files/file_util.cc index 95f8cd95db..f85fda2550 100644 --- a/naiveproxy/src/base/files/file_util.cc +++ b/naiveproxy/src/base/files/file_util.cc @@ -418,13 +418,9 @@ std::optional GetFileSize(const FilePath& file_path) { return info.size; } -bool GetFileSize(const FilePath& file_path, int64_t* file_size) { - std::optional maybe_size = GetFileSize(file_path); - if (!maybe_size.has_value()) { - return false; - } - *file_size = maybe_size.value(); - return true; +OnceCallback()> GetFileSizeCallback( + const FilePath& path) { + return BindOnce([](const FilePath& path) { return GetFileSize(path); }, path); } bool TouchFile(const FilePath& path, diff --git a/naiveproxy/src/base/files/file_util.h b/naiveproxy/src/base/files/file_util.h index 33599243b9..0cb1885cd3 100644 --- a/naiveproxy/src/base/files/file_util.h +++ b/naiveproxy/src/base/files/file_util.h @@ -480,12 +480,9 @@ BASE_EXPORT bool CreateDirectory(const FilePath& full_path); // Returns the file size, or std::nullopt on failure. BASE_EXPORT std::optional GetFileSize(const FilePath& file_path); -// DEPRECATED: Prefer the GetFileSize() variation above in new code. -// TODO(crbug.com/371234479): Migrate callers and remove this. -// -// Returns true on success and writes the file size to `file_size`. Otherwise -// returns false and `file_size` is unmodified. -BASE_EXPORT bool GetFileSize(const FilePath& file_path, int64_t* file_size); +// Same as above, but as an OnceCallback. +BASE_EXPORT OnceCallback()> GetFileSizeCallback( + const FilePath& path); // Sets |real_path| to |path| with symbolic links and junctions expanded. // On Windows, the function ensures that the resulting |real_path| starts with a diff --git a/naiveproxy/src/base/files/file_util_win.cc b/naiveproxy/src/base/files/file_util_win.cc index 7cda11126e..ec523fd408 100644 --- a/naiveproxy/src/base/files/file_util_win.cc +++ b/naiveproxy/src/base/files/file_util_win.cc @@ -1128,11 +1128,6 @@ bool PreReadFile(const FilePath& file_path, } bool PreventExecuteMappingInternal(const FilePath& path, bool skip_path_check) { - if (!base::FeatureList::IsEnabled( - features::kEnforceNoExecutableFileHandles)) { - return true; - } - bool is_path_safe = skip_path_check || IsPathSafeToSetAclOn(path); if (!is_path_safe) { diff --git a/naiveproxy/src/base/files/important_file_writer.cc b/naiveproxy/src/base/files/important_file_writer.cc index 283609924e..e0d7d75154 100644 --- a/naiveproxy/src/base/files/important_file_writer.cc +++ b/naiveproxy/src/base/files/important_file_writer.cc @@ -18,7 +18,7 @@ #include #include -#include "base/check.h" +#include "base/check_op.h" #include "base/critical_closure.h" #include "base/debug/alias.h" #include "base/files/file.h" @@ -47,26 +47,81 @@ namespace base { namespace { constexpr auto kDefaultCommitInterval = Seconds(10); + #if BUILDFLAG(IS_WIN) // This is how many times we will retry ReplaceFile on Windows. constexpr int kReplaceRetries = 5; -// This is the result code recorded if ReplaceFile still fails. -// It should stay constant even if we change kReplaceRetries. + +// This is the result code recorded to ImportantFile.FileReplaceRetryCount if +// ReplaceFile still fails. It should stay constant even if we change +// kReplaceRetries. constexpr int kReplaceRetryFailure = 10; static_assert(kReplaceRetryFailure > kReplaceRetries, "No overlap allowed"); + constexpr auto kReplacePauseInterval = Milliseconds(100); + +// Alternate representation of ReplaceFile results, recorded to +// ImportantFile.FileReplaceResult. +// These values are persisted to logs. Entries should not be renumbered and +// numeric values should never be reused. +enum class ReplaceResult { + // ReplaceFile succeeded on the first try. + kSuccessWithoutRetry = 0, + // ReplaceFile succeeded after one or more retries. + kSuccessWithRetry = 1, + // ReplaceFile never succeeded, even after retries. + kFailure = 2, + kMaxValue = kFailure +}; + +void UmaHistogramRetryCountWithSuffix(std::string_view histogram_suffix, + int retry_count, + bool success) { + constexpr char kCountHistogramName[] = "ImportantFile.FileReplaceRetryCount2"; + constexpr char kResultHistogramName[] = "ImportantFile.FileReplaceResult"; + CHECK_LE(retry_count, kReplaceRetries); + auto result = success + ? (retry_count > 0 ? ReplaceResult::kSuccessWithRetry + : ReplaceResult::kSuccessWithoutRetry) + : ReplaceResult::kFailure; + + // Log with the given suffix and the aggregated ".All" suffix. + if (histogram_suffix.empty()) { + UmaHistogramEnumeration(kResultHistogramName, result); + } else { + UmaHistogramEnumeration( + base::JoinString({kResultHistogramName, histogram_suffix}, "."), + result); + } + UmaHistogramEnumeration(base::JoinString({kResultHistogramName, "All"}, "."), + result); + if (retry_count > 0) { + if (histogram_suffix.empty()) { + UmaHistogramExactLinear(kCountHistogramName, retry_count, + kReplaceRetries + 1); + } else { + UmaHistogramExactLinear( + base::JoinString({kCountHistogramName, histogram_suffix}, "."), + retry_count, kReplaceRetries + 1); + } + UmaHistogramExactLinear(base::JoinString({kCountHistogramName, "All"}, "."), + retry_count, kReplaceRetries + 1); + } +} #endif void UmaHistogramTimesWithSuffix(const char* histogram_name, std::string_view histogram_suffix, base::TimeDelta sample) { DCHECK(histogram_name); - std::string histogram_full_name(histogram_name); - if (!histogram_suffix.empty()) { - histogram_full_name.append("."); - histogram_full_name.append(histogram_suffix); + // Log with the given suffix and the aggregated ".All" suffix. + if (histogram_suffix.empty()) { + UmaHistogramTimes(histogram_name, sample); + } else { + UmaHistogramTimes(base::JoinString({histogram_name, histogram_suffix}, "."), + sample); } - UmaHistogramTimes(histogram_full_name, sample); + UmaHistogramTimes(base::JoinString({histogram_name, "All"}, "."), sample); } // Deletes the file named |tmp_file_path| (which may be open as |tmp_file|), @@ -117,7 +172,8 @@ bool ImportantFileWriter::WriteFileAtomically( // Calling the impl by way of the public WriteFileAtomically, so // |from_instance| is false. return WriteFileAtomicallyImpl(path, data, histogram_suffix, - /*from_instance=*/false); + /*from_instance=*/false, + BindRepeating(&ReplaceFile)); } // static @@ -126,6 +182,7 @@ void ImportantFileWriter::ProduceAndWriteStringToFileAtomically( BackgroundDataProducerCallback data_producer_for_background_sequence, OnceClosure before_write_callback, OnceCallback after_write_callback, + ReplaceFileCallback replace_file_callback, const std::string& histogram_suffix) { // Produce the actual data string on the background sequence. std::optional data = @@ -142,7 +199,8 @@ void ImportantFileWriter::ProduceAndWriteStringToFileAtomically( // ProduceAndWriteStringToFileAtomically, which originated from an // ImportantFileWriter instance, so |from_instance| is true. const bool result = WriteFileAtomicallyImpl(path, *data, histogram_suffix, - /*from_instance=*/true); + /*from_instance=*/true, + std::move(replace_file_callback)); if (!after_write_callback.is_null()) std::move(after_write_callback).Run(result); @@ -153,7 +211,8 @@ bool ImportantFileWriter::WriteFileAtomicallyImpl( const FilePath& path, std::string_view data, std::string_view histogram_suffix, - bool from_instance) { + bool from_instance, + ReplaceFileCallback replace_file_callback) { const TimeTicks write_start = TimeTicks::Now(); if (!from_instance) ImportantFileWriterCleaner::AddDirectory(path.DirName()); @@ -232,7 +291,8 @@ bool ImportantFileWriter::WriteFileAtomicallyImpl( { ScopedBoostPriority scoped_boost_priority(ThreadType::kDisplayCritical); tmp_file.Close(); - result = ReplaceFile(tmp_file_path, path, &replace_file_error); + result = + replace_file_callback.Run(tmp_file_path, path, &replace_file_error); // Save and restore the last error code so that it's not polluted by the // thread priority change. last_error = ::GetLastError(); @@ -241,20 +301,26 @@ bool ImportantFileWriter::WriteFileAtomicallyImpl( // gets hit on a regular basis on some systems // (https://crbug.com/1099284), so we retry a few times before giving up. PlatformThread::Sleep(kReplacePauseInterval); - result = ReplaceFile(tmp_file_path, path, &replace_file_error); + result = + replace_file_callback.Run(tmp_file_path, path, &replace_file_error); last_error = ::GetLastError(); } } // Log how many times we had to retry the ReplaceFile operation before it - // succeeded. If we never succeeded then return a special value. - if (!result) + // succeeded. + UmaHistogramRetryCountWithSuffix(histogram_suffix, retry_count, result); + + // Log to an unsuffixed histogram as well. If we never succeeded then return a + // special value. + if (!result) { retry_count = kReplaceRetryFailure; + } UmaHistogramExactLinear("ImportantFile.FileReplaceRetryCount", retry_count, kReplaceRetryFailure); #else tmp_file.Close(); - result = ReplaceFile(tmp_file_path, path, &replace_file_error); + result = replace_file_callback.Run(tmp_file_path, path, &replace_file_error); #endif // BUILDFLAG(IS_WIN) if (!result) { @@ -292,7 +358,8 @@ ImportantFileWriter::ImportantFileWriter( : path_(path), task_runner_(std::move(task_runner)), commit_interval_(interval), - histogram_suffix_(histogram_suffix) { + histogram_suffix_(histogram_suffix), + replace_file_callback_(BindRepeating(&ReplaceFile)) { DCHECK(task_runner_); ImportantFileWriterCleaner::AddDirectory(path.DirName()); } @@ -319,15 +386,21 @@ void ImportantFileWriter::WriteNow(std::string data) { std::move(data))); } +void ImportantFileWriter::SetReplaceFileCallbackForTesting( + ReplaceFileCallback callback) { + replace_file_callback_ = std::move(callback); +} + void ImportantFileWriter::WriteNowWithBackgroundDataProducer( BackgroundDataProducerCallback background_data_producer) { DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_); - auto split_task = SplitOnceCallback( - BindOnce(&ProduceAndWriteStringToFileAtomically, path_, - std::move(background_data_producer), - std::move(before_next_write_callback_), - std::move(after_next_write_callback_), histogram_suffix_)); + auto split_task = + SplitOnceCallback(BindOnce(&ProduceAndWriteStringToFileAtomically, path_, + std::move(background_data_producer), + std::move(before_next_write_callback_), + std::move(after_next_write_callback_), + replace_file_callback_, histogram_suffix_)); if (!task_runner_->PostTask( FROM_HERE, MakeCriticalClosure("ImportantFileWriter::WriteNow", diff --git a/naiveproxy/src/base/files/important_file_writer.h b/naiveproxy/src/base/files/important_file_writer.h index 8839d733b5..61ccb7e073 100644 --- a/naiveproxy/src/base/files/important_file_writer.h +++ b/naiveproxy/src/base/files/important_file_writer.h @@ -11,6 +11,8 @@ #include #include "base/base_export.h" +#include "base/compiler_specific.h" +#include "base/files/file.h" #include "base/files/file_path.h" #include "base/functional/callback.h" #include "base/memory/raw_ptr.h" @@ -103,7 +105,7 @@ class BASE_EXPORT ImportantFileWriter { // of destruction. ~ImportantFileWriter(); - const FilePath& path() const { return path_; } + const FilePath& path() const LIFETIME_BOUND { return path_; } // Returns true if there is a scheduled write pending which has not yet // been started. @@ -154,11 +156,18 @@ class BASE_EXPORT ImportantFileWriter { previous_data_size_ = previous_data_size; } + // Allows tests to call the given callback instead of ReplaceFile(). + using ReplaceFileCallback = + RepeatingCallback; + void SetReplaceFileCallbackForTesting(ReplaceFileCallback callback); + private: - const OneShotTimer& timer() const { + const OneShotTimer& timer() const LIFETIME_BOUND { + return timer_override_ ? *timer_override_ : timer_; + } + OneShotTimer& timer() LIFETIME_BOUND { return timer_override_ ? *timer_override_ : timer_; } - OneShotTimer& timer() { return timer_override_ ? *timer_override_ : timer_; } // Same as WriteNow() but it uses a promise-like signature that allows running // custom logic in the background sequence. @@ -172,6 +181,7 @@ class BASE_EXPORT ImportantFileWriter { BackgroundDataProducerCallback data_producer_for_background_sequence, OnceClosure before_write_callback, OnceCallback after_write_callback, + ReplaceFileCallback replace_file_callback, const std::string& histogram_suffix); // Writes |data| to |path|, recording histograms with an optional @@ -179,10 +189,12 @@ class BASE_EXPORT ImportantFileWriter { // from an instance of ImportantFileWriter or a direct call to // WriteFileAtomically. When false, the directory containing |path| is added // to the set cleaned by the ImportantFileWriterCleaner (Windows only). - static bool WriteFileAtomicallyImpl(const FilePath& path, - std::string_view data, - std::string_view histogram_suffix, - bool from_instance); + static bool WriteFileAtomicallyImpl( + const FilePath& path, + std::string_view data, + std::string_view histogram_suffix, + bool from_instance, + ReplaceFileCallback replace_file_callback); void ClearPendingWrite(); @@ -217,6 +229,8 @@ class BASE_EXPORT ImportantFileWriter { // scheduled writes. size_t previous_data_size_ = 0; + ReplaceFileCallback replace_file_callback_; + SEQUENCE_CHECKER(sequence_checker_); WeakPtrFactory weak_factory_{this}; diff --git a/naiveproxy/src/base/files/safe_base_name.h b/naiveproxy/src/base/files/safe_base_name.h index bcf92bbbc4..a3f311483e 100644 --- a/naiveproxy/src/base/files/safe_base_name.h +++ b/naiveproxy/src/base/files/safe_base_name.h @@ -8,6 +8,7 @@ #include #include "base/base_export.h" +#include "base/compiler_specific.h" #include "base/files/file_path.h" namespace base { @@ -30,7 +31,14 @@ class BASE_EXPORT SafeBaseName { // Same as above, but takes a StringPieceType for convenience. static std::optional Create(FilePath::StringPieceType); - const FilePath& path() const { return path_; } + const FilePath& path() const LIFETIME_BOUND { return path_; } + + // Convenience functions. + const std::string AsUTF8Unsafe() const { return path_.AsUTF8Unsafe(); } + const FilePath::StringType& value() const LIFETIME_BOUND { + return path_.value(); + } + [[nodiscard]] bool empty() const { return path_.empty(); } bool operator==(const SafeBaseName& that) const; diff --git a/naiveproxy/src/base/files/scoped_temp_dir.h b/naiveproxy/src/base/files/scoped_temp_dir.h index 53a1b481f2..3cbc16842e 100644 --- a/naiveproxy/src/base/files/scoped_temp_dir.h +++ b/naiveproxy/src/base/files/scoped_temp_dir.h @@ -18,6 +18,7 @@ // intervening calls to Delete or Take, or the calls will fail. #include "base/base_export.h" +#include "base/compiler_specific.h" #include "base/files/file_path.h" namespace base { @@ -53,7 +54,7 @@ class BASE_EXPORT ScopedTempDir { // Returns the path to the created directory. Call one of the // CreateUniqueTempDir* methods before getting the path. - const FilePath& GetPath() const; + const FilePath& GetPath() const LIFETIME_BOUND; // Returns true if path_ is non-empty and exists. bool IsValid() const; diff --git a/naiveproxy/src/base/fuchsia/scoped_service_publisher.h b/naiveproxy/src/base/fuchsia/scoped_service_publisher.h index c261a05a1a..dcd5d83aa4 100644 --- a/naiveproxy/src/base/fuchsia/scoped_service_publisher.h +++ b/naiveproxy/src/base/fuchsia/scoped_service_publisher.h @@ -20,6 +20,7 @@ #include "base/base_export.h" #include "base/fuchsia/fuchsia_logging.h" +#include "base/memory/raw_ptr.h" namespace base { @@ -52,7 +53,7 @@ class BASE_EXPORT ScopedServicePublisher { ~ScopedServicePublisher() { pseudo_dir_->RemoveEntry(name_); } private: - vfs::PseudoDir* const pseudo_dir_ = nullptr; + const raw_ptr pseudo_dir_ = nullptr; std::string name_; }; @@ -95,7 +96,7 @@ class BASE_EXPORT ScopedNaturalServicePublisher { ~ScopedNaturalServicePublisher() { pseudo_dir_->RemoveEntry(name_); } private: - vfs::PseudoDir* const pseudo_dir_ = nullptr; + const raw_ptr pseudo_dir_ = nullptr; std::string name_; }; diff --git a/naiveproxy/src/base/functional/callback.h b/naiveproxy/src/base/functional/callback.h index 89484a04cb..d85057e232 100644 --- a/naiveproxy/src/base/functional/callback.h +++ b/naiveproxy/src/base/functional/callback.h @@ -144,7 +144,7 @@ class TRIVIAL_ABI OnceCallback { // // May not be called on a null callback. R Run(Args... args) && { - CHECK(!holder_.is_null()); + CHECK(!is_null()); // Move the callback instance into a local variable before the invocation, // that ensures the internal state is cleared after the invocation. @@ -333,7 +333,7 @@ class TRIVIAL_ABI RepeatingCallback { // // May not be called on a null callback. R Run(Args... args) const& { - CHECK(!holder_.is_null()); + CHECK(!is_null()); // Keep `bind_state` alive at least until after the invocation to ensure all // bound `Unretained` arguments remain protected by MiraclePtr. diff --git a/naiveproxy/src/base/json/OWNERS b/naiveproxy/src/base/json/OWNERS index 3e509a96ec..712ef7297b 100644 --- a/naiveproxy/src/base/json/OWNERS +++ b/naiveproxy/src/base/json/OWNERS @@ -1,3 +1,3 @@ file://base/SECURITY_OWNERS -per-file values_util*=alancutter@chromium.org,jdoerrie@chromium.org +per-file values_util*=alancutter@chromium.org diff --git a/naiveproxy/src/base/json/json_parser.cc b/naiveproxy/src/base/json/json_parser.cc index f19cccf762..e54a4e6aab 100644 --- a/naiveproxy/src/base/json/json_parser.cc +++ b/naiveproxy/src/base/json/json_parser.cc @@ -818,8 +818,9 @@ bool JSONParser::ReadInt(bool allow_leading_zeros) { char first = 0; while (std::optional c = PeekChar()) { - if (!IsAsciiDigit(c)) + if (!IsAsciiDigit(*c)) { break; + } if (len == 0) first = *c; diff --git a/naiveproxy/src/base/json/json_reader.cc b/naiveproxy/src/base/json/json_reader.cc index 5a173f0273..7ffed0c70f 100644 --- a/naiveproxy/src/base/json/json_reader.cc +++ b/naiveproxy/src/base/json/json_reader.cc @@ -8,20 +8,22 @@ #include #include "base/features.h" +#include "base/json/json_parser.h" #include "base/logging.h" #include "base/metrics/histogram_macros.h" -#include "base/rust_buildflags.h" +#include "build/build_config.h" -#if BUILDFLAG(BUILD_RUST_JSON_READER) +#if 0 // Disables Rust #include "base/strings/string_view_rust.h" #include "third_party/rust/serde_json_lenient/v0_2/wrapper/functions.h" #include "third_party/rust/serde_json_lenient/v0_2/wrapper/lib.rs.h" -#endif // BUILDFLAG(BUILD_RUST_JSON_READER) -#include "base/json/json_parser.h" +#endif namespace base { -#if BUILDFLAG(BUILD_RUST_JSON_READER) +// TODO(crbug.com/40811643): Move the C++ parser into components/nacl to just +// run in-process there. Don't compile base::JSONReader on NaCL at all. +#if 0 // Disables Rust namespace { using serde_json_lenient::ContextPointer; @@ -132,13 +134,16 @@ JSONReader::Result DecodeJSONInRust(std::string_view json, } // anonymous namespace -#endif // BUILDFLAG(BUILD_RUST_JSON_READER) +#endif // !BUILDFLAG(IS_NACL) // static std::optional JSONReader::Read(std::string_view json, int options, size_t max_depth) { -#if BUILDFLAG(BUILD_RUST_JSON_READER) +#if 1 // Disables Rust + internal::JSONParser parser(options, max_depth); + return parser.Parse(json); +#else // BUILDFLAG(IS_NACL) SCOPED_UMA_HISTOGRAM_TIMER_MICROS(kSecurityJsonParsingTime); if (UsingRust()) { JSONReader::Result result = DecodeJSONInRust(json, options, max_depth); @@ -150,10 +155,7 @@ std::optional JSONReader::Read(std::string_view json, internal::JSONParser parser(options, max_depth); return parser.Parse(json); } -#else // BUILDFLAG(BUILD_RUST_JSON_READER) - internal::JSONParser parser(options, max_depth); - return parser.Parse(json); -#endif // BUILDFLAG(BUILD_RUST_JSON_READER) +#endif // BUILDFLAG(IS_NACL) } // static @@ -171,7 +173,19 @@ std::optional JSONReader::ReadDict(std::string_view json, JSONReader::Result JSONReader::ReadAndReturnValueWithError( std::string_view json, int options) { -#if BUILDFLAG(BUILD_RUST_JSON_READER) +#if 1 // Disables Rust + internal::JSONParser parser(options); + auto value = parser.Parse(json); + if (!value) { + Error error; + error.message = parser.GetErrorMessage(); + error.line = parser.error_line(); + error.column = parser.error_column(); + return base::unexpected(std::move(error)); + } + + return std::move(*value); +#else // BUILDFLAG(IS_NACL) SCOPED_UMA_HISTOGRAM_TIMER_MICROS(kSecurityJsonParsingTime); if (UsingRust()) { return DecodeJSONInRust(json, options, internal::kAbsoluteMaxDepth); @@ -188,19 +202,7 @@ JSONReader::Result JSONReader::ReadAndReturnValueWithError( return std::move(*value); } -#else // BUILDFLAG(BUILD_RUST_JSON_READER) - internal::JSONParser parser(options); - auto value = parser.Parse(json); - if (!value) { - Error error; - error.message = parser.GetErrorMessage(); - error.line = parser.error_line(); - error.column = parser.error_column(); - return base::unexpected(std::move(error)); - } - - return std::move(*value); -#endif // BUILDFLAG(BUILD_RUST_JSON_READER) +#endif // BUILDFLAG(IS_NACL) } // static @@ -211,11 +213,11 @@ bool JSONReader::UsingRust() { if (!base::FeatureList::GetInstance()) { return false; } -#if BUILDFLAG(BUILD_RUST_JSON_READER) - return base::FeatureList::IsEnabled(base::features::kUseRustJsonParser); -#else // BUILDFLAG(BUILD_RUST_JSON_READER) +#if 1 // Disables Rust return false; -#endif // BUILDFLAG(BUILD_RUST_JSON_READER) +#else + return base::FeatureList::IsEnabled(base::features::kUseRustJsonParser); +#endif } } // namespace base diff --git a/naiveproxy/src/base/json/json_value_converter.h b/naiveproxy/src/base/json/json_value_converter.h index 5afcdb6f9b..2496160bab 100644 --- a/naiveproxy/src/base/json/json_value_converter.h +++ b/naiveproxy/src/base/json/json_value_converter.h @@ -14,6 +14,7 @@ #include #include "base/base_export.h" +#include "base/compiler_specific.h" #include "base/logging.h" #include "base/memory/ptr_util.h" #include "base/values.h" @@ -102,7 +103,7 @@ class FieldConverterBase { virtual ~FieldConverterBase() = default; virtual bool ConvertField(const base::Value& value, StructType* obj) const = 0; - const std::string& field_path() const { return field_path_; } + const std::string& field_path() const LIFETIME_BOUND { return field_path_; } private: std::string field_path_; diff --git a/naiveproxy/src/base/json/values_util.cc b/naiveproxy/src/base/json/values_util.cc index f656db2c48..3f290d7cc1 100644 --- a/naiveproxy/src/base/json/values_util.cc +++ b/naiveproxy/src/base/json/values_util.cc @@ -82,7 +82,7 @@ std::optional