From 14bfb80a08083f903bf3e609fcf651263567625a Mon Sep 17 00:00:00 2001 From: Keeley Hammond Date: Tue, 27 Jan 2026 17:38:24 -0800 Subject: [PATCH] 7508687: use ChildProcessId for file permission APIs The ChildProcessSecurityPolicy::CanReadFile and GrantReadFile APIs now require ChildProcessId instead of int. Updated to use GetID() instead of GetDeprecatedID() for these specific calls. Ref: https://chromium-review.googlesource.com/c/chromium/src/+/7508687 --- shell/browser/api/electron_api_web_contents.cc | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/shell/browser/api/electron_api_web_contents.cc b/shell/browser/api/electron_api_web_contents.cc index 34aa5187d6..e999395e06 100644 --- a/shell/browser/api/electron_api_web_contents.cc +++ b/shell/browser/api/electron_api_web_contents.cc @@ -68,6 +68,7 @@ #include "content/public/browser/storage_partition.h" #include "content/public/browser/visibility.h" #include "content/public/browser/web_contents.h" +#include "content/public/common/child_process_id.h" #include "content/public/common/referrer_type_converters.h" #include "content/public/common/result_codes.h" #include "content/public/common/webplugininfo.h" @@ -642,13 +643,14 @@ std::string RegisterFileSystem(content::WebContents* web_contents, content::ChildProcessSecurityPolicy::GetInstance(); content::RenderViewHost* render_view_host = web_contents->GetRenderViewHost(); int renderer_id = render_view_host->GetProcess()->GetDeprecatedID(); + content::ChildProcessId process_id = render_view_host->GetProcess()->GetID(); policy->GrantReadFileSystem(renderer_id, file_system.id()); policy->GrantWriteFileSystem(renderer_id, file_system.id()); policy->GrantCreateFileForFileSystem(renderer_id, file_system.id()); policy->GrantDeleteFromFileSystem(renderer_id, file_system.id()); - if (!policy->CanReadFile(renderer_id, path)) - policy->GrantReadFile(renderer_id, path); + if (!policy->CanReadFile(process_id, path)) + policy->GrantReadFile(process_id, path); return file_system.id(); }