dependencies: Upgrade cookie and rename Servo's Cookie to ServoCookie (#32861)

This changes updates to the new version of the `cookie` crate in Servo
which no longer uses the old `time@0.1` data types. This requires using
a new version of `time` while we transition off of the old one. This is
the first step in that process.

In addition, the overloading of the `cookie::Cookie` name was causing a
great deal of confusion, so I've renamed the Servo wrapper to
`ServoCookie` like we do with `ServoUrl`.

Signed-off-by: Martin Robinson <mrobinson@igalia.com>
This commit is contained in:
Martin Robinson 2024-07-26 18:13:39 +02:00 committed by GitHub
parent 8f377a0cb1
commit b6f1e3b22d
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
16 changed files with 203 additions and 199 deletions

View file

@ -12,7 +12,7 @@ use std::sync::{Arc, Mutex, RwLock};
use std::time::Duration;
use base::id::TEST_PIPELINE_ID;
use cookie_rs::Cookie as CookiePair;
use cookie::Cookie as CookiePair;
use crossbeam_channel::{unbounded, Receiver};
use devtools_traits::{
ChromeToDevtoolsControlMsg, DevtoolsControlMsg, HttpRequest as DevtoolsHttpRequest,
@ -30,7 +30,7 @@ use http::{Method, StatusCode};
use hyper::{Body, Request as HyperRequest, Response as HyperResponse};
use ipc_channel::ipc;
use ipc_channel::router::ROUTER;
use net::cookie::Cookie;
use net::cookie::ServoCookie;
use net::cookie_storage::CookieStorage;
use net::http_loader::determine_requests_referrer;
use net::resource_thread::AuthCacheEntry;
@ -648,7 +648,7 @@ fn test_load_sets_requests_cookies_header_for_url_by_getting_cookies_from_the_re
{
let mut cookie_jar = context.state.cookie_jar.write().unwrap();
let cookie = Cookie::new_wrapped(
let cookie = ServoCookie::new_wrapped(
CookiePair::new("mozillaIs".to_owned(), "theBest".to_owned()),
&url,
CookieSource::HTTP,
@ -694,7 +694,7 @@ fn test_load_sends_cookie_if_nonhttp() {
{
let mut cookie_jar = context.state.cookie_jar.write().unwrap();
let cookie = Cookie::new_wrapped(
let cookie = ServoCookie::new_wrapped(
CookiePair::new("mozillaIs".to_owned(), "theBest".to_owned()),
&url,
CookieSource::NonHTTP,
@ -1192,7 +1192,7 @@ fn test_redirect_from_x_to_y_provides_y_cookies_from_y() {
let mut context = new_fetch_context(None, None, None);
{
let mut cookie_jar = context.state.cookie_jar.write().unwrap();
let cookie_x = Cookie::new_wrapped(
let cookie_x = ServoCookie::new_wrapped(
CookiePair::new("mozillaIsNot".to_owned(), "dotOrg".to_owned()),
&url_x,
CookieSource::HTTP,
@ -1201,7 +1201,7 @@ fn test_redirect_from_x_to_y_provides_y_cookies_from_y() {
cookie_jar.push(cookie_x, &url_x, CookieSource::HTTP);
let cookie_y = Cookie::new_wrapped(
let cookie_y = ServoCookie::new_wrapped(
CookiePair::new("mozillaIs".to_owned(), "theBest".to_owned()),
&url_y,
CookieSource::HTTP,