7498491: update process_id to use OriginatingProcess type

The upstream Chromium API changed - URLLoaderFactoryParams::process_id
was changed from an integer to a union type network::OriginatingProcess
that distinguishes between browser and renderer processes.

- For browser process requests, use OriginatingProcess::browser()
- For renderer process lookups, check !is_browser() and use
  renderer_process().value() to get the child_id

Ref: https://chromium-review.googlesource.com/c/chromium/src/+/7498491
This commit is contained in:
Keeley Hammond
2026-01-28 17:15:26 -08:00
parent 5ca2df8806
commit ae3d24ec95
4 changed files with 10 additions and 5 deletions

View File

@@ -41,6 +41,7 @@
#include "gin/arguments.h"
#include "media/audio/audio_device_description.h"
#include "services/network/public/cpp/features.h"
#include "services/network/public/cpp/originating_process.h"
#include "services/network/public/cpp/url_loader_factory_builder.h"
#include "services/network/public/cpp/wrapper_shared_url_loader_factory.h"
#include "services/network/public/mojom/network_context.mojom.h"
@@ -588,7 +589,7 @@ ElectronBrowserContext::GetURLLoaderFactory() {
network::mojom::URLLoaderFactoryParamsPtr params =
network::mojom::URLLoaderFactoryParams::New();
params->header_client = std::move(header_client);
params->process_id = network::mojom::kBrowserProcessId;
params->process_id = network::OriginatingProcess::browser();
params->is_trusted = true;
params->is_orb_enabled = false;
// The tests of net module would fail if this setting is true, it seems that