Commit d3df4878 authored by Junbo Ke's avatar Junbo Ke Committed by Chromium LUCI CQ

[Chromecast] Add cookie settings to CastNetworkContexts.

Previously no cookie settings were provided when NetworkContext was
created, and the default in-memory cookie store was used. Provide a
cookie path so that the on-disk cookie store is used.

Bug: internal b/177479549
Test: Launch YT on device and verified cookies survived reboot.
Change-Id: Icf6ac063ffc0fc13de36bb6dd6b62edc8e4496a5
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2631358Reviewed-by: default avatarLuke Halliwell (slow) <halliwell@chromium.org>
Commit-Queue: Junbo Ke <juke@chromium.org>
Cr-Commit-Position: refs/heads/master@{#844123}
parent bbccae1a
......@@ -30,6 +30,10 @@
namespace chromecast {
namespace shell {
namespace {
constexpr char kCookieStoreFile[] = "Cookies";
} // namespace
// SharedURLLoaderFactory backed by a CastNetworkContexts and its system
// NetworkContext. Transparently handles crashes.
class CastNetworkContexts::URLLoaderFactoryForSystem
......@@ -193,6 +197,13 @@ void CastNetworkContexts::ConfigureDefaultNetworkContextParams(
network_context_params->accept_language =
CastHttpUserAgentSettings::AcceptLanguage();
auto* browser_context = CastBrowserProcess::GetInstance()->browser_context();
DCHECK(browser_context);
network_context_params->cookie_path =
browser_context->GetPath().Append(kCookieStoreFile);
network_context_params->restore_old_session_cookies = false;
network_context_params->persist_session_cookies = true;
// Disable idle sockets close on memory pressure, if instructed by DCS. On
// memory constrained devices:
// 1. if idle sockets are closed when memory pressure happens, cast_shell will
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment