From ea7e9d95293da73797e8edfcded7ce05315703dc Mon Sep 17 00:00:00 2001 From: John Turpish Date: Mon, 26 Aug 2024 16:11:01 -0400 Subject: [PATCH] Fixes #117 The default impl only: not in Chromium. --- .../124.0.6323.0/url/url_canon.h.patch | 28 --------- .../124.0.6323.0/url/url_canon_ipfs.cc | 55 ------------------ .../124.0.6323.0/url/url_util.cc.patch | 22 ------- .../chrome/browser/BUILD.gn.patch | 4 +- .../chrome/browser/about_flags.cc.patch | 4 +- ...me_autocomplete_scheme_classifier.cc.patch | 0 .../chrome_content_browser_client.cc.patch | 8 +-- .../chrome/browser/flag-metadata.json.patch | 4 +- .../chrome/browser/flag_descriptions.cc.patch | 2 +- .../chrome/browser/flag_descriptions.h.patch | 2 +- .../chrome/browser/ipfs_extra_parts.cc | 0 .../chrome/browser/ipfs_extra_parts.h | 0 .../browser/prefs/browser_prefs.cc.patch | 2 +- .../browser/shell_integration_mac.mm.patch | 13 +++++ .../common/chrome_content_client.cc.patch | 0 .../linux/common/desktop.template.patch | 13 +++++ .../chrome/installer/util/shell_util.cc.patch | 20 +++++++ .../components/cbor/reader.cc.patch | 0 .../components/cbor/reader.h.patch | 0 .../components/cbor/reader_unittest.cc.patch | 0 .../components/cbor/values.cc.patch | 0 .../components/cbor/values.h.patch | 0 .../components/cbor/writer.cc.patch | 0 .../components/cbor/writer_unittest.cc.patch | 0 .../clipboard_recent_content_generic.cc.patch | 0 .../net/dns/dns_config_service_linux.cc.patch | 0 .../weborigin/scheme_registry.cc.patch | 8 ++- .../url/BUILD.gn.patch | 0 .../url/url_canon.h.patch | 0 .../url/url_canon_ipfs.cc | 0 .../128.0.6613.36/url/url_util.cc.patch | 45 ++++++++++++++ .../128.0.6613.7/url/url_util.cc.patch | 18 ------ .../chrome/browser/BUILD.gn.patch | 8 +-- .../chrome/browser/about_flags.cc.patch | 8 +-- ...me_autocomplete_scheme_classifier.cc.patch | 29 ++++----- .../chrome_content_browser_client.cc.patch | 27 +++++---- .../chrome/browser/flag-metadata.json.patch | 4 +- .../chrome/browser/flag_descriptions.cc.patch | 4 +- .../chrome/browser/flag_descriptions.h.patch | 8 +-- .../chrome/browser/ipfs_extra_parts.cc | 0 .../chrome/browser/ipfs_extra_parts.h | 0 .../browser/prefs/browser_prefs.cc.patch | 11 ++-- .../browser/shell_integration_mac.mm.patch | 13 +++++ .../common/chrome_content_client.cc.patch | 4 +- .../linux/common/desktop.template.patch | 13 +++++ .../chrome/installer/util/shell_util.cc.patch | 20 +++++++ .../components/cbor/reader.cc.patch | 2 +- .../components/cbor/reader.h.patch | 6 +- .../components/cbor/reader_unittest.cc.patch | 2 +- .../components/cbor/values.cc.patch | 14 ++--- .../components/cbor/values.h.patch | 14 ++--- .../components/cbor/writer.cc.patch | 2 +- .../components/cbor/writer_unittest.cc.patch | 4 +- .../clipboard_recent_content_generic.cc.patch | 2 +- .../net/dns/dns_config_service_linux.cc.patch | 4 +- .../weborigin/scheme_registry.cc.patch | 8 ++- .../url/BUILD.gn.patch | 6 +- .../128.0.6613.84/url/url_canon.h.patch | 26 +++++++++ .../128.0.6613.84/url/url_canon_ipfs.cc | 54 +++++++++++++++++ .../128.0.6613.84/url/url_util.cc.patch | 45 ++++++++++++++ .../128.0.6613.85/url/url_util.cc.patch | 31 +++++++++- cmake/CodeCoverage.cmake | 2 +- cmake/patch.py | 14 ++--- component/CMakeLists.txt | 18 ++++-- component/cache_requestor.cc | 1 - component/chromium_cbor_adapter.cc | 2 +- component/ipfs_url_loader.cc | 4 +- library/src/ipfs_client/car.h | 4 ++ .../src/ipfs_client/ctx/default_gateways.cc | 28 ++++----- .../gw/dnslink_requestor_unittest.cc | 4 +- library/src/ipfs_client/gw/gateway_request.cc | 1 - .../gw/gateway_request_unittest.cc | 2 + library/src/ipfs_client/gw/gateway_state.cc | 2 +- .../gw/inline_request_handler_unittest.cc | 4 +- .../ipfs_client/gw/multi_gateway_requestor.cc | 5 +- .../gw/multi_gateway_requestor_unittest.cc | 14 +++++ library/src/ipfs_client/gw/requestor.cc | 2 +- .../src/ipfs_client/ipld/directory_shard.cc | 4 +- .../src/ipfs_client/ipld/symlink_unittest.cc | 4 +- .../src/ipfs_client/ipns_record_unittest.cc | 2 + library/src/ipfs_client/redirects.cc | 1 - library/src/ipfs_client/web_util.cc | 8 +-- library/src/ipfs_client/web_util_unittest.cc | 14 +++++ ...TsNbk8JV17n2TFUY1eJToy3mKp6z4Lyo7vfQDddq1o | 3 - ...hLYDwVFvxos9h8CGU2ibaY66QNgv8hpfewxaQrPiZj | Bin 468 -> 0 bytes ...ytt5kh44lxvxlzwmrps6cekbpddkiw3pylcwnifkrq | 1 - test_data/include/log_recorder.h | 37 ++++++++++++ test_data/include/mock_api.h | 5 ++ test_data/include/mock_gw_cfg.h | 6 +- test_data/include/mock_http_provider.h | 16 +++++ 90 files changed, 552 insertions(+), 273 deletions(-) delete mode 100644 chromium_edits/124.0.6323.0/url/url_canon.h.patch delete mode 100644 chromium_edits/124.0.6323.0/url/url_canon_ipfs.cc delete mode 100644 chromium_edits/124.0.6323.0/url/url_util.cc.patch rename chromium_edits/{128.0.6613.7 => 128.0.6613.36}/chrome/browser/BUILD.gn.patch (89%) rename chromium_edits/{128.0.6613.7 => 128.0.6613.36}/chrome/browser/about_flags.cc.patch (93%) rename chromium_edits/{128.0.6613.7 => 128.0.6613.36}/chrome/browser/autocomplete/chrome_autocomplete_scheme_classifier.cc.patch (100%) rename chromium_edits/{128.0.6613.7 => 128.0.6613.36}/chrome/browser/chrome_content_browser_client.cc.patch (93%) rename chromium_edits/{128.0.6613.7 => 128.0.6613.36}/chrome/browser/flag-metadata.json.patch (89%) rename chromium_edits/{128.0.6613.7 => 128.0.6613.36}/chrome/browser/flag_descriptions.cc.patch (94%) rename chromium_edits/{128.0.6613.7 => 128.0.6613.36}/chrome/browser/flag_descriptions.h.patch (95%) rename chromium_edits/{124.0.6323.0 => 128.0.6613.36}/chrome/browser/ipfs_extra_parts.cc (100%) rename chromium_edits/{124.0.6323.0 => 128.0.6613.36}/chrome/browser/ipfs_extra_parts.h (100%) rename chromium_edits/{128.0.6613.7 => 128.0.6613.36}/chrome/browser/prefs/browser_prefs.cc.patch (97%) create mode 100644 chromium_edits/128.0.6613.36/chrome/browser/shell_integration_mac.mm.patch rename chromium_edits/{128.0.6613.7 => 128.0.6613.36}/chrome/common/chrome_content_client.cc.patch (100%) create mode 100644 chromium_edits/128.0.6613.36/chrome/installer/linux/common/desktop.template.patch create mode 100644 chromium_edits/128.0.6613.36/chrome/installer/util/shell_util.cc.patch rename chromium_edits/{128.0.6613.7 => 128.0.6613.36}/components/cbor/reader.cc.patch (100%) rename chromium_edits/{128.0.6613.7 => 128.0.6613.36}/components/cbor/reader.h.patch (100%) rename chromium_edits/{128.0.6613.7 => 128.0.6613.36}/components/cbor/reader_unittest.cc.patch (100%) rename chromium_edits/{128.0.6613.7 => 128.0.6613.36}/components/cbor/values.cc.patch (100%) rename chromium_edits/{128.0.6613.7 => 128.0.6613.36}/components/cbor/values.h.patch (100%) rename chromium_edits/{128.0.6613.7 => 128.0.6613.36}/components/cbor/writer.cc.patch (100%) rename chromium_edits/{128.0.6613.7 => 128.0.6613.36}/components/cbor/writer_unittest.cc.patch (100%) rename chromium_edits/{128.0.6613.7 => 128.0.6613.36}/components/open_from_clipboard/clipboard_recent_content_generic.cc.patch (100%) rename chromium_edits/{128.0.6613.7 => 128.0.6613.36}/net/dns/dns_config_service_linux.cc.patch (100%) rename chromium_edits/{124.0.6323.0 => 128.0.6613.36}/third_party/blink/renderer/platform/weborigin/scheme_registry.cc.patch (70%) rename chromium_edits/{128.0.6613.7 => 128.0.6613.36}/url/BUILD.gn.patch (100%) rename chromium_edits/{128.0.6613.7 => 128.0.6613.36}/url/url_canon.h.patch (100%) rename chromium_edits/{128.0.6613.7 => 128.0.6613.36}/url/url_canon_ipfs.cc (100%) create mode 100644 chromium_edits/128.0.6613.36/url/url_util.cc.patch delete mode 100644 chromium_edits/128.0.6613.7/url/url_util.cc.patch rename chromium_edits/{124.0.6323.0 => 128.0.6613.84}/chrome/browser/BUILD.gn.patch (77%) rename chromium_edits/{124.0.6323.0 => 128.0.6613.84}/chrome/browser/about_flags.cc.patch (90%) rename chromium_edits/{124.0.6323.0 => 128.0.6613.84}/chrome/browser/autocomplete/chrome_autocomplete_scheme_classifier.cc.patch (82%) rename chromium_edits/{124.0.6323.0 => 128.0.6613.84}/chrome/browser/chrome_content_browser_client.cc.patch (79%) rename chromium_edits/{124.0.6323.0 => 128.0.6613.84}/chrome/browser/flag-metadata.json.patch (89%) rename chromium_edits/{124.0.6323.0 => 128.0.6613.84}/chrome/browser/flag_descriptions.cc.patch (85%) rename chromium_edits/{124.0.6323.0 => 128.0.6613.84}/chrome/browser/flag_descriptions.h.patch (84%) rename chromium_edits/{128.0.6613.7 => 128.0.6613.84}/chrome/browser/ipfs_extra_parts.cc (100%) rename chromium_edits/{128.0.6613.7 => 128.0.6613.84}/chrome/browser/ipfs_extra_parts.h (100%) rename chromium_edits/{124.0.6323.0 => 128.0.6613.84}/chrome/browser/prefs/browser_prefs.cc.patch (86%) create mode 100644 chromium_edits/128.0.6613.84/chrome/browser/shell_integration_mac.mm.patch rename chromium_edits/{124.0.6323.0 => 128.0.6613.84}/chrome/common/chrome_content_client.cc.patch (85%) create mode 100644 chromium_edits/128.0.6613.84/chrome/installer/linux/common/desktop.template.patch create mode 100644 chromium_edits/128.0.6613.84/chrome/installer/util/shell_util.cc.patch rename chromium_edits/{124.0.6323.0 => 128.0.6613.84}/components/cbor/reader.cc.patch (97%) rename chromium_edits/{124.0.6323.0 => 128.0.6613.84}/components/cbor/reader.h.patch (88%) rename chromium_edits/{124.0.6323.0 => 128.0.6613.84}/components/cbor/reader_unittest.cc.patch (97%) rename chromium_edits/{124.0.6323.0 => 128.0.6613.84}/components/cbor/values.cc.patch (92%) rename chromium_edits/{124.0.6323.0 => 128.0.6613.84}/components/cbor/values.h.patch (87%) rename chromium_edits/{124.0.6323.0 => 128.0.6613.84}/components/cbor/writer.cc.patch (91%) rename chromium_edits/{124.0.6323.0 => 128.0.6613.84}/components/cbor/writer_unittest.cc.patch (91%) rename chromium_edits/{124.0.6323.0 => 128.0.6613.84}/components/open_from_clipboard/clipboard_recent_content_generic.cc.patch (95%) rename chromium_edits/{124.0.6323.0 => 128.0.6613.84}/net/dns/dns_config_service_linux.cc.patch (88%) rename chromium_edits/{128.0.6613.7 => 128.0.6613.84}/third_party/blink/renderer/platform/weborigin/scheme_registry.cc.patch (70%) rename chromium_edits/{124.0.6323.0 => 128.0.6613.84}/url/BUILD.gn.patch (87%) create mode 100644 chromium_edits/128.0.6613.84/url/url_canon.h.patch create mode 100644 chromium_edits/128.0.6613.84/url/url_canon_ipfs.cc create mode 100644 chromium_edits/128.0.6613.84/url/url_util.cc.patch create mode 100644 library/src/ipfs_client/web_util_unittest.cc delete mode 100644 test_data/blocks/QmY1TsNbk8JV17n2TFUY1eJToy3mKp6z4Lyo7vfQDddq1o delete mode 100644 test_data/blocks/QmYBhLYDwVFvxos9h8CGU2ibaY66QNgv8hpfewxaQrPiZj delete mode 100644 test_data/blocks/bafkreigenfhs5e6vytt5kh44lxvxlzwmrps6cekbpddkiw3pylcwnifkrq create mode 100644 test_data/include/log_recorder.h create mode 100644 test_data/include/mock_http_provider.h diff --git a/chromium_edits/124.0.6323.0/url/url_canon.h.patch b/chromium_edits/124.0.6323.0/url/url_canon.h.patch deleted file mode 100644 index 9f47d9c8..00000000 --- a/chromium_edits/124.0.6323.0/url/url_canon.h.patch +++ /dev/null @@ -1,28 +0,0 @@ -diff --git a/url/url_canon.h b/url/url_canon.h -index e8778694a9c46..b0bf281e557db 100644 ---- a/url/url_canon.h -+++ b/url/url_canon.h -@@ -804,6 +804,23 @@ bool CanonicalizeMailtoURL(const char16_t* spec, - CanonOutput* output, - Parsed* new_parsed); - -+COMPONENT_EXPORT(URL) -+bool CanonicalizeIpfsURL(const char* spec, -+ int spec_len, -+ const Parsed& parsed, -+ SchemeType scheme_type, -+ CharsetConverter* query_converter, -+ CanonOutput* output, -+ Parsed* new_parsed); -+COMPONENT_EXPORT(URL) -+bool CanonicalizeIpfsURL(const char16_t* spec, -+ int spec_len, -+ const Parsed& parsed, -+ SchemeType scheme_type, -+ CharsetConverter* query_converter, -+ CanonOutput* output, -+ Parsed* new_parsed); -+ - // Part replacer -------------------------------------------------------------- - - // Internal structure used for storing separate strings for each component. diff --git a/chromium_edits/124.0.6323.0/url/url_canon_ipfs.cc b/chromium_edits/124.0.6323.0/url/url_canon_ipfs.cc deleted file mode 100644 index d7c9fdc7..00000000 --- a/chromium_edits/124.0.6323.0/url/url_canon_ipfs.cc +++ /dev/null @@ -1,55 +0,0 @@ -#include "url_canon_internal.h" - -#include -#include - -#include - -bool url::CanonicalizeIpfsURL(const char* spec, - int spec_len, - const Parsed& parsed, - SchemeType scheme_type, - CharsetConverter* charset_converter, - CanonOutput* output, - Parsed* output_parsed) { - if ( spec_len < 1 || !spec ) { - return false; - } - if ( parsed.host.len < 1 ) { - return false; - } - std::string_view cid_str{ spec + parsed.host.begin, static_cast(parsed.host.len) }; - auto cid = ipfs::Cid(cid_str); - if ( !cid.valid() ) { - cid = ipfs::id_cid::forText( std::string{cid_str} + " is not a valid CID." ); - } - auto as_str = cid.to_string(); - if ( as_str.empty() ) { - return false; - } - std::string stdurl{ spec, static_cast(parsed.host.begin) }; - stdurl.append( as_str ); - stdurl.append( spec + parsed.host.end(), spec_len - parsed.host.end() ); - spec = stdurl.data(); - spec_len = static_cast(stdurl.size()); - Parsed parsed_input; - ParseStandardURL(spec, spec_len, &parsed_input); - return CanonicalizeStandardURL( - spec, - parsed_input, - scheme_type, - charset_converter, - output, output_parsed - ); -} -bool url::CanonicalizeIpfsURL(const char16_t* spec, - int spec_len, - const Parsed& parsed, - SchemeType scheme_type, - CharsetConverter* query_converter, - CanonOutput* output, - Parsed* new_parsed) { - RawCanonOutput<2048> as8; - ConvertUTF16ToUTF8(spec, spec_len, &as8); - return CanonicalizeIpfsURL(as8.data(), as8.length(), parsed, scheme_type, query_converter, output, new_parsed); -} diff --git a/chromium_edits/124.0.6323.0/url/url_util.cc.patch b/chromium_edits/124.0.6323.0/url/url_util.cc.patch deleted file mode 100644 index caa001ee..00000000 --- a/chromium_edits/124.0.6323.0/url/url_util.cc.patch +++ /dev/null @@ -1,22 +0,0 @@ -diff --git a/url/url_util.cc b/url/url_util.cc -index 16875957448d2..b6ddd7a6c075c 100644 ---- a/url/url_util.cc -+++ b/url/url_util.cc -@@ -274,8 +274,15 @@ bool DoCanonicalize(const CHAR* spec, - } else if (DoCompareSchemeComponent(spec, scheme, url::kFileSystemScheme)) { - // Filesystem URLs are special. - ParseFileSystemURL(spec, spec_len, &parsed_input); -- success = CanonicalizeFileSystemURL(spec, parsed_input, charset_converter, -- output, output_parsed); -+ success = CanonicalizeFileSystemURL(spec, parsed_input, -+ charset_converter, output, -+ output_parsed); -+ -+ } else if (DoCompareSchemeComponent(spec, scheme, "ipfs")) { -+ // Switch multibase away from case-sensitive ones before continuing canonicalization. -+ ParseStandardURL(spec, spec_len, &parsed_input); -+ success = CanonicalizeIpfsURL(spec, spec_len, parsed_input, scheme_type, -+ charset_converter, output, output_parsed); - - } else if (DoIsStandard(spec, scheme, &scheme_type)) { - // All "normal" URLs. diff --git a/chromium_edits/128.0.6613.7/chrome/browser/BUILD.gn.patch b/chromium_edits/128.0.6613.36/chrome/browser/BUILD.gn.patch similarity index 89% rename from chromium_edits/128.0.6613.7/chrome/browser/BUILD.gn.patch rename to chromium_edits/128.0.6613.36/chrome/browser/BUILD.gn.patch index 9983e88b..54a6921f 100644 --- a/chromium_edits/128.0.6613.7/chrome/browser/BUILD.gn.patch +++ b/chromium_edits/128.0.6613.36/chrome/browser/BUILD.gn.patch @@ -1,5 +1,5 @@ diff --git a/chrome/browser/BUILD.gn b/chrome/browser/BUILD.gn -index 7c6e3dea2fa88..a7496359c413d 100644 +index fe0452e8bd462..575137d6dbbf9 100644 --- a/chrome/browser/BUILD.gn +++ b/chrome/browser/BUILD.gn @@ -41,6 +41,7 @@ import("//sandbox/features.gni") @@ -10,7 +10,7 @@ index 7c6e3dea2fa88..a7496359c413d 100644 import("//third_party/protobuf/proto_library.gni") import("//third_party/webrtc/webrtc.gni") import("//third_party/widevine/cdm/widevine.gni") -@@ -2721,6 +2722,14 @@ static_library("browser") { +@@ -2717,6 +2718,14 @@ static_library("browser") { ] } diff --git a/chromium_edits/128.0.6613.7/chrome/browser/about_flags.cc.patch b/chromium_edits/128.0.6613.36/chrome/browser/about_flags.cc.patch similarity index 93% rename from chromium_edits/128.0.6613.7/chrome/browser/about_flags.cc.patch rename to chromium_edits/128.0.6613.36/chrome/browser/about_flags.cc.patch index 7a2e6898..6dc27a42 100644 --- a/chromium_edits/128.0.6613.7/chrome/browser/about_flags.cc.patch +++ b/chromium_edits/128.0.6613.36/chrome/browser/about_flags.cc.patch @@ -1,5 +1,5 @@ diff --git a/chrome/browser/about_flags.cc b/chrome/browser/about_flags.cc -index 97b604eed712a..187a2738cbfda 100644 +index 96370d4ac35a9..82bf3f78caccc 100644 --- a/chrome/browser/about_flags.cc +++ b/chrome/browser/about_flags.cc @@ -220,6 +220,7 @@ @@ -21,7 +21,7 @@ index 97b604eed712a..187a2738cbfda 100644 #if BUILDFLAG(ENABLE_PDF) #include "pdf/pdf_features.h" #endif -@@ -10076,6 +10081,14 @@ const FeatureEntry kFeatureEntries[] = { +@@ -10130,6 +10135,14 @@ const FeatureEntry kFeatureEntries[] = { flag_descriptions::kOmitCorsClientCertDescription, kOsAll, FEATURE_VALUE_TYPE(network::features::kOmitCorsClientCert)}, diff --git a/chromium_edits/128.0.6613.7/chrome/browser/autocomplete/chrome_autocomplete_scheme_classifier.cc.patch b/chromium_edits/128.0.6613.36/chrome/browser/autocomplete/chrome_autocomplete_scheme_classifier.cc.patch similarity index 100% rename from chromium_edits/128.0.6613.7/chrome/browser/autocomplete/chrome_autocomplete_scheme_classifier.cc.patch rename to chromium_edits/128.0.6613.36/chrome/browser/autocomplete/chrome_autocomplete_scheme_classifier.cc.patch diff --git a/chromium_edits/128.0.6613.7/chrome/browser/chrome_content_browser_client.cc.patch b/chromium_edits/128.0.6613.36/chrome/browser/chrome_content_browser_client.cc.patch similarity index 93% rename from chromium_edits/128.0.6613.7/chrome/browser/chrome_content_browser_client.cc.patch rename to chromium_edits/128.0.6613.36/chrome/browser/chrome_content_browser_client.cc.patch index 0a6ce799..f506d677 100644 --- a/chromium_edits/128.0.6613.7/chrome/browser/chrome_content_browser_client.cc.patch +++ b/chromium_edits/128.0.6613.36/chrome/browser/chrome_content_browser_client.cc.patch @@ -1,5 +1,5 @@ diff --git a/chrome/browser/chrome_content_browser_client.cc b/chrome/browser/chrome_content_browser_client.cc -index 4b8cf312d4ca4..c7345399b4908 100644 +index c4b98aa0e759f..0b645f5482fca 100644 --- a/chrome/browser/chrome_content_browser_client.cc +++ b/chrome/browser/chrome_content_browser_client.cc @@ -396,6 +396,7 @@ @@ -24,7 +24,7 @@ index 4b8cf312d4ca4..c7345399b4908 100644 #if !BUILDFLAG(IS_ANDROID) #include "chrome/browser/digital_credentials/digital_identity_provider_desktop.h" #include "chrome/browser/preloading/preview/preview_navigation_throttle.h" -@@ -1862,6 +1870,11 @@ ChromeContentBrowserClient::CreateBrowserMainParts(bool is_integration_test) { +@@ -1870,6 +1878,11 @@ ChromeContentBrowserClient::CreateBrowserMainParts(bool is_integration_test) { main_parts->AddParts( std::make_unique()); @@ -36,7 +36,7 @@ index 4b8cf312d4ca4..c7345399b4908 100644 return main_parts; } -@@ -6467,12 +6480,29 @@ void ChromeContentBrowserClient:: +@@ -6482,12 +6495,29 @@ void ChromeContentBrowserClient:: const std::optional& request_initiator_origin, NonNetworkURLLoaderFactoryMap* factories) { #if BUILDFLAG(IS_CHROMEOS_ASH) || BUILDFLAG(ENABLE_EXTENSIONS) || \ @@ -67,7 +67,7 @@ index 4b8cf312d4ca4..c7345399b4908 100644 #if BUILDFLAG(IS_CHROMEOS_ASH) if (web_contents) { -@@ -6617,6 +6647,11 @@ ChromeContentBrowserClient::WillCreateURLLoaderRequestInterceptors( +@@ -6633,6 +6663,11 @@ ChromeContentBrowserClient::WillCreateURLLoaderRequestInterceptors( scoped_refptr navigation_response_task_runner) { std::vector> interceptors; diff --git a/chromium_edits/128.0.6613.7/chrome/browser/flag-metadata.json.patch b/chromium_edits/128.0.6613.36/chrome/browser/flag-metadata.json.patch similarity index 89% rename from chromium_edits/128.0.6613.7/chrome/browser/flag-metadata.json.patch rename to chromium_edits/128.0.6613.36/chrome/browser/flag-metadata.json.patch index d0e21c81..f954d6b0 100644 --- a/chromium_edits/128.0.6613.7/chrome/browser/flag-metadata.json.patch +++ b/chromium_edits/128.0.6613.36/chrome/browser/flag-metadata.json.patch @@ -1,8 +1,8 @@ diff --git a/chrome/browser/flag-metadata.json b/chrome/browser/flag-metadata.json -index 6671e383a0807..5279b7f2419e2 100644 +index fa225f6564471..e8444d0f88e84 100644 --- a/chrome/browser/flag-metadata.json +++ b/chrome/browser/flag-metadata.json -@@ -3376,6 +3376,11 @@ +@@ -3386,6 +3386,11 @@ "owners": [ "adamta@google.com", "chrome-feed-fundamentals@google.com" ], "expiry_milestone": 130 }, diff --git a/chromium_edits/128.0.6613.7/chrome/browser/flag_descriptions.cc.patch b/chromium_edits/128.0.6613.36/chrome/browser/flag_descriptions.cc.patch similarity index 94% rename from chromium_edits/128.0.6613.7/chrome/browser/flag_descriptions.cc.patch rename to chromium_edits/128.0.6613.36/chrome/browser/flag_descriptions.cc.patch index 9790614b..4d5c4d25 100644 --- a/chromium_edits/128.0.6613.7/chrome/browser/flag_descriptions.cc.patch +++ b/chromium_edits/128.0.6613.36/chrome/browser/flag_descriptions.cc.patch @@ -1,5 +1,5 @@ diff --git a/chrome/browser/flag_descriptions.cc b/chrome/browser/flag_descriptions.cc -index bda0400e3811d..5074f0a19e3eb 100644 +index be5b3f2e79a5f..d61281fca8be5 100644 --- a/chrome/browser/flag_descriptions.cc +++ b/chrome/browser/flag_descriptions.cc @@ -302,6 +302,11 @@ const char kEnableBenchmarkingChoiceDefaultFeatureStates[] = diff --git a/chromium_edits/128.0.6613.7/chrome/browser/flag_descriptions.h.patch b/chromium_edits/128.0.6613.36/chrome/browser/flag_descriptions.h.patch similarity index 95% rename from chromium_edits/128.0.6613.7/chrome/browser/flag_descriptions.h.patch rename to chromium_edits/128.0.6613.36/chrome/browser/flag_descriptions.h.patch index 44f6db3f..ea921b20 100644 --- a/chromium_edits/128.0.6613.7/chrome/browser/flag_descriptions.h.patch +++ b/chromium_edits/128.0.6613.36/chrome/browser/flag_descriptions.h.patch @@ -1,5 +1,5 @@ diff --git a/chrome/browser/flag_descriptions.h b/chrome/browser/flag_descriptions.h -index 01ac19bf4fac5..3a304131016a1 100644 +index b14d6612eaa86..34aa125a87e57 100644 --- a/chrome/browser/flag_descriptions.h +++ b/chrome/browser/flag_descriptions.h @@ -24,6 +24,7 @@ diff --git a/chromium_edits/124.0.6323.0/chrome/browser/ipfs_extra_parts.cc b/chromium_edits/128.0.6613.36/chrome/browser/ipfs_extra_parts.cc similarity index 100% rename from chromium_edits/124.0.6323.0/chrome/browser/ipfs_extra_parts.cc rename to chromium_edits/128.0.6613.36/chrome/browser/ipfs_extra_parts.cc diff --git a/chromium_edits/124.0.6323.0/chrome/browser/ipfs_extra_parts.h b/chromium_edits/128.0.6613.36/chrome/browser/ipfs_extra_parts.h similarity index 100% rename from chromium_edits/124.0.6323.0/chrome/browser/ipfs_extra_parts.h rename to chromium_edits/128.0.6613.36/chrome/browser/ipfs_extra_parts.h diff --git a/chromium_edits/128.0.6613.7/chrome/browser/prefs/browser_prefs.cc.patch b/chromium_edits/128.0.6613.36/chrome/browser/prefs/browser_prefs.cc.patch similarity index 97% rename from chromium_edits/128.0.6613.7/chrome/browser/prefs/browser_prefs.cc.patch rename to chromium_edits/128.0.6613.36/chrome/browser/prefs/browser_prefs.cc.patch index ec647aef..6464d20f 100644 --- a/chromium_edits/128.0.6613.7/chrome/browser/prefs/browser_prefs.cc.patch +++ b/chromium_edits/128.0.6613.36/chrome/browser/prefs/browser_prefs.cc.patch @@ -1,5 +1,5 @@ diff --git a/chrome/browser/prefs/browser_prefs.cc b/chrome/browser/prefs/browser_prefs.cc -index 0f37944dfa465..1368cfdf9e02b 100644 +index 8cf6b5d7d4281..699490b84fc37 100644 --- a/chrome/browser/prefs/browser_prefs.cc +++ b/chrome/browser/prefs/browser_prefs.cc @@ -199,6 +199,8 @@ diff --git a/chromium_edits/128.0.6613.36/chrome/browser/shell_integration_mac.mm.patch b/chromium_edits/128.0.6613.36/chrome/browser/shell_integration_mac.mm.patch new file mode 100644 index 00000000..220e2546 --- /dev/null +++ b/chromium_edits/128.0.6613.36/chrome/browser/shell_integration_mac.mm.patch @@ -0,0 +1,13 @@ +diff --git a/chrome/browser/shell_integration_mac.mm b/chrome/browser/shell_integration_mac.mm +index c6bb768979453..c0d0abb9c78f3 100644 +--- a/chrome/browser/shell_integration_mac.mm ++++ b/chrome/browser/shell_integration_mac.mm +@@ -79,6 +79,8 @@ bool SetAsDefaultBrowser() { + if (LSSetDefaultHandlerForURLScheme(CFSTR("https"), identifier) != noErr) { + return false; + } ++ LSSetDefaultHandlerForURLScheme(CFSTR("ipfs"), identifier); ++ LSSetDefaultHandlerForURLScheme(CFSTR("ipns"), identifier); + if (LSSetDefaultRoleHandlerForContentType(kUTTypeHTML, kLSRolesViewer, + identifier) != noErr) { + return false; diff --git a/chromium_edits/128.0.6613.7/chrome/common/chrome_content_client.cc.patch b/chromium_edits/128.0.6613.36/chrome/common/chrome_content_client.cc.patch similarity index 100% rename from chromium_edits/128.0.6613.7/chrome/common/chrome_content_client.cc.patch rename to chromium_edits/128.0.6613.36/chrome/common/chrome_content_client.cc.patch diff --git a/chromium_edits/128.0.6613.36/chrome/installer/linux/common/desktop.template.patch b/chromium_edits/128.0.6613.36/chrome/installer/linux/common/desktop.template.patch new file mode 100644 index 00000000..dcd9460b --- /dev/null +++ b/chromium_edits/128.0.6613.36/chrome/installer/linux/common/desktop.template.patch @@ -0,0 +1,13 @@ +diff --git a/chrome/installer/linux/common/desktop.template b/chrome/installer/linux/common/desktop.template +index 2eb13ee1aba46..9af65726bde89 100644 +--- a/chrome/installer/linux/common/desktop.template ++++ b/chrome/installer/linux/common/desktop.template +@@ -111,7 +111,7 @@ Terminal=false + Icon=@@PACKAGE@@ + Type=Application + Categories=Network;WebBrowser; +-MimeType=application/pdf;application/rdf+xml;application/rss+xml;application/xhtml+xml;application/xhtml_xml;application/xml;image/gif;image/jpeg;image/png;image/webp;text/html;text/xml;x-scheme-handler/http;x-scheme-handler/https; ++MimeType=application/pdf;application/rdf+xml;application/rss+xml;application/xhtml+xml;application/xhtml_xml;application/xml;image/gif;image/jpeg;image/png;image/webp;text/html;text/xml;x-scheme-handler/http;x-scheme-handler/https;x-scheme-handler/ipfs;x-scheme-handler/ipns; + Actions=new-window;new-private-window; + + [Desktop Action new-window] diff --git a/chromium_edits/128.0.6613.36/chrome/installer/util/shell_util.cc.patch b/chromium_edits/128.0.6613.36/chrome/installer/util/shell_util.cc.patch new file mode 100644 index 00000000..ff731765 --- /dev/null +++ b/chromium_edits/128.0.6613.36/chrome/installer/util/shell_util.cc.patch @@ -0,0 +1,20 @@ +diff --git a/chrome/installer/util/shell_util.cc b/chrome/installer/util/shell_util.cc +index 87a2c70b6cb1a..50c52f1ef579e 100644 +--- a/chrome/installer/util/shell_util.cc ++++ b/chrome/installer/util/shell_util.cc +@@ -1523,11 +1523,12 @@ const wchar_t* ShellUtil::kDefaultFileAssociations[] = { + const wchar_t* ShellUtil::kPotentialFileAssociations[] = { + L".htm", L".html", L".pdf", L".shtml", L".svg", + L".xht", L".xhtml", L".webp", nullptr}; +-const wchar_t* ShellUtil::kBrowserProtocolAssociations[] = {L"http", L"https", +- nullptr}; ++const wchar_t* ShellUtil::kBrowserProtocolAssociations[] = { ++ L"http", L"https", L"ipfs", L"ipns", nullptr}; + const wchar_t* ShellUtil::kPotentialProtocolAssociations[] = { + L"http", L"https", L"irc", L"mailto", L"mms", L"news", L"nntp", +- L"sms", L"smsto", L"snews", L"tel", L"urn", L"webcal", nullptr}; ++ L"sms", L"smsto", L"snews", L"tel", L"urn", L"webcal", L"ipfs", ++ L"ipns", nullptr}; + const wchar_t* ShellUtil::kRegUrlProtocol = L"URL Protocol"; + const wchar_t* ShellUtil::kRegApplication = L"\\Application"; + const wchar_t* ShellUtil::kRegAppUserModelId = L"AppUserModelId"; diff --git a/chromium_edits/128.0.6613.7/components/cbor/reader.cc.patch b/chromium_edits/128.0.6613.36/components/cbor/reader.cc.patch similarity index 100% rename from chromium_edits/128.0.6613.7/components/cbor/reader.cc.patch rename to chromium_edits/128.0.6613.36/components/cbor/reader.cc.patch diff --git a/chromium_edits/128.0.6613.7/components/cbor/reader.h.patch b/chromium_edits/128.0.6613.36/components/cbor/reader.h.patch similarity index 100% rename from chromium_edits/128.0.6613.7/components/cbor/reader.h.patch rename to chromium_edits/128.0.6613.36/components/cbor/reader.h.patch diff --git a/chromium_edits/128.0.6613.7/components/cbor/reader_unittest.cc.patch b/chromium_edits/128.0.6613.36/components/cbor/reader_unittest.cc.patch similarity index 100% rename from chromium_edits/128.0.6613.7/components/cbor/reader_unittest.cc.patch rename to chromium_edits/128.0.6613.36/components/cbor/reader_unittest.cc.patch diff --git a/chromium_edits/128.0.6613.7/components/cbor/values.cc.patch b/chromium_edits/128.0.6613.36/components/cbor/values.cc.patch similarity index 100% rename from chromium_edits/128.0.6613.7/components/cbor/values.cc.patch rename to chromium_edits/128.0.6613.36/components/cbor/values.cc.patch diff --git a/chromium_edits/128.0.6613.7/components/cbor/values.h.patch b/chromium_edits/128.0.6613.36/components/cbor/values.h.patch similarity index 100% rename from chromium_edits/128.0.6613.7/components/cbor/values.h.patch rename to chromium_edits/128.0.6613.36/components/cbor/values.h.patch diff --git a/chromium_edits/128.0.6613.7/components/cbor/writer.cc.patch b/chromium_edits/128.0.6613.36/components/cbor/writer.cc.patch similarity index 100% rename from chromium_edits/128.0.6613.7/components/cbor/writer.cc.patch rename to chromium_edits/128.0.6613.36/components/cbor/writer.cc.patch diff --git a/chromium_edits/128.0.6613.7/components/cbor/writer_unittest.cc.patch b/chromium_edits/128.0.6613.36/components/cbor/writer_unittest.cc.patch similarity index 100% rename from chromium_edits/128.0.6613.7/components/cbor/writer_unittest.cc.patch rename to chromium_edits/128.0.6613.36/components/cbor/writer_unittest.cc.patch diff --git a/chromium_edits/128.0.6613.7/components/open_from_clipboard/clipboard_recent_content_generic.cc.patch b/chromium_edits/128.0.6613.36/components/open_from_clipboard/clipboard_recent_content_generic.cc.patch similarity index 100% rename from chromium_edits/128.0.6613.7/components/open_from_clipboard/clipboard_recent_content_generic.cc.patch rename to chromium_edits/128.0.6613.36/components/open_from_clipboard/clipboard_recent_content_generic.cc.patch diff --git a/chromium_edits/128.0.6613.7/net/dns/dns_config_service_linux.cc.patch b/chromium_edits/128.0.6613.36/net/dns/dns_config_service_linux.cc.patch similarity index 100% rename from chromium_edits/128.0.6613.7/net/dns/dns_config_service_linux.cc.patch rename to chromium_edits/128.0.6613.36/net/dns/dns_config_service_linux.cc.patch diff --git a/chromium_edits/124.0.6323.0/third_party/blink/renderer/platform/weborigin/scheme_registry.cc.patch b/chromium_edits/128.0.6613.36/third_party/blink/renderer/platform/weborigin/scheme_registry.cc.patch similarity index 70% rename from chromium_edits/124.0.6323.0/third_party/blink/renderer/platform/weborigin/scheme_registry.cc.patch rename to chromium_edits/128.0.6613.36/third_party/blink/renderer/platform/weborigin/scheme_registry.cc.patch index 119d72b2..663fe49e 100644 --- a/chromium_edits/124.0.6323.0/third_party/blink/renderer/platform/weborigin/scheme_registry.cc.patch +++ b/chromium_edits/128.0.6613.36/third_party/blink/renderer/platform/weborigin/scheme_registry.cc.patch @@ -1,13 +1,15 @@ diff --git a/third_party/blink/renderer/platform/weborigin/scheme_registry.cc b/third_party/blink/renderer/platform/weborigin/scheme_registry.cc -index 4eadf46ea0c24..d62fc7fb14e01 100644 +index e1bc209c337c5..6fbac29fcddfd 100644 --- a/third_party/blink/renderer/platform/weborigin/scheme_registry.cc +++ b/third_party/blink/renderer/platform/weborigin/scheme_registry.cc -@@ -67,7 +67,7 @@ class URLSchemesRegistry final { +@@ -68,8 +68,8 @@ class URLSchemesRegistry final { // is considered secure. Additional checks are performed to ensure that // other http pages are filtered out. service_worker_schemes({"http", "https"}), - fetch_api_schemes({"http", "https"}), +- allowed_in_referrer_schemes({"http", "https"}) { + fetch_api_schemes({"http", "https", "ipfs", "ipns"}), - allowed_in_referrer_schemes({"http", "https"}) { ++ allowed_in_referrer_schemes({"http", "https", "ipfs", "ipns"}) { for (auto& scheme : url::GetCorsEnabledSchemes()) cors_enabled_schemes.insert(scheme.c_str()); + for (auto& scheme : url::GetCSPBypassingSchemes()) { diff --git a/chromium_edits/128.0.6613.7/url/BUILD.gn.patch b/chromium_edits/128.0.6613.36/url/BUILD.gn.patch similarity index 100% rename from chromium_edits/128.0.6613.7/url/BUILD.gn.patch rename to chromium_edits/128.0.6613.36/url/BUILD.gn.patch diff --git a/chromium_edits/128.0.6613.7/url/url_canon.h.patch b/chromium_edits/128.0.6613.36/url/url_canon.h.patch similarity index 100% rename from chromium_edits/128.0.6613.7/url/url_canon.h.patch rename to chromium_edits/128.0.6613.36/url/url_canon.h.patch diff --git a/chromium_edits/128.0.6613.7/url/url_canon_ipfs.cc b/chromium_edits/128.0.6613.36/url/url_canon_ipfs.cc similarity index 100% rename from chromium_edits/128.0.6613.7/url/url_canon_ipfs.cc rename to chromium_edits/128.0.6613.36/url/url_canon_ipfs.cc diff --git a/chromium_edits/128.0.6613.36/url/url_util.cc.patch b/chromium_edits/128.0.6613.36/url/url_util.cc.patch new file mode 100644 index 00000000..988797b0 --- /dev/null +++ b/chromium_edits/128.0.6613.36/url/url_util.cc.patch @@ -0,0 +1,45 @@ +diff --git a/url/url_util.cc b/url/url_util.cc +index ce5225e121f5d..79e33208f728e 100644 +--- a/url/url_util.cc ++++ b/url/url_util.cc +@@ -76,6 +76,8 @@ struct SchemeRegistry { + std::vector referrer_schemes = { + {kHttpsScheme, SCHEME_WITH_HOST_PORT_AND_USER_INFORMATION}, + {kHttpScheme, SCHEME_WITH_HOST_PORT_AND_USER_INFORMATION}, ++ {"ipfs", SCHEME_WITH_HOST}, ++ {"ipns", SCHEME_WITH_HOST}, + }; + + // Schemes that do not trigger mixed content warning. +@@ -84,6 +86,8 @@ struct SchemeRegistry { + kWssScheme, + kDataScheme, + kAboutScheme, ++ {"ipfs", SCHEME_WITH_HOST}, ++ {"ipns", SCHEME_WITH_HOST}, + }; + + // Schemes that normal pages cannot link to or access (i.e., with the same +@@ -105,6 +109,8 @@ struct SchemeRegistry { + kHttpsScheme, + kHttpScheme, + kDataScheme, ++ {"ipfs", SCHEME_WITH_HOST}, ++ {"ipns", SCHEME_WITH_HOST}, + }; + + // Schemes that can be used by web to store data (local storage, etc). +@@ -308,7 +314,12 @@ bool DoCanonicalize(const CHAR* spec, + success = CanonicalizeFileSystemURL( + spec, ParseFileSystemURL(std::basic_string_view(spec, spec_len)), + charset_converter, output, output_parsed); +- ++ } else if (DoCompareSchemeComponent(spec, scheme, "ipfs")) { ++ auto spec_view = std::basic_string_view(spec, spec_len); ++ // Switch multibase away from case-sensitive ones before continuing canonicalization. ++ auto parsed_input = ParseStandardURL(spec_view); ++ success = CanonicalizeIpfsURL(spec_view, parsed_input, scheme_type, ++ charset_converter, output, output_parsed); + } else if (DoIsStandard(spec, scheme, &scheme_type)) { + // All "normal" URLs. + success = CanonicalizeStandardURL( diff --git a/chromium_edits/128.0.6613.7/url/url_util.cc.patch b/chromium_edits/128.0.6613.7/url/url_util.cc.patch deleted file mode 100644 index 2f430e17..00000000 --- a/chromium_edits/128.0.6613.7/url/url_util.cc.patch +++ /dev/null @@ -1,18 +0,0 @@ -diff --git a/url/url_util.cc b/url/url_util.cc -index ce5225e121f5d..e2ddfd9323214 100644 ---- a/url/url_util.cc -+++ b/url/url_util.cc -@@ -308,7 +308,12 @@ bool DoCanonicalize(const CHAR* spec, - success = CanonicalizeFileSystemURL( - spec, ParseFileSystemURL(std::basic_string_view(spec, spec_len)), - charset_converter, output, output_parsed); -- -+ } else if (DoCompareSchemeComponent(spec, scheme, "ipfs")) { -+ auto spec_view = std::basic_string_view(spec, spec_len); -+ // Switch multibase away from case-sensitive ones before continuing canonicalization. -+ auto parsed_input = ParseStandardURL(spec_view); -+ success = CanonicalizeIpfsURL(spec_view, parsed_input, scheme_type, -+ charset_converter, output, output_parsed); - } else if (DoIsStandard(spec, scheme, &scheme_type)) { - // All "normal" URLs. - success = CanonicalizeStandardURL( diff --git a/chromium_edits/124.0.6323.0/chrome/browser/BUILD.gn.patch b/chromium_edits/128.0.6613.84/chrome/browser/BUILD.gn.patch similarity index 77% rename from chromium_edits/124.0.6323.0/chrome/browser/BUILD.gn.patch rename to chromium_edits/128.0.6613.84/chrome/browser/BUILD.gn.patch index 0cae8d35..54a6921f 100644 --- a/chromium_edits/124.0.6323.0/chrome/browser/BUILD.gn.patch +++ b/chromium_edits/128.0.6613.84/chrome/browser/BUILD.gn.patch @@ -1,16 +1,16 @@ diff --git a/chrome/browser/BUILD.gn b/chrome/browser/BUILD.gn -index dfba1dd0fcfa9..220aab649b46a 100644 +index fe0452e8bd462..575137d6dbbf9 100644 --- a/chrome/browser/BUILD.gn +++ b/chrome/browser/BUILD.gn -@@ -39,6 +39,7 @@ import("//rlz/buildflags/buildflags.gni") - import("//sandbox/features.gni") +@@ -41,6 +41,7 @@ import("//sandbox/features.gni") + import("//services/screen_ai/buildflags/features.gni") import("//testing/libfuzzer/fuzzer_test.gni") import("//third_party/blink/public/public_features.gni") +import("//third_party/ipfs_client/args.gni") import("//third_party/protobuf/proto_library.gni") import("//third_party/webrtc/webrtc.gni") import("//third_party/widevine/cdm/widevine.gni") -@@ -2640,6 +2641,14 @@ static_library("browser") { +@@ -2717,6 +2718,14 @@ static_library("browser") { ] } diff --git a/chromium_edits/124.0.6323.0/chrome/browser/about_flags.cc.patch b/chromium_edits/128.0.6613.84/chrome/browser/about_flags.cc.patch similarity index 90% rename from chromium_edits/124.0.6323.0/chrome/browser/about_flags.cc.patch rename to chromium_edits/128.0.6613.84/chrome/browser/about_flags.cc.patch index 0114c547..6dc27a42 100644 --- a/chromium_edits/124.0.6323.0/chrome/browser/about_flags.cc.patch +++ b/chromium_edits/128.0.6613.84/chrome/browser/about_flags.cc.patch @@ -1,8 +1,8 @@ diff --git a/chrome/browser/about_flags.cc b/chrome/browser/about_flags.cc -index ceae9a5b9433e..5f7dc19a1d06a 100644 +index 96370d4ac35a9..82bf3f78caccc 100644 --- a/chrome/browser/about_flags.cc +++ b/chrome/browser/about_flags.cc -@@ -214,6 +214,7 @@ +@@ -220,6 +220,7 @@ #include "third_party/blink/public/common/features_generated.h" #include "third_party/blink/public/common/forcedark/forcedark_switches.h" #include "third_party/blink/public/common/switches.h" @@ -10,7 +10,7 @@ index ceae9a5b9433e..5f7dc19a1d06a 100644 #include "ui/accessibility/accessibility_features.h" #include "ui/accessibility/accessibility_switches.h" #include "ui/base/ozone_buildflags.h" -@@ -308,6 +309,10 @@ +@@ -320,6 +321,10 @@ #include "extensions/common/switches.h" #endif // BUILDFLAG(ENABLE_EXTENSIONS) @@ -21,7 +21,7 @@ index ceae9a5b9433e..5f7dc19a1d06a 100644 #if BUILDFLAG(ENABLE_PDF) #include "pdf/pdf_features.h" #endif -@@ -9461,6 +9466,14 @@ const FeatureEntry kFeatureEntries[] = { +@@ -10130,6 +10135,14 @@ const FeatureEntry kFeatureEntries[] = { flag_descriptions::kOmitCorsClientCertDescription, kOsAll, FEATURE_VALUE_TYPE(network::features::kOmitCorsClientCert)}, diff --git a/chromium_edits/124.0.6323.0/chrome/browser/autocomplete/chrome_autocomplete_scheme_classifier.cc.patch b/chromium_edits/128.0.6613.84/chrome/browser/autocomplete/chrome_autocomplete_scheme_classifier.cc.patch similarity index 82% rename from chromium_edits/124.0.6323.0/chrome/browser/autocomplete/chrome_autocomplete_scheme_classifier.cc.patch rename to chromium_edits/128.0.6613.84/chrome/browser/autocomplete/chrome_autocomplete_scheme_classifier.cc.patch index 4d172311..f9965a24 100644 --- a/chromium_edits/124.0.6323.0/chrome/browser/autocomplete/chrome_autocomplete_scheme_classifier.cc.patch +++ b/chromium_edits/128.0.6613.84/chrome/browser/autocomplete/chrome_autocomplete_scheme_classifier.cc.patch @@ -1,27 +1,28 @@ diff --git a/chrome/browser/autocomplete/chrome_autocomplete_scheme_classifier.cc b/chrome/browser/autocomplete/chrome_autocomplete_scheme_classifier.cc -index 4c88614c68c25..f8bb12a3b0c2e 100644 +index 9f234a2a7d41d..a9378ca80dc1e 100644 --- a/chrome/browser/autocomplete/chrome_autocomplete_scheme_classifier.cc +++ b/chrome/browser/autocomplete/chrome_autocomplete_scheme_classifier.cc -@@ -10,6 +10,8 @@ - #include "chrome/browser/custom_handlers/protocol_handler_registry_factory.h" - #include "chrome/browser/external_protocol/external_protocol_handler.h" - #include "chrome/browser/profiles/profile.h" +@@ -13,6 +13,7 @@ + #include "chrome/browser/profiles/profile_io_data.h" + #include "components/custom_handlers/protocol_handler_registry.h" + #include "content/public/common/url_constants.h" +#include "third_party/ipfs_client/ipfs_buildflags.h" -+ + #include "url/url_util.h" + #if BUILDFLAG(IS_ANDROID) - #include "chrome/browser/profiles/profile_android.h" - #endif -@@ -18,6 +20,9 @@ +@@ -20,6 +21,11 @@ #include "chrome/browser/ui/android/omnibox/jni_headers/ChromeAutocompleteSchemeClassifier_jni.h" #endif - #include "components/custom_handlers/protocol_handler_registry.h" + +#if BUILDFLAG(ENABLE_IPFS) +#include "components/ipfs/ipfs_features.h" +#endif - #include "content/public/common/url_constants.h" - #include "url/url_util.h" - -@@ -55,12 +60,20 @@ ChromeAutocompleteSchemeClassifier::GetInputTypeForScheme( ++ ++ + #if BUILDFLAG(IS_ANDROID) + static jlong + JNI_ChromeAutocompleteSchemeClassifier_CreateAutocompleteClassifier( +@@ -53,12 +59,20 @@ ChromeAutocompleteSchemeClassifier::GetInputTypeForScheme( if (scheme.empty()) { return metrics::OmniboxInputType::EMPTY; } diff --git a/chromium_edits/124.0.6323.0/chrome/browser/chrome_content_browser_client.cc.patch b/chromium_edits/128.0.6613.84/chrome/browser/chrome_content_browser_client.cc.patch similarity index 79% rename from chromium_edits/124.0.6323.0/chrome/browser/chrome_content_browser_client.cc.patch rename to chromium_edits/128.0.6613.84/chrome/browser/chrome_content_browser_client.cc.patch index 16045994..f506d677 100644 --- a/chromium_edits/124.0.6323.0/chrome/browser/chrome_content_browser_client.cc.patch +++ b/chromium_edits/128.0.6613.84/chrome/browser/chrome_content_browser_client.cc.patch @@ -1,17 +1,17 @@ diff --git a/chrome/browser/chrome_content_browser_client.cc b/chrome/browser/chrome_content_browser_client.cc -index 68f41c663344f..53416b4afd164 100644 +index c4b98aa0e759f..0b645f5482fca 100644 --- a/chrome/browser/chrome_content_browser_client.cc +++ b/chrome/browser/chrome_content_browser_client.cc -@@ -377,6 +377,7 @@ - #include "third_party/blink/public/common/switches.h" +@@ -396,6 +396,7 @@ #include "third_party/blink/public/mojom/browsing_topics/browsing_topics.mojom.h" + #include "third_party/blink/public/mojom/use_counter/metrics/web_feature.mojom.h" #include "third_party/blink/public/public_buildflags.h" +#include "third_party/ipfs_client/ipfs_buildflags.h" #include "third_party/widevine/cdm/buildflags.h" #include "ui/base/clipboard/clipboard_format_type.h" #include "ui/base/l10n/l10n_util.h" -@@ -498,6 +499,13 @@ - #include "chrome/browser/fuchsia/chrome_browser_main_parts_fuchsia.h" +@@ -516,6 +517,13 @@ + #include "chrome/browser/chrome_browser_main_posix.h" #endif +#if BUILDFLAG(ENABLE_IPFS) @@ -22,9 +22,9 @@ index 68f41c663344f..53416b4afd164 100644 +#endif + #if !BUILDFLAG(IS_ANDROID) + #include "chrome/browser/digital_credentials/digital_identity_provider_desktop.h" #include "chrome/browser/preloading/preview/preview_navigation_throttle.h" - #endif // !BUILDFLAG(IS_ANDROID) -@@ -1694,6 +1702,11 @@ ChromeContentBrowserClient::CreateBrowserMainParts(bool is_integration_test) { +@@ -1870,6 +1878,11 @@ ChromeContentBrowserClient::CreateBrowserMainParts(bool is_integration_test) { main_parts->AddParts( std::make_unique()); @@ -36,7 +36,7 @@ index 68f41c663344f..53416b4afd164 100644 return main_parts; } -@@ -6079,12 +6092,25 @@ void ChromeContentBrowserClient:: +@@ -6482,12 +6495,29 @@ void ChromeContentBrowserClient:: const std::optional& request_initiator_origin, NonNetworkURLLoaderFactoryMap* factories) { #if BUILDFLAG(IS_CHROMEOS_ASH) || BUILDFLAG(ENABLE_EXTENSIONS) || \ @@ -46,10 +46,11 @@ index 68f41c663344f..53416b4afd164 100644 RenderFrameHost::FromID(render_process_id, render_frame_id); WebContents* web_contents = WebContents::FromRenderFrameHost(frame_host); #endif // BUILDFLAG(IS_CHROMEOS_ASH) || BUILDFLAG(ENABLE_EXTENSIONS) || \ -- // !BUILDFLAG(IS_ANDROID) -+ // !BUILDFLAG(IS_ANDROID) || BUILDFLAG(ENABLE_IPFS) + // !BUILDFLAG(IS_ANDROID) +#if BUILDFLAG(ENABLE_IPFS) -+ if (base::FeatureList::IsEnabled(ipfs::kEnableIpfs)) { ++ if (!web_contents) { ++ VLOG(2) << "No web contents, can't register url loader factory."; ++ } else if (base::FeatureList::IsEnabled(ipfs::kEnableIpfs)) { + network::mojom::URLLoaderFactory* default_factory = g_browser_process->system_network_context_manager()->GetURLLoaderFactory(); + auto* context = web_contents->GetBrowserContext(); + ipfs::IpfsURLLoaderFactory::Create( @@ -59,12 +60,14 @@ index 68f41c663344f..53416b4afd164 100644 + GetSystemNetworkContext(), + Profile::FromBrowserContext(context)->GetPrefs() + ); ++ } else { ++ LOG(INFO) << "IPFS disabled."; + } +#endif // BUILDFLAG(ENABLE_IPFS) #if BUILDFLAG(IS_CHROMEOS_ASH) if (web_contents) { -@@ -6221,6 +6247,11 @@ ChromeContentBrowserClient::WillCreateURLLoaderRequestInterceptors( +@@ -6633,6 +6663,11 @@ ChromeContentBrowserClient::WillCreateURLLoaderRequestInterceptors( scoped_refptr navigation_response_task_runner) { std::vector> interceptors; diff --git a/chromium_edits/124.0.6323.0/chrome/browser/flag-metadata.json.patch b/chromium_edits/128.0.6613.84/chrome/browser/flag-metadata.json.patch similarity index 89% rename from chromium_edits/124.0.6323.0/chrome/browser/flag-metadata.json.patch rename to chromium_edits/128.0.6613.84/chrome/browser/flag-metadata.json.patch index ad3a5934..f954d6b0 100644 --- a/chromium_edits/124.0.6323.0/chrome/browser/flag-metadata.json.patch +++ b/chromium_edits/128.0.6613.84/chrome/browser/flag-metadata.json.patch @@ -1,8 +1,8 @@ diff --git a/chrome/browser/flag-metadata.json b/chrome/browser/flag-metadata.json -index d1f0e4e09966d..2dc307a1285f4 100644 +index fa225f6564471..e8444d0f88e84 100644 --- a/chrome/browser/flag-metadata.json +++ b/chrome/browser/flag-metadata.json -@@ -3050,6 +3050,11 @@ +@@ -3386,6 +3386,11 @@ "owners": [ "adamta@google.com", "chrome-feed-fundamentals@google.com" ], "expiry_milestone": 130 }, diff --git a/chromium_edits/124.0.6323.0/chrome/browser/flag_descriptions.cc.patch b/chromium_edits/128.0.6613.84/chrome/browser/flag_descriptions.cc.patch similarity index 85% rename from chromium_edits/124.0.6323.0/chrome/browser/flag_descriptions.cc.patch rename to chromium_edits/128.0.6613.84/chrome/browser/flag_descriptions.cc.patch index ca520f91..4d5c4d25 100644 --- a/chromium_edits/124.0.6323.0/chrome/browser/flag_descriptions.cc.patch +++ b/chromium_edits/128.0.6613.84/chrome/browser/flag_descriptions.cc.patch @@ -1,8 +1,8 @@ diff --git a/chrome/browser/flag_descriptions.cc b/chrome/browser/flag_descriptions.cc -index 158f85cb254da..d8a939b5d5462 100644 +index be5b3f2e79a5f..d61281fca8be5 100644 --- a/chrome/browser/flag_descriptions.cc +++ b/chrome/browser/flag_descriptions.cc -@@ -297,6 +297,11 @@ const char kEnableBenchmarkingChoiceDefaultFeatureStates[] = +@@ -302,6 +302,11 @@ const char kEnableBenchmarkingChoiceDefaultFeatureStates[] = const char kEnableBenchmarkingChoiceMatchFieldTrialTestingConfig[] = "Match Field Trial Testing Config"; diff --git a/chromium_edits/124.0.6323.0/chrome/browser/flag_descriptions.h.patch b/chromium_edits/128.0.6613.84/chrome/browser/flag_descriptions.h.patch similarity index 84% rename from chromium_edits/124.0.6323.0/chrome/browser/flag_descriptions.h.patch rename to chromium_edits/128.0.6613.84/chrome/browser/flag_descriptions.h.patch index 8b0899ea..ea921b20 100644 --- a/chromium_edits/124.0.6323.0/chrome/browser/flag_descriptions.h.patch +++ b/chromium_edits/128.0.6613.84/chrome/browser/flag_descriptions.h.patch @@ -1,8 +1,8 @@ diff --git a/chrome/browser/flag_descriptions.h b/chrome/browser/flag_descriptions.h -index 7a2f7dda93ec9..fba18f10c1a52 100644 +index b14d6612eaa86..34aa125a87e57 100644 --- a/chrome/browser/flag_descriptions.h +++ b/chrome/browser/flag_descriptions.h -@@ -23,6 +23,7 @@ +@@ -24,6 +24,7 @@ #include "pdf/buildflags.h" #include "printing/buildflags/buildflags.h" #include "third_party/blink/public/common/buildflags.h" @@ -10,7 +10,7 @@ index 7a2f7dda93ec9..fba18f10c1a52 100644 // This file declares strings used in chrome://flags. These messages are not // translated, because instead of end-users they target Chromium developers and -@@ -182,6 +183,11 @@ extern const char kEnableBenchmarkingChoiceDisabled[]; +@@ -195,6 +196,11 @@ extern const char kEnableBenchmarkingChoiceDisabled[]; extern const char kEnableBenchmarkingChoiceDefaultFeatureStates[]; extern const char kEnableBenchmarkingChoiceMatchFieldTrialTestingConfig[]; @@ -19,6 +19,6 @@ index 7a2f7dda93ec9..fba18f10c1a52 100644 +extern const char kEnableIpfsDescription[]; +#endif + - #if BUILDFLAG(USE_FONTATIONS_BACKEND) extern const char kFontationsFontBackendName[]; extern const char kFontationsFontBackendDescription[]; + diff --git a/chromium_edits/128.0.6613.7/chrome/browser/ipfs_extra_parts.cc b/chromium_edits/128.0.6613.84/chrome/browser/ipfs_extra_parts.cc similarity index 100% rename from chromium_edits/128.0.6613.7/chrome/browser/ipfs_extra_parts.cc rename to chromium_edits/128.0.6613.84/chrome/browser/ipfs_extra_parts.cc diff --git a/chromium_edits/128.0.6613.7/chrome/browser/ipfs_extra_parts.h b/chromium_edits/128.0.6613.84/chrome/browser/ipfs_extra_parts.h similarity index 100% rename from chromium_edits/128.0.6613.7/chrome/browser/ipfs_extra_parts.h rename to chromium_edits/128.0.6613.84/chrome/browser/ipfs_extra_parts.h diff --git a/chromium_edits/124.0.6323.0/chrome/browser/prefs/browser_prefs.cc.patch b/chromium_edits/128.0.6613.84/chrome/browser/prefs/browser_prefs.cc.patch similarity index 86% rename from chromium_edits/124.0.6323.0/chrome/browser/prefs/browser_prefs.cc.patch rename to chromium_edits/128.0.6613.84/chrome/browser/prefs/browser_prefs.cc.patch index f6f0f678..6464d20f 100644 --- a/chromium_edits/124.0.6323.0/chrome/browser/prefs/browser_prefs.cc.patch +++ b/chromium_edits/128.0.6613.84/chrome/browser/prefs/browser_prefs.cc.patch @@ -1,16 +1,17 @@ diff --git a/chrome/browser/prefs/browser_prefs.cc b/chrome/browser/prefs/browser_prefs.cc -index 06a311d3b11e9..348e2150489a1 100644 +index 8cf6b5d7d4281..699490b84fc37 100644 --- a/chrome/browser/prefs/browser_prefs.cc +++ b/chrome/browser/prefs/browser_prefs.cc -@@ -190,6 +190,7 @@ - #include "ppapi/buildflags/buildflags.h" +@@ -199,6 +199,8 @@ #include "printing/buildflags/buildflags.h" #include "rlz/buildflags/buildflags.h" + #include "services/screen_ai/buildflags/buildflags.h" +#include "third_party/ipfs_client/ipfs_buildflags.h" ++ #if BUILDFLAG(ENABLE_BACKGROUND_MODE) #include "chrome/browser/background/background_mode_manager.h" -@@ -234,6 +235,11 @@ +@@ -244,6 +246,11 @@ #include "chrome/browser/pdf/pdf_pref_names.h" #endif // BUILDFLAG(ENABLE_PDF) @@ -22,7 +23,7 @@ index 06a311d3b11e9..348e2150489a1 100644 #if BUILDFLAG(ENABLE_SCREEN_AI_SERVICE) #include "chrome/browser/screen_ai/pref_names.h" #endif -@@ -1760,6 +1766,11 @@ void RegisterProfilePrefs(user_prefs::PrefRegistrySyncable* registry, +@@ -1783,6 +1790,11 @@ void RegisterProfilePrefs(user_prefs::PrefRegistrySyncable* registry, IncognitoModePrefs::RegisterProfilePrefs(registry); invalidation::PerUserTopicSubscriptionManager::RegisterProfilePrefs(registry); invalidation::InvalidatorRegistrarWithMemory::RegisterProfilePrefs(registry); diff --git a/chromium_edits/128.0.6613.84/chrome/browser/shell_integration_mac.mm.patch b/chromium_edits/128.0.6613.84/chrome/browser/shell_integration_mac.mm.patch new file mode 100644 index 00000000..220e2546 --- /dev/null +++ b/chromium_edits/128.0.6613.84/chrome/browser/shell_integration_mac.mm.patch @@ -0,0 +1,13 @@ +diff --git a/chrome/browser/shell_integration_mac.mm b/chrome/browser/shell_integration_mac.mm +index c6bb768979453..c0d0abb9c78f3 100644 +--- a/chrome/browser/shell_integration_mac.mm ++++ b/chrome/browser/shell_integration_mac.mm +@@ -79,6 +79,8 @@ bool SetAsDefaultBrowser() { + if (LSSetDefaultHandlerForURLScheme(CFSTR("https"), identifier) != noErr) { + return false; + } ++ LSSetDefaultHandlerForURLScheme(CFSTR("ipfs"), identifier); ++ LSSetDefaultHandlerForURLScheme(CFSTR("ipns"), identifier); + if (LSSetDefaultRoleHandlerForContentType(kUTTypeHTML, kLSRolesViewer, + identifier) != noErr) { + return false; diff --git a/chromium_edits/124.0.6323.0/chrome/common/chrome_content_client.cc.patch b/chromium_edits/128.0.6613.84/chrome/common/chrome_content_client.cc.patch similarity index 85% rename from chromium_edits/124.0.6323.0/chrome/common/chrome_content_client.cc.patch rename to chromium_edits/128.0.6613.84/chrome/common/chrome_content_client.cc.patch index 8e7677e6..d0ce5acb 100644 --- a/chromium_edits/124.0.6323.0/chrome/common/chrome_content_client.cc.patch +++ b/chromium_edits/128.0.6613.84/chrome/common/chrome_content_client.cc.patch @@ -1,8 +1,8 @@ diff --git a/chrome/common/chrome_content_client.cc b/chrome/common/chrome_content_client.cc -index 76a5e7ea40232..60ae61f15612e 100644 +index 23baff86bfc1f..df9417b28e153 100644 --- a/chrome/common/chrome_content_client.cc +++ b/chrome/common/chrome_content_client.cc -@@ -296,6 +296,12 @@ void ChromeContentClient::AddAdditionalSchemes(Schemes* schemes) { +@@ -308,6 +308,12 @@ void ChromeContentClient::AddAdditionalSchemes(Schemes* schemes) { #if BUILDFLAG(IS_ANDROID) schemes->local_schemes.push_back(url::kContentScheme); #endif diff --git a/chromium_edits/128.0.6613.84/chrome/installer/linux/common/desktop.template.patch b/chromium_edits/128.0.6613.84/chrome/installer/linux/common/desktop.template.patch new file mode 100644 index 00000000..dcd9460b --- /dev/null +++ b/chromium_edits/128.0.6613.84/chrome/installer/linux/common/desktop.template.patch @@ -0,0 +1,13 @@ +diff --git a/chrome/installer/linux/common/desktop.template b/chrome/installer/linux/common/desktop.template +index 2eb13ee1aba46..9af65726bde89 100644 +--- a/chrome/installer/linux/common/desktop.template ++++ b/chrome/installer/linux/common/desktop.template +@@ -111,7 +111,7 @@ Terminal=false + Icon=@@PACKAGE@@ + Type=Application + Categories=Network;WebBrowser; +-MimeType=application/pdf;application/rdf+xml;application/rss+xml;application/xhtml+xml;application/xhtml_xml;application/xml;image/gif;image/jpeg;image/png;image/webp;text/html;text/xml;x-scheme-handler/http;x-scheme-handler/https; ++MimeType=application/pdf;application/rdf+xml;application/rss+xml;application/xhtml+xml;application/xhtml_xml;application/xml;image/gif;image/jpeg;image/png;image/webp;text/html;text/xml;x-scheme-handler/http;x-scheme-handler/https;x-scheme-handler/ipfs;x-scheme-handler/ipns; + Actions=new-window;new-private-window; + + [Desktop Action new-window] diff --git a/chromium_edits/128.0.6613.84/chrome/installer/util/shell_util.cc.patch b/chromium_edits/128.0.6613.84/chrome/installer/util/shell_util.cc.patch new file mode 100644 index 00000000..ff731765 --- /dev/null +++ b/chromium_edits/128.0.6613.84/chrome/installer/util/shell_util.cc.patch @@ -0,0 +1,20 @@ +diff --git a/chrome/installer/util/shell_util.cc b/chrome/installer/util/shell_util.cc +index 87a2c70b6cb1a..50c52f1ef579e 100644 +--- a/chrome/installer/util/shell_util.cc ++++ b/chrome/installer/util/shell_util.cc +@@ -1523,11 +1523,12 @@ const wchar_t* ShellUtil::kDefaultFileAssociations[] = { + const wchar_t* ShellUtil::kPotentialFileAssociations[] = { + L".htm", L".html", L".pdf", L".shtml", L".svg", + L".xht", L".xhtml", L".webp", nullptr}; +-const wchar_t* ShellUtil::kBrowserProtocolAssociations[] = {L"http", L"https", +- nullptr}; ++const wchar_t* ShellUtil::kBrowserProtocolAssociations[] = { ++ L"http", L"https", L"ipfs", L"ipns", nullptr}; + const wchar_t* ShellUtil::kPotentialProtocolAssociations[] = { + L"http", L"https", L"irc", L"mailto", L"mms", L"news", L"nntp", +- L"sms", L"smsto", L"snews", L"tel", L"urn", L"webcal", nullptr}; ++ L"sms", L"smsto", L"snews", L"tel", L"urn", L"webcal", L"ipfs", ++ L"ipns", nullptr}; + const wchar_t* ShellUtil::kRegUrlProtocol = L"URL Protocol"; + const wchar_t* ShellUtil::kRegApplication = L"\\Application"; + const wchar_t* ShellUtil::kRegAppUserModelId = L"AppUserModelId"; diff --git a/chromium_edits/124.0.6323.0/components/cbor/reader.cc.patch b/chromium_edits/128.0.6613.84/components/cbor/reader.cc.patch similarity index 97% rename from chromium_edits/124.0.6323.0/components/cbor/reader.cc.patch rename to chromium_edits/128.0.6613.84/components/cbor/reader.cc.patch index a9c4a7b3..88eef088 100644 --- a/chromium_edits/124.0.6323.0/components/cbor/reader.cc.patch +++ b/chromium_edits/128.0.6613.84/components/cbor/reader.cc.patch @@ -1,5 +1,5 @@ diff --git a/components/cbor/reader.cc b/components/cbor/reader.cc -index 3c31e3d05e5d3..5ad0dbb183884 100644 +index 464e93937d8d7..220dd4960cd2b 100644 --- a/components/cbor/reader.cc +++ b/components/cbor/reader.cc @@ -22,7 +22,7 @@ diff --git a/chromium_edits/124.0.6323.0/components/cbor/reader.h.patch b/chromium_edits/128.0.6613.84/components/cbor/reader.h.patch similarity index 88% rename from chromium_edits/124.0.6323.0/components/cbor/reader.h.patch rename to chromium_edits/128.0.6613.84/components/cbor/reader.h.patch index cd7d9eb0..2dbc0534 100644 --- a/chromium_edits/124.0.6323.0/components/cbor/reader.h.patch +++ b/chromium_edits/128.0.6613.84/components/cbor/reader.h.patch @@ -1,8 +1,8 @@ diff --git a/components/cbor/reader.h b/components/cbor/reader.h -index 73c5dcb23e555..a933768608d73 100644 +index 5f11ba48ba494..d4c9c489da4b6 100644 --- a/components/cbor/reader.h +++ b/components/cbor/reader.h -@@ -130,6 +130,11 @@ class CBOR_EXPORT Reader { +@@ -131,6 +131,11 @@ class CBOR_EXPORT Reader { // during decoding will set raise the `UNSUPPORTED_FLOATING_POINT_VALUE` // error. bool allow_floating_point = false; @@ -14,7 +14,7 @@ index 73c5dcb23e555..a933768608d73 100644 }; Reader(const Reader&) = delete; -@@ -204,6 +209,9 @@ class CBOR_EXPORT Reader { +@@ -205,6 +210,9 @@ class CBOR_EXPORT Reader { std::optional ReadMapContent(const DataItemHeader& header, const Config& config, int max_nesting_level); diff --git a/chromium_edits/124.0.6323.0/components/cbor/reader_unittest.cc.patch b/chromium_edits/128.0.6613.84/components/cbor/reader_unittest.cc.patch similarity index 97% rename from chromium_edits/124.0.6323.0/components/cbor/reader_unittest.cc.patch rename to chromium_edits/128.0.6613.84/components/cbor/reader_unittest.cc.patch index 1566f783..150e0c73 100644 --- a/chromium_edits/124.0.6323.0/components/cbor/reader_unittest.cc.patch +++ b/chromium_edits/128.0.6613.84/components/cbor/reader_unittest.cc.patch @@ -1,5 +1,5 @@ diff --git a/components/cbor/reader_unittest.cc b/components/cbor/reader_unittest.cc -index e5c02ceea3402..07168e636d6bd 100644 +index e5c02ceea3402..f26b8e77f6da3 100644 --- a/components/cbor/reader_unittest.cc +++ b/components/cbor/reader_unittest.cc @@ -1449,5 +1449,42 @@ TEST(CBORReaderTest, AllowInvalidUTF8) { diff --git a/chromium_edits/124.0.6323.0/components/cbor/values.cc.patch b/chromium_edits/128.0.6613.84/components/cbor/values.cc.patch similarity index 92% rename from chromium_edits/124.0.6323.0/components/cbor/values.cc.patch rename to chromium_edits/128.0.6613.84/components/cbor/values.cc.patch index ddbab2b3..2832d248 100644 --- a/chromium_edits/124.0.6323.0/components/cbor/values.cc.patch +++ b/chromium_edits/128.0.6613.84/components/cbor/values.cc.patch @@ -1,9 +1,9 @@ diff --git a/components/cbor/values.cc b/components/cbor/values.cc -index 02498209c820e..34055aef24cfe 100644 +index 7c6b7a0aeaae3..5096311ba2a20 100644 --- a/components/cbor/values.cc +++ b/components/cbor/values.cc @@ -66,32 +66,34 @@ Value::Value(Type type) : type_(type) { - NOTREACHED(); + NOTREACHED_IN_MIGRATION(); } -Value::Value(SimpleValue in_simple) @@ -53,13 +53,13 @@ index 02498209c820e..34055aef24cfe 100644 } } --Value::Value(base::StringPiece in_string, Type type) : type_(type) { -+Value::Value(base::StringPiece in_string, Type type, uint64_t tag) +-Value::Value(std::string_view in_string, Type type) : type_(type) { ++Value::Value(std::string_view in_string, Type type, uint64_t tag) +: type_(type), tag_(tag) { switch (type_) { case Type::STRING: new (&string_value_) std::string(); -@@ -133,16 +136,18 @@ Value::Value(base::StringPiece in_string, Type type) : type_(type) { +@@ -133,16 +136,18 @@ Value::Value(std::string_view in_string, Type type) : type_(type) { } } @@ -105,7 +105,7 @@ index 02498209c820e..34055aef24cfe 100644 - return Value(map_value_); + return Value(map_value_, tag_); case Type::TAG: - NOTREACHED() << constants::kUnsupportedMajorType; + NOTREACHED_IN_MIGRATION() << constants::kUnsupportedMajorType; return Value(); case Type::SIMPLE_VALUE: - return Value(simple_value_); @@ -115,7 +115,7 @@ index 02498209c820e..34055aef24cfe 100644 + return Value(float_value_, tag_); } - NOTREACHED(); + NOTREACHED_IN_MIGRATION(); return Value(); } diff --git a/chromium_edits/124.0.6323.0/components/cbor/values.h.patch b/chromium_edits/128.0.6613.84/components/cbor/values.h.patch similarity index 87% rename from chromium_edits/124.0.6323.0/components/cbor/values.h.patch rename to chromium_edits/128.0.6613.84/components/cbor/values.h.patch index ca39df01..5556e8c5 100644 --- a/chromium_edits/124.0.6323.0/components/cbor/values.h.patch +++ b/chromium_edits/128.0.6613.84/components/cbor/values.h.patch @@ -1,8 +1,8 @@ diff --git a/components/cbor/values.h b/components/cbor/values.h -index d81ef5607c55a..10216a8dcdc57 100644 +index d55369f1a71bf..7dabb368c51d6 100644 --- a/components/cbor/values.h +++ b/components/cbor/values.h -@@ -127,28 +127,29 @@ class CBOR_EXPORT Value { +@@ -125,28 +125,29 @@ class CBOR_EXPORT Value { explicit Value(Type type); @@ -25,8 +25,8 @@ index d81ef5607c55a..10216a8dcdc57 100644 explicit Value(const char* in_string, Type type = Type::STRING); explicit Value(std::string&& in_string, Type type = Type::STRING) noexcept; -- explicit Value(base::StringPiece in_string, Type type = Type::STRING); -+ explicit Value(base::StringPiece in_string, Type type = Type::STRING, uint64_t tag = NO_TAG); +- explicit Value(std::string_view in_string, Type type = Type::STRING); ++ explicit Value(std::string_view in_string, Type type = Type::STRING, uint64_t tag = NO_TAG); - explicit Value(const ArrayValue& in_array); - explicit Value(ArrayValue&& in_array) noexcept; @@ -42,7 +42,7 @@ index d81ef5607c55a..10216a8dcdc57 100644 Value(const Value&) = delete; Value& operator=(const Value&) = delete; -@@ -179,6 +180,7 @@ class CBOR_EXPORT Value { +@@ -177,6 +178,7 @@ class CBOR_EXPORT Value { bool is_string() const { return type() == Type::STRING; } bool is_array() const { return type() == Type::ARRAY; } bool is_map() const { return type() == Type::MAP; } @@ -50,7 +50,7 @@ index d81ef5607c55a..10216a8dcdc57 100644 // These will all fatally assert if the type doesn't match. SimpleValue GetSimpleValue() const; -@@ -194,12 +196,13 @@ class CBOR_EXPORT Value { +@@ -192,12 +194,13 @@ class CBOR_EXPORT Value { const ArrayValue& GetArray() const; const MapValue& GetMap() const; const BinaryValue& GetInvalidUTF8() const; @@ -65,7 +65,7 @@ index d81ef5607c55a..10216a8dcdc57 100644 Type type_; -@@ -213,6 +216,11 @@ class CBOR_EXPORT Value { +@@ -211,6 +214,11 @@ class CBOR_EXPORT Value { MapValue map_value_; }; diff --git a/chromium_edits/124.0.6323.0/components/cbor/writer.cc.patch b/chromium_edits/128.0.6613.84/components/cbor/writer.cc.patch similarity index 91% rename from chromium_edits/124.0.6323.0/components/cbor/writer.cc.patch rename to chromium_edits/128.0.6613.84/components/cbor/writer.cc.patch index bb89c1e6..150c3fca 100644 --- a/chromium_edits/124.0.6323.0/components/cbor/writer.cc.patch +++ b/chromium_edits/128.0.6613.84/components/cbor/writer.cc.patch @@ -1,5 +1,5 @@ diff --git a/components/cbor/writer.cc b/components/cbor/writer.cc -index f400a65e7b66a..fcdebb8f3b458 100644 +index e7e47774abe9a..4c085d5693a38 100644 --- a/components/cbor/writer.cc +++ b/components/cbor/writer.cc @@ -47,6 +47,9 @@ bool Writer::EncodeCBOR(const Value& node, diff --git a/chromium_edits/124.0.6323.0/components/cbor/writer_unittest.cc.patch b/chromium_edits/128.0.6613.84/components/cbor/writer_unittest.cc.patch similarity index 91% rename from chromium_edits/124.0.6323.0/components/cbor/writer_unittest.cc.patch rename to chromium_edits/128.0.6613.84/components/cbor/writer_unittest.cc.patch index 240fee83..1acf5f7f 100644 --- a/chromium_edits/124.0.6323.0/components/cbor/writer_unittest.cc.patch +++ b/chromium_edits/128.0.6613.84/components/cbor/writer_unittest.cc.patch @@ -1,8 +1,8 @@ diff --git a/components/cbor/writer_unittest.cc b/components/cbor/writer_unittest.cc -index e3bffe20734bc..0ed569ae164a0 100644 +index ee11e7cb86712..b8942f1829a37 100644 --- a/components/cbor/writer_unittest.cc +++ b/components/cbor/writer_unittest.cc -@@ -522,4 +522,31 @@ TEST(CBORWriterTest, OverlyNestedCBOR) { +@@ -523,4 +523,31 @@ TEST(CBORWriterTest, OverlyNestedCBOR) { EXPECT_FALSE(Writer::Write(Value(map), 4).has_value()); } diff --git a/chromium_edits/124.0.6323.0/components/open_from_clipboard/clipboard_recent_content_generic.cc.patch b/chromium_edits/128.0.6613.84/components/open_from_clipboard/clipboard_recent_content_generic.cc.patch similarity index 95% rename from chromium_edits/124.0.6323.0/components/open_from_clipboard/clipboard_recent_content_generic.cc.patch rename to chromium_edits/128.0.6613.84/components/open_from_clipboard/clipboard_recent_content_generic.cc.patch index 291d84f1..31e2e173 100644 --- a/chromium_edits/124.0.6323.0/components/open_from_clipboard/clipboard_recent_content_generic.cc.patch +++ b/chromium_edits/128.0.6613.84/components/open_from_clipboard/clipboard_recent_content_generic.cc.patch @@ -1,5 +1,5 @@ diff --git a/components/open_from_clipboard/clipboard_recent_content_generic.cc b/components/open_from_clipboard/clipboard_recent_content_generic.cc -index 32c4138ec358c..e9c62d51bf59b 100644 +index 9c0cda2dfb314..fea1c527c6d1d 100644 --- a/components/open_from_clipboard/clipboard_recent_content_generic.cc +++ b/components/open_from_clipboard/clipboard_recent_content_generic.cc @@ -20,7 +20,7 @@ diff --git a/chromium_edits/124.0.6323.0/net/dns/dns_config_service_linux.cc.patch b/chromium_edits/128.0.6613.84/net/dns/dns_config_service_linux.cc.patch similarity index 88% rename from chromium_edits/124.0.6323.0/net/dns/dns_config_service_linux.cc.patch rename to chromium_edits/128.0.6613.84/net/dns/dns_config_service_linux.cc.patch index 3b042d33..fd7227a5 100644 --- a/chromium_edits/124.0.6323.0/net/dns/dns_config_service_linux.cc.patch +++ b/chromium_edits/128.0.6613.84/net/dns/dns_config_service_linux.cc.patch @@ -1,8 +1,8 @@ diff --git a/net/dns/dns_config_service_linux.cc b/net/dns/dns_config_service_linux.cc -index f909f127ba3e1..31d7f9d58c0af 100644 +index 7aaf9fa5b0b78..5a9f5b5a70dd9 100644 --- a/net/dns/dns_config_service_linux.cc +++ b/net/dns/dns_config_service_linux.cc -@@ -271,11 +271,11 @@ bool IsNsswitchConfigCompatible( +@@ -276,11 +276,11 @@ bool IsNsswitchConfigCompatible( // Ignore any entries after `kDns` because Chrome will fallback to the // system resolver if a result was not found in DNS. return true; diff --git a/chromium_edits/128.0.6613.7/third_party/blink/renderer/platform/weborigin/scheme_registry.cc.patch b/chromium_edits/128.0.6613.84/third_party/blink/renderer/platform/weborigin/scheme_registry.cc.patch similarity index 70% rename from chromium_edits/128.0.6613.7/third_party/blink/renderer/platform/weborigin/scheme_registry.cc.patch rename to chromium_edits/128.0.6613.84/third_party/blink/renderer/platform/weborigin/scheme_registry.cc.patch index 5779267b..663fe49e 100644 --- a/chromium_edits/128.0.6613.7/third_party/blink/renderer/platform/weborigin/scheme_registry.cc.patch +++ b/chromium_edits/128.0.6613.84/third_party/blink/renderer/platform/weborigin/scheme_registry.cc.patch @@ -1,13 +1,15 @@ diff --git a/third_party/blink/renderer/platform/weborigin/scheme_registry.cc b/third_party/blink/renderer/platform/weborigin/scheme_registry.cc -index e1bc209c337c5..844ce502464d4 100644 +index e1bc209c337c5..6fbac29fcddfd 100644 --- a/third_party/blink/renderer/platform/weborigin/scheme_registry.cc +++ b/third_party/blink/renderer/platform/weborigin/scheme_registry.cc -@@ -68,7 +68,7 @@ class URLSchemesRegistry final { +@@ -68,8 +68,8 @@ class URLSchemesRegistry final { // is considered secure. Additional checks are performed to ensure that // other http pages are filtered out. service_worker_schemes({"http", "https"}), - fetch_api_schemes({"http", "https"}), +- allowed_in_referrer_schemes({"http", "https"}) { + fetch_api_schemes({"http", "https", "ipfs", "ipns"}), - allowed_in_referrer_schemes({"http", "https"}) { ++ allowed_in_referrer_schemes({"http", "https", "ipfs", "ipns"}) { for (auto& scheme : url::GetCorsEnabledSchemes()) cors_enabled_schemes.insert(scheme.c_str()); + for (auto& scheme : url::GetCSPBypassingSchemes()) { diff --git a/chromium_edits/124.0.6323.0/url/BUILD.gn.patch b/chromium_edits/128.0.6613.84/url/BUILD.gn.patch similarity index 87% rename from chromium_edits/124.0.6323.0/url/BUILD.gn.patch rename to chromium_edits/128.0.6613.84/url/BUILD.gn.patch index cc358ad4..be4bfca8 100644 --- a/chromium_edits/124.0.6323.0/url/BUILD.gn.patch +++ b/chromium_edits/128.0.6613.84/url/BUILD.gn.patch @@ -1,5 +1,5 @@ diff --git a/url/BUILD.gn b/url/BUILD.gn -index b5edb89f7698f..d299856674d7d 100644 +index f22b73bc29f06..df36977322ec7 100644 --- a/url/BUILD.gn +++ b/url/BUILD.gn @@ -5,6 +5,7 @@ @@ -10,7 +10,7 @@ index b5edb89f7698f..d299856674d7d 100644 import("features.gni") import("//build/config/cronet/config.gni") -@@ -68,6 +69,7 @@ component("url") { +@@ -67,6 +68,7 @@ component("url") { public_deps = [ "//base", "//build:robolectric_buildflags", @@ -18,7 +18,7 @@ index b5edb89f7698f..d299856674d7d 100644 ] configs += [ "//build/config/compiler:wexit_time_destructors" ] -@@ -90,6 +92,11 @@ component("url") { +@@ -89,6 +91,11 @@ component("url") { public_configs = [ "//third_party/jdk" ] } diff --git a/chromium_edits/128.0.6613.84/url/url_canon.h.patch b/chromium_edits/128.0.6613.84/url/url_canon.h.patch new file mode 100644 index 00000000..57a53f5b --- /dev/null +++ b/chromium_edits/128.0.6613.84/url/url_canon.h.patch @@ -0,0 +1,26 @@ +diff --git a/url/url_canon.h b/url/url_canon.h +index ab5ec90988943..d28d325a01fc0 100644 +--- a/url/url_canon.h ++++ b/url/url_canon.h +@@ -821,6 +821,21 @@ bool CanonicalizeMailtoURL(const char16_t* spec, + CanonOutput* output, + Parsed* new_parsed); + ++COMPONENT_EXPORT(URL) ++bool CanonicalizeIpfsURL(std::string_view spec, ++ const Parsed& parsed, ++ SchemeType scheme_type, ++ CharsetConverter* query_converter, ++ CanonOutput* output, ++ Parsed* new_parsed); ++COMPONENT_EXPORT(URL) ++bool CanonicalizeIpfsURL(std::basic_string_view spec, ++ const Parsed& parsed, ++ SchemeType scheme_type, ++ CharsetConverter* query_converter, ++ CanonOutput* output, ++ Parsed* new_parsed); ++ + // Part replacer -------------------------------------------------------------- + + // Internal structure used for storing separate strings for each component. diff --git a/chromium_edits/128.0.6613.84/url/url_canon_ipfs.cc b/chromium_edits/128.0.6613.84/url/url_canon_ipfs.cc new file mode 100644 index 00000000..e40732ee --- /dev/null +++ b/chromium_edits/128.0.6613.84/url/url_canon_ipfs.cc @@ -0,0 +1,54 @@ +#include "url_canon_internal.h" + +#include +#include + +#include + +bool url::CanonicalizeIpfsURL(std::string_view spec, + const Parsed& parsed, + SchemeType scheme_type, + CharsetConverter* charset_converter, + CanonOutput* output, + Parsed* output_parsed) { + if (spec.size() < 1) { + return false; + } + if ( parsed.host.len < 1 ) { + return false; + } + auto cid_str = spec.substr( parsed.host.begin, static_cast(parsed.host.len) ); + auto cid = ipfs::Cid(cid_str); + if ( !cid.valid() ) { + cid = ipfs::id_cid::forText( std::string{cid_str} + " is not a valid CID." ); + } + auto as_str = cid.to_string(); + if ( as_str.empty() ) { + return false; + } + std::string stdurl{ spec.substr(0UL, static_cast(parsed.host.begin)) }; + stdurl.append( as_str ); + spec.remove_prefix(parsed.host.end()); + stdurl.append(spec); + auto len = static_cast(stdurl.size()); + Parsed parsed_input; + ParseStandardURL(stdurl.data(), len, &parsed_input); + return CanonicalizeStandardURL( + stdurl.data(), + parsed_input, + scheme_type, + charset_converter, + output, output_parsed + ); +} +bool url::CanonicalizeIpfsURL(std::basic_string_view spec, + const Parsed& parsed, + SchemeType scheme_type, + CharsetConverter* query_converter, + CanonOutput* output, + Parsed* new_parsed) { + RawCanonOutput<2048> as8; + ConvertUTF16ToUTF8(spec.data(), spec.size(), &as8); + return CanonicalizeIpfsURL({as8.data(), as8.length()}, parsed, scheme_type, + query_converter, output, new_parsed); +} diff --git a/chromium_edits/128.0.6613.84/url/url_util.cc.patch b/chromium_edits/128.0.6613.84/url/url_util.cc.patch new file mode 100644 index 00000000..988797b0 --- /dev/null +++ b/chromium_edits/128.0.6613.84/url/url_util.cc.patch @@ -0,0 +1,45 @@ +diff --git a/url/url_util.cc b/url/url_util.cc +index ce5225e121f5d..79e33208f728e 100644 +--- a/url/url_util.cc ++++ b/url/url_util.cc +@@ -76,6 +76,8 @@ struct SchemeRegistry { + std::vector referrer_schemes = { + {kHttpsScheme, SCHEME_WITH_HOST_PORT_AND_USER_INFORMATION}, + {kHttpScheme, SCHEME_WITH_HOST_PORT_AND_USER_INFORMATION}, ++ {"ipfs", SCHEME_WITH_HOST}, ++ {"ipns", SCHEME_WITH_HOST}, + }; + + // Schemes that do not trigger mixed content warning. +@@ -84,6 +86,8 @@ struct SchemeRegistry { + kWssScheme, + kDataScheme, + kAboutScheme, ++ {"ipfs", SCHEME_WITH_HOST}, ++ {"ipns", SCHEME_WITH_HOST}, + }; + + // Schemes that normal pages cannot link to or access (i.e., with the same +@@ -105,6 +109,8 @@ struct SchemeRegistry { + kHttpsScheme, + kHttpScheme, + kDataScheme, ++ {"ipfs", SCHEME_WITH_HOST}, ++ {"ipns", SCHEME_WITH_HOST}, + }; + + // Schemes that can be used by web to store data (local storage, etc). +@@ -308,7 +314,12 @@ bool DoCanonicalize(const CHAR* spec, + success = CanonicalizeFileSystemURL( + spec, ParseFileSystemURL(std::basic_string_view(spec, spec_len)), + charset_converter, output, output_parsed); +- ++ } else if (DoCompareSchemeComponent(spec, scheme, "ipfs")) { ++ auto spec_view = std::basic_string_view(spec, spec_len); ++ // Switch multibase away from case-sensitive ones before continuing canonicalization. ++ auto parsed_input = ParseStandardURL(spec_view); ++ success = CanonicalizeIpfsURL(spec_view, parsed_input, scheme_type, ++ charset_converter, output, output_parsed); + } else if (DoIsStandard(spec, scheme, &scheme_type)) { + // All "normal" URLs. + success = CanonicalizeStandardURL( diff --git a/chromium_edits/128.0.6613.85/url/url_util.cc.patch b/chromium_edits/128.0.6613.85/url/url_util.cc.patch index 2f430e17..988797b0 100644 --- a/chromium_edits/128.0.6613.85/url/url_util.cc.patch +++ b/chromium_edits/128.0.6613.85/url/url_util.cc.patch @@ -1,8 +1,35 @@ diff --git a/url/url_util.cc b/url/url_util.cc -index ce5225e121f5d..e2ddfd9323214 100644 +index ce5225e121f5d..79e33208f728e 100644 --- a/url/url_util.cc +++ b/url/url_util.cc -@@ -308,7 +308,12 @@ bool DoCanonicalize(const CHAR* spec, +@@ -76,6 +76,8 @@ struct SchemeRegistry { + std::vector referrer_schemes = { + {kHttpsScheme, SCHEME_WITH_HOST_PORT_AND_USER_INFORMATION}, + {kHttpScheme, SCHEME_WITH_HOST_PORT_AND_USER_INFORMATION}, ++ {"ipfs", SCHEME_WITH_HOST}, ++ {"ipns", SCHEME_WITH_HOST}, + }; + + // Schemes that do not trigger mixed content warning. +@@ -84,6 +86,8 @@ struct SchemeRegistry { + kWssScheme, + kDataScheme, + kAboutScheme, ++ {"ipfs", SCHEME_WITH_HOST}, ++ {"ipns", SCHEME_WITH_HOST}, + }; + + // Schemes that normal pages cannot link to or access (i.e., with the same +@@ -105,6 +109,8 @@ struct SchemeRegistry { + kHttpsScheme, + kHttpScheme, + kDataScheme, ++ {"ipfs", SCHEME_WITH_HOST}, ++ {"ipns", SCHEME_WITH_HOST}, + }; + + // Schemes that can be used by web to store data (local storage, etc). +@@ -308,7 +314,12 @@ bool DoCanonicalize(const CHAR* spec, success = CanonicalizeFileSystemURL( spec, ParseFileSystemURL(std::basic_string_view(spec, spec_len)), charset_converter, output, output_parsed); diff --git a/cmake/CodeCoverage.cmake b/cmake/CodeCoverage.cmake index 0596018d..adf13eb6 100644 --- a/cmake/CodeCoverage.cmake +++ b/cmake/CodeCoverage.cmake @@ -297,7 +297,7 @@ function(setup_target_for_coverage_lcov) ${GENHTML_EXTRA_ARGS} ${Coverage_GENHTML_ARGS} --rc genhtml_hi_limit=88 - --rc genhtml_med_limit=73 + --rc genhtml_med_limit=73.4 --prefix "${BASEDIR}" -o ${Coverage_NAME} ${Coverage_NAME}.info diff --git a/cmake/patch.py b/cmake/patch.py index 9529dded..b65f0b86 100755 --- a/cmake/patch.py +++ b/cmake/patch.py @@ -530,15 +530,13 @@ def list_ood(self, to_check: list[str], sense: bool): for chan in ["Dev", "Beta", "Stable", "Extended"]: for os in ["Linux", "Mac", "Windows"]: rels = per.release_versions(chan, os) - if len(rels) > 0: - print(f"Curr {chan:9}{os:7}", rels[0][1]) - if len(rels) > 1: - print(f"Prev {chan:9}{os:7}", rels[1][1]) - if len(rels) > 2: - print(f"Old {chan:9}{os:7}", rels[2][1]) - print("Electron's main branch:", per.electron_version()) + for (n,v) in zip(['Cur', 'Prv', 'Old'], rels): + print(f"{v[1]:15} {n} {chan:9}{os:7}") + for (elec_br,chrom_ver) in per.electron_versions().items(): + print(f"{chrom_ver:15} Electron {elec_br}") + print(f"{per.electron_version():15} Electron main") o = per.oldest() - print("Oldest maintained Extended:", o[1], f"({ctime(o[2])})") + print(f"{o[1]:15} Oldest maintained Extended:", f"({ctime(o[2])})") n = per.newest() print("Development at:", n[1], f"({ctime(n[2])})") elif argv[1] == "available": diff --git a/component/CMakeLists.txt b/component/CMakeLists.txt index 3cbd6708..2ce14088 100644 --- a/component/CMakeLists.txt +++ b/component/CMakeLists.txt @@ -127,26 +127,36 @@ if(CMAKE_BUILD_TYPE STREQUAL "Release") COMMAND "${Python3_EXECUTABLE}" "${CMAKE_SOURCE_DIR}/cmake/chromium.py" "${CMAKE_BINARY_DIR}" chrome.stripped DEPENDS build_browser ) + add_custom_target(build_browser_sandbox + COMMENT "Sandboxing browser, output is out/${CHROMIUM_PROFILE}/chrome_sandbox" + COMMAND "${Python3_EXECUTABLE}" "${CMAKE_SOURCE_DIR}/cmake/chromium.py" "${CMAKE_BINARY_DIR}" chrome_sandbox + DEPENDS build_stripped_browser + ) + add_custom_target(build_stripped_browser_sandbox + COMMENT "Sandboxing stripped browser" + COMMAND "${Python3_EXECUTABLE}" "${CMAKE_SOURCE_DIR}/cmake/chromium.py" "${CMAKE_BINARY_DIR}" chrome_sandbox.stripped + DEPENDS build_browser_sandbox + ) foreach(suffix "" _sandbox) add_custom_command( - TARGET build_browser + TARGET build_browser${suffix} POST_BUILD COMMAND "${CMAKE_COMMAND}" -E copy "${CHROMIUM_SOURCE_TREE}/out/${CHROMIUM_PROFILE}/chrome${suffix}" "${CHROMIUM_SOURCE_TREE}/out/${CHROMIUM_PROFILE}/ipfs_chromium${suffix}" ) add_custom_command( - TARGET build_stripped_browser + TARGET build_stripped_browser${suffix} POST_BUILD COMMAND "${CMAKE_COMMAND}" -E copy "${CHROMIUM_SOURCE_TREE}/out/${CHROMIUM_PROFILE}/chrome${suffix}.stripped" - "${CHROMIUM_SOURCE_TREE}/out/${CHROMIUM_PROFILE}/ipfs_chromium${suffix}.stripped " + "${CHROMIUM_SOURCE_TREE}/out/${CHROMIUM_PROFILE}/ipfs_chromium${suffix}.stripped" ) endforeach() add_custom_target(package_browser COMMENT "Packaging" COMMAND "${Python3_EXECUTABLE}" "${CMAKE_SOURCE_DIR}/cmake/chromium.py" "${CMAKE_BINARY_DIR}" ${CHROMIUM_PACKAGE_TARGET} - DEPENDS build_stripped_browser + DEPENDS build_stripped_browser build_stripped_browser_sandbox ) add_custom_target(upload_browser DEPENDS package_browser diff --git a/component/cache_requestor.cc b/component/cache_requestor.cc index 7f0304c8..dc1d69c8 100644 --- a/component/cache_requestor.cc +++ b/component/cache_requestor.cc @@ -129,7 +129,6 @@ void Self::OnHeaderRead(Task task, int code) { } void Self::OnBodyRead(Task task, int code) { if (code <= 0) { - VLOG(2) << "Failed to read body for entry " << task.key << " in " << name(); Miss(task); return; } diff --git a/component/chromium_cbor_adapter.cc b/component/chromium_cbor_adapter.cc index ad9ee8e9..78d44b20 100644 --- a/component/chromium_cbor_adapter.cc +++ b/component/chromium_cbor_adapter.cc @@ -70,7 +70,7 @@ auto Self::as_link() const -> std::optional { VLOG(2) << "Trying to do an as_link(" << static_cast(cbor_.type()) << ',' << std::boolalpha << cbor_.has_tag() << ")"; if (!cbor_.has_tag() || cbor_.GetTag() != 42UL || !cbor_.is_bytestring()) { - VLOG(1) << "This is not a link."; + VLOG(2) << "This is not a link."; return std::nullopt; } auto& bytes = cbor_.GetBytestring(); diff --git a/component/ipfs_url_loader.cc b/component/ipfs_url_loader.cc index 4fc6fe99..5906c501 100644 --- a/component/ipfs_url_loader.cc +++ b/component/ipfs_url_loader.cc @@ -130,7 +130,7 @@ void ipfs::IpfsUrlLoader::StartRequest( }; me->ipfs_request_ = std::make_shared(abs_path, whendone); if (auto sh = GetHeader(resource_request.headers, "Semantic")) { - LOG(INFO) << "Setting semantic header: '" << *sh << "'."; + VLOG(2) << "Setting semantic header: '" << *sh << "'."; me->ipfs_request_->semantic(*sh); } me->stepper_ = std::make_unique(); @@ -193,7 +193,7 @@ void ipfs::IpfsUrlLoader::BlocksComplete(std::string mime_type, } if (resp_loc_.size()) { head->headers->AddHeader("Location", resp_loc_); - VLOG(1) << "Sending response for " << original_url_ << " with mime type " + VLOG(2) << "Sending response for " << original_url_ << " with mime type " << head->mime_type << " and status line '" << status_line << "' @location '" << resp_loc_ << "'"; } diff --git a/library/src/ipfs_client/car.h b/library/src/ipfs_client/car.h index 6175f38e..e0d1bd36 100644 --- a/library/src/ipfs_client/car.h +++ b/library/src/ipfs_client/car.h @@ -9,6 +9,10 @@ namespace ipfs { class Client; +/*! A (C)ontent-addressed (A)(r)chive + * Archive in the same sense as tape archive (.tar), Java archive (.jar), archive (.a) etc. + * However contains metadata not related to a filesystem, but to an IPLD DAG (or part of one) + */ class Car { public: Car(ByteView, Client&); diff --git a/library/src/ipfs_client/ctx/default_gateways.cc b/library/src/ipfs_client/ctx/default_gateways.cc index dc9cad2a..aab03d42 100644 --- a/library/src/ipfs_client/ctx/default_gateways.cc +++ b/library/src/ipfs_client/ctx/default_gateways.cc @@ -29,20 +29,20 @@ bool ctx::LoadGatewaysFromEnvironmentVariable(ipfs::ctx::GatewayConfig& cfg) { void ctx::LoadStaticGatewayList(ipfs::ctx::GatewayConfig& cfg) { auto static_list = { - std::pair{"http://127.0.0.1:8080/", 1001}, - {"https://ipfs.io/", 991}, - {"https://dweb.link/", 984}, - {"https://hardbin.com/", 968}, - {"https://ipfs.joaoleitao.org/", 903}, - {"https://ipfs.greyh.at/", 902}, - {"https://trustless-gateway.link/", 789}, - {"https://human.mypinata.cloud/", 453}, - {"https://delegated-ipfs.dev/", 362}, - {"https://jcsl.hopto.org/", 356}, - {"https://4everland.io/", 338}, - {"https://ipfs.runfission.com/", 307}, - {"https://gateway.pinata.cloud/", 204}, - {"https://dag.w3s.link/", 177}, + std::pair{"http://127.0.0.1:8080/", 1012}, + {"https://ipfs.io/", 980}, + {"https://dweb.link/", 973}, + {"https://hardbin.com/", 957}, + {"https://ipfs.joaoleitao.org/", 892}, + {"https://ipfs.greyh.at/", 891}, + {"https://trustless-gateway.link/", 778}, + {"https://human.mypinata.cloud/", 442}, + {"https://jcsl.hopto.org/", 354}, + {"https://delegated-ipfs.dev/", 351}, + {"https://4everland.io/", 327}, + {"https://ipfs.runfission.com/", 295}, + {"https://gateway.pinata.cloud/", 175}, + {"https://dag.w3s.link/", 166}, {"https://ipfs.eth.aragon.network/", 11}, {"https://data.filstorage.io/", 10}, {"https://storry.tv/", 9}, diff --git a/library/src/ipfs_client/gw/dnslink_requestor_unittest.cc b/library/src/ipfs_client/gw/dnslink_requestor_unittest.cc index e40129f5..59aac930 100644 --- a/library/src/ipfs_client/gw/dnslink_requestor_unittest.cc +++ b/library/src/ipfs_client/gw/dnslink_requestor_unittest.cc @@ -1,6 +1,7 @@ #include #include +#include #include #include @@ -10,6 +11,7 @@ using T = ig::DnsLinkRequestor; namespace { struct DnslinkRequestorTest : public testing::Test { + LogRecorder logs_; std::shared_ptr api = std::make_shared(); std::shared_ptr t_ = std::make_shared(api); std::shared_ptr r_ = @@ -34,4 +36,4 @@ TEST_F(DnslinkRequestorTest, basic) { auto res = t_->handle(r_); EXPECT_EQ(static_cast(res), 'P'); EXPECT_TRUE(orc_->has_key("not_a_cid")); -} \ No newline at end of file +} diff --git a/library/src/ipfs_client/gw/gateway_request.cc b/library/src/ipfs_client/gw/gateway_request.cc index 5a58fa07..d9e9807b 100644 --- a/library/src/ipfs_client/gw/gateway_request.cc +++ b/library/src/ipfs_client/gw/gateway_request.cc @@ -375,7 +375,6 @@ void Self::AddDnsLink(std::string_view target, bool& success, ipld::BlockSource auto node = std::make_shared(target); if (node) { node->source(src); - VLOG(2) << "Added a DNSLink node pointing to " << target; } if (orchestrator_) { success = orchestrator_->add_node(main_param, node) || success; diff --git a/library/src/ipfs_client/gw/gateway_request_unittest.cc b/library/src/ipfs_client/gw/gateway_request_unittest.cc index a730083b..2d7892d8 100644 --- a/library/src/ipfs_client/gw/gateway_request_unittest.cc +++ b/library/src/ipfs_client/gw/gateway_request_unittest.cc @@ -2,6 +2,7 @@ #include #include +#include #include #include "ipfs_client/gw/gateway_request_type.h" @@ -69,6 +70,7 @@ struct GatewayRequestTest : public testing::Test { } // namespace TEST_F(GatewayRequestTest, RespondsToCar) { + LogRecorder lr; t_.cid = i::Cid{"bafybeibwfakyszctcz54dungqay7jae35agjjhokltvvtboospgo6napxy"}; t_.type = RT::Car; diff --git a/library/src/ipfs_client/gw/gateway_state.cc b/library/src/ipfs_client/gw/gateway_state.cc index 77b6065d..a04d6a1b 100644 --- a/library/src/ipfs_client/gw/gateway_state.cc +++ b/library/src/ipfs_client/gw/gateway_state.cc @@ -50,7 +50,7 @@ void Self::hit(GatewayRequestType grt, GatewayRequest const& req) { c.SetTypeAffinity(prefix_, grt, std::max(typaff + 9, 1)); affinity_success[req.affinity] += 9; auto rpm = c.GetGatewayRate(prefix_); - for (auto i = 7; i; --i) { + for (auto i = 10; i; --i) { if (over_rate(rpm / i)) { ++rpm; } else { diff --git a/library/src/ipfs_client/gw/inline_request_handler_unittest.cc b/library/src/ipfs_client/gw/inline_request_handler_unittest.cc index 0eee916b..43813dba 100644 --- a/library/src/ipfs_client/gw/inline_request_handler_unittest.cc +++ b/library/src/ipfs_client/gw/inline_request_handler_unittest.cc @@ -1,6 +1,7 @@ #include #include +#include #include #include @@ -17,6 +18,7 @@ using RT = ig::GatewayRequestType; using ipfs::Cid; TEST(InlineRequestHanlder, bluesky) { + LogRecorder lr; T t; auto api = std::make_shared(); auto rtor = std::make_shared(); @@ -28,4 +30,4 @@ TEST(InlineRequestHanlder, bluesky) { r->cid = Cid(i::MultiCodec::RAW, h); auto res = t.handle(r); EXPECT_EQ(static_cast(res), 'D'); -} \ No newline at end of file +} diff --git a/library/src/ipfs_client/gw/multi_gateway_requestor.cc b/library/src/ipfs_client/gw/multi_gateway_requestor.cc index f196efbf..11adabc8 100644 --- a/library/src/ipfs_client/gw/multi_gateway_requestor.cc +++ b/library/src/ipfs_client/gw/multi_gateway_requestor.cc @@ -131,7 +131,9 @@ void Self::DoSend(RequestPtr req, std::string const& gw, GatewayState& state) { }; state.just_sent_one(); auto cancel = api_->http().SendHttpRequest(*desc, cb); - req->dependent->to_cleanup(cancel); + if (req->dependent) { + req->dependent->to_cleanup(cancel); + } } void Self::HandleResponse(HttpRequestDescription const& desc, RequestPtr req, @@ -163,7 +165,6 @@ void Self::HandleResponse(HttpRequestDescription const& desc, return; } if (state_.end() != i) { - VLOG(2) << "Wrong accept (" << ct << ") on " << req->debug_string(); i->second.miss(req_type, *req); req->failures.insert(gw); } else { diff --git a/library/src/ipfs_client/gw/multi_gateway_requestor_unittest.cc b/library/src/ipfs_client/gw/multi_gateway_requestor_unittest.cc index 4576c1c1..7a63fb0c 100644 --- a/library/src/ipfs_client/gw/multi_gateway_requestor_unittest.cc +++ b/library/src/ipfs_client/gw/multi_gateway_requestor_unittest.cc @@ -36,3 +36,17 @@ TEST(MultiGatewayRequestor, PendingIfHttp) { auto o = t.handle(r); EXPECT_TRUE(o == ig::Requestor::HandleOutcome::PENDING); } +TEST(MultiGatewayRequestor, SendsRequestIfGatewayThereWithAnHttpRequest) { + auto t = std::make_shared(); + auto api = std::make_shared(); + api->gw_->index_gettable_gateways.emplace_back("telnet://::1/", 9); + t->api(api); + auto r = block_req(); + r->type = RT::Block; + auto o = t->handle(r); + EXPECT_TRUE(o == ig::Requestor::HandleOutcome::PENDING); + EXPECT_EQ(api->h_->requests_sent.size(),1UL); + auto& rs = api->h_->requests_sent.at(0); + auto url_sent_to = rs.first.url; + EXPECT_LT(url_sent_to.find("bafybeid4dzlxm6h"),999UL) << url_sent_to; +} diff --git a/library/src/ipfs_client/gw/requestor.cc b/library/src/ipfs_client/gw/requestor.cc index 5e66b61c..c10ef491 100644 --- a/library/src/ipfs_client/gw/requestor.cc +++ b/library/src/ipfs_client/gw/requestor.cc @@ -30,7 +30,7 @@ void Self::request(ReqPtr req) { return; } if (req->Finished()) { - VLOG(1) << "Dropping a finished/zombie request " << req->debug_string(); + VLOG(2) << "Dropping a finished/zombie request " << req->debug_string(); return; } switch (handle(req)) { diff --git a/library/src/ipfs_client/ipld/directory_shard.cc b/library/src/ipfs_client/ipld/directory_shard.cc index 11a3262a..7e1f02d4 100644 --- a/library/src/ipfs_client/ipld/directory_shard.cc +++ b/library/src/ipfs_client/ipld/directory_shard.cc @@ -31,7 +31,6 @@ auto Self::resolve(ResolutionState& parms) -> ResolveResult { if (resp) { resp->mime_ = "text/html"; } else if (std::holds_alternative(result)){ - VLOG(1) << "HAMT returning dynamic listing HTML page."; return DynamicListingHtml(parms.MyPath().to_view()); } return result; @@ -45,11 +44,12 @@ auto Self::resolve_internal(ipfs::ipld::DirShard::HashIter hash_b, std::string_view human_name, ResolutionState& parms) -> ResolveResult { auto hash_chunk = hash_b == hash_e ? std::string{} : *hash_b; + auto needed_size = hash_chunk.size() + human_name.size(); for (auto& [name, link] : links_) { if (!starts_with(name, hash_chunk)) { continue; } - if (ends_with(name, human_name)) { + if (name.size() == needed_size && ends_with(name, human_name)) { return CallChild(parms, name); } auto node = parms.GetBlock(link.cid); diff --git a/library/src/ipfs_client/ipld/symlink_unittest.cc b/library/src/ipfs_client/ipld/symlink_unittest.cc index 712c0475..d91ec558 100644 --- a/library/src/ipfs_client/ipld/symlink_unittest.cc +++ b/library/src/ipfs_client/ipld/symlink_unittest.cc @@ -1,8 +1,7 @@ #include "symlink.h" -#include "small_directory.h" - #include +#include #include #include @@ -31,6 +30,7 @@ TEST(SymlinkTest, fromBlock) { EXPECT_EQ(actual.new_path, expect); } TEST(SymlinkTest, rooted) { + LogRecorder lr; auto target = "/b"; auto sub = std::make_shared(target); // This dir actually contains an inlined symlink which points to /b/c, but diff --git a/library/src/ipfs_client/ipns_record_unittest.cc b/library/src/ipfs_client/ipns_record_unittest.cc index 63b02938..c778de8f 100644 --- a/library/src/ipfs_client/ipns_record_unittest.cc +++ b/library/src/ipfs_client/ipns_record_unittest.cc @@ -2,6 +2,7 @@ #include #include +#include #include #include @@ -165,6 +166,7 @@ TEST(IpnsRecordTest, TooBig) { EXPECT_TRUE(cid.hash_type() == i::HashType::IDENTITY); EXPECT_TRUE(cid.valid()); Api api; + LogRecorder lr; auto actual = ipfs::ValidateIpnsRecord({p, 12345}, cid, api); EXPECT_FALSE(actual.has_value()); } diff --git a/library/src/ipfs_client/redirects.cc b/library/src/ipfs_client/redirects.cc index da5b34de..51df70a2 100644 --- a/library/src/ipfs_client/redirects.cc +++ b/library/src/ipfs_client/redirects.cc @@ -199,7 +199,6 @@ namespace { std::pair parse_status(std::string_view line, std::size_t col) { if (col >= line.size()) { - VLOG(2) << " No status specified, using default."; return {DEFAULT_STATUS, ""}; } auto b = line.find_first_not_of(WHITESPACE, col); diff --git a/library/src/ipfs_client/web_util.cc b/library/src/ipfs_client/web_util.cc index 589d7d65..29da0aef 100644 --- a/library/src/ipfs_client/web_util.cc +++ b/library/src/ipfs_client/web_util.cc @@ -25,10 +25,10 @@ std::string u::RoughlyUnescapeUrlComponent(std::string_view url_comp) { if (c <= '9') { return c - '0'; } - if (c <= 'Z') { - return c - 'A'; + if (c <= 'F') { + return c - 'A' + 10; } - return c - 'a'; + return c - 'a' + 10; }; for (auto i = 0UL; i + 1UL < rv.size(); ++i) { if (rv[i] != '%') { @@ -52,4 +52,4 @@ std::string u::RoughlyUnescapeUrlComponent(std::string_view url_comp) { } } return rv; -} \ No newline at end of file +} diff --git a/library/src/ipfs_client/web_util_unittest.cc b/library/src/ipfs_client/web_util_unittest.cc new file mode 100644 index 00000000..52b2c176 --- /dev/null +++ b/library/src/ipfs_client/web_util_unittest.cc @@ -0,0 +1,14 @@ +#include "web_util.h" +#include + +namespace u = ipfs::util; + +TEST(RoughlyUnescapeUrlComponent,SomeStolenTestCases) { + // https://greenbytes.de/tech/webdav/urldecomp.html + auto actual = u::RoughlyUnescapeUrlComponent(",A%20brief%20note%25foo#bar"); + EXPECT_EQ(actual, ",A brief note%foo#bar"); + actual = u::RoughlyUnescapeUrlComponent("a-umlaut-%C3%A4"); + EXPECT_EQ(actual, "a-umlaut-รค"); + actual = u::RoughlyUnescapeUrlComponent("a%"); + EXPECT_EQ(actual, "a%"); +} diff --git a/test_data/blocks/QmY1TsNbk8JV17n2TFUY1eJToy3mKp6z4Lyo7vfQDddq1o b/test_data/blocks/QmY1TsNbk8JV17n2TFUY1eJToy3mKp6z4Lyo7vfQDddq1o deleted file mode 100644 index 6b71e933..00000000 --- a/test_data/blocks/QmY1TsNbk8JV17n2TFUY1eJToy3mKp6z4Lyo7vfQDddq1o +++ /dev/null @@ -1,3 +0,0 @@ - -vpZx2 Zx3 Zx4 Zx5 Zx6 Zx7 Zx8 Zx9 Zy0 Zy1 Zy2 Zy3 Zy4 Zy5 Zy6 Zy7 Zy8 Zy9 Zz0 Zz1 Zz2 Zz3 Zz4 Zz5 Zz6 Zz7 Zz8 Zz9 -p \ No newline at end of file diff --git a/test_data/blocks/QmYBhLYDwVFvxos9h8CGU2ibaY66QNgv8hpfewxaQrPiZj b/test_data/blocks/QmYBhLYDwVFvxos9h8CGU2ibaY66QNgv8hpfewxaQrPiZj deleted file mode 100644 index f83c97c8566d833bd6e2641302d74bdadffdfc79..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 468 zcmWeK;8GG&xc#Lv`Qqb5-IWeeH(#xMGDUT%t$^{qj^71;KBkzNdV2|Rm>8JoWt8OR zNbn1RbvPb-XT3SAVfGvk$(p}2e(j50IQ7WXSv|TNlV5!Kr0%*3sKd|zMMtK{bcU** z3YIs7U!VQ`NpRM$(6hGZ8Ew|;_zW5)vv{-1* zoCBwpd~PWJ{=IUonKpk+mi_`EuK1$Vl+2>kcr0*bJexPv)GR>U`W36J-%K*h$FG6Br`cDwOC>nlaLWei}|I=+rJ+wI1-bcEq;0K zk2%)@OI)u^4qCM!cT$ewlX^=buFSlY)C!2(1R?(CxTE1!Jjc#Qg{ju#QjWRG>{*$g z^Gl^Bb1qc8*S~>{2rTkq5tn1?@eti) z$fzxQgalxoNlno$F33qNkqCy^6(PE{e50kc{@x3<208g3Tx>p0Z)Pr Rj-5grCFS{0ySSJ*7y%*KxKRKA diff --git a/test_data/blocks/bafkreigenfhs5e6vytt5kh44lxvxlzwmrps6cekbpddkiw3pylcwnifkrq b/test_data/blocks/bafkreigenfhs5e6vytt5kh44lxvxlzwmrps6cekbpddkiw3pylcwnifkrq deleted file mode 100644 index 60a89ed2..00000000 --- a/test_data/blocks/bafkreigenfhs5e6vytt5kh44lxvxlzwmrps6cekbpddkiw3pylcwnifkrq +++ /dev/null @@ -1 +0,0 @@ -O \ No newline at end of file diff --git a/test_data/include/log_recorder.h b/test_data/include/log_recorder.h new file mode 100644 index 00000000..5bd748f8 --- /dev/null +++ b/test_data/include/log_recorder.h @@ -0,0 +1,37 @@ +#ifndef LOG_RECORDER_H +#define LOG_RECORDER_H + +#include + +#include +#include + +namespace { +struct LogRecorder { + static LogRecorder* me; + LogRecorder() { + assert(!me); + me = this; + ipfs::log::SetHandler(Handle); + } + ~LogRecorder() { + ipfs::log::SetHandler(&ipfs::log::DefaultHandler); + assert(me == this); + me = nullptr; + } + struct LogMessage { + std::string message; + std::string_view file; + int line; + ipfs::log::Level level; + }; + std::vector messages; + static void Handle(std::string const& msg, char const* fil, int lin, ipfs::log::Level lev) { + assert(me); + me->messages.push_back({msg, fil, lin, lev}); + } +}; +LogRecorder* LogRecorder::me = nullptr; +} + +#endif // LOG_RECORDER_H diff --git a/test_data/include/mock_api.h b/test_data/include/mock_api.h index bc6faed5..1fb4b0cf 100644 --- a/test_data/include/mock_api.h +++ b/test_data/include/mock_api.h @@ -6,6 +6,7 @@ #include #include +#include "mock_http_provider.h" #include "mock_gw_cfg.h" #include "mock_sig_vtor.h" @@ -43,6 +44,7 @@ struct MockDnsTxt : public i::ctx::DnsTxtLookup { struct MockApi final : public i::Client { MockDnsTxt* dns_; MockGwCfg* gw_; + MockHttpProvider* h_; MockApi() { auto dns = std::make_unique(); dns_ = dns.get(); @@ -50,6 +52,9 @@ struct MockApi final : public i::Client { auto g = std::make_unique(); gw_ = g.get(); with(std::move(g)); + auto h = std::make_unique(); + h_ = h.get(); + with(std::move(h)); with(i::crypto::SigningKeyType::RSA, std::make_unique()); with(i::crypto::SigningKeyType::Ed25519, std::make_unique()); } diff --git a/test_data/include/mock_gw_cfg.h b/test_data/include/mock_gw_cfg.h index 8eed3266..7053151e 100644 --- a/test_data/include/mock_gw_cfg.h +++ b/test_data/include/mock_gw_cfg.h @@ -8,7 +8,11 @@ namespace ig = i::gw; namespace { struct MockGwCfg final : public ipfs::ctx::GatewayConfig { - std::optional GetGateway(std::size_t) const { + std::vector index_gettable_gateways; + std::optional GetGateway(std::size_t i) const { + if (i < index_gettable_gateways.size()) { + return index_gettable_gateways.at(i); + } return std::nullopt; } unsigned GetGatewayRate(std::string_view) { return 120U; } diff --git a/test_data/include/mock_http_provider.h b/test_data/include/mock_http_provider.h new file mode 100644 index 00000000..7f048e0b --- /dev/null +++ b/test_data/include/mock_http_provider.h @@ -0,0 +1,16 @@ +#pragma once + +#include + +namespace { + struct MockHttpProvider final : public ipfs::ctx::HttpApi { + mutable std::vector> requests_sent; + mutable std::vector requests_cancelled; + Canceller SendHttpRequest(ReqDesc d, OnComplete cb) const { + auto i = requests_sent.size(); + requests_sent.emplace_back(d, cb); + return [this,i](){requests_cancelled.push_back(i);}; + } + }; +} +