Skip to content

Commit 64deb36

Browse files
brencacodebytere
authored andcommitted
fix: backport patch that ensures that cookie store is always created (backport: 4-0-x) (electron#15890)
* fix: backport patch that ensures that cookie store is always created * fix: disable cookie encryption * fix: flush the cookie store when NetworkContext shuts down * test: add test for cookie store persistance * Update patches/common/chromium/ensure_cookie_store.patch Co-Authored-By: brenca <benecene@gmail.com> * Update patches/common/chromium/ensure_cookie_store.patch Co-Authored-By: brenca <benecene@gmail.com> * fix: disable cookie encryption for real
1 parent a4ed644 commit 64deb36

File tree

6 files changed

+486
-0
lines changed

6 files changed

+486
-0
lines changed

atom/browser/net/url_request_context_getter.cc

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -97,6 +97,9 @@ network::mojom::NetworkContextParamsPtr CreateDefaultNetworkContextParams(
9797
base_path.Append(chrome::kChannelIDFilename);
9898
network_context_params->restore_old_session_cookies = false;
9999
network_context_params->persist_session_cookies = false;
100+
// TODO(deepak1556): Matches the existing behavior https://git.io/fxHMl,
101+
// enable encryption as a followup.
102+
network_context_params->enable_encrypted_cookies = false;
100103
}
101104
// TODO(deepak1556): Decide the stand on chrome ct policy and
102105
// enable it.
@@ -299,6 +302,11 @@ void URLRequestContextGetter::NotifyContextShuttingDown(
299302
std::unique_ptr<ResourceContext> resource_context) {
300303
DCHECK_CURRENTLY_ON(BrowserThread::IO);
301304

305+
// todo(brenca): remove once C70 lands
306+
if (url_request_context_ && url_request_context_->cookie_store()) {
307+
url_request_context_->cookie_store()->FlushStore(base::NullCallback());
308+
}
309+
302310
context_shutting_down_ = true;
303311
resource_context.reset();
304312
net::URLRequestContextGetter::NotifyContextShuttingDown();

patches/common/chromium/.patches

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -83,3 +83,4 @@ fix_zoom_display.patch
8383
cross_site_document_resource_handler.patch
8484
fix_trackpad_scrolling.patch
8585
mac_fix_form_control_rendering_on_10_14_mojave.patch
86+
ensure_cookie_store.patch

0 commit comments

Comments
 (0)