-
Notifications
You must be signed in to change notification settings - Fork 16.2k
fix: provide paths for all NetworkContextFilePaths keys #31777
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good! 👍
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
Relevant CL https://chromium-review.googlesource.com/c/chromium/src/+/3163674 for reference.
< 8000 td class="blob-code blob-code-addition"> path.Append(chrome::kNetworkDataDirname); | ||
network_context_params->file_paths->unsandboxed_data_path = path; | ||
network_context_params->file_paths->trigger_migration = | ||
features::ShouldTriggerNetworkDataMigration(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Might need to include chrome/browser/browser_features.h
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oops forgot that we don't build the entire //chrome/browser
target as part of https://github.com/electron/electron/blob/main/chromium_src/BUILD.gn#L13. Will need to add //chrome/browser/browser_features.h, //chrome/browser/browser_features.cc
to address ci failure.
|
@deepak1556 My plan was to pick it up when Chrome flipped it to |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The Windows code calls SystemNetworkContextManager::IsNetworkSandboxEnabled()
which is implemented in chrome/browser/net/system_network_context_manager.cc
, I don't think we can simply include that file to build since it seems to have lots of dependencies.
lld-link: error: undefined symbol: public: static bool __cdecl SystemNetworkContextManager::IsNetworkSandboxEnabled(void)
>>> referenced by .\..\..\chrome\browser\browser_features.cc:99
As a workaround you can probably just define it somewhere in Electron.
#if defined(OS_WIN)
bool SystemNetworkContextManager::IsNetworkSandboxEnabled() {
auto* local_state = g_browser_process->local_state();
if (local_state &&
local_state->HasPrefPath(prefs::kNetworkServiceSandboxEnabled)) {
return local_state->GetBoolean(prefs::kNetworkServiceSandboxEnabled);
}
return sandbox::policy::features::IsNetworkSandboxEnabled();
}
#endif
We maintain a synonymous version of But this one would be a special case, as we are building Another way would be declare |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm just here to provide that critically-needed fifth approval
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Windows fails to build
CI will be fixed, don't want to leave this blocked
@VerteDinde has manually backported this PR to "16-x-y", please check out #31852 |
Release Notes Persisted
|
I was unable to backport this PR to "16-x-y" cleanly; |
* fix: provide paths for all NetworkContextFilePaths keys * chore: include chrome features header * chore: build browser_features * yolo * add pref service * fix: include sandbox policy features * fix pref key * fix: gate pref key to OS_WIN Co-authored-by: VerteDinde <khammond@slack-corp.com>
Chromium is currently migrating file paths for the network service to a different path, as such a bunch of path calculations were moved into a config struct that we weren't fully populating.
This populates the struct identically to
//chrome
.Refs: https://source.chromium.org/chromium/chromium/src/+/main:services/network/public/mojom/network_context.mojom;l=219;drc=b6e40f8ab247ea209bcecff994386a70a4169e9d
Refs: https://source.chromium.org/chromium/chromium/src/+/main:chrome/browser/net/profile_network_context_service.cc;l=712;drc=b6e40f8ab247ea209bcecff994386a70a4169e9d;bpv=1;bpt=1
Notes:
~/.config/{App Name}
will no longer be incorrectly deleted if it is a symlink on unix systems