diff options
author | 2023-06-07 10:12:49 +0000 | |
---|---|---|
committer | 2023-06-07 10:12:49 +0000 | |
commit | c672da4340a4af2076c2faa30f03a0827640c83f (patch) | |
tree | 39fe5ac95bd77ff9032723f1aeb76f3d840a5743 | |
parent | 0c1b3509f45ba897b7ce6b0ff55010e24fb772f8 (diff) | |
parent | fb495c79edcec94a303ad5dddcfbd207994dfad2 (diff) |
Merge "Update the WebView docs to point to MDN for cookie attribute explanations with an explicit callout for the Partitioned attribute." am: f707968b3a am: fb495c79ed
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/2616390
Change-Id: If1bedfa0dfae10d17f58cdbdc8bb6b4e5edce6bf
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
-rw-r--r-- | core/java/android/webkit/CookieManager.java | 50 |
1 files changed, 34 insertions, 16 deletions
diff --git a/core/java/android/webkit/CookieManager.java b/core/java/android/webkit/CookieManager.java index 20230e770bf5..0427d1051919 100644 --- a/core/java/android/webkit/CookieManager.java +++ b/core/java/android/webkit/CookieManager.java @@ -103,15 +103,22 @@ public abstract class CookieManager { * will be ignored if it is expired. To set multiple cookies, your application should invoke * this method multiple times. * - * <p>The {@code value} parameter must follow the format of the {@code Set-Cookie} HTTP - * response header defined by - * <a href="https://tools.ietf.org/html/draft-ietf-httpbis-rfc6265bis-03">RFC6265bis</a>. - * This is a key-value pair of the form {@code "key=value"}, optionally followed by a list of - * cookie attributes delimited with semicolons (ex. {@code "key=value; Max-Age=123"}). Please - * consult the RFC specification for a list of valid attributes. + * <p>The {@code value} parameter must follow the format of the {@code Set-Cookie} HTTP response + * header. This is a key-value pair of the form {@code "key=value"}, optionally followed by a + * list of cookie attributes delimited with semicolons (ex. {@code "key=value; Max-Age=123"}). + * For the header format and attributes supported by WebView, see the <a href= + * "https://developer.mozilla.org/docs/Web/HTTP/Headers/Set-Cookie">{@code Set-Cookie} + * documentation on MDN</a>. * - * <p class="note"><b>Note:</b> if specifying a {@code value} containing the {@code "Secure"} - * attribute, {@code url} must use the {@code "https://"} scheme. + * <p class="note"> + * <b>Notes:</b> + * <ul> + * <li>If specifying a {@code value} containing the {@code "Secure"} attribute, + * {@code url} must use the {@code "https://"} scheme.</li> + * <li>if specifying a {@code value} containing the {@code "Partitioned"} + * attribute, the cookie will be set for the top-level partition of the + * {@code url}.</li> + * </ul> * * @param url the URL for which the cookie is to be set * @param value the cookie as a string, using the format of the 'Set-Cookie' @@ -125,12 +132,12 @@ public abstract class CookieManager { * will be ignored if it is expired. To set multiple cookies, your application should invoke * this method multiple times. * - * <p>The {@code value} parameter must follow the format of the {@code Set-Cookie} HTTP - * response header defined by - * <a href="https://tools.ietf.org/html/draft-ietf-httpbis-rfc6265bis-03">RFC6265bis</a>. - * This is a key-value pair of the form {@code "key=value"}, optionally followed by a list of - * cookie attributes delimited with semicolons (ex. {@code "key=value; Max-Age=123"}). Please - * consult the RFC specification for a list of valid attributes. + * <p>The {@code value} parameter must follow the format of the {@code Set-Cookie} HTTP response + * header. This is a key-value pair of the form {@code "key=value"}, optionally followed by a + * list of cookie attributes delimited with semicolons (ex. {@code "key=value; Max-Age=123"}). + * For the header format and attributes supported by WebView, see the <a href= + * "https://developer.mozilla.org/docs/Web/HTTP/Headers/Set-Cookie">{@code Set-Cookie} + * documentation on MDN</a>. * * <p>This method is asynchronous. If a {@link ValueCallback} is provided, * {@link ValueCallback#onReceiveValue} will be called on the current @@ -140,8 +147,15 @@ public abstract class CookieManager { * completes or whether it succeeded, and in this case it is safe to call the method from a * thread without a Looper. * - * <p class="note"><b>Note:</b> if specifying a {@code value} containing the {@code "Secure"} - * attribute, {@code url} must use the {@code "https://"} scheme. + * <p class="note"> + * <b>Notes:</b> + * <ul> + * <li>If specifying a {@code value} containing the {@code "Secure"} attribute, + * {@code url} must use the {@code "https://"} scheme.</li> + * <li>if specifying a {@code value} containing the {@code "Partitioned"} + * attribute, the cookie will be set for the top-level partition of the + * {@code url}.</li> + * </ul> * * @param url the URL for which the cookie is to be set * @param value the cookie as a string, using the format of the 'Set-Cookie' @@ -157,6 +171,10 @@ public abstract class CookieManager { * "; "} characters (semicolon followed by a space). Each key-value pair will be of the form * {@code "key=value"}. * + * <p class="note"> + * <b>Note:</b> Any cookies set with the {@code "Partitioned"} attribute will only be returned + * for the top-level partition of {@code url}. + * * @param url the URL for which the cookies are requested * @return value the cookies as a string, using the format of the 'Cookie' * HTTP request header |