Skip to content

Commit

Permalink
chore: reconcile FPS patch differences
Browse files Browse the repository at this point in the history
  • Loading branch information
VerteDinde committed Oct 8, 2021
1 parent 3a2d642 commit 194d854
Show file tree
Hide file tree
Showing 3 changed files with 63 additions and 64 deletions.
2 changes: 1 addition & 1 deletion patches/chromium/.patches
Expand Up @@ -104,5 +104,5 @@ don_t_run_pcscan_notifythreadcreated_if_pcscan_is_disabled.patch
logging_win32_only_create_a_console_if_logging_to_stderr.patch
feat_expose_raw_response_headers_from_urlloader.patch
fix_media_key_usage_with_globalshortcuts.patch
cherry-pick-39090918efac.patch
cherry-pick-ec42dfd3545f.patch
cherry-pick-39090918efac.patch
73 changes: 37 additions & 36 deletions patches/chromium/cherry-pick-39090918efac.patch
@@ -1,7 +1,7 @@
From 39090918efac313d376f65713f4de6a6ff0a55bb Mon Sep 17 00:00:00 2001
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: cfredric <cfredric@chromium.org>
Date: Mon, 27 Sep 2021 22:14:18 +0000
Subject: [PATCH] Consider HTTPS and WSS schemes identically for FPS.
Subject: Consider HTTPS and WSS schemes identically for FPS.

This modifies the FPS implementation to normalize wss:// URLs into
https:// URLs when determining the same-partiness of a request.
Expand All @@ -16,10 +16,9 @@ Reviewed-by: Maksim Orlovich <morlovich@chromium.org>
Reviewed-by: Shuran Huang <shuuran@chromium.org>
Commit-Queue: Chris Fredrickson <cfredric@chromium.org>
Cr-Commit-Position: refs/heads/main@{#925457}
---

diff --git a/chrome/browser/net/websocket_browsertest.cc b/chrome/browser/net/websocket_browsertest.cc
index 8a9fe6db..de48b97b 100644
index 0714f0d0231d677edd0f0cdf82f4129ddc43a5c2..6f2f101743fbd470bafe90d7e5d14351ee0ff708 100644
--- a/chrome/browser/net/websocket_browsertest.cc
+++ b/chrome/browser/net/websocket_browsertest.cc
@@ -21,6 +21,7 @@
Expand Down Expand Up @@ -64,15 +63,15 @@ index 8a9fe6db..de48b97b 100644
net::GetWebSocketTestDataDirectory()) {}

protected:
@@ -145,7 +152,6 @@
@@ -145,7 +152,6 @@ class WebSocketBrowserTest : public InProcessBrowserTest {
net::SpawnedTestServer wss_server_;

private:
- typedef net::SpawnedTestServer::SSLOptions SSLOptions;
std::unique_ptr<content::TitleWatcher> watcher_;

DISALLOW_COPY_AND_ASSIGN(WebSocketBrowserTest);
@@ -162,37 +168,72 @@
@@ -162,37 +168,72 @@ class WebSocketBrowserTestWithAllowFileAccessFromFiles
};

// Framework for tests using the connect_to.html page served by a separate HTTP
Expand Down Expand Up @@ -114,11 +113,13 @@ index 8a9fe6db..de48b97b 100644
std::string query("url=" + url.spec());
GURL::Replacements replacements;
replacements.SetQueryStr(query);
ASSERT_TRUE(ui_test_utils::NavigateToURL(
- browser(), http_server_.GetURL("/connect_to.html")
- ui_test_utils::NavigateToURL(browser(),
- http_server_.GetURL("/connect_to.html")
- .ReplaceComponents(replacements));
+ ASSERT_TRUE(ui_test_utils::NavigateToURL(
+ browser(), server()
+ .GetURL(host, "/connect_to.html")
.ReplaceComponents(replacements)));
+ .ReplaceComponents(replacements)));
}

- private:
Expand Down Expand Up @@ -156,7 +157,7 @@ index 8a9fe6db..de48b97b 100644
// Automatically fill in any login prompts that appear with the supplied
// credentials.
class AutoLogin : public content::NotificationObserver {
@@ -352,7 +393,7 @@
@@ -352,7 +393,7 @@ IN_PROC_BROWSER_TEST_F(WebSocketBrowserTest,
EXPECT_EQ("PASS", WaitAndGetTitle());
}

Expand All @@ -165,7 +166,7 @@ index 8a9fe6db..de48b97b 100644
WebSocketBasicAuthInWSURL) {
// Launch a basic-auth-protected WebSocket server.
ws_server_.set_websocket_basic_auth(true);
@@ -364,7 +405,7 @@
@@ -364,7 +405,7 @@ IN_PROC_BROWSER_TEST_F(WebSocketBrowserConnectToTest,
EXPECT_EQ("PASS", WaitAndGetTitle());
}

Expand All @@ -174,7 +175,7 @@ index 8a9fe6db..de48b97b 100644
WebSocketBasicAuthInWSURLBadCreds) {
// Launch a basic-auth-protected WebSocket server.
ws_server_.set_websocket_basic_auth(true);
@@ -376,7 +417,7 @@
@@ -376,7 +417,7 @@ IN_PROC_BROWSER_TEST_F(WebSocketBrowserConnectToTest,
EXPECT_EQ("FAIL", WaitAndGetTitle());
}

Expand All @@ -183,7 +184,7 @@ index 8a9fe6db..de48b97b 100644
WebSocketBasicAuthNoCreds) {
// Launch a basic-auth-protected WebSocket server.
ws_server_.set_websocket_basic_auth(true);
@@ -420,8 +461,7 @@
@@ -420,8 +461,7 @@ IN_PROC_BROWSER_TEST_F(WebSocketBrowserTest, MAYBE_WebSocketAppliesHSTS) {
https_server.ServeFilesFromSourceDirectory(GetChromeTestDataDir());
net::SpawnedTestServer wss_server(
net::SpawnedTestServer::TYPE_WSS,
Expand All @@ -193,7 +194,7 @@ index 8a9fe6db..de48b97b 100644
net::GetWebSocketTestDataDirectory());
// This test sets HSTS on localhost. To avoid being redirected to https, start
// the http server on 127.0.0.1 instead.
@@ -711,4 +751,43 @@
@@ -711,4 +751,43 @@ IN_PROC_BROWSER_TEST_F(WebSocketBrowserTestWithAllowFileAccessFromFiles,
EXPECT_EQ("FILE", WaitAndGetTitle());
}

Expand Down Expand Up @@ -238,10 +239,10 @@ index 8a9fe6db..de48b97b 100644
+
} // namespace
diff --git a/net/data/websocket/connect_to.html b/net/data/websocket/connect_to.html
index 05c653f..8a6d782 100644
index 05c653fc5d2ab9a333efea5b4c5eee83a03bbe07..8a6d78214fe5974cbb0ec62b61f4d7fdcdf42c3b 100644
--- a/net/data/websocket/connect_to.html
+++ b/net/data/websocket/connect_to.html
@@ -29,6 +29,17 @@
@@ -29,6 +29,17 @@ ws.onclose = function()
document.title = 'FAIL';
}

Expand All @@ -260,19 +261,19 @@ index 05c653f..8a6d782 100644
</head>
</html>
diff --git a/net/test/spawned_test_server/base_test_server.cc b/net/test/spawned_test_server/base_test_server.cc
index 70937f8..01359fa 100644
index 9caaf0ad501322f480be9867909e2e6cb8c56503..54c84e4d0bbd51640b374532fd92903b2e01de58 100644
--- a/net/test/spawned_test_server/base_test_server.cc
+++ b/net/test/spawned_test_server/base_test_server.cc
@@ -137,6 +137,8 @@
case CERT_KEY_USAGE_RSA_DIGITAL_SIGNATURE:
return base::FilePath(
@@ -156,6 +156,8 @@ base::FilePath BaseTestServer::SSLOptions::GetCertificateFile() const {
FILE_PATH_LITERAL("key_usage_rsa_digitalsignature.pem"));
case CERT_AUTO:
return base::FilePath();
+ case CERT_TEST_NAMES:
+ return base::FilePath(FILE_PATH_LITERAL("test_names.pem"));
default:
NOTREACHED();
}
@@ -228,6 +230,14 @@
@@ -249,6 +251,14 @@ GURL BaseTestServer::GetURL(const std::string& path) const {
return GURL(GetScheme() + "://" + host_port_pair_.ToString() + "/" + path);
}

Expand All @@ -288,10 +289,10 @@ index 70937f8..01359fa 100644
const std::string& user) const {
return GURL(GetScheme() + "://" + user + "@" + host_port_pair_.ToString() +
diff --git a/net/test/spawned_test_server/base_test_server.h b/net/test/spawned_test_server/base_test_server.h
index 367ba3b..62b3234 100644
index 6c209afcdeeed129ec58f4c55a78501d707fd8f3..848698160b6eba1a02618bfaa968114d10776395 100644
--- a/net/test/spawned_test_server/base_test_server.h
+++ b/net/test/spawned_test_server/base_test_server.h
@@ -77,6 +77,11 @@
@@ -82,6 +82,11 @@ class BaseTestServer {
// A certificate with invalid notBefore and notAfter times. Windows'
// certificate library will not parse this certificate.
CERT_BAD_VALIDITY,
Expand All @@ -302,8 +303,8 @@ index 367ba3b..62b3234 100644
+ CERT_TEST_NAMES,
};

// NOTE: the values of these enumerators are passed to the the Python test
@@ -198,6 +203,8 @@
// Bitmask of key exchange algorithms that the test server supports and that
@@ -277,6 +282,8 @@ class BaseTestServer {
bool GetAddressList(AddressList* address_list) const WARN_UNUSED_RESULT;

GURL GetURL(const std::string& path) const;
Expand All @@ -313,10 +314,10 @@ index 367ba3b..62b3234 100644
GURL GetURLWithUser(const std::string& path,
const std::string& user) const;
diff --git a/services/network/first_party_sets/first_party_sets.cc b/services/network/first_party_sets/first_party_sets.cc
index 1650c28d..826b403 100644
index 1650c28d8b6c61b30531e1e2ef3e2869d8450360..826b403a2a9702c255ee9b7ea38dc74b9e18791d 100644
--- a/services/network/first_party_sets/first_party_sets.cc
+++ b/services/network/first_party_sets/first_party_sets.cc
@@ -91,16 +91,17 @@
@@ -91,16 +91,17 @@ bool FirstPartySets::IsContextSamePartyWithSite(
const net::SchemefulSite* top_frame_site,
const std::set<net::SchemefulSite>& party_context,
bool infer_singleton_sets) const {
Expand All @@ -339,7 +340,7 @@ index 1650c28d..826b403 100644
};

if (top_frame_site && !is_owned_by_site_owner(*top_frame_site))
@@ -131,7 +132,8 @@
@@ -131,7 +132,8 @@ net::FirstPartySetsContextType FirstPartySets::ComputeContextType(
const absl::optional<net::SchemefulSite>& top_frame_site,
const std::set<net::SchemefulSite>& party_context) const {
constexpr bool infer_singleton_sets = true;
Expand All @@ -349,7 +350,7 @@ index 1650c28d..826b403 100644
// Note: the `party_context` consists of the intermediate frames (for frame
// requests) or intermediate frames and current frame for subresource
// requests.
@@ -152,18 +154,22 @@
@@ -152,18 +154,22 @@ net::FirstPartySetsContextType FirstPartySets::ComputeContextType(
: net::FirstPartySetsContextType::kTopResourceMatchMixed;
}

Expand Down Expand Up @@ -378,7 +379,7 @@ index 1650c28d..826b403 100644
}

base::flat_map<net::SchemefulSite, std::set<net::SchemefulSite>>
@@ -244,7 +250,8 @@
@@ -244,7 +250,8 @@ base::flat_set<net::SchemefulSite> FirstPartySets::ComputeSetsDiff(
for (const auto& old_pair : old_sets) {
const net::SchemefulSite& old_member = old_pair.first;
const net::SchemefulSite& old_owner = old_pair.second;
Expand All @@ -389,10 +390,10 @@ index 1650c28d..826b403 100644
if (!current_owner || *current_owner != old_owner) {
result.emplace(old_member);
diff --git a/services/network/first_party_sets/first_party_sets.h b/services/network/first_party_sets/first_party_sets.h
index 8158b55..fc87e51 100644
index 8158b555856526170051cba72a08312a5528de51..fc87e5155667befc5a94bbe539ca71dc47d5f7d1 100644
--- a/services/network/first_party_sets/first_party_sets.h
+++ b/services/network/first_party_sets/first_party_sets.h
@@ -97,11 +97,12 @@
@@ -97,11 +97,12 @@ class FirstPartySets {
base::OnceCallback<void(const std::string&)> callback);

private:
Expand All @@ -411,10 +412,10 @@ index 8158b55..fc87e51 100644
// We must ensure there's no intersection between the manually-specified set
// and the sets that came from Component Updater. (When reconciling the
diff --git a/services/network/first_party_sets/first_party_sets_unittest.cc b/services/network/first_party_sets/first_party_sets_unittest.cc
index 2055619..52eb8e8 100644
index 2055619f4c999cbfd5a5ee4780e2eb5c1dad5816..52eb8e8a3d87172353c64bba972311db2889c693 100644
--- a/services/network/first_party_sets/first_party_sets_unittest.cc
+++ b/services/network/first_party_sets/first_party_sets_unittest.cc
@@ -1167,6 +1167,8 @@
@@ -1167,6 +1167,8 @@ TEST_F(FirstPartySetsTest, ComputeContext) {
net::SchemefulSite nonmember1(GURL("https://nonmember1.test"));
net::SchemefulSite member(GURL("https://member1.test"));
net::SchemefulSite owner(GURL("https://example.test"));
Expand All @@ -423,7 +424,7 @@ index 2055619..52eb8e8 100644

// Works as usual for sites that are in First-Party sets.
EXPECT_THAT(sets().ComputeContext(member, &member, {member}),
@@ -1180,10 +1182,17 @@
@@ -1180,10 +1182,17 @@ TEST_F(FirstPartySetsTest, ComputeContext) {
EXPECT_THAT(sets().ComputeContext(member, &member, {member, owner}),
net::SamePartyContext(SamePartyContextType::kSameParty));

Expand All @@ -441,7 +442,7 @@ index 2055619..52eb8e8 100644

// Top&resource differs from Ancestors.
EXPECT_THAT(sets().ComputeContext(member, &member, {nonmember}),
@@ -1225,6 +1234,12 @@
@@ -1225,6 +1234,12 @@ TEST_F(FirstPartySetsTest, IsInNontrivialFirstPartySet) {
EXPECT_TRUE(sets().IsInNontrivialFirstPartySet(
net::SchemefulSite(GURL("https://member1.test"))));

Expand Down

0 comments on commit 194d854

Please sign in to comment.