New issue
Advanced search Search tips

Issue 902641 link

Starred by 4 users

Issue metadata

Status: Started
Owner:
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: Android
Pri: 3
Type: Bug

Blocking:
issue 841556
issue 887538
issue 893575
issue 893576



Sign in to add a comment

Configuring Cookies for NetworkService

Project Member Reported by ntfschr@chromium.org, Nov 7

Issue description

Although there's more work to be done for Cookies in general, we will be blocked until we configure cookies on the network context. I think this should require:

 * NetworkContextParams.channel_id_path
 * NetworkContextParams.cookie_path
 * NetworkContextParams.cookie_manager_params

I'm not 100% clear on channel_id_path and cookie_path (not sure if the latter should be used by WebView). This also ties into WebView's TokenBinding feature, but this is a hidden API and it's not clear if this is really used by anyone (aside from sgurun@'s demo app [1]). If anyone has more background, that would be appreciated.

It also seems CookieManagerParams would be global for all WebViews, but we currently support per-WebView cookie settings (e.g., acceptThirdPartyCookies [2]), so it seems we may need a new API in the network service.

[1] https://cs.corp.google.com/android/vendor/google_experimental/users/sgurun/TokenBinding/src/com/test/Tokenbinding/Tokenbinding.java?q=package:android+tokenbinding+lang:java&dr=CSs&l=1
[2] https://developer.android.com/reference/android/webkit/CookieManager.html#acceptThirdPartyCookies(android.webkit.WebView)
 
Blocking: 841556
rdsmith wrote up a doc on his thoughts on how to handle this, before he left the team: 
 https://docs.google.com/document/d/1s1vL8hNDPvOhssgsp8HjgL9yKZMzwo50yY5Hy8X6iE4/edit#heading=h.teti343s2ez2

Channel ID is deprecated, so I don't think we have to worry about it.  Cookies are a problem, because WebView wants to be able to muck with the cookie store without the rest of Chrome being loaded.  It looks like we may just be able to create a fully configured NetworkContext in the absence of everything else, and have the BrowserContext adopt it if needed.  If we can go with that approach, it will make our lives much simpler.
Labels: Hotlist-KnownIssue
Labels: Proj-Servicification-Canary
+1 to comment 2. Since we know that Android WebView only uses default storage partition and doesn't use incognito, and only has one BrowserContext, AwContentBrowserClient::CreateNetworkContext() could return the mojo pointer to NetworkContext that was created early before content/ is initialized.
Owner: ntfschr@chromium.org
Status: Started (was: Available)
I'll look into this, and implementing some of the cookie APIs. I think we're also missing some coverage (for example, there's no coverage for flushing cookies [1]) to storage.

I'll focus on configuring the NetworkContext first, and adding coverage.

[1] https://cs.chromium.org/search/?q=f:android_webview/javatests/+flush+cookie&sq=package:chromium&type=cs
 Issue 792668  has been merged into this issue.
Cc: changwan@chromium.org
Cc: nhar...@chromium.org
Labels: Proj-Servicification
(Bulk edit to add component)

Comment 11 by cduvall@chromium.org, Jan 18 (4 days ago)

Cc: cduvall@chromium.org

Sign in to add a comment