From 07bfbd5744527e87adbec9da6c0e62936c05f94d Mon Sep 17 00:00:00 2001 From: John Turpish <97759690+John-LittleBearLabs@users.noreply.github.com> Date: Wed, 1 May 2024 13:02:07 -0400 Subject: [PATCH] License (#106) * Closes #88 Library dual licensed. component's googled --- .../chrome/browser/BUILD.gn.patch | 8 +- .../chrome/browser/about_flags.cc.patch | 6 +- ...me_autocomplete_scheme_classifier.cc.patch | 0 .../chrome_content_browser_client.cc.patch | 23 ++- .../chrome/browser/flag-metadata.json.patch | 6 +- .../chrome/browser/flag_descriptions.cc.patch | 8 +- .../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 +- .../common/chrome_content_client.cc.patch | 4 +- .../components/cbor/reader.cc.patch | 10 +- .../components/cbor/reader.h.patch | 14 +- .../components/cbor/reader_unittest.cc.patch | 8 +- .../components/cbor/values.cc.patch | 0 .../components/cbor/values.h.patch | 0 .../components/cbor/writer.cc.patch | 2 +- .../components/cbor/writer_unittest.cc.patch | 0 .../clipboard_recent_content_generic.cc.patch | 2 +- .../net/dns/dns_config_service_linux.cc.patch | 4 +- .../weborigin/scheme_registry.cc.patch | 0 .../url/BUILD.gn.patch | 6 +- .../url/url_canon.h.patch | 4 +- .../url/url_canon_ipfs.cc | 0 .../url/url_util.cc.patch | 4 +- .../chrome/browser/BUILD.gn.patch | 27 ++++ .../chrome/browser/about_flags.cc.patch | 38 +++++ ...me_autocomplete_scheme_classifier.cc.patch | 50 ++++++ .../chrome_content_browser_client.cc.patch | 77 ++++++++++ .../chrome/browser/flag-metadata.json.patch | 16 ++ .../chrome/browser/flag_descriptions.cc.patch | 16 ++ .../chrome/browser/flag_descriptions.h.patch | 24 +++ .../chrome/browser/ipfs_extra_parts.cc | 10 ++ .../chrome/browser/ipfs_extra_parts.h | 10 ++ .../browser/prefs/browser_prefs.cc.patch | 37 +++++ .../common/chrome_content_client.cc.patch | 17 ++ .../components/cbor/reader.cc.patch | 44 ++++++ .../components/cbor/reader.h.patch | 26 ++++ .../components/cbor/reader_unittest.cc.patch | 47 ++++++ .../components/cbor/values.cc.patch | 145 ++++++++++++++++++ .../components/cbor/values.h.patch | 79 ++++++++++ .../components/cbor/writer.cc.patch | 14 ++ .../components/cbor/writer_unittest.cc.patch | 36 +++++ .../clipboard_recent_content_generic.cc.patch | 13 ++ .../net/dns/dns_config_service_linux.cc.patch | 18 +++ .../weborigin/scheme_registry.cc.patch | 13 ++ .../125.0.6368.2/url/BUILD.gn.patch | 32 ++++ .../125.0.6368.2/url/url_canon.h.patch | 28 ++++ .../125.0.6368.2/url/url_canon_ipfs.cc | 55 +++++++ .../125.0.6368.2/url/url_util.cc.patch | 22 +++ .../chrome/browser/BUILD.gn.patch | 27 ++++ .../chrome/browser/about_flags.cc.patch | 38 +++++ ...me_autocomplete_scheme_classifier.cc.patch | 50 ++++++ .../chrome_content_browser_client.cc.patch | 77 ++++++++++ .../chrome/browser/flag-metadata.json.patch | 16 ++ .../chrome/browser/flag_descriptions.cc.patch | 16 ++ .../chrome/browser/flag_descriptions.h.patch | 24 +++ .../chrome/browser/ipfs_extra_parts.cc | 10 ++ .../chrome/browser/ipfs_extra_parts.h | 10 ++ .../browser/prefs/browser_prefs.cc.patch | 37 +++++ .../common/chrome_content_client.cc.patch | 17 ++ .../components/cbor/reader.cc.patch | 44 ++++++ .../components/cbor/reader.h.patch | 26 ++++ .../components/cbor/reader_unittest.cc.patch | 47 ++++++ .../components/cbor/values.cc.patch | 145 ++++++++++++++++++ .../components/cbor/values.h.patch | 79 ++++++++++ .../components/cbor/writer.cc.patch | 14 ++ .../components/cbor/writer_unittest.cc.patch | 36 +++++ .../clipboard_recent_content_generic.cc.patch | 13 ++ .../net/dns/dns_config_service_linux.cc.patch | 18 +++ .../weborigin/scheme_registry.cc.patch | 13 ++ .../125.0.6382.3/url/BUILD.gn.patch | 32 ++++ .../125.0.6382.3/url/url_canon.h.patch | 28 ++++ .../125.0.6382.3/url/url_canon_ipfs.cc | 55 +++++++ .../125.0.6382.3/url/url_util.cc.patch | 22 +++ .../chrome/browser/BUILD.gn.patch | 27 ++++ .../chrome/browser/about_flags.cc.patch | 38 +++++ ...me_autocomplete_scheme_classifier.cc.patch | 50 ++++++ .../chrome_content_browser_client.cc.patch | 77 ++++++++++ .../chrome/browser/flag-metadata.json.patch | 16 ++ .../chrome/browser/flag_descriptions.cc.patch | 16 ++ .../chrome/browser/flag_descriptions.h.patch | 24 +++ .../chrome/browser/ipfs_extra_parts.cc | 10 ++ .../chrome/browser/ipfs_extra_parts.h | 10 ++ .../browser/prefs/browser_prefs.cc.patch | 37 +++++ .../common/chrome_content_client.cc.patch | 17 ++ .../components/cbor/reader.cc.patch | 44 ++++++ .../components/cbor/reader.h.patch | 26 ++++ .../components/cbor/reader_unittest.cc.patch | 47 ++++++ .../components/cbor/values.cc.patch | 145 ++++++++++++++++++ .../components/cbor/values.h.patch | 79 ++++++++++ .../components/cbor/writer.cc.patch | 14 ++ .../components/cbor/writer_unittest.cc.patch | 36 +++++ .../clipboard_recent_content_generic.cc.patch | 13 ++ .../net/dns/dns_config_service_linux.cc.patch | 18 +++ .../weborigin/scheme_registry.cc.patch | 13 ++ .../125.0.6396.3/url/BUILD.gn.patch | 32 ++++ .../125.0.6396.3/url/url_canon.h.patch | 28 ++++ .../125.0.6396.3/url/url_canon_ipfs.cc | 55 +++++++ .../125.0.6396.3/url/url_util.cc.patch | 22 +++ .../chrome/browser/BUILD.gn.patch | 27 ++++ .../chrome/browser/about_flags.cc.patch | 38 +++++ ...me_autocomplete_scheme_classifier.cc.patch | 50 ++++++ .../chrome_content_browser_client.cc.patch | 77 ++++++++++ .../chrome/browser/flag-metadata.json.patch | 16 ++ .../chrome/browser/flag_descriptions.cc.patch | 16 ++ .../chrome/browser/flag_descriptions.h.patch | 24 +++ .../chrome/browser/ipfs_extra_parts.cc | 10 ++ .../chrome/browser/ipfs_extra_parts.h | 10 ++ .../browser/prefs/browser_prefs.cc.patch | 37 +++++ .../common/chrome_content_client.cc.patch | 17 ++ .../components/cbor/reader.cc.patch | 44 ++++++ .../components/cbor/reader.h.patch | 26 ++++ .../components/cbor/reader_unittest.cc.patch | 47 ++++++ .../components/cbor/values.cc.patch | 145 ++++++++++++++++++ .../components/cbor/values.h.patch | 79 ++++++++++ .../components/cbor/writer.cc.patch | 14 ++ .../components/cbor/writer_unittest.cc.patch | 36 +++++ .../clipboard_recent_content_generic.cc.patch | 13 ++ .../net/dns/dns_config_service_linux.cc.patch | 18 +++ .../weborigin/scheme_registry.cc.patch | 13 ++ .../125.0.6412.0/url/BUILD.gn.patch | 32 ++++ .../125.0.6412.0/url/url_canon.h.patch | 28 ++++ .../125.0.6412.0/url/url_canon_ipfs.cc | 55 +++++++ .../125.0.6412.0/url/url_util.cc.patch | 17 ++ cmake/CodeCoverage.cmake | 10 +- cmake/chrome.cmake | 2 +- cmake/conanfile.txt | 2 +- cmake/patch.py | 19 ++- cmake/valgrind.suppressions.txt | 7 + component/LICENSE | 27 ++++ component/cache_requestor.cc | 16 +- component/cache_requestor.h | 2 - component/chromium_cbor_adapter.cc | 3 +- component/chromium_dns_txt_lookup.cc | 8 +- component/chromium_dns_txt_lookup.h | 2 +- component/ipfs_url_loader.cc | 7 - component/preferences.cc | 12 +- doc/explainer.md | 1 - doc/todo.md | 4 - library/conanfile.py | 4 +- .../ipfs_client/ctx/boost_beast_http.h | 2 +- .../include/ipfs_client/opinionated_context.h | 3 +- library/src/ipfs_client/car.cc | 12 +- library/src/ipfs_client/client.cc | 2 +- .../crypto/openssl_signature_verifier.cc | 2 +- .../ctx/boost_beast_http_unittest.cc | 28 ++++ .../src/ipfs_client/ctx/default_gateways.cc | 52 +++---- .../ctx/transitory_gateway_config_unittest.cc | 18 +++ .../gw/default_requestor_unittest.cc | 2 +- library/src/ipfs_client/gw/gateway_state.cc | 11 +- .../ipfs_client/gw/multi_gateway_requestor.cc | 13 +- .../src/ipfs_client/gw/providers_response.cc | 2 +- .../src/ipfs_client/gw/requestor_unittest.cc | 1 - library/src/ipfs_client/ipld/chunk.cc | 4 +- .../src/ipfs_client/ipld/directory_shard.cc | 1 + library/src/ipfs_client/ipns_record.cc | 2 +- library/src/ipfs_client/partition.cc | 13 +- ...thLvyy5dFjFmfZsUmHZNqsAi3GNMTjGVAdq4g26BrU | 2 - ...HtEim6pkJHdoknVuMNEa3qvzmJLMdawYALvLQ8fjbf | 2 - ...f9FSFBE35WZsqvHh8T2h3HQ7ZdiLo4xWgFWff9Rf5v | Bin 8013 -> 0 bytes ...B5iP6QF1FYjT3svb7k6XNspRbkSGvbFPv1r7f494JZ | 2 - ...PuKJXiX4p2kD8A6Ah8PyKjipsbvfGdsypNhkx5JXoN | 2 - ...zEVZH71iTjYqS1gHyTAjkRjvW51HeNBotrjTTaGYme | 2 - ...pedSHDoZuxDgVa8AiHoQpTGtiC8cjPAqwos28VSri9 | 2 - ...KJGP6tGhPQwgBW8SRwyGNxTAeZ1JEPCUQ6iGQ7sxZa | 2 - ...rm6TK5QuquwwQExxxAJwt4zQTrTz5GtaPQcE8Lw43m | 2 - ...3kboiyi9jV59D8Mw8wzuvsr3HmvskqhYRRhdFA8wRq | 12 -- ...mpki8rHHKM5JapR5V1orGKdSmjxfPG98rr33t4v7yz | 2 - ...nTPho8usnuvTnYW76npS8GVNahehZq7pHkqoDBB3yK | 2 - ...vzwedtq57z5wx6wo5jnlndsaujdw6ubarzjg6udaqa | 1 - ...3ofwbtqfyhpm7y5nc23semewpxqb6zalpzdstne7zy | 1 - ...h4ammlhvt4qwgvbktwg7ajde57vwcxjraunq7xodey | 1 - ...2v4v2oijoggn2bnl2skxf2cp4vkzb3xtdkekbd677u | 1 - ...gevssqz3pxmks77qndppzouxkw3nluaoqtcsjvt3ay | 1 - 175 files changed, 3808 insertions(+), 222 deletions(-) rename chromium_edits/{122.0.6236.2 => 124.0.6367.9}/chrome/browser/BUILD.gn.patch (77%) rename chromium_edits/{122.0.6236.2 => 124.0.6367.9}/chrome/browser/about_flags.cc.patch (91%) rename chromium_edits/{122.0.6236.2 => 124.0.6367.9}/chrome/browser/autocomplete/chrome_autocomplete_scheme_classifier.cc.patch (100%) rename chromium_edits/{122.0.6236.2 => 124.0.6367.9}/chrome/browser/chrome_content_browser_client.cc.patch (82%) rename chromium_edits/{122.0.6236.2 => 124.0.6367.9}/chrome/browser/flag-metadata.json.patch (76%) rename chromium_edits/{122.0.6236.2 => 124.0.6367.9}/chrome/browser/flag_descriptions.cc.patch (67%) rename chromium_edits/{122.0.6236.2 => 124.0.6367.9}/chrome/browser/flag_descriptions.h.patch (75%) rename chromium_edits/{122.0.6236.2 => 124.0.6367.9}/chrome/browser/ipfs_extra_parts.cc (100%) rename chromium_edits/{122.0.6236.2 => 124.0.6367.9}/chrome/browser/ipfs_extra_parts.h (100%) rename chromium_edits/{122.0.6236.2 => 124.0.6367.9}/chrome/browser/prefs/browser_prefs.cc.patch (86%) rename chromium_edits/{122.0.6236.2 => 124.0.6367.9}/chrome/common/chrome_content_client.cc.patch (85%) rename chromium_edits/{122.0.6236.2 => 124.0.6367.9}/components/cbor/reader.cc.patch (80%) rename chromium_edits/{122.0.6236.2 => 124.0.6367.9}/components/cbor/reader.h.patch (64%) rename chromium_edits/{122.0.6236.2 => 124.0.6367.9}/components/cbor/reader_unittest.cc.patch (88%) rename chromium_edits/{122.0.6236.2 => 124.0.6367.9}/components/cbor/values.cc.patch (100%) rename chromium_edits/{122.0.6236.2 => 124.0.6367.9}/components/cbor/values.h.patch (100%) rename chromium_edits/{122.0.6236.2 => 124.0.6367.9}/components/cbor/writer.cc.patch (91%) rename chromium_edits/{122.0.6236.2 => 124.0.6367.9}/components/cbor/writer_unittest.cc.patch (100%) rename chromium_edits/{122.0.6236.2 => 124.0.6367.9}/components/open_from_clipboard/clipboard_recent_content_generic.cc.patch (95%) rename chromium_edits/{122.0.6236.2 => 124.0.6367.9}/net/dns/dns_config_service_linux.cc.patch (88%) rename chromium_edits/{122.0.6236.2 => 124.0.6367.9}/third_party/blink/renderer/platform/weborigin/scheme_registry.cc.patch (100%) rename chromium_edits/{122.0.6236.2 => 124.0.6367.9}/url/BUILD.gn.patch (87%) rename chromium_edits/{122.0.6236.2 => 124.0.6367.9}/url/url_canon.h.patch (91%) rename chromium_edits/{122.0.6236.2 => 124.0.6367.9}/url/url_canon_ipfs.cc (100%) rename chromium_edits/{122.0.6236.2 => 124.0.6367.9}/url/url_util.cc.patch (91%) create mode 100644 chromium_edits/125.0.6368.2/chrome/browser/BUILD.gn.patch create mode 100644 chromium_edits/125.0.6368.2/chrome/browser/about_flags.cc.patch create mode 100644 chromium_edits/125.0.6368.2/chrome/browser/autocomplete/chrome_autocomplete_scheme_classifier.cc.patch create mode 100644 chromium_edits/125.0.6368.2/chrome/browser/chrome_content_browser_client.cc.patch create mode 100644 chromium_edits/125.0.6368.2/chrome/browser/flag-metadata.json.patch create mode 100644 chromium_edits/125.0.6368.2/chrome/browser/flag_descriptions.cc.patch create mode 100644 chromium_edits/125.0.6368.2/chrome/browser/flag_descriptions.h.patch create mode 100644 chromium_edits/125.0.6368.2/chrome/browser/ipfs_extra_parts.cc create mode 100644 chromium_edits/125.0.6368.2/chrome/browser/ipfs_extra_parts.h create mode 100644 chromium_edits/125.0.6368.2/chrome/browser/prefs/browser_prefs.cc.patch create mode 100644 chromium_edits/125.0.6368.2/chrome/common/chrome_content_client.cc.patch create mode 100644 chromium_edits/125.0.6368.2/components/cbor/reader.cc.patch create mode 100644 chromium_edits/125.0.6368.2/components/cbor/reader.h.patch create mode 100644 chromium_edits/125.0.6368.2/components/cbor/reader_unittest.cc.patch create mode 100644 chromium_edits/125.0.6368.2/components/cbor/values.cc.patch create mode 100644 chromium_edits/125.0.6368.2/components/cbor/values.h.patch create mode 100644 chromium_edits/125.0.6368.2/components/cbor/writer.cc.patch create mode 100644 chromium_edits/125.0.6368.2/components/cbor/writer_unittest.cc.patch create mode 100644 chromium_edits/125.0.6368.2/components/open_from_clipboard/clipboard_recent_content_generic.cc.patch create mode 100644 chromium_edits/125.0.6368.2/net/dns/dns_config_service_linux.cc.patch create mode 100644 chromium_edits/125.0.6368.2/third_party/blink/renderer/platform/weborigin/scheme_registry.cc.patch create mode 100644 chromium_edits/125.0.6368.2/url/BUILD.gn.patch create mode 100644 chromium_edits/125.0.6368.2/url/url_canon.h.patch create mode 100644 chromium_edits/125.0.6368.2/url/url_canon_ipfs.cc create mode 100644 chromium_edits/125.0.6368.2/url/url_util.cc.patch create mode 100644 chromium_edits/125.0.6382.3/chrome/browser/BUILD.gn.patch create mode 100644 chromium_edits/125.0.6382.3/chrome/browser/about_flags.cc.patch create mode 100644 chromium_edits/125.0.6382.3/chrome/browser/autocomplete/chrome_autocomplete_scheme_classifier.cc.patch create mode 100644 chromium_edits/125.0.6382.3/chrome/browser/chrome_content_browser_client.cc.patch create mode 100644 chromium_edits/125.0.6382.3/chrome/browser/flag-metadata.json.patch create mode 100644 chromium_edits/125.0.6382.3/chrome/browser/flag_descriptions.cc.patch create mode 100644 chromium_edits/125.0.6382.3/chrome/browser/flag_descriptions.h.patch create mode 100644 chromium_edits/125.0.6382.3/chrome/browser/ipfs_extra_parts.cc create mode 100644 chromium_edits/125.0.6382.3/chrome/browser/ipfs_extra_parts.h create mode 100644 chromium_edits/125.0.6382.3/chrome/browser/prefs/browser_prefs.cc.patch create mode 100644 chromium_edits/125.0.6382.3/chrome/common/chrome_content_client.cc.patch create mode 100644 chromium_edits/125.0.6382.3/components/cbor/reader.cc.patch create mode 100644 chromium_edits/125.0.6382.3/components/cbor/reader.h.patch create mode 100644 chromium_edits/125.0.6382.3/components/cbor/reader_unittest.cc.patch create mode 100644 chromium_edits/125.0.6382.3/components/cbor/values.cc.patch create mode 100644 chromium_edits/125.0.6382.3/components/cbor/values.h.patch create mode 100644 chromium_edits/125.0.6382.3/components/cbor/writer.cc.patch create mode 100644 chromium_edits/125.0.6382.3/components/cbor/writer_unittest.cc.patch create mode 100644 chromium_edits/125.0.6382.3/components/open_from_clipboard/clipboard_recent_content_generic.cc.patch create mode 100644 chromium_edits/125.0.6382.3/net/dns/dns_config_service_linux.cc.patch create mode 100644 chromium_edits/125.0.6382.3/third_party/blink/renderer/platform/weborigin/scheme_registry.cc.patch create mode 100644 chromium_edits/125.0.6382.3/url/BUILD.gn.patch create mode 100644 chromium_edits/125.0.6382.3/url/url_canon.h.patch create mode 100644 chromium_edits/125.0.6382.3/url/url_canon_ipfs.cc create mode 100644 chromium_edits/125.0.6382.3/url/url_util.cc.patch create mode 100644 chromium_edits/125.0.6396.3/chrome/browser/BUILD.gn.patch create mode 100644 chromium_edits/125.0.6396.3/chrome/browser/about_flags.cc.patch create mode 100644 chromium_edits/125.0.6396.3/chrome/browser/autocomplete/chrome_autocomplete_scheme_classifier.cc.patch create mode 100644 chromium_edits/125.0.6396.3/chrome/browser/chrome_content_browser_client.cc.patch create mode 100644 chromium_edits/125.0.6396.3/chrome/browser/flag-metadata.json.patch create mode 100644 chromium_edits/125.0.6396.3/chrome/browser/flag_descriptions.cc.patch create mode 100644 chromium_edits/125.0.6396.3/chrome/browser/flag_descriptions.h.patch create mode 100644 chromium_edits/125.0.6396.3/chrome/browser/ipfs_extra_parts.cc create mode 100644 chromium_edits/125.0.6396.3/chrome/browser/ipfs_extra_parts.h create mode 100644 chromium_edits/125.0.6396.3/chrome/browser/prefs/browser_prefs.cc.patch create mode 100644 chromium_edits/125.0.6396.3/chrome/common/chrome_content_client.cc.patch create mode 100644 chromium_edits/125.0.6396.3/components/cbor/reader.cc.patch create mode 100644 chromium_edits/125.0.6396.3/components/cbor/reader.h.patch create mode 100644 chromium_edits/125.0.6396.3/components/cbor/reader_unittest.cc.patch create mode 100644 chromium_edits/125.0.6396.3/components/cbor/values.cc.patch create mode 100644 chromium_edits/125.0.6396.3/components/cbor/values.h.patch create mode 100644 chromium_edits/125.0.6396.3/components/cbor/writer.cc.patch create mode 100644 chromium_edits/125.0.6396.3/components/cbor/writer_unittest.cc.patch create mode 100644 chromium_edits/125.0.6396.3/components/open_from_clipboard/clipboard_recent_content_generic.cc.patch create mode 100644 chromium_edits/125.0.6396.3/net/dns/dns_config_service_linux.cc.patch create mode 100644 chromium_edits/125.0.6396.3/third_party/blink/renderer/platform/weborigin/scheme_registry.cc.patch create mode 100644 chromium_edits/125.0.6396.3/url/BUILD.gn.patch create mode 100644 chromium_edits/125.0.6396.3/url/url_canon.h.patch create mode 100644 chromium_edits/125.0.6396.3/url/url_canon_ipfs.cc create mode 100644 chromium_edits/125.0.6396.3/url/url_util.cc.patch create mode 100644 chromium_edits/125.0.6412.0/chrome/browser/BUILD.gn.patch create mode 100644 chromium_edits/125.0.6412.0/chrome/browser/about_flags.cc.patch create mode 100644 chromium_edits/125.0.6412.0/chrome/browser/autocomplete/chrome_autocomplete_scheme_classifier.cc.patch create mode 100644 chromium_edits/125.0.6412.0/chrome/browser/chrome_content_browser_client.cc.patch create mode 100644 chromium_edits/125.0.6412.0/chrome/browser/flag-metadata.json.patch create mode 100644 chromium_edits/125.0.6412.0/chrome/browser/flag_descriptions.cc.patch create mode 100644 chromium_edits/125.0.6412.0/chrome/browser/flag_descriptions.h.patch create mode 100644 chromium_edits/125.0.6412.0/chrome/browser/ipfs_extra_parts.cc create mode 100644 chromium_edits/125.0.6412.0/chrome/browser/ipfs_extra_parts.h create mode 100644 chromium_edits/125.0.6412.0/chrome/browser/prefs/browser_prefs.cc.patch create mode 100644 chromium_edits/125.0.6412.0/chrome/common/chrome_content_client.cc.patch create mode 100644 chromium_edits/125.0.6412.0/components/cbor/reader.cc.patch create mode 100644 chromium_edits/125.0.6412.0/components/cbor/reader.h.patch create mode 100644 chromium_edits/125.0.6412.0/components/cbor/reader_unittest.cc.patch create mode 100644 chromium_edits/125.0.6412.0/components/cbor/values.cc.patch create mode 100644 chromium_edits/125.0.6412.0/components/cbor/values.h.patch create mode 100644 chromium_edits/125.0.6412.0/components/cbor/writer.cc.patch create mode 100644 chromium_edits/125.0.6412.0/components/cbor/writer_unittest.cc.patch create mode 100644 chromium_edits/125.0.6412.0/components/open_from_clipboard/clipboard_recent_content_generic.cc.patch create mode 100644 chromium_edits/125.0.6412.0/net/dns/dns_config_service_linux.cc.patch create mode 100644 chromium_edits/125.0.6412.0/third_party/blink/renderer/platform/weborigin/scheme_registry.cc.patch create mode 100644 chromium_edits/125.0.6412.0/url/BUILD.gn.patch create mode 100644 chromium_edits/125.0.6412.0/url/url_canon.h.patch create mode 100644 chromium_edits/125.0.6412.0/url/url_canon_ipfs.cc create mode 100644 chromium_edits/125.0.6412.0/url/url_util.cc.patch create mode 100644 component/LICENSE create mode 100644 library/src/ipfs_client/ctx/boost_beast_http_unittest.cc create mode 100644 library/src/ipfs_client/ctx/transitory_gateway_config_unittest.cc delete mode 100644 test_data/blocks/QmVKthLvyy5dFjFmfZsUmHZNqsAi3GNMTjGVAdq4g26BrU delete mode 100644 test_data/blocks/QmVeHtEim6pkJHdoknVuMNEa3qvzmJLMdawYALvLQ8fjbf delete mode 100644 test_data/blocks/QmYjf9FSFBE35WZsqvHh8T2h3HQ7ZdiLo4xWgFWff9Rf5v delete mode 100644 test_data/blocks/QmYoB5iP6QF1FYjT3svb7k6XNspRbkSGvbFPv1r7f494JZ delete mode 100644 test_data/blocks/QmZ2PuKJXiX4p2kD8A6Ah8PyKjipsbvfGdsypNhkx5JXoN delete mode 100644 test_data/blocks/QmZ8zEVZH71iTjYqS1gHyTAjkRjvW51HeNBotrjTTaGYme delete mode 100644 test_data/blocks/QmZApedSHDoZuxDgVa8AiHoQpTGtiC8cjPAqwos28VSri9 delete mode 100644 test_data/blocks/QmZHKJGP6tGhPQwgBW8SRwyGNxTAeZ1JEPCUQ6iGQ7sxZa delete mode 100644 test_data/blocks/QmZPrm6TK5QuquwwQExxxAJwt4zQTrTz5GtaPQcE8Lw43m delete mode 100644 test_data/blocks/QmZU3kboiyi9jV59D8Mw8wzuvsr3HmvskqhYRRhdFA8wRq delete mode 100644 test_data/blocks/QmZWmpki8rHHKM5JapR5V1orGKdSmjxfPG98rr33t4v7yz delete mode 100644 test_data/blocks/QmZjnTPho8usnuvTnYW76npS8GVNahehZq7pHkqoDBB3yK delete mode 100644 test_data/blocks/bafkreicmsref4dbbvzwedtq57z5wx6wo5jnlndsaujdw6ubarzjg6udaqa delete mode 100644 test_data/blocks/bafkreicoa5aikyv63ofwbtqfyhpm7y5nc23semewpxqb6zalpzdstne7zy delete mode 100644 test_data/blocks/bafkreicq44q6jhabh4ammlhvt4qwgvbktwg7ajde57vwcxjraunq7xodey delete mode 100644 test_data/blocks/bafkreicvtlvnbate2v4v2oijoggn2bnl2skxf2cp4vkzb3xtdkekbd677u delete mode 100644 test_data/blocks/bafkreiczjzizvzezgevssqz3pxmks77qndppzouxkw3nluaoqtcsjvt3ay diff --git a/chromium_edits/122.0.6236.2/chrome/browser/BUILD.gn.patch b/chromium_edits/124.0.6367.9/chrome/browser/BUILD.gn.patch similarity index 77% rename from chromium_edits/122.0.6236.2/chrome/browser/BUILD.gn.patch rename to chromium_edits/124.0.6367.9/chrome/browser/BUILD.gn.patch index eb61fe43..f85f4013 100644 --- a/chromium_edits/122.0.6236.2/chrome/browser/BUILD.gn.patch +++ b/chromium_edits/124.0.6367.9/chrome/browser/BUILD.gn.patch @@ -1,16 +1,16 @@ diff --git a/chrome/browser/BUILD.gn b/chrome/browser/BUILD.gn -index 9e7f057a1c35d..846fe6d119c66 100644 +index 5d698b969a134..530ef283aea55 100644 --- a/chrome/browser/BUILD.gn +++ b/chrome/browser/BUILD.gn -@@ -39,6 +39,7 @@ import("//rlz/buildflags/buildflags.gni") - import("//sandbox/features.gni") +@@ -39,6 +39,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") -@@ -2619,6 +2620,14 @@ static_library("browser") { +@@ -2653,6 +2654,14 @@ static_library("browser") { ] } diff --git a/chromium_edits/122.0.6236.2/chrome/browser/about_flags.cc.patch b/chromium_edits/124.0.6367.9/chrome/browser/about_flags.cc.patch similarity index 91% rename from chromium_edits/122.0.6236.2/chrome/browser/about_flags.cc.patch rename to chromium_edits/124.0.6367.9/chrome/browser/about_flags.cc.patch index bbc45911..eca0178f 100644 --- a/chromium_edits/122.0.6236.2/chrome/browser/about_flags.cc.patch +++ b/chromium_edits/124.0.6367.9/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 61699cdf19305..5b99fd9811eb0 100644 +index 4a8a44e4a87de..28a442b093dff 100644 --- a/chrome/browser/about_flags.cc +++ b/chrome/browser/about_flags.cc -@@ -214,6 +214,7 @@ +@@ -216,6 +216,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" @@ -21,7 +21,7 @@ index 61699cdf19305..5b99fd9811eb0 100644 #if BUILDFLAG(ENABLE_PDF) #include "pdf/pdf_features.h" #endif -@@ -9413,6 +9418,14 @@ const FeatureEntry kFeatureEntries[] = { +@@ -9552,6 +9557,14 @@ const FeatureEntry kFeatureEntries[] = { flag_descriptions::kOmitCorsClientCertDescription, kOsAll, FEATURE_VALUE_TYPE(network::features::kOmitCorsClientCert)}, diff --git a/chromium_edits/122.0.6236.2/chrome/browser/autocomplete/chrome_autocomplete_scheme_classifier.cc.patch b/chromium_edits/124.0.6367.9/chrome/browser/autocomplete/chrome_autocomplete_scheme_classifier.cc.patch similarity index 100% rename from chromium_edits/122.0.6236.2/chrome/browser/autocomplete/chrome_autocomplete_scheme_classifier.cc.patch rename to chromium_edits/124.0.6367.9/chrome/browser/autocomplete/chrome_autocomplete_scheme_classifier.cc.patch diff --git a/chromium_edits/122.0.6236.2/chrome/browser/chrome_content_browser_client.cc.patch b/chromium_edits/124.0.6367.9/chrome/browser/chrome_content_browser_client.cc.patch similarity index 82% rename from chromium_edits/122.0.6236.2/chrome/browser/chrome_content_browser_client.cc.patch rename to chromium_edits/124.0.6367.9/chrome/browser/chrome_content_browser_client.cc.patch index 2ba498b0..bfa52289 100644 --- a/chromium_edits/122.0.6236.2/chrome/browser/chrome_content_browser_client.cc.patch +++ b/chromium_edits/124.0.6367.9/chrome/browser/chrome_content_browser_client.cc.patch @@ -1,8 +1,8 @@ diff --git a/chrome/browser/chrome_content_browser_client.cc b/chrome/browser/chrome_content_browser_client.cc -index a9f0eb5ab9151..8956d3ca5519e 100644 +index 66b50cf0fd99b..9662a72a3bd33 100644 --- a/chrome/browser/chrome_content_browser_client.cc +++ b/chrome/browser/chrome_content_browser_client.cc -@@ -374,6 +374,7 @@ +@@ -379,6 +379,7 @@ #include "third_party/blink/public/common/switches.h" #include "third_party/blink/public/mojom/browsing_topics/browsing_topics.mojom.h" #include "third_party/blink/public/public_buildflags.h" @@ -10,7 +10,7 @@ index a9f0eb5ab9151..8956d3ca5519e 100644 #include "third_party/widevine/cdm/buildflags.h" #include "ui/base/clipboard/clipboard_format_type.h" #include "ui/base/l10n/l10n_util.h" -@@ -497,6 +498,13 @@ +@@ -500,6 +501,13 @@ #include "chrome/browser/fuchsia/chrome_browser_main_parts_fuchsia.h" #endif @@ -21,10 +21,10 @@ index a9f0eb5ab9151..8956d3ca5519e 100644 +#include "components/ipfs/url_loader_factory.h" +#endif + - #if BUILDFLAG(IS_CHROMEOS) - #include "base/debug/leak_annotations.h" - #include "chrome/browser/apps/app_service/app_install/app_install_navigation_throttle.h" -@@ -1709,6 +1717,11 @@ ChromeContentBrowserClient::CreateBrowserMainParts(bool is_integration_test) { + #if !BUILDFLAG(IS_ANDROID) + #include "chrome/browser/preloading/preview/preview_navigation_throttle.h" + #include "chrome/browser/web_applications/isolated_web_apps/chrome_content_browser_client_isolated_web_apps_part.h" +@@ -1699,6 +1707,11 @@ ChromeContentBrowserClient::CreateBrowserMainParts(bool is_integration_test) { main_parts->AddParts( std::make_unique()); @@ -36,8 +36,8 @@ index a9f0eb5ab9151..8956d3ca5519e 100644 return main_parts; } -@@ -6049,12 +6062,25 @@ void ChromeContentBrowserClient:: - const absl::optional& request_initiator_origin, +@@ -6100,12 +6113,25 @@ void ChromeContentBrowserClient:: + const std::optional& request_initiator_origin, NonNetworkURLLoaderFactoryMap* factories) { #if BUILDFLAG(IS_CHROMEOS_ASH) || BUILDFLAG(ENABLE_EXTENSIONS) || \ - !BUILDFLAG(IS_ANDROID) @@ -46,8 +46,7 @@ index a9f0eb5ab9151..8956d3ca5519e 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)) { + network::mojom::URLLoaderFactory* default_factory = g_browser_process->system_network_context_manager()->GetURLLoaderFactory(); @@ -64,7 +63,7 @@ index a9f0eb5ab9151..8956d3ca5519e 100644 #if BUILDFLAG(IS_CHROMEOS_ASH) if (web_contents) { -@@ -6196,6 +6222,11 @@ ChromeContentBrowserClient::WillCreateURLLoaderRequestInterceptors( +@@ -6242,6 +6268,11 @@ ChromeContentBrowserClient::WillCreateURLLoaderRequestInterceptors( scoped_refptr navigation_response_task_runner) { std::vector> interceptors; diff --git a/chromium_edits/122.0.6236.2/chrome/browser/flag-metadata.json.patch b/chromium_edits/124.0.6367.9/chrome/browser/flag-metadata.json.patch similarity index 76% rename from chromium_edits/122.0.6236.2/chrome/browser/flag-metadata.json.patch rename to chromium_edits/124.0.6367.9/chrome/browser/flag-metadata.json.patch index 7827ee94..329d54af 100644 --- a/chromium_edits/122.0.6236.2/chrome/browser/flag-metadata.json.patch +++ b/chromium_edits/124.0.6367.9/chrome/browser/flag-metadata.json.patch @@ -1,9 +1,9 @@ diff --git a/chrome/browser/flag-metadata.json b/chrome/browser/flag-metadata.json -index 91740e0cc9e2b..916f584f37a54 100644 +index b5c5b2d917208..189348efbd047 100644 --- a/chrome/browser/flag-metadata.json +++ b/chrome/browser/flag-metadata.json -@@ -2943,6 +2943,11 @@ - "owners": [ "hanxi@chromium.org", "wychen@chromium.org" ], +@@ -3132,6 +3132,11 @@ + "owners": [ "adamta@google.com", "chrome-feed-fundamentals@google.com" ], "expiry_milestone": 130 }, + { diff --git a/chromium_edits/122.0.6236.2/chrome/browser/flag_descriptions.cc.patch b/chromium_edits/124.0.6367.9/chrome/browser/flag_descriptions.cc.patch similarity index 67% rename from chromium_edits/122.0.6236.2/chrome/browser/flag_descriptions.cc.patch rename to chromium_edits/124.0.6367.9/chrome/browser/flag_descriptions.cc.patch index 9a74068e..62080ff3 100644 --- a/chromium_edits/122.0.6236.2/chrome/browser/flag_descriptions.cc.patch +++ b/chromium_edits/124.0.6367.9/chrome/browser/flag_descriptions.cc.patch @@ -1,10 +1,10 @@ diff --git a/chrome/browser/flag_descriptions.cc b/chrome/browser/flag_descriptions.cc -index bddee4563e255..9e84641ac307f 100644 +index d3baaf38f5eb2..fb7162b452871 100644 --- a/chrome/browser/flag_descriptions.cc +++ b/chrome/browser/flag_descriptions.cc -@@ -284,6 +284,11 @@ const char kEnableBenchmarkingDescription[] = - "after 3 restarts. On the third restart, the flag will appear to be off " - "but the effect is still active."; +@@ -329,6 +329,11 @@ const char kEnableBenchmarkingChoiceDefaultFeatureStates[] = + const char kEnableBenchmarkingChoiceMatchFieldTrialTestingConfig[] = + "Match Field Trial Testing Config"; +#if BUILDFLAG(ENABLE_IPFS) +extern const char kEnableIpfsName[] = "Enable IPFS"; diff --git a/chromium_edits/122.0.6236.2/chrome/browser/flag_descriptions.h.patch b/chromium_edits/124.0.6367.9/chrome/browser/flag_descriptions.h.patch similarity index 75% rename from chromium_edits/122.0.6236.2/chrome/browser/flag_descriptions.h.patch rename to chromium_edits/124.0.6367.9/chrome/browser/flag_descriptions.h.patch index e3bc6464..6d65b1a3 100644 --- a/chromium_edits/122.0.6236.2/chrome/browser/flag_descriptions.h.patch +++ b/chromium_edits/124.0.6367.9/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 dc09da6e1897a..f139e88d67ae1 100644 +index 49c7d75f3115e..1cdeb27b5e0f0 100644 --- a/chrome/browser/flag_descriptions.h +++ b/chrome/browser/flag_descriptions.h @@ -23,6 +23,7 @@ @@ -10,9 +10,9 @@ index dc09da6e1897a..f139e88d67ae1 100644 // This file declares strings used in chrome://flags. These messages are not // translated, because instead of end-users they target Chromium developers and -@@ -176,6 +177,11 @@ extern const char kDownloadWarningImprovementsDescription[]; - extern const char kEnableBenchmarkingName[]; - extern const char kEnableBenchmarkingDescription[]; +@@ -198,6 +199,11 @@ extern const char kEnableBenchmarkingChoiceDisabled[]; + extern const char kEnableBenchmarkingChoiceDefaultFeatureStates[]; + extern const char kEnableBenchmarkingChoiceMatchFieldTrialTestingConfig[]; +#if BUILDFLAG(ENABLE_IPFS) +extern const char kEnableIpfsName[]; diff --git a/chromium_edits/122.0.6236.2/chrome/browser/ipfs_extra_parts.cc b/chromium_edits/124.0.6367.9/chrome/browser/ipfs_extra_parts.cc similarity index 100% rename from chromium_edits/122.0.6236.2/chrome/browser/ipfs_extra_parts.cc rename to chromium_edits/124.0.6367.9/chrome/browser/ipfs_extra_parts.cc diff --git a/chromium_edits/122.0.6236.2/chrome/browser/ipfs_extra_parts.h b/chromium_edits/124.0.6367.9/chrome/browser/ipfs_extra_parts.h similarity index 100% rename from chromium_edits/122.0.6236.2/chrome/browser/ipfs_extra_parts.h rename to chromium_edits/124.0.6367.9/chrome/browser/ipfs_extra_parts.h diff --git a/chromium_edits/122.0.6236.2/chrome/browser/prefs/browser_prefs.cc.patch b/chromium_edits/124.0.6367.9/chrome/browser/prefs/browser_prefs.cc.patch similarity index 86% rename from chromium_edits/122.0.6236.2/chrome/browser/prefs/browser_prefs.cc.patch rename to chromium_edits/124.0.6367.9/chrome/browser/prefs/browser_prefs.cc.patch index ddda775c..fd04d160 100644 --- a/chromium_edits/122.0.6236.2/chrome/browser/prefs/browser_prefs.cc.patch +++ b/chromium_edits/124.0.6367.9/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 e406d936c277c..0aff4e87587ae 100644 +index 5eef5cdedda4c..a05199c7e40d4 100644 --- a/chrome/browser/prefs/browser_prefs.cc +++ b/chrome/browser/prefs/browser_prefs.cc -@@ -189,6 +189,7 @@ +@@ -190,6 +190,8 @@ #include "printing/buildflags/buildflags.h" #include "rlz/buildflags/buildflags.h" - #include "third_party/abseil-cpp/absl/types/optional.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" -@@ -233,6 +234,11 @@ +@@ -234,6 +236,11 @@ #include "chrome/browser/pdf/pdf_pref_names.h" #endif // BUILDFLAG(ENABLE_PDF) @@ -22,7 +23,7 @@ index e406d936c277c..0aff4e87587ae 100644 #if BUILDFLAG(ENABLE_SCREEN_AI_SERVICE) #include "chrome/browser/screen_ai/pref_names.h" #endif -@@ -1658,6 +1664,11 @@ void RegisterProfilePrefs(user_prefs::PrefRegistrySyncable* registry, +@@ -1746,6 +1753,11 @@ void RegisterProfilePrefs(user_prefs::PrefRegistrySyncable* registry, IncognitoModePrefs::RegisterProfilePrefs(registry); invalidation::PerUserTopicSubscriptionManager::RegisterProfilePrefs(registry); invalidation::InvalidatorRegistrarWithMemory::RegisterProfilePrefs(registry); diff --git a/chromium_edits/122.0.6236.2/chrome/common/chrome_content_client.cc.patch b/chromium_edits/124.0.6367.9/chrome/common/chrome_content_client.cc.patch similarity index 85% rename from chromium_edits/122.0.6236.2/chrome/common/chrome_content_client.cc.patch rename to chromium_edits/124.0.6367.9/chrome/common/chrome_content_client.cc.patch index 5bd09f16..59ea01c2 100644 --- a/chromium_edits/122.0.6236.2/chrome/common/chrome_content_client.cc.patch +++ b/chromium_edits/124.0.6367.9/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 246ec9c5c911f..5d66d133a7907 100644 +index 2f016718fdd3c..bc38d5c2e4d8e 100644 --- a/chrome/common/chrome_content_client.cc +++ b/chrome/common/chrome_content_client.cc -@@ -296,6 +296,12 @@ void ChromeContentClient::AddAdditionalSchemes(Schemes* schemes) { +@@ -302,6 +302,12 @@ void ChromeContentClient::AddAdditionalSchemes(Schemes* schemes) { #if BUILDFLAG(IS_ANDROID) schemes->local_schemes.push_back(url::kContentScheme); #endif diff --git a/chromium_edits/122.0.6236.2/components/cbor/reader.cc.patch b/chromium_edits/124.0.6367.9/components/cbor/reader.cc.patch similarity index 80% rename from chromium_edits/122.0.6236.2/components/cbor/reader.cc.patch rename to chromium_edits/124.0.6367.9/components/cbor/reader.cc.patch index aed86452..a9c4a7b3 100644 --- a/chromium_edits/122.0.6236.2/components/cbor/reader.cc.patch +++ b/chromium_edits/124.0.6367.9/components/cbor/reader.cc.patch @@ -1,5 +1,5 @@ diff --git a/components/cbor/reader.cc b/components/cbor/reader.cc -index 306ba52fa4944..6b13b3a679a65 100644 +index 3c31e3d05e5d3..5ad0dbb183884 100644 --- a/components/cbor/reader.cc +++ b/components/cbor/reader.cc @@ -22,7 +22,7 @@ @@ -11,7 +11,7 @@ index 306ba52fa4944..6b13b3a679a65 100644 } namespace { -@@ -156,7 +156,11 @@ absl::optional Reader::DecodeCompleteDataItem(const Config& config, +@@ -156,7 +156,11 @@ std::optional Reader::DecodeCompleteDataItem(const Config& config, case Value::Type::FLOAT_VALUE: // Floating point values also go here since they are also type 7. return DecodeToSimpleValueOrFloat(*header, config); @@ -24,11 +24,11 @@ index 306ba52fa4944..6b13b3a679a65 100644 case Value::Type::NONE: case Value::Type::INVALID_UTF8: break; -@@ -347,6 +351,17 @@ absl::optional Reader::ReadByteStringContent( +@@ -347,6 +351,17 @@ std::optional Reader::ReadByteStringContent( return Value(std::move(cbor_byte_string)); } -+absl::optional Reader::ReadTagContent( ++std::optional Reader::ReadTagContent( + const Reader::DataItemHeader& header, + const Config& config, + int max_nesting_level) { @@ -39,6 +39,6 @@ index 306ba52fa4944..6b13b3a679a65 100644 + return tagged_content; +} + - absl::optional Reader::ReadArrayContent( + std::optional Reader::ReadArrayContent( const Reader::DataItemHeader& header, const Config& config, diff --git a/chromium_edits/122.0.6236.2/components/cbor/reader.h.patch b/chromium_edits/124.0.6367.9/components/cbor/reader.h.patch similarity index 64% rename from chromium_edits/122.0.6236.2/components/cbor/reader.h.patch rename to chromium_edits/124.0.6367.9/components/cbor/reader.h.patch index fb821165..cd7d9eb0 100644 --- a/chromium_edits/122.0.6236.2/components/cbor/reader.h.patch +++ b/chromium_edits/124.0.6367.9/components/cbor/reader.h.patch @@ -1,5 +1,5 @@ diff --git a/components/cbor/reader.h b/components/cbor/reader.h -index f0b43a5517528..a57e277a1bc66 100644 +index 73c5dcb23e555..a933768608d73 100644 --- a/components/cbor/reader.h +++ b/components/cbor/reader.h @@ -130,6 +130,11 @@ class CBOR_EXPORT Reader { @@ -15,12 +15,12 @@ index f0b43a5517528..a57e277a1bc66 100644 Reader(const Reader&) = delete; @@ -204,6 +209,9 @@ class CBOR_EXPORT Reader { - absl::optional ReadMapContent(const DataItemHeader& header, - const Config& config, - int max_nesting_level); -+ absl::optional ReadTagContent(const DataItemHeader& header, + std::optional ReadMapContent(const DataItemHeader& header, + const Config& config, + int max_nesting_level); ++ std::optional ReadTagContent(const DataItemHeader& header, + const Config& config, + int max_nesting_level); - absl::optional ReadByte(); - absl::optional> ReadBytes(uint64_t num_bytes); + std::optional ReadByte(); + std::optional> ReadBytes(uint64_t num_bytes); bool IsKeyInOrder(const Value& new_key, diff --git a/chromium_edits/122.0.6236.2/components/cbor/reader_unittest.cc.patch b/chromium_edits/124.0.6367.9/components/cbor/reader_unittest.cc.patch similarity index 88% rename from chromium_edits/122.0.6236.2/components/cbor/reader_unittest.cc.patch rename to chromium_edits/124.0.6367.9/components/cbor/reader_unittest.cc.patch index 3f657dc3..150e0c73 100644 --- a/chromium_edits/122.0.6236.2/components/cbor/reader_unittest.cc.patch +++ b/chromium_edits/124.0.6367.9/components/cbor/reader_unittest.cc.patch @@ -1,8 +1,8 @@ diff --git a/components/cbor/reader_unittest.cc b/components/cbor/reader_unittest.cc -index 83d44a48d6dfa..a6ec5299b3241 100644 +index e5c02ceea3402..f26b8e77f6da3 100644 --- a/components/cbor/reader_unittest.cc +++ b/components/cbor/reader_unittest.cc -@@ -1451,5 +1451,42 @@ TEST(CBORReaderTest, AllowInvalidUTF8) { +@@ -1449,5 +1449,42 @@ TEST(CBORReaderTest, AllowInvalidUTF8) { EXPECT_FALSE(cbor); EXPECT_EQ(Reader::DecoderError::INVALID_UTF8, error); } @@ -14,7 +14,7 @@ index 83d44a48d6dfa..a6ec5299b3241 100644 + 0x9d, 0xf6, 0x3a, 0x36, 0x5b + }; + Reader::Config config; -+ absl::optional cbor = Reader::Read(kTaggedCbor, config); ++ auto cbor = Reader::Read(kTaggedCbor, config); + EXPECT_FALSE(cbor.has_value()); +} +TEST(CBORReaderTest, ReadsTagWhenConfiguredToDoSo) { @@ -26,7 +26,7 @@ index 83d44a48d6dfa..a6ec5299b3241 100644 + }; + Reader::Config config; + config.parse_tags = true; -+ absl::optional cbor = Reader::Read(kTaggedCbor, config); ++ auto cbor = Reader::Read(kTaggedCbor, config); + EXPECT_TRUE(cbor.has_value()); + auto& v = cbor.value(); + EXPECT_TRUE(v.has_tag()); diff --git a/chromium_edits/122.0.6236.2/components/cbor/values.cc.patch b/chromium_edits/124.0.6367.9/components/cbor/values.cc.patch similarity index 100% rename from chromium_edits/122.0.6236.2/components/cbor/values.cc.patch rename to chromium_edits/124.0.6367.9/components/cbor/values.cc.patch diff --git a/chromium_edits/122.0.6236.2/components/cbor/values.h.patch b/chromium_edits/124.0.6367.9/components/cbor/values.h.patch similarity index 100% rename from chromium_edits/122.0.6236.2/components/cbor/values.h.patch rename to chromium_edits/124.0.6367.9/components/cbor/values.h.patch diff --git a/chromium_edits/122.0.6236.2/components/cbor/writer.cc.patch b/chromium_edits/124.0.6367.9/components/cbor/writer.cc.patch similarity index 91% rename from chromium_edits/122.0.6236.2/components/cbor/writer.cc.patch rename to chromium_edits/124.0.6367.9/components/cbor/writer.cc.patch index 21fe28ce..bb89c1e6 100644 --- a/chromium_edits/122.0.6236.2/components/cbor/writer.cc.patch +++ b/chromium_edits/124.0.6367.9/components/cbor/writer.cc.patch @@ -1,5 +1,5 @@ diff --git a/components/cbor/writer.cc b/components/cbor/writer.cc -index bb22754d36a07..aae4027836377 100644 +index f400a65e7b66a..fcdebb8f3b458 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/122.0.6236.2/components/cbor/writer_unittest.cc.patch b/chromium_edits/124.0.6367.9/components/cbor/writer_unittest.cc.patch similarity index 100% rename from chromium_edits/122.0.6236.2/components/cbor/writer_unittest.cc.patch rename to chromium_edits/124.0.6367.9/components/cbor/writer_unittest.cc.patch diff --git a/chromium_edits/122.0.6236.2/components/open_from_clipboard/clipboard_recent_content_generic.cc.patch b/chromium_edits/124.0.6367.9/components/open_from_clipboard/clipboard_recent_content_generic.cc.patch similarity index 95% rename from chromium_edits/122.0.6236.2/components/open_from_clipboard/clipboard_recent_content_generic.cc.patch rename to chromium_edits/124.0.6367.9/components/open_from_clipboard/clipboard_recent_content_generic.cc.patch index 891b53df..291d84f1 100644 --- a/chromium_edits/122.0.6236.2/components/open_from_clipboard/clipboard_recent_content_generic.cc.patch +++ b/chromium_edits/124.0.6367.9/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 4dcafecbc66c6..d205209c08162 100644 +index 32c4138ec358c..e9c62d51bf59b 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/122.0.6236.2/net/dns/dns_config_service_linux.cc.patch b/chromium_edits/124.0.6367.9/net/dns/dns_config_service_linux.cc.patch similarity index 88% rename from chromium_edits/122.0.6236.2/net/dns/dns_config_service_linux.cc.patch rename to chromium_edits/124.0.6367.9/net/dns/dns_config_service_linux.cc.patch index a5e9863f..3b042d33 100644 --- a/chromium_edits/122.0.6236.2/net/dns/dns_config_service_linux.cc.patch +++ b/chromium_edits/124.0.6367.9/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 5273da5190277..12b28b86a4c00 100644 +index f909f127ba3e1..31d7f9d58c0af 100644 --- a/net/dns/dns_config_service_linux.cc +++ b/net/dns/dns_config_service_linux.cc -@@ -272,11 +272,11 @@ bool IsNsswitchConfigCompatible( +@@ -271,11 +271,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/122.0.6236.2/third_party/blink/renderer/platform/weborigin/scheme_registry.cc.patch b/chromium_edits/124.0.6367.9/third_party/blink/renderer/platform/weborigin/scheme_registry.cc.patch similarity index 100% rename from chromium_edits/122.0.6236.2/third_party/blink/renderer/platform/weborigin/scheme_registry.cc.patch rename to chromium_edits/124.0.6367.9/third_party/blink/renderer/platform/weborigin/scheme_registry.cc.patch diff --git a/chromium_edits/122.0.6236.2/url/BUILD.gn.patch b/chromium_edits/124.0.6367.9/url/BUILD.gn.patch similarity index 87% rename from chromium_edits/122.0.6236.2/url/BUILD.gn.patch rename to chromium_edits/124.0.6367.9/url/BUILD.gn.patch index cc358ad4..201770c4 100644 --- a/chromium_edits/122.0.6236.2/url/BUILD.gn.patch +++ b/chromium_edits/124.0.6367.9/url/BUILD.gn.patch @@ -1,5 +1,5 @@ diff --git a/url/BUILD.gn b/url/BUILD.gn -index b5edb89f7698f..d299856674d7d 100644 +index aedf1bf9f80be..b11c73a88aae5 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/122.0.6236.2/url/url_canon.h.patch b/chromium_edits/124.0.6367.9/url/url_canon.h.patch similarity index 91% rename from chromium_edits/122.0.6236.2/url/url_canon.h.patch rename to chromium_edits/124.0.6367.9/url/url_canon.h.patch index 7ffd3a2f..71d7a758 100644 --- a/chromium_edits/122.0.6236.2/url/url_canon.h.patch +++ b/chromium_edits/124.0.6367.9/url/url_canon.h.patch @@ -1,8 +1,8 @@ diff --git a/url/url_canon.h b/url/url_canon.h -index 8c48f9825d8cf..b9ad961e1b123 100644 +index bd40235e4aa85..05d250fe1b746 100644 --- a/url/url_canon.h +++ b/url/url_canon.h -@@ -804,6 +804,23 @@ bool CanonicalizeMailtoURL(const char16_t* spec, +@@ -815,6 +815,23 @@ bool CanonicalizeMailtoURL(const char16_t* spec, CanonOutput* output, Parsed* new_parsed); diff --git a/chromium_edits/122.0.6236.2/url/url_canon_ipfs.cc b/chromium_edits/124.0.6367.9/url/url_canon_ipfs.cc similarity index 100% rename from chromium_edits/122.0.6236.2/url/url_canon_ipfs.cc rename to chromium_edits/124.0.6367.9/url/url_canon_ipfs.cc diff --git a/chromium_edits/122.0.6236.2/url/url_util.cc.patch b/chromium_edits/124.0.6367.9/url/url_util.cc.patch similarity index 91% rename from chromium_edits/122.0.6236.2/url/url_util.cc.patch rename to chromium_edits/124.0.6367.9/url/url_util.cc.patch index 814f4b82..3850fcfe 100644 --- a/chromium_edits/122.0.6236.2/url/url_util.cc.patch +++ b/chromium_edits/124.0.6367.9/url/url_util.cc.patch @@ -1,8 +1,8 @@ diff --git a/url/url_util.cc b/url/url_util.cc -index 6f83f33c01c6b..a248e11c49445 100644 +index 82b27b8f59684..2f3045adefaa7 100644 --- a/url/url_util.cc +++ b/url/url_util.cc -@@ -273,8 +273,15 @@ bool DoCanonicalize(const CHAR* spec, +@@ -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); diff --git a/chromium_edits/125.0.6368.2/chrome/browser/BUILD.gn.patch b/chromium_edits/125.0.6368.2/chrome/browser/BUILD.gn.patch new file mode 100644 index 00000000..3a32f136 --- /dev/null +++ b/chromium_edits/125.0.6368.2/chrome/browser/BUILD.gn.patch @@ -0,0 +1,27 @@ +diff --git a/chrome/browser/BUILD.gn b/chrome/browser/BUILD.gn +index 7a4534d39b491..8caeb8ab3ec7c 100644 +--- a/chrome/browser/BUILD.gn ++++ b/chrome/browser/BUILD.gn +@@ -39,6 +39,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") +@@ -2654,6 +2655,14 @@ static_library("browser") { + ] + } + ++ if (enable_ipfs) { ++ sources += [ ++ "ipfs_extra_parts.cc", ++ "ipfs_extra_parts.h", ++ ] ++ deps += [ "//components/ipfs" ] ++ } ++ + if (is_chromeos_ash) { + deps += [ "//chrome/browser/screen_ai:screen_ai_dlc_installer" ] + } diff --git a/chromium_edits/125.0.6368.2/chrome/browser/about_flags.cc.patch b/chromium_edits/125.0.6368.2/chrome/browser/about_flags.cc.patch new file mode 100644 index 00000000..ab68d89c --- /dev/null +++ b/chromium_edits/125.0.6368.2/chrome/browser/about_flags.cc.patch @@ -0,0 +1,38 @@ +diff --git a/chrome/browser/about_flags.cc b/chrome/browser/about_flags.cc +index 1b5f384a735c3..98743f6cdbb92 100644 +--- a/chrome/browser/about_flags.cc ++++ b/chrome/browser/about_flags.cc +@@ -216,6 +216,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" ++#include "third_party/ipfs_client/ipfs_buildflags.h" + #include "ui/accessibility/accessibility_features.h" + #include "ui/accessibility/accessibility_switches.h" + #include "ui/base/ozone_buildflags.h" +@@ -309,6 +310,10 @@ + #include "extensions/common/switches.h" + #endif // BUILDFLAG(ENABLE_EXTENSIONS) + ++#if BUILDFLAG(ENABLE_IPFS) ++#include "components/ipfs/ipfs_features.h" ++#endif ++ + #if BUILDFLAG(ENABLE_PDF) + #include "pdf/pdf_features.h" + #endif +@@ -9521,6 +9526,14 @@ const FeatureEntry kFeatureEntries[] = { + flag_descriptions::kOmitCorsClientCertDescription, kOsAll, + FEATURE_VALUE_TYPE(network::features::kOmitCorsClientCert)}, + ++#if BUILDFLAG(ENABLE_IPFS) ++ {"enable-ipfs", ++ flag_descriptions::kEnableIpfsName, ++ flag_descriptions::kEnableIpfsDescription, ++ kOsMac | kOsWin | kOsLinux,//TODO: These are the only variants currently getting built, but that is not likely to remain the case ++ FEATURE_VALUE_TYPE(ipfs::kEnableIpfs)}, ++#endif ++ + {"use-idna2008-non-transitional", + flag_descriptions::kUseIDNA2008NonTransitionalName, + flag_descriptions::kUseIDNA2008NonTransitionalDescription, kOsAll, diff --git a/chromium_edits/125.0.6368.2/chrome/browser/autocomplete/chrome_autocomplete_scheme_classifier.cc.patch b/chromium_edits/125.0.6368.2/chrome/browser/autocomplete/chrome_autocomplete_scheme_classifier.cc.patch new file mode 100644 index 00000000..4d172311 --- /dev/null +++ b/chromium_edits/125.0.6368.2/chrome/browser/autocomplete/chrome_autocomplete_scheme_classifier.cc.patch @@ -0,0 +1,50 @@ +diff --git a/chrome/browser/autocomplete/chrome_autocomplete_scheme_classifier.cc b/chrome/browser/autocomplete/chrome_autocomplete_scheme_classifier.cc +index 4c88614c68c25..f8bb12a3b0c2e 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" ++#include "third_party/ipfs_client/ipfs_buildflags.h" ++ + #if BUILDFLAG(IS_ANDROID) + #include "chrome/browser/profiles/profile_android.h" + #endif +@@ -18,6 +20,9 @@ + #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 (scheme.empty()) { + return metrics::OmniboxInputType::EMPTY; + } +- if (base::IsStringASCII(scheme) && +- (ProfileIOData::IsHandledProtocol(scheme) || +- base::EqualsCaseInsensitiveASCII(scheme, content::kViewSourceScheme) || +- base::EqualsCaseInsensitiveASCII(scheme, url::kJavaScriptScheme) || +- base::EqualsCaseInsensitiveASCII(scheme, url::kDataScheme))) { +- return metrics::OmniboxInputType::URL; ++ if (base::IsStringASCII(scheme)) { ++ if (ProfileIOData::IsHandledProtocol(scheme) || ++ base::EqualsCaseInsensitiveASCII(scheme, content::kViewSourceScheme) || ++ base::EqualsCaseInsensitiveASCII(scheme, url::kJavaScriptScheme) || ++ base::EqualsCaseInsensitiveASCII(scheme, url::kDataScheme)) { ++ return metrics::OmniboxInputType::URL; ++ } ++#if BUILDFLAG(ENABLE_IPFS) ++ if (base::FeatureList::IsEnabled(ipfs::kEnableIpfs) && ++ (base::EqualsCaseInsensitiveASCII(scheme, "ipfs") || base::EqualsCaseInsensitiveASCII(scheme, "ipns")) ++ ) { ++ return metrics::OmniboxInputType::URL; ++ } ++#endif + } + + // Also check for schemes registered via registerProtocolHandler(), which diff --git a/chromium_edits/125.0.6368.2/chrome/browser/chrome_content_browser_client.cc.patch b/chromium_edits/125.0.6368.2/chrome/browser/chrome_content_browser_client.cc.patch new file mode 100644 index 00000000..4f4aaeb5 --- /dev/null +++ b/chromium_edits/125.0.6368.2/chrome/browser/chrome_content_browser_client.cc.patch @@ -0,0 +1,77 @@ +diff --git a/chrome/browser/chrome_content_browser_client.cc b/chrome/browser/chrome_content_browser_client.cc +index 135976b7e09aa..184f1313fde01 100644 +--- a/chrome/browser/chrome_content_browser_client.cc ++++ b/chrome/browser/chrome_content_browser_client.cc +@@ -379,6 +379,7 @@ + #include "third_party/blink/public/common/switches.h" + #include "third_party/blink/public/mojom/browsing_topics/browsing_topics.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" +@@ -500,6 +501,13 @@ + #include "chrome/browser/fuchsia/chrome_browser_main_parts_fuchsia.h" + #endif + ++#if BUILDFLAG(ENABLE_IPFS) ++#include "chrome/browser/ipfs_extra_parts.h" ++#include "components/ipfs/interceptor.h" ++#include "components/ipfs/ipfs_features.h" ++#include "components/ipfs/url_loader_factory.h" ++#endif ++ + #if !BUILDFLAG(IS_ANDROID) + #include "chrome/browser/preloading/preview/preview_navigation_throttle.h" + #include "chrome/browser/web_applications/isolated_web_apps/chrome_content_browser_client_isolated_web_apps_part.h" +@@ -1699,6 +1707,11 @@ ChromeContentBrowserClient::CreateBrowserMainParts(bool is_integration_test) { + main_parts->AddParts( + std::make_unique()); + ++#if BUILDFLAG(ENABLE_IPFS) ++ if (base::FeatureList::IsEnabled(ipfs::kEnableIpfs)) { ++ main_parts->AddParts(std::make_unique()); ++ } ++#endif + return main_parts; + } + +@@ -6085,12 +6098,25 @@ void ChromeContentBrowserClient:: + const std::optional& request_initiator_origin, + NonNetworkURLLoaderFactoryMap* factories) { + #if BUILDFLAG(IS_CHROMEOS_ASH) || BUILDFLAG(ENABLE_EXTENSIONS) || \ +- !BUILDFLAG(IS_ANDROID) ++ !BUILDFLAG(IS_ANDROID) || BUILDFLAG(ENABLE_IPFS) + content::RenderFrameHost* frame_host = + 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) ++#if BUILDFLAG(ENABLE_IPFS) ++ 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( ++ factories, ++ context, ++ default_factory, ++ GetSystemNetworkContext(), ++ Profile::FromBrowserContext(context)->GetPrefs() ++ ); ++ } ++#endif // BUILDFLAG(ENABLE_IPFS) + + #if BUILDFLAG(IS_CHROMEOS_ASH) + if (web_contents) { +@@ -6227,6 +6253,11 @@ ChromeContentBrowserClient::WillCreateURLLoaderRequestInterceptors( + scoped_refptr navigation_response_task_runner) { + std::vector> + interceptors; ++#if BUILDFLAG(ENABLE_IPFS) ++ if (base::FeatureList::IsEnabled(ipfs::kEnableIpfs)) { ++ interceptors.push_back(std::make_unique(g_browser_process->system_network_context_manager()->GetURLLoaderFactory(), GetSystemNetworkContext())); ++ } ++#endif + #if BUILDFLAG(ENABLE_OFFLINE_PAGES) + interceptors.push_back( + std::make_unique( diff --git a/chromium_edits/125.0.6368.2/chrome/browser/flag-metadata.json.patch b/chromium_edits/125.0.6368.2/chrome/browser/flag-metadata.json.patch new file mode 100644 index 00000000..da06034b --- /dev/null +++ b/chromium_edits/125.0.6368.2/chrome/browser/flag-metadata.json.patch @@ -0,0 +1,16 @@ +diff --git a/chrome/browser/flag-metadata.json b/chrome/browser/flag-metadata.json +index d65f31edc395e..0326237952772 100644 +--- a/chrome/browser/flag-metadata.json ++++ b/chrome/browser/flag-metadata.json +@@ -3143,6 +3143,11 @@ + "owners": [ "adamta@google.com", "chrome-feed-fundamentals@google.com" ], + "expiry_milestone": 130 + }, ++ { ++ "name": "enable-ipfs", ++ "owners": [ "//components/ipfs/OWNERS" ], ++ "expiry_milestone": 150 ++ }, + { + "name": "enable-isolated-sandboxed-iframes", + "owners": [ "wjmaclean@chromium.org", "alexmos@chromium.org", "creis@chromium.org" ], diff --git a/chromium_edits/125.0.6368.2/chrome/browser/flag_descriptions.cc.patch b/chromium_edits/125.0.6368.2/chrome/browser/flag_descriptions.cc.patch new file mode 100644 index 00000000..2527fa0e --- /dev/null +++ b/chromium_edits/125.0.6368.2/chrome/browser/flag_descriptions.cc.patch @@ -0,0 +1,16 @@ +diff --git a/chrome/browser/flag_descriptions.cc b/chrome/browser/flag_descriptions.cc +index b9f85a38759fc..029edd4f1e1fc 100644 +--- a/chrome/browser/flag_descriptions.cc ++++ b/chrome/browser/flag_descriptions.cc +@@ -329,6 +329,11 @@ const char kEnableBenchmarkingChoiceDefaultFeatureStates[] = + const char kEnableBenchmarkingChoiceMatchFieldTrialTestingConfig[] = + "Match Field Trial Testing Config"; + ++#if BUILDFLAG(ENABLE_IPFS) ++extern const char kEnableIpfsName[] = "Enable IPFS"; ++extern const char kEnableIpfsDescription[] = "Enable ipfs:// and ipns:// URLs"; ++#endif ++ + const char kPreloadingOnPerformancePageName[] = + "Preloading Settings on Performance Page"; + const char kPreloadingOnPerformancePageDescription[] = diff --git a/chromium_edits/125.0.6368.2/chrome/browser/flag_descriptions.h.patch b/chromium_edits/125.0.6368.2/chrome/browser/flag_descriptions.h.patch new file mode 100644 index 00000000..2fa6bb23 --- /dev/null +++ b/chromium_edits/125.0.6368.2/chrome/browser/flag_descriptions.h.patch @@ -0,0 +1,24 @@ +diff --git a/chrome/browser/flag_descriptions.h b/chrome/browser/flag_descriptions.h +index b6d7b4361e1b2..e984dbf51d888 100644 +--- a/chrome/browser/flag_descriptions.h ++++ b/chrome/browser/flag_descriptions.h +@@ -24,6 +24,7 @@ + #include "pdf/buildflags.h" + #include "printing/buildflags/buildflags.h" + #include "third_party/blink/public/common/buildflags.h" ++#include "third_party/ipfs_client/ipfs_buildflags.h" + + // This file declares strings used in chrome://flags. These messages are not + // translated, because instead of end-users they target Chromium developers and +@@ -199,6 +200,11 @@ extern const char kEnableBenchmarkingChoiceDisabled[]; + extern const char kEnableBenchmarkingChoiceDefaultFeatureStates[]; + extern const char kEnableBenchmarkingChoiceMatchFieldTrialTestingConfig[]; + ++#if BUILDFLAG(ENABLE_IPFS) ++extern const char kEnableIpfsName[]; ++extern const char kEnableIpfsDescription[]; ++#endif ++ + #if BUILDFLAG(USE_FONTATIONS_BACKEND) + extern const char kFontationsFontBackendName[]; + extern const char kFontationsFontBackendDescription[]; diff --git a/chromium_edits/125.0.6368.2/chrome/browser/ipfs_extra_parts.cc b/chromium_edits/125.0.6368.2/chrome/browser/ipfs_extra_parts.cc new file mode 100644 index 00000000..90d2596f --- /dev/null +++ b/chromium_edits/125.0.6368.2/chrome/browser/ipfs_extra_parts.cc @@ -0,0 +1,10 @@ +#include "ipfs_extra_parts.h" + +#include "profiles/profile.h" + +#include + +void IpfsExtraParts::PostProfileInit(Profile* profile, bool /* is_initial_profile */ ) { + DCHECK(profile); + ipfs::InterRequestState::CreateForBrowserContext(profile, profile->GetPrefs()); +} diff --git a/chromium_edits/125.0.6368.2/chrome/browser/ipfs_extra_parts.h b/chromium_edits/125.0.6368.2/chrome/browser/ipfs_extra_parts.h new file mode 100644 index 00000000..2059c437 --- /dev/null +++ b/chromium_edits/125.0.6368.2/chrome/browser/ipfs_extra_parts.h @@ -0,0 +1,10 @@ +#ifndef IPFS_EXTRA_PART_H_ +#define IPFS_EXTRA_PART_H_ + +#include + +class IpfsExtraParts : public ChromeBrowserMainExtraParts { + void PostProfileInit(Profile* profile, bool is_initial_profile) override; +}; + +#endif // IPFS_EXTRA_PART_H_ diff --git a/chromium_edits/125.0.6368.2/chrome/browser/prefs/browser_prefs.cc.patch b/chromium_edits/125.0.6368.2/chrome/browser/prefs/browser_prefs.cc.patch new file mode 100644 index 00000000..fd04d160 --- /dev/null +++ b/chromium_edits/125.0.6368.2/chrome/browser/prefs/browser_prefs.cc.patch @@ -0,0 +1,37 @@ +diff --git a/chrome/browser/prefs/browser_prefs.cc b/chrome/browser/prefs/browser_prefs.cc +index 5eef5cdedda4c..a05199c7e40d4 100644 +--- a/chrome/browser/prefs/browser_prefs.cc ++++ b/chrome/browser/prefs/browser_prefs.cc +@@ -190,6 +190,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 +236,11 @@ + #include "chrome/browser/pdf/pdf_pref_names.h" + #endif // BUILDFLAG(ENABLE_PDF) + ++#if BUILDFLAG(ENABLE_IPFS) ++#include "components/ipfs/ipfs_features.h" ++#include "components/ipfs/preferences.h" ++#endif ++ + #if BUILDFLAG(ENABLE_SCREEN_AI_SERVICE) + #include "chrome/browser/screen_ai/pref_names.h" + #endif +@@ -1746,6 +1753,11 @@ void RegisterProfilePrefs(user_prefs::PrefRegistrySyncable* registry, + IncognitoModePrefs::RegisterProfilePrefs(registry); + invalidation::PerUserTopicSubscriptionManager::RegisterProfilePrefs(registry); + invalidation::InvalidatorRegistrarWithMemory::RegisterProfilePrefs(registry); ++#if BUILDFLAG(ENABLE_IPFS) ++ if (base::FeatureList::IsEnabled(ipfs::kEnableIpfs)) { ++ ipfs::RegisterPreferences(registry); ++ } ++#endif + language::LanguagePrefs::RegisterProfilePrefs(registry); + login_detection::prefs::RegisterProfilePrefs(registry); + lookalikes::RegisterProfilePrefs(registry); diff --git a/chromium_edits/125.0.6368.2/chrome/common/chrome_content_client.cc.patch b/chromium_edits/125.0.6368.2/chrome/common/chrome_content_client.cc.patch new file mode 100644 index 00000000..59ea01c2 --- /dev/null +++ b/chromium_edits/125.0.6368.2/chrome/common/chrome_content_client.cc.patch @@ -0,0 +1,17 @@ +diff --git a/chrome/common/chrome_content_client.cc b/chrome/common/chrome_content_client.cc +index 2f016718fdd3c..bc38d5c2e4d8e 100644 +--- a/chrome/common/chrome_content_client.cc ++++ b/chrome/common/chrome_content_client.cc +@@ -302,6 +302,12 @@ void ChromeContentClient::AddAdditionalSchemes(Schemes* schemes) { + #if BUILDFLAG(IS_ANDROID) + schemes->local_schemes.push_back(url::kContentScheme); + #endif ++ for ( const char* ip_s : {"ipfs", "ipns"} ) { ++ schemes->standard_schemes.push_back(ip_s); ++ schemes->cors_enabled_schemes.push_back(ip_s); ++ schemes->secure_schemes.push_back(ip_s); ++ schemes->csp_bypassing_schemes.push_back(ip_s); ++ } + } + + std::u16string ChromeContentClient::GetLocalizedString(int message_id) { diff --git a/chromium_edits/125.0.6368.2/components/cbor/reader.cc.patch b/chromium_edits/125.0.6368.2/components/cbor/reader.cc.patch new file mode 100644 index 00000000..a9c4a7b3 --- /dev/null +++ b/chromium_edits/125.0.6368.2/components/cbor/reader.cc.patch @@ -0,0 +1,44 @@ +diff --git a/components/cbor/reader.cc b/components/cbor/reader.cc +index 3c31e3d05e5d3..5ad0dbb183884 100644 +--- a/components/cbor/reader.cc ++++ b/components/cbor/reader.cc +@@ -22,7 +22,7 @@ + namespace cbor { + + namespace constants { +-const char kUnsupportedMajorType[] = "Unsupported major type."; ++const char kUnsupportedMajorType[] = "Unsupported major type operation."; + } + + namespace { +@@ -156,7 +156,11 @@ std::optional Reader::DecodeCompleteDataItem(const Config& config, + case Value::Type::FLOAT_VALUE: + // Floating point values also go here since they are also type 7. + return DecodeToSimpleValueOrFloat(*header, config); +- case Value::Type::TAG: // We explicitly don't support TAG. ++ case Value::Type::TAG: ++ if (config.parse_tags) { ++ return ReadTagContent(*header, config, max_nesting_level); ++ } ++ break; + case Value::Type::NONE: + case Value::Type::INVALID_UTF8: + break; +@@ -347,6 +351,17 @@ std::optional Reader::ReadByteStringContent( + return Value(std::move(cbor_byte_string)); + } + ++std::optional Reader::ReadTagContent( ++ const Reader::DataItemHeader& header, ++ const Config& config, ++ int max_nesting_level) { ++ auto tagged_content = DecodeCompleteDataItem(config, max_nesting_level); ++ if (tagged_content.has_value()) { ++ tagged_content.value().SetTag(header.value); ++ } ++ return tagged_content; ++} ++ + std::optional Reader::ReadArrayContent( + const Reader::DataItemHeader& header, + const Config& config, diff --git a/chromium_edits/125.0.6368.2/components/cbor/reader.h.patch b/chromium_edits/125.0.6368.2/components/cbor/reader.h.patch new file mode 100644 index 00000000..cd7d9eb0 --- /dev/null +++ b/chromium_edits/125.0.6368.2/components/cbor/reader.h.patch @@ -0,0 +1,26 @@ +diff --git a/components/cbor/reader.h b/components/cbor/reader.h +index 73c5dcb23e555..a933768608d73 100644 +--- a/components/cbor/reader.h ++++ b/components/cbor/reader.h +@@ -130,6 +130,11 @@ class CBOR_EXPORT Reader { + // during decoding will set raise the `UNSUPPORTED_FLOATING_POINT_VALUE` + // error. + bool allow_floating_point = false; ++ ++ // If the parser encounters a TAG element, should it be parsed out and ++ // the tag value saved (true), or should the entire node and its content ++ // be discarded (false) ++ bool parse_tags = false; + }; + + Reader(const Reader&) = delete; +@@ -204,6 +209,9 @@ class CBOR_EXPORT Reader { + std::optional ReadMapContent(const DataItemHeader& header, + const Config& config, + int max_nesting_level); ++ std::optional ReadTagContent(const DataItemHeader& header, ++ const Config& config, ++ int max_nesting_level); + std::optional ReadByte(); + std::optional> ReadBytes(uint64_t num_bytes); + bool IsKeyInOrder(const Value& new_key, diff --git a/chromium_edits/125.0.6368.2/components/cbor/reader_unittest.cc.patch b/chromium_edits/125.0.6368.2/components/cbor/reader_unittest.cc.patch new file mode 100644 index 00000000..150e0c73 --- /dev/null +++ b/chromium_edits/125.0.6368.2/components/cbor/reader_unittest.cc.patch @@ -0,0 +1,47 @@ +diff --git a/components/cbor/reader_unittest.cc b/components/cbor/reader_unittest.cc +index e5c02ceea3402..f26b8e77f6da3 100644 +--- a/components/cbor/reader_unittest.cc ++++ b/components/cbor/reader_unittest.cc +@@ -1449,5 +1449,42 @@ TEST(CBORReaderTest, AllowInvalidUTF8) { + EXPECT_FALSE(cbor); + EXPECT_EQ(Reader::DecoderError::INVALID_UTF8, error); + } ++TEST(CBORReaderTest, RejectsTagUnderDefaultConfig) { ++ static const uint8_t kTaggedCbor[] = { ++ 0xd8, 0x2a, 0x58, 0x25, 0x00, 0x01, 0x71, 0x12, 0x20, 0x69, 0xea, 0x07, ++ 0x40, 0xf9, 0x80, 0x7a, 0x28, 0xf4, 0xd9, 0x32, 0xc6, 0x2e, 0x7c, 0x1c, ++ 0x83, 0xbe, 0x05, 0x5e, 0x55, 0x07, 0x2c, 0x90, 0x26, 0x6a, 0xb3, 0xe7, ++ 0x9d, 0xf6, 0x3a, 0x36, 0x5b ++ }; ++ Reader::Config config; ++ auto cbor = Reader::Read(kTaggedCbor, config); ++ EXPECT_FALSE(cbor.has_value()); ++} ++TEST(CBORReaderTest, ReadsTagWhenConfiguredToDoSo) { ++ static const uint8_t kTaggedCbor[] = { ++ 0xd8, 0x2a, 0x58, 0x25, 0x00, 0x01, 0x71, 0x12, 0x20, 0x69, 0xea, 0x07, ++ 0x40, 0xf9, 0x80, 0x7a, 0x28, 0xf4, 0xd9, 0x32, 0xc6, 0x2e, 0x7c, 0x1c, ++ 0x83, 0xbe, 0x05, 0x5e, 0x55, 0x07, 0x2c, 0x90, 0x26, 0x6a, 0xb3, 0xe7, ++ 0x9d, 0xf6, 0x3a, 0x36, 0x5b ++ }; ++ Reader::Config config; ++ config.parse_tags = true; ++ auto cbor = Reader::Read(kTaggedCbor, config); ++ EXPECT_TRUE(cbor.has_value()); ++ auto& v = cbor.value(); ++ EXPECT_TRUE(v.has_tag()); ++ EXPECT_EQ(v.GetTag(),42UL); ++ EXPECT_TRUE(v.is_bytestring()); ++ EXPECT_EQ(v.type(), Value::Type::BYTE_STRING); ++ auto& bytes = v.GetBytestring(); ++ EXPECT_EQ(bytes.size(), 37UL); ++ EXPECT_EQ(bytes.at(0), 0x00);//identity multibase (e.g. not base-encoded, bytes are themselves) ++ EXPECT_EQ(bytes.at(1), 0x01);//CID version 1 ++ EXPECT_EQ(bytes.at(2), 0x71);//codec = dag-cbor ++ EXPECT_EQ(bytes.at(3), 0x12);//multihash = 18 = sha2-256 ++ EXPECT_EQ(bytes.at(4), 0x20);//hash length = 32 bytes ++ EXPECT_EQ(bytes.at(5), 0x69);//first byte of hash digest ++ EXPECT_EQ(bytes.at(36),0x5b);//last byte of hash digest ++} + + } // namespace cbor diff --git a/chromium_edits/125.0.6368.2/components/cbor/values.cc.patch b/chromium_edits/125.0.6368.2/components/cbor/values.cc.patch new file mode 100644 index 00000000..ddbab2b3 --- /dev/null +++ b/chromium_edits/125.0.6368.2/components/cbor/values.cc.patch @@ -0,0 +1,145 @@ +diff --git a/components/cbor/values.cc b/components/cbor/values.cc +index 02498209c820e..34055aef24cfe 100644 +--- a/components/cbor/values.cc ++++ b/components/cbor/values.cc +@@ -66,32 +66,34 @@ Value::Value(Type type) : type_(type) { + NOTREACHED(); + } + +-Value::Value(SimpleValue in_simple) +- : type_(Type::SIMPLE_VALUE), simple_value_(in_simple) { ++Value::Value(SimpleValue in_simple, uint64_t tag) ++ : type_(Type::SIMPLE_VALUE), simple_value_(in_simple), tag_(tag) { + CHECK(static_cast(in_simple) >= 20 && static_cast(in_simple) <= 23); + } + +-Value::Value(bool boolean_value) : type_(Type::SIMPLE_VALUE) { ++Value::Value(bool boolean_value, uint64_t tag) : type_(Type::SIMPLE_VALUE), tag_(tag) { + simple_value_ = boolean_value ? Value::SimpleValue::TRUE_VALUE + : Value::SimpleValue::FALSE_VALUE; + } + +-Value::Value(double float_value) +- : type_(Type::FLOAT_VALUE), float_value_(float_value) {} ++Value::Value(double float_value, uint64_t tag) ++ : type_(Type::FLOAT_VALUE), float_value_(float_value), tag_(tag) {} + +-Value::Value(int integer_value) +- : Value(base::checked_cast(integer_value)) {} ++Value::Value(int integer_value, uint64_t tag) ++ : Value(base::checked_cast(integer_value), tag) {} + +-Value::Value(int64_t integer_value) : integer_value_(integer_value) { ++Value::Value(int64_t integer_value, uint64_t tag) : integer_value_(integer_value), tag_(tag) { + type_ = integer_value >= 0 ? Type::UNSIGNED : Type::NEGATIVE; + } + +-Value::Value(base::span in_bytes) ++Value::Value(base::span in_bytes, uint64_t tag) + : type_(Type::BYTE_STRING), +- bytestring_value_(in_bytes.begin(), in_bytes.end()) {} ++ bytestring_value_(in_bytes.begin(), in_bytes.end()), ++ tag_(tag) ++ {} + +-Value::Value(base::span in_bytes, Type type) +- : type_(type), bytestring_value_(in_bytes.begin(), in_bytes.end()) { ++Value::Value(base::span in_bytes, Type type, uint64_t tag) ++ : type_(type), bytestring_value_(in_bytes.begin(), in_bytes.end()), tag_(tag) { + DCHECK(type_ == Type::BYTE_STRING || type_ == Type::INVALID_UTF8); + } + +@@ -117,7 +119,8 @@ Value::Value(std::string&& in_string, Type type) noexcept : type_(type) { + } + } + +-Value::Value(base::StringPiece in_string, Type type) : type_(type) { ++Value::Value(base::StringPiece 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) { + } + } + +-Value::Value(const ArrayValue& in_array) : type_(Type::ARRAY), array_value_() { ++Value::Value(const ArrayValue& in_array, uint64_t tag) ++: type_(Type::ARRAY), array_value_(), tag_(tag) { + array_value_.reserve(in_array.size()); + for (const auto& val : in_array) + array_value_.emplace_back(val.Clone()); + } + +-Value::Value(ArrayValue&& in_array) noexcept +- : type_(Type::ARRAY), array_value_(std::move(in_array)) {} ++Value::Value(ArrayValue&& in_array, uint64_t tag) noexcept ++ : type_(Type::ARRAY), array_value_(std::move(in_array)), tag_(tag) {} + +-Value::Value(const MapValue& in_map) : type_(Type::MAP), map_value_() { ++Value::Value(const MapValue& in_map, uint64_t tag) ++: type_(Type::MAP), map_value_(), tag_(tag) { + map_value_.reserve(in_map.size()); + for (const auto& it : in_map) + map_value_.emplace_hint(map_value_.end(), it.first.Clone(), +@@ -168,31 +173,36 @@ Value Value::Clone() const { + case Type::NONE: + return Value(); + case Type::INVALID_UTF8: +- return Value(bytestring_value_, Type::INVALID_UTF8); ++ return Value(bytestring_value_, Type::INVALID_UTF8, tag_); + case Type::UNSIGNED: + case Type::NEGATIVE: +- return Value(integer_value_); ++ return Value(integer_value_, tag_); + case Type::BYTE_STRING: +- return Value(bytestring_value_); ++ return Value(bytestring_value_, tag_); + case Type::STRING: +- return Value(string_value_); ++ return Value(string_value_, Type::STRING, tag_); + case Type::ARRAY: +- return Value(array_value_); ++ return Value(array_value_, tag_); + case Type::MAP: +- return Value(map_value_); ++ return Value(map_value_, tag_); + case Type::TAG: + NOTREACHED() << constants::kUnsupportedMajorType; + return Value(); + case Type::SIMPLE_VALUE: +- return Value(simple_value_); ++ return Value(simple_value_, tag_); + case Type::FLOAT_VALUE: +- return Value(float_value_); ++ return Value(float_value_, tag_); + } + + NOTREACHED(); + return Value(); + } + ++Value& Value::SetTag(uint64_t tag) noexcept { ++ tag_ = tag; ++ return *this; ++} ++ + Value::SimpleValue Value::GetSimpleValue() const { + CHECK(is_simple()); + return simple_value_; +@@ -258,9 +268,14 @@ const Value::BinaryValue& Value::GetInvalidUTF8() const { + return bytestring_value_; + } + ++uint64_t Value::GetTag() const { ++ CHECK(has_tag()); ++ return tag_; ++} ++ + void Value::InternalMoveConstructFrom(Value&& that) { + type_ = that.type_; +- ++ tag_ = that.tag_; + switch (type_) { + case Type::UNSIGNED: + case Type::NEGATIVE: diff --git a/chromium_edits/125.0.6368.2/components/cbor/values.h.patch b/chromium_edits/125.0.6368.2/components/cbor/values.h.patch new file mode 100644 index 00000000..ca39df01 --- /dev/null +++ b/chromium_edits/125.0.6368.2/components/cbor/values.h.patch @@ -0,0 +1,79 @@ +diff --git a/components/cbor/values.h b/components/cbor/values.h +index d81ef5607c55a..10216a8dcdc57 100644 +--- a/components/cbor/values.h ++++ b/components/cbor/values.h +@@ -127,28 +127,29 @@ class CBOR_EXPORT Value { + + explicit Value(Type type); + +- explicit Value(SimpleValue in_simple); +- explicit Value(bool boolean_value); +- explicit Value(double in_float); ++ explicit Value(SimpleValue in_simple, uint64_t tag = NO_TAG); ++ explicit Value(bool boolean_value, uint64_t tag = NO_TAG); ++ explicit Value(double in_float, uint64_t tag = NO_TAG); + +- explicit Value(int integer_value); +- explicit Value(int64_t integer_value); ++ explicit Value(int integer_value, uint64_t tag = NO_TAG); ++ explicit Value(int64_t integer_value, uint64_t tag = NO_TAG); + explicit Value(uint64_t integer_value) = delete; + +- explicit Value(base::span in_bytes); ++ explicit Value(base::span in_bytes, uint64_t tag = NO_TAG); + explicit Value(BinaryValue&& in_bytes) noexcept; + + 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(const ArrayValue& in_array); +- explicit Value(ArrayValue&& in_array) noexcept; ++ explicit Value(const ArrayValue& in_array, uint64_t tag = NO_TAG); ++ explicit Value(ArrayValue&& in_array, uint64_t tag = NO_TAG) noexcept; + +- explicit Value(const MapValue& in_map); ++ explicit Value(const MapValue& in_map, uint64_t tag = NO_TAG); + explicit Value(MapValue&& in_map) noexcept; + + Value& operator=(Value&& that) noexcept; ++ Value& SetTag(uint64_t) noexcept; + + Value(const Value&) = delete; + Value& operator=(const Value&) = delete; +@@ -179,6 +180,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; } ++ bool has_tag() const { return tag_ != NO_TAG; } + + // These will all fatally assert if the type doesn't match. + SimpleValue GetSimpleValue() const; +@@ -194,12 +196,13 @@ class CBOR_EXPORT Value { + const ArrayValue& GetArray() const; + const MapValue& GetMap() const; + const BinaryValue& GetInvalidUTF8() const; ++ uint64_t GetTag() const; + + private: + friend class Reader; + // This constructor allows INVALID_UTF8 values to be created, which only + // |Reader| and InvalidUTF8StringValueForTesting() may do. +- Value(base::span in_bytes, Type type); ++ Value(base::span in_bytes, Type type, uint64_t tag = NO_TAG); + + Type type_; + +@@ -213,6 +216,11 @@ class CBOR_EXPORT Value { + MapValue map_value_; + }; + ++ //This value specified as Invalid, ++ // used here to represent absence of TAG ++ constexpr static uint64_t NO_TAG = 0xFFFF; ++ uint64_t tag_ = NO_TAG; ++ + void InternalMoveConstructFrom(Value&& that); + void InternalCleanup(); + }; diff --git a/chromium_edits/125.0.6368.2/components/cbor/writer.cc.patch b/chromium_edits/125.0.6368.2/components/cbor/writer.cc.patch new file mode 100644 index 00000000..bb89c1e6 --- /dev/null +++ b/chromium_edits/125.0.6368.2/components/cbor/writer.cc.patch @@ -0,0 +1,14 @@ +diff --git a/components/cbor/writer.cc b/components/cbor/writer.cc +index f400a65e7b66a..fcdebb8f3b458 100644 +--- a/components/cbor/writer.cc ++++ b/components/cbor/writer.cc +@@ -47,6 +47,9 @@ bool Writer::EncodeCBOR(const Value& node, + if (max_nesting_level < 0) + return false; + ++ if (node.has_tag()) { ++ StartItem(Value::Type::TAG, node.GetTag()); ++ } + switch (node.type()) { + case Value::Type::NONE: { + StartItem(Value::Type::BYTE_STRING, 0); diff --git a/chromium_edits/125.0.6368.2/components/cbor/writer_unittest.cc.patch b/chromium_edits/125.0.6368.2/components/cbor/writer_unittest.cc.patch new file mode 100644 index 00000000..240fee83 --- /dev/null +++ b/chromium_edits/125.0.6368.2/components/cbor/writer_unittest.cc.patch @@ -0,0 +1,36 @@ +diff --git a/components/cbor/writer_unittest.cc b/components/cbor/writer_unittest.cc +index e3bffe20734bc..0ed569ae164a0 100644 +--- a/components/cbor/writer_unittest.cc ++++ b/components/cbor/writer_unittest.cc +@@ -522,4 +522,31 @@ TEST(CBORWriterTest, OverlyNestedCBOR) { + EXPECT_FALSE(Writer::Write(Value(map), 4).has_value()); + } + ++TEST(CBORWriterTest, CanWriteTag) { ++ std::array content{ ++ 0x00, 0x01, 0x71, 0x12, 0x20, ++ 0x69, 0xea, 0x07, 0x40, 0xf9, ++ 0x80, 0x7a, 0x28, 0xf4, 0xd9, ++ 0x32, 0xc6, 0x2e, 0x7c, 0x1c, ++ 0x83, 0xbe, 0x05, 0x5e, 0x55, ++ 0x07, 0x2c, 0x90, 0x26, 0x6a, ++ 0xb3, 0xe7, 0x9d, 0xf6, 0x3a, ++ 0x36, 0x5b ++ }; ++ Value to_write(content); ++ to_write.SetTag(42); ++ auto result = Writer::Write(to_write); ++ EXPECT_TRUE(result.has_value()); ++ auto& bytes = result.value(); ++ EXPECT_EQ(bytes.size(), 41UL); ++ EXPECT_EQ(bytes.at(0), 0xd8); ++ EXPECT_EQ(bytes.at(1), 0x2a); ++ EXPECT_EQ(bytes.at(2), 0x58); ++ EXPECT_EQ(bytes.at(3), 0x25); ++ for (auto i = 0UL; i < content.size(); ++i) { ++ ASSERT_LT(i + 4UL, bytes.size()); ++ ASSERT_EQ(content.at(i), bytes.at(i+4UL)); ++ } ++} ++ + } // namespace cbor diff --git a/chromium_edits/125.0.6368.2/components/open_from_clipboard/clipboard_recent_content_generic.cc.patch b/chromium_edits/125.0.6368.2/components/open_from_clipboard/clipboard_recent_content_generic.cc.patch new file mode 100644 index 00000000..291d84f1 --- /dev/null +++ b/chromium_edits/125.0.6368.2/components/open_from_clipboard/clipboard_recent_content_generic.cc.patch @@ -0,0 +1,13 @@ +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 +--- a/components/open_from_clipboard/clipboard_recent_content_generic.cc ++++ b/components/open_from_clipboard/clipboard_recent_content_generic.cc +@@ -20,7 +20,7 @@ + namespace { + // Schemes appropriate for suggestion by ClipboardRecentContent. + const char* kAuthorizedSchemes[] = { +- url::kAboutScheme, url::kDataScheme, url::kHttpScheme, url::kHttpsScheme, ++ url::kAboutScheme, url::kDataScheme, url::kHttpScheme, url::kHttpsScheme, "ipfs", "ipns" + // TODO(mpearson): add support for chrome:// URLs. Right now the scheme + // for that lives in content and is accessible via + // GetEmbedderRepresentationOfAboutScheme() or content::kChromeUIScheme diff --git a/chromium_edits/125.0.6368.2/net/dns/dns_config_service_linux.cc.patch b/chromium_edits/125.0.6368.2/net/dns/dns_config_service_linux.cc.patch new file mode 100644 index 00000000..3b042d33 --- /dev/null +++ b/chromium_edits/125.0.6368.2/net/dns/dns_config_service_linux.cc.patch @@ -0,0 +1,18 @@ +diff --git a/net/dns/dns_config_service_linux.cc b/net/dns/dns_config_service_linux.cc +index f909f127ba3e1..31d7f9d58c0af 100644 +--- a/net/dns/dns_config_service_linux.cc ++++ b/net/dns/dns_config_service_linux.cc +@@ -271,11 +271,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; +- ++ case NsswitchReader::Service::kResolve: ++ break; + case NsswitchReader::Service::kMdns: + case NsswitchReader::Service::kMdns4: + case NsswitchReader::Service::kMdns6: +- case NsswitchReader::Service::kResolve: + case NsswitchReader::Service::kNis: + RecordIncompatibleNsswitchReason( + IncompatibleNsswitchReason::kIncompatibleService, diff --git a/chromium_edits/125.0.6368.2/third_party/blink/renderer/platform/weborigin/scheme_registry.cc.patch b/chromium_edits/125.0.6368.2/third_party/blink/renderer/platform/weborigin/scheme_registry.cc.patch new file mode 100644 index 00000000..119d72b2 --- /dev/null +++ b/chromium_edits/125.0.6368.2/third_party/blink/renderer/platform/weborigin/scheme_registry.cc.patch @@ -0,0 +1,13 @@ +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 +--- 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 { + // 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"}), ++ fetch_api_schemes({"http", "https", "ipfs", "ipns"}), + allowed_in_referrer_schemes({"http", "https"}) { + for (auto& scheme : url::GetCorsEnabledSchemes()) + cors_enabled_schemes.insert(scheme.c_str()); diff --git a/chromium_edits/125.0.6368.2/url/BUILD.gn.patch b/chromium_edits/125.0.6368.2/url/BUILD.gn.patch new file mode 100644 index 00000000..201770c4 --- /dev/null +++ b/chromium_edits/125.0.6368.2/url/BUILD.gn.patch @@ -0,0 +1,32 @@ +diff --git a/url/BUILD.gn b/url/BUILD.gn +index aedf1bf9f80be..b11c73a88aae5 100644 +--- a/url/BUILD.gn ++++ b/url/BUILD.gn +@@ -5,6 +5,7 @@ + import("//build/buildflag_header.gni") + import("//testing/libfuzzer/fuzzer_test.gni") + import("//testing/test.gni") ++import("//third_party/ipfs_client/args.gni") + import("features.gni") + + import("//build/config/cronet/config.gni") +@@ -67,6 +68,7 @@ component("url") { + public_deps = [ + "//base", + "//build:robolectric_buildflags", ++ "//third_party/ipfs_client:ipfs_buildflags", + ] + + configs += [ "//build/config/compiler:wexit_time_destructors" ] +@@ -89,6 +91,11 @@ component("url") { + public_configs = [ "//third_party/jdk" ] + } + ++ if (enable_ipfs) { ++ sources += [ "url_canon_ipfs.cc" ] ++ deps += [ "//third_party/ipfs_client:ipfs_client" ] ++ } ++ + if (is_win) { + # Don't conflict with Windows' "url.dll". + output_name = "url_lib" diff --git a/chromium_edits/125.0.6368.2/url/url_canon.h.patch b/chromium_edits/125.0.6368.2/url/url_canon.h.patch new file mode 100644 index 00000000..71d7a758 --- /dev/null +++ b/chromium_edits/125.0.6368.2/url/url_canon.h.patch @@ -0,0 +1,28 @@ +diff --git a/url/url_canon.h b/url/url_canon.h +index bd40235e4aa85..05d250fe1b746 100644 +--- a/url/url_canon.h ++++ b/url/url_canon.h +@@ -815,6 +815,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/125.0.6368.2/url/url_canon_ipfs.cc b/chromium_edits/125.0.6368.2/url/url_canon_ipfs.cc new file mode 100644 index 00000000..d7c9fdc7 --- /dev/null +++ b/chromium_edits/125.0.6368.2/url/url_canon_ipfs.cc @@ -0,0 +1,55 @@ +#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/125.0.6368.2/url/url_util.cc.patch b/chromium_edits/125.0.6368.2/url/url_util.cc.patch new file mode 100644 index 00000000..3850fcfe --- /dev/null +++ b/chromium_edits/125.0.6368.2/url/url_util.cc.patch @@ -0,0 +1,22 @@ +diff --git a/url/url_util.cc b/url/url_util.cc +index 82b27b8f59684..2f3045adefaa7 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/125.0.6382.3/chrome/browser/BUILD.gn.patch b/chromium_edits/125.0.6382.3/chrome/browser/BUILD.gn.patch new file mode 100644 index 00000000..a7493c51 --- /dev/null +++ b/chromium_edits/125.0.6382.3/chrome/browser/BUILD.gn.patch @@ -0,0 +1,27 @@ +diff --git a/chrome/browser/BUILD.gn b/chrome/browser/BUILD.gn +index 324cc35fa51ee..6815f92508d7f 100644 +--- a/chrome/browser/BUILD.gn ++++ b/chrome/browser/BUILD.gn +@@ -39,6 +39,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") +@@ -2682,6 +2683,14 @@ static_library("browser") { + ] + } + ++ if (enable_ipfs) { ++ sources += [ ++ "ipfs_extra_parts.cc", ++ "ipfs_extra_parts.h", ++ ] ++ deps += [ "//components/ipfs" ] ++ } ++ + if (is_chromeos_ash) { + deps += [ "//chrome/browser/screen_ai:screen_ai_dlc_installer" ] + } diff --git a/chromium_edits/125.0.6382.3/chrome/browser/about_flags.cc.patch b/chromium_edits/125.0.6382.3/chrome/browser/about_flags.cc.patch new file mode 100644 index 00000000..df202267 --- /dev/null +++ b/chromium_edits/125.0.6382.3/chrome/browser/about_flags.cc.patch @@ -0,0 +1,38 @@ +diff --git a/chrome/browser/about_flags.cc b/chrome/browser/about_flags.cc +index ad4a564570cad..0b32f23c4ad48 100644 +--- a/chrome/browser/about_flags.cc ++++ b/chrome/browser/about_flags.cc +@@ -215,6 +215,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" ++#include "third_party/ipfs_client/ipfs_buildflags.h" + #include "ui/accessibility/accessibility_features.h" + #include "ui/accessibility/accessibility_switches.h" + #include "ui/base/ozone_buildflags.h" +@@ -309,6 +310,10 @@ + #include "extensions/common/switches.h" + #endif // BUILDFLAG(ENABLE_EXTENSIONS) + ++#if BUILDFLAG(ENABLE_IPFS) ++#include "components/ipfs/ipfs_features.h" ++#endif ++ + #if BUILDFLAG(ENABLE_PDF) + #include "pdf/pdf_features.h" + #endif +@@ -9603,6 +9608,14 @@ const FeatureEntry kFeatureEntries[] = { + flag_descriptions::kOmitCorsClientCertDescription, kOsAll, + FEATURE_VALUE_TYPE(network::features::kOmitCorsClientCert)}, + ++#if BUILDFLAG(ENABLE_IPFS) ++ {"enable-ipfs", ++ flag_descriptions::kEnableIpfsName, ++ flag_descriptions::kEnableIpfsDescription, ++ kOsMac | kOsWin | kOsLinux,//TODO: These are the only variants currently getting built, but that is not likely to remain the case ++ FEATURE_VALUE_TYPE(ipfs::kEnableIpfs)}, ++#endif ++ + {"use-idna2008-non-transitional", + flag_descriptions::kUseIDNA2008NonTransitionalName, + flag_descriptions::kUseIDNA2008NonTransitionalDescription, kOsAll, diff --git a/chromium_edits/125.0.6382.3/chrome/browser/autocomplete/chrome_autocomplete_scheme_classifier.cc.patch b/chromium_edits/125.0.6382.3/chrome/browser/autocomplete/chrome_autocomplete_scheme_classifier.cc.patch new file mode 100644 index 00000000..4d172311 --- /dev/null +++ b/chromium_edits/125.0.6382.3/chrome/browser/autocomplete/chrome_autocomplete_scheme_classifier.cc.patch @@ -0,0 +1,50 @@ +diff --git a/chrome/browser/autocomplete/chrome_autocomplete_scheme_classifier.cc b/chrome/browser/autocomplete/chrome_autocomplete_scheme_classifier.cc +index 4c88614c68c25..f8bb12a3b0c2e 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" ++#include "third_party/ipfs_client/ipfs_buildflags.h" ++ + #if BUILDFLAG(IS_ANDROID) + #include "chrome/browser/profiles/profile_android.h" + #endif +@@ -18,6 +20,9 @@ + #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 (scheme.empty()) { + return metrics::OmniboxInputType::EMPTY; + } +- if (base::IsStringASCII(scheme) && +- (ProfileIOData::IsHandledProtocol(scheme) || +- base::EqualsCaseInsensitiveASCII(scheme, content::kViewSourceScheme) || +- base::EqualsCaseInsensitiveASCII(scheme, url::kJavaScriptScheme) || +- base::EqualsCaseInsensitiveASCII(scheme, url::kDataScheme))) { +- return metrics::OmniboxInputType::URL; ++ if (base::IsStringASCII(scheme)) { ++ if (ProfileIOData::IsHandledProtocol(scheme) || ++ base::EqualsCaseInsensitiveASCII(scheme, content::kViewSourceScheme) || ++ base::EqualsCaseInsensitiveASCII(scheme, url::kJavaScriptScheme) || ++ base::EqualsCaseInsensitiveASCII(scheme, url::kDataScheme)) { ++ return metrics::OmniboxInputType::URL; ++ } ++#if BUILDFLAG(ENABLE_IPFS) ++ if (base::FeatureList::IsEnabled(ipfs::kEnableIpfs) && ++ (base::EqualsCaseInsensitiveASCII(scheme, "ipfs") || base::EqualsCaseInsensitiveASCII(scheme, "ipns")) ++ ) { ++ return metrics::OmniboxInputType::URL; ++ } ++#endif + } + + // Also check for schemes registered via registerProtocolHandler(), which diff --git a/chromium_edits/125.0.6382.3/chrome/browser/chrome_content_browser_client.cc.patch b/chromium_edits/125.0.6382.3/chrome/browser/chrome_content_browser_client.cc.patch new file mode 100644 index 00000000..a1d53d7f --- /dev/null +++ b/chromium_edits/125.0.6382.3/chrome/browser/chrome_content_browser_client.cc.patch @@ -0,0 +1,77 @@ +diff --git a/chrome/browser/chrome_content_browser_client.cc b/chrome/browser/chrome_content_browser_client.cc +index ae225c7d31963..49b2b3a05a63a 100644 +--- a/chrome/browser/chrome_content_browser_client.cc ++++ b/chrome/browser/chrome_content_browser_client.cc +@@ -381,6 +381,7 @@ + #include "third_party/blink/public/common/switches.h" + #include "third_party/blink/public/mojom/browsing_topics/browsing_topics.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" +@@ -503,6 +504,13 @@ + #include "chrome/browser/fuchsia/chrome_browser_main_parts_fuchsia.h" + #endif + ++#if BUILDFLAG(ENABLE_IPFS) ++#include "chrome/browser/ipfs_extra_parts.h" ++#include "components/ipfs/interceptor.h" ++#include "components/ipfs/ipfs_features.h" ++#include "components/ipfs/url_loader_factory.h" ++#endif ++ + #if !BUILDFLAG(IS_ANDROID) + #include "chrome/browser/preloading/preview/preview_navigation_throttle.h" + #include "chrome/browser/web_applications/isolated_web_apps/chrome_content_browser_client_isolated_web_apps_part.h" +@@ -1695,6 +1703,11 @@ ChromeContentBrowserClient::CreateBrowserMainParts(bool is_integration_test) { + main_parts->AddParts( + std::make_unique()); + ++#if BUILDFLAG(ENABLE_IPFS) ++ if (base::FeatureList::IsEnabled(ipfs::kEnableIpfs)) { ++ main_parts->AddParts(std::make_unique()); ++ } ++#endif + return main_parts; + } + +@@ -6143,12 +6156,25 @@ void ChromeContentBrowserClient:: + const std::optional& request_initiator_origin, + NonNetworkURLLoaderFactoryMap* factories) { + #if BUILDFLAG(IS_CHROMEOS_ASH) || BUILDFLAG(ENABLE_EXTENSIONS) || \ +- !BUILDFLAG(IS_ANDROID) ++ !BUILDFLAG(IS_ANDROID) || BUILDFLAG(ENABLE_IPFS) + content::RenderFrameHost* frame_host = + 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) ++#if BUILDFLAG(ENABLE_IPFS) ++ 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( ++ factories, ++ context, ++ default_factory, ++ GetSystemNetworkContext(), ++ Profile::FromBrowserContext(context)->GetPrefs() ++ ); ++ } ++#endif // BUILDFLAG(ENABLE_IPFS) + + #if BUILDFLAG(IS_CHROMEOS_ASH) + if (web_contents) { +@@ -6285,6 +6311,11 @@ ChromeContentBrowserClient::WillCreateURLLoaderRequestInterceptors( + scoped_refptr navigation_response_task_runner) { + std::vector> + interceptors; ++#if BUILDFLAG(ENABLE_IPFS) ++ if (base::FeatureList::IsEnabled(ipfs::kEnableIpfs)) { ++ interceptors.push_back(std::make_unique(g_browser_process->system_network_context_manager()->GetURLLoaderFactory(), GetSystemNetworkContext())); ++ } ++#endif + #if BUILDFLAG(ENABLE_OFFLINE_PAGES) + interceptors.push_back( + std::make_unique( diff --git a/chromium_edits/125.0.6382.3/chrome/browser/flag-metadata.json.patch b/chromium_edits/125.0.6382.3/chrome/browser/flag-metadata.json.patch new file mode 100644 index 00000000..2026a41e --- /dev/null +++ b/chromium_edits/125.0.6382.3/chrome/browser/flag-metadata.json.patch @@ -0,0 +1,16 @@ +diff --git a/chrome/browser/flag-metadata.json b/chrome/browser/flag-metadata.json +index ab9e93c432f62..77786a6765cf7 100644 +--- a/chrome/browser/flag-metadata.json ++++ b/chrome/browser/flag-metadata.json +@@ -3132,6 +3132,11 @@ + "owners": [ "adamta@google.com", "chrome-feed-fundamentals@google.com" ], + "expiry_milestone": 130 + }, ++ { ++ "name": "enable-ipfs", ++ "owners": [ "//components/ipfs/OWNERS" ], ++ "expiry_milestone": 150 ++ }, + { + "name": "enable-isolated-sandboxed-iframes", + "owners": [ "wjmaclean@chromium.org", "alexmos@chromium.org", "creis@chromium.org" ], diff --git a/chromium_edits/125.0.6382.3/chrome/browser/flag_descriptions.cc.patch b/chromium_edits/125.0.6382.3/chrome/browser/flag_descriptions.cc.patch new file mode 100644 index 00000000..19143725 --- /dev/null +++ b/chromium_edits/125.0.6382.3/chrome/browser/flag_descriptions.cc.patch @@ -0,0 +1,16 @@ +diff --git a/chrome/browser/flag_descriptions.cc b/chrome/browser/flag_descriptions.cc +index 873d802b41094..4b374b38fa838 100644 +--- a/chrome/browser/flag_descriptions.cc ++++ b/chrome/browser/flag_descriptions.cc +@@ -312,6 +312,11 @@ const char kEnableBenchmarkingChoiceDefaultFeatureStates[] = + const char kEnableBenchmarkingChoiceMatchFieldTrialTestingConfig[] = + "Match Field Trial Testing Config"; + ++#if BUILDFLAG(ENABLE_IPFS) ++extern const char kEnableIpfsName[] = "Enable IPFS"; ++extern const char kEnableIpfsDescription[] = "Enable ipfs:// and ipns:// URLs"; ++#endif ++ + const char kPreloadingOnPerformancePageName[] = + "Preloading Settings on Performance Page"; + const char kPreloadingOnPerformancePageDescription[] = diff --git a/chromium_edits/125.0.6382.3/chrome/browser/flag_descriptions.h.patch b/chromium_edits/125.0.6382.3/chrome/browser/flag_descriptions.h.patch new file mode 100644 index 00000000..bb761151 --- /dev/null +++ b/chromium_edits/125.0.6382.3/chrome/browser/flag_descriptions.h.patch @@ -0,0 +1,24 @@ +diff --git a/chrome/browser/flag_descriptions.h b/chrome/browser/flag_descriptions.h +index 801ea7a83dfaf..288fd279d7407 100644 +--- a/chrome/browser/flag_descriptions.h ++++ b/chrome/browser/flag_descriptions.h +@@ -23,6 +23,7 @@ + #include "pdf/buildflags.h" + #include "printing/buildflags/buildflags.h" + #include "third_party/blink/public/common/buildflags.h" ++#include "third_party/ipfs_client/ipfs_buildflags.h" + + // This file declares strings used in chrome://flags. These messages are not + // translated, because instead of end-users they target Chromium developers and +@@ -192,6 +193,11 @@ extern const char kEnableBenchmarkingChoiceDisabled[]; + extern const char kEnableBenchmarkingChoiceDefaultFeatureStates[]; + extern const char kEnableBenchmarkingChoiceMatchFieldTrialTestingConfig[]; + ++#if BUILDFLAG(ENABLE_IPFS) ++extern const char kEnableIpfsName[]; ++extern const char kEnableIpfsDescription[]; ++#endif ++ + #if BUILDFLAG(USE_FONTATIONS_BACKEND) + extern const char kFontationsFontBackendName[]; + extern const char kFontationsFontBackendDescription[]; diff --git a/chromium_edits/125.0.6382.3/chrome/browser/ipfs_extra_parts.cc b/chromium_edits/125.0.6382.3/chrome/browser/ipfs_extra_parts.cc new file mode 100644 index 00000000..90d2596f --- /dev/null +++ b/chromium_edits/125.0.6382.3/chrome/browser/ipfs_extra_parts.cc @@ -0,0 +1,10 @@ +#include "ipfs_extra_parts.h" + +#include "profiles/profile.h" + +#include + +void IpfsExtraParts::PostProfileInit(Profile* profile, bool /* is_initial_profile */ ) { + DCHECK(profile); + ipfs::InterRequestState::CreateForBrowserContext(profile, profile->GetPrefs()); +} diff --git a/chromium_edits/125.0.6382.3/chrome/browser/ipfs_extra_parts.h b/chromium_edits/125.0.6382.3/chrome/browser/ipfs_extra_parts.h new file mode 100644 index 00000000..2059c437 --- /dev/null +++ b/chromium_edits/125.0.6382.3/chrome/browser/ipfs_extra_parts.h @@ -0,0 +1,10 @@ +#ifndef IPFS_EXTRA_PART_H_ +#define IPFS_EXTRA_PART_H_ + +#include + +class IpfsExtraParts : public ChromeBrowserMainExtraParts { + void PostProfileInit(Profile* profile, bool is_initial_profile) override; +}; + +#endif // IPFS_EXTRA_PART_H_ diff --git a/chromium_edits/125.0.6382.3/chrome/browser/prefs/browser_prefs.cc.patch b/chromium_edits/125.0.6382.3/chrome/browser/prefs/browser_prefs.cc.patch new file mode 100644 index 00000000..0cd1eb47 --- /dev/null +++ b/chromium_edits/125.0.6382.3/chrome/browser/prefs/browser_prefs.cc.patch @@ -0,0 +1,37 @@ +diff --git a/chrome/browser/prefs/browser_prefs.cc b/chrome/browser/prefs/browser_prefs.cc +index faf3fa0460e3b..5bf2e3d4eae68 100644 +--- a/chrome/browser/prefs/browser_prefs.cc ++++ b/chrome/browser/prefs/browser_prefs.cc +@@ -189,6 +189,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" +@@ -233,6 +235,11 @@ + #include "chrome/browser/pdf/pdf_pref_names.h" + #endif // BUILDFLAG(ENABLE_PDF) + ++#if BUILDFLAG(ENABLE_IPFS) ++#include "components/ipfs/ipfs_features.h" ++#include "components/ipfs/preferences.h" ++#endif ++ + #if BUILDFLAG(ENABLE_SCREEN_AI_SERVICE) + #include "chrome/browser/screen_ai/pref_names.h" + #endif +@@ -1765,6 +1772,11 @@ void RegisterProfilePrefs(user_prefs::PrefRegistrySyncable* registry, + IncognitoModePrefs::RegisterProfilePrefs(registry); + invalidation::PerUserTopicSubscriptionManager::RegisterProfilePrefs(registry); + invalidation::InvalidatorRegistrarWithMemory::RegisterProfilePrefs(registry); ++#if BUILDFLAG(ENABLE_IPFS) ++ if (base::FeatureList::IsEnabled(ipfs::kEnableIpfs)) { ++ ipfs::RegisterPreferences(registry); ++ } ++#endif + language::LanguagePrefs::RegisterProfilePrefs(registry); + login_detection::prefs::RegisterProfilePrefs(registry); + lookalikes::RegisterProfilePrefs(registry); diff --git a/chromium_edits/125.0.6382.3/chrome/common/chrome_content_client.cc.patch b/chromium_edits/125.0.6382.3/chrome/common/chrome_content_client.cc.patch new file mode 100644 index 00000000..59ea01c2 --- /dev/null +++ b/chromium_edits/125.0.6382.3/chrome/common/chrome_content_client.cc.patch @@ -0,0 +1,17 @@ +diff --git a/chrome/common/chrome_content_client.cc b/chrome/common/chrome_content_client.cc +index 2f016718fdd3c..bc38d5c2e4d8e 100644 +--- a/chrome/common/chrome_content_client.cc ++++ b/chrome/common/chrome_content_client.cc +@@ -302,6 +302,12 @@ void ChromeContentClient::AddAdditionalSchemes(Schemes* schemes) { + #if BUILDFLAG(IS_ANDROID) + schemes->local_schemes.push_back(url::kContentScheme); + #endif ++ for ( const char* ip_s : {"ipfs", "ipns"} ) { ++ schemes->standard_schemes.push_back(ip_s); ++ schemes->cors_enabled_schemes.push_back(ip_s); ++ schemes->secure_schemes.push_back(ip_s); ++ schemes->csp_bypassing_schemes.push_back(ip_s); ++ } + } + + std::u16string ChromeContentClient::GetLocalizedString(int message_id) { diff --git a/chromium_edits/125.0.6382.3/components/cbor/reader.cc.patch b/chromium_edits/125.0.6382.3/components/cbor/reader.cc.patch new file mode 100644 index 00000000..a9c4a7b3 --- /dev/null +++ b/chromium_edits/125.0.6382.3/components/cbor/reader.cc.patch @@ -0,0 +1,44 @@ +diff --git a/components/cbor/reader.cc b/components/cbor/reader.cc +index 3c31e3d05e5d3..5ad0dbb183884 100644 +--- a/components/cbor/reader.cc ++++ b/components/cbor/reader.cc +@@ -22,7 +22,7 @@ + namespace cbor { + + namespace constants { +-const char kUnsupportedMajorType[] = "Unsupported major type."; ++const char kUnsupportedMajorType[] = "Unsupported major type operation."; + } + + namespace { +@@ -156,7 +156,11 @@ std::optional Reader::DecodeCompleteDataItem(const Config& config, + case Value::Type::FLOAT_VALUE: + // Floating point values also go here since they are also type 7. + return DecodeToSimpleValueOrFloat(*header, config); +- case Value::Type::TAG: // We explicitly don't support TAG. ++ case Value::Type::TAG: ++ if (config.parse_tags) { ++ return ReadTagContent(*header, config, max_nesting_level); ++ } ++ break; + case Value::Type::NONE: + case Value::Type::INVALID_UTF8: + break; +@@ -347,6 +351,17 @@ std::optional Reader::ReadByteStringContent( + return Value(std::move(cbor_byte_string)); + } + ++std::optional Reader::ReadTagContent( ++ const Reader::DataItemHeader& header, ++ const Config& config, ++ int max_nesting_level) { ++ auto tagged_content = DecodeCompleteDataItem(config, max_nesting_level); ++ if (tagged_content.has_value()) { ++ tagged_content.value().SetTag(header.value); ++ } ++ return tagged_content; ++} ++ + std::optional Reader::ReadArrayContent( + const Reader::DataItemHeader& header, + const Config& config, diff --git a/chromium_edits/125.0.6382.3/components/cbor/reader.h.patch b/chromium_edits/125.0.6382.3/components/cbor/reader.h.patch new file mode 100644 index 00000000..cd7d9eb0 --- /dev/null +++ b/chromium_edits/125.0.6382.3/components/cbor/reader.h.patch @@ -0,0 +1,26 @@ +diff --git a/components/cbor/reader.h b/components/cbor/reader.h +index 73c5dcb23e555..a933768608d73 100644 +--- a/components/cbor/reader.h ++++ b/components/cbor/reader.h +@@ -130,6 +130,11 @@ class CBOR_EXPORT Reader { + // during decoding will set raise the `UNSUPPORTED_FLOATING_POINT_VALUE` + // error. + bool allow_floating_point = false; ++ ++ // If the parser encounters a TAG element, should it be parsed out and ++ // the tag value saved (true), or should the entire node and its content ++ // be discarded (false) ++ bool parse_tags = false; + }; + + Reader(const Reader&) = delete; +@@ -204,6 +209,9 @@ class CBOR_EXPORT Reader { + std::optional ReadMapContent(const DataItemHeader& header, + const Config& config, + int max_nesting_level); ++ std::optional ReadTagContent(const DataItemHeader& header, ++ const Config& config, ++ int max_nesting_level); + std::optional ReadByte(); + std::optional> ReadBytes(uint64_t num_bytes); + bool IsKeyInOrder(const Value& new_key, diff --git a/chromium_edits/125.0.6382.3/components/cbor/reader_unittest.cc.patch b/chromium_edits/125.0.6382.3/components/cbor/reader_unittest.cc.patch new file mode 100644 index 00000000..150e0c73 --- /dev/null +++ b/chromium_edits/125.0.6382.3/components/cbor/reader_unittest.cc.patch @@ -0,0 +1,47 @@ +diff --git a/components/cbor/reader_unittest.cc b/components/cbor/reader_unittest.cc +index e5c02ceea3402..f26b8e77f6da3 100644 +--- a/components/cbor/reader_unittest.cc ++++ b/components/cbor/reader_unittest.cc +@@ -1449,5 +1449,42 @@ TEST(CBORReaderTest, AllowInvalidUTF8) { + EXPECT_FALSE(cbor); + EXPECT_EQ(Reader::DecoderError::INVALID_UTF8, error); + } ++TEST(CBORReaderTest, RejectsTagUnderDefaultConfig) { ++ static const uint8_t kTaggedCbor[] = { ++ 0xd8, 0x2a, 0x58, 0x25, 0x00, 0x01, 0x71, 0x12, 0x20, 0x69, 0xea, 0x07, ++ 0x40, 0xf9, 0x80, 0x7a, 0x28, 0xf4, 0xd9, 0x32, 0xc6, 0x2e, 0x7c, 0x1c, ++ 0x83, 0xbe, 0x05, 0x5e, 0x55, 0x07, 0x2c, 0x90, 0x26, 0x6a, 0xb3, 0xe7, ++ 0x9d, 0xf6, 0x3a, 0x36, 0x5b ++ }; ++ Reader::Config config; ++ auto cbor = Reader::Read(kTaggedCbor, config); ++ EXPECT_FALSE(cbor.has_value()); ++} ++TEST(CBORReaderTest, ReadsTagWhenConfiguredToDoSo) { ++ static const uint8_t kTaggedCbor[] = { ++ 0xd8, 0x2a, 0x58, 0x25, 0x00, 0x01, 0x71, 0x12, 0x20, 0x69, 0xea, 0x07, ++ 0x40, 0xf9, 0x80, 0x7a, 0x28, 0xf4, 0xd9, 0x32, 0xc6, 0x2e, 0x7c, 0x1c, ++ 0x83, 0xbe, 0x05, 0x5e, 0x55, 0x07, 0x2c, 0x90, 0x26, 0x6a, 0xb3, 0xe7, ++ 0x9d, 0xf6, 0x3a, 0x36, 0x5b ++ }; ++ Reader::Config config; ++ config.parse_tags = true; ++ auto cbor = Reader::Read(kTaggedCbor, config); ++ EXPECT_TRUE(cbor.has_value()); ++ auto& v = cbor.value(); ++ EXPECT_TRUE(v.has_tag()); ++ EXPECT_EQ(v.GetTag(),42UL); ++ EXPECT_TRUE(v.is_bytestring()); ++ EXPECT_EQ(v.type(), Value::Type::BYTE_STRING); ++ auto& bytes = v.GetBytestring(); ++ EXPECT_EQ(bytes.size(), 37UL); ++ EXPECT_EQ(bytes.at(0), 0x00);//identity multibase (e.g. not base-encoded, bytes are themselves) ++ EXPECT_EQ(bytes.at(1), 0x01);//CID version 1 ++ EXPECT_EQ(bytes.at(2), 0x71);//codec = dag-cbor ++ EXPECT_EQ(bytes.at(3), 0x12);//multihash = 18 = sha2-256 ++ EXPECT_EQ(bytes.at(4), 0x20);//hash length = 32 bytes ++ EXPECT_EQ(bytes.at(5), 0x69);//first byte of hash digest ++ EXPECT_EQ(bytes.at(36),0x5b);//last byte of hash digest ++} + + } // namespace cbor diff --git a/chromium_edits/125.0.6382.3/components/cbor/values.cc.patch b/chromium_edits/125.0.6382.3/components/cbor/values.cc.patch new file mode 100644 index 00000000..ddbab2b3 --- /dev/null +++ b/chromium_edits/125.0.6382.3/components/cbor/values.cc.patch @@ -0,0 +1,145 @@ +diff --git a/components/cbor/values.cc b/components/cbor/values.cc +index 02498209c820e..34055aef24cfe 100644 +--- a/components/cbor/values.cc ++++ b/components/cbor/values.cc +@@ -66,32 +66,34 @@ Value::Value(Type type) : type_(type) { + NOTREACHED(); + } + +-Value::Value(SimpleValue in_simple) +- : type_(Type::SIMPLE_VALUE), simple_value_(in_simple) { ++Value::Value(SimpleValue in_simple, uint64_t tag) ++ : type_(Type::SIMPLE_VALUE), simple_value_(in_simple), tag_(tag) { + CHECK(static_cast(in_simple) >= 20 && static_cast(in_simple) <= 23); + } + +-Value::Value(bool boolean_value) : type_(Type::SIMPLE_VALUE) { ++Value::Value(bool boolean_value, uint64_t tag) : type_(Type::SIMPLE_VALUE), tag_(tag) { + simple_value_ = boolean_value ? Value::SimpleValue::TRUE_VALUE + : Value::SimpleValue::FALSE_VALUE; + } + +-Value::Value(double float_value) +- : type_(Type::FLOAT_VALUE), float_value_(float_value) {} ++Value::Value(double float_value, uint64_t tag) ++ : type_(Type::FLOAT_VALUE), float_value_(float_value), tag_(tag) {} + +-Value::Value(int integer_value) +- : Value(base::checked_cast(integer_value)) {} ++Value::Value(int integer_value, uint64_t tag) ++ : Value(base::checked_cast(integer_value), tag) {} + +-Value::Value(int64_t integer_value) : integer_value_(integer_value) { ++Value::Value(int64_t integer_value, uint64_t tag) : integer_value_(integer_value), tag_(tag) { + type_ = integer_value >= 0 ? Type::UNSIGNED : Type::NEGATIVE; + } + +-Value::Value(base::span in_bytes) ++Value::Value(base::span in_bytes, uint64_t tag) + : type_(Type::BYTE_STRING), +- bytestring_value_(in_bytes.begin(), in_bytes.end()) {} ++ bytestring_value_(in_bytes.begin(), in_bytes.end()), ++ tag_(tag) ++ {} + +-Value::Value(base::span in_bytes, Type type) +- : type_(type), bytestring_value_(in_bytes.begin(), in_bytes.end()) { ++Value::Value(base::span in_bytes, Type type, uint64_t tag) ++ : type_(type), bytestring_value_(in_bytes.begin(), in_bytes.end()), tag_(tag) { + DCHECK(type_ == Type::BYTE_STRING || type_ == Type::INVALID_UTF8); + } + +@@ -117,7 +119,8 @@ Value::Value(std::string&& in_string, Type type) noexcept : type_(type) { + } + } + +-Value::Value(base::StringPiece in_string, Type type) : type_(type) { ++Value::Value(base::StringPiece 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) { + } + } + +-Value::Value(const ArrayValue& in_array) : type_(Type::ARRAY), array_value_() { ++Value::Value(const ArrayValue& in_array, uint64_t tag) ++: type_(Type::ARRAY), array_value_(), tag_(tag) { + array_value_.reserve(in_array.size()); + for (const auto& val : in_array) + array_value_.emplace_back(val.Clone()); + } + +-Value::Value(ArrayValue&& in_array) noexcept +- : type_(Type::ARRAY), array_value_(std::move(in_array)) {} ++Value::Value(ArrayValue&& in_array, uint64_t tag) noexcept ++ : type_(Type::ARRAY), array_value_(std::move(in_array)), tag_(tag) {} + +-Value::Value(const MapValue& in_map) : type_(Type::MAP), map_value_() { ++Value::Value(const MapValue& in_map, uint64_t tag) ++: type_(Type::MAP), map_value_(), tag_(tag) { + map_value_.reserve(in_map.size()); + for (const auto& it : in_map) + map_value_.emplace_hint(map_value_.end(), it.first.Clone(), +@@ -168,31 +173,36 @@ Value Value::Clone() const { + case Type::NONE: + return Value(); + case Type::INVALID_UTF8: +- return Value(bytestring_value_, Type::INVALID_UTF8); ++ return Value(bytestring_value_, Type::INVALID_UTF8, tag_); + case Type::UNSIGNED: + case Type::NEGATIVE: +- return Value(integer_value_); ++ return Value(integer_value_, tag_); + case Type::BYTE_STRING: +- return Value(bytestring_value_); ++ return Value(bytestring_value_, tag_); + case Type::STRING: +- return Value(string_value_); ++ return Value(string_value_, Type::STRING, tag_); + case Type::ARRAY: +- return Value(array_value_); ++ return Value(array_value_, tag_); + case Type::MAP: +- return Value(map_value_); ++ return Value(map_value_, tag_); + case Type::TAG: + NOTREACHED() << constants::kUnsupportedMajorType; + return Value(); + case Type::SIMPLE_VALUE: +- return Value(simple_value_); ++ return Value(simple_value_, tag_); + case Type::FLOAT_VALUE: +- return Value(float_value_); ++ return Value(float_value_, tag_); + } + + NOTREACHED(); + return Value(); + } + ++Value& Value::SetTag(uint64_t tag) noexcept { ++ tag_ = tag; ++ return *this; ++} ++ + Value::SimpleValue Value::GetSimpleValue() const { + CHECK(is_simple()); + return simple_value_; +@@ -258,9 +268,14 @@ const Value::BinaryValue& Value::GetInvalidUTF8() const { + return bytestring_value_; + } + ++uint64_t Value::GetTag() const { ++ CHECK(has_tag()); ++ return tag_; ++} ++ + void Value::InternalMoveConstructFrom(Value&& that) { + type_ = that.type_; +- ++ tag_ = that.tag_; + switch (type_) { + case Type::UNSIGNED: + case Type::NEGATIVE: diff --git a/chromium_edits/125.0.6382.3/components/cbor/values.h.patch b/chromium_edits/125.0.6382.3/components/cbor/values.h.patch new file mode 100644 index 00000000..ca39df01 --- /dev/null +++ b/chromium_edits/125.0.6382.3/components/cbor/values.h.patch @@ -0,0 +1,79 @@ +diff --git a/components/cbor/values.h b/components/cbor/values.h +index d81ef5607c55a..10216a8dcdc57 100644 +--- a/components/cbor/values.h ++++ b/components/cbor/values.h +@@ -127,28 +127,29 @@ class CBOR_EXPORT Value { + + explicit Value(Type type); + +- explicit Value(SimpleValue in_simple); +- explicit Value(bool boolean_value); +- explicit Value(double in_float); ++ explicit Value(SimpleValue in_simple, uint64_t tag = NO_TAG); ++ explicit Value(bool boolean_value, uint64_t tag = NO_TAG); ++ explicit Value(double in_float, uint64_t tag = NO_TAG); + +- explicit Value(int integer_value); +- explicit Value(int64_t integer_value); ++ explicit Value(int integer_value, uint64_t tag = NO_TAG); ++ explicit Value(int64_t integer_value, uint64_t tag = NO_TAG); + explicit Value(uint64_t integer_value) = delete; + +- explicit Value(base::span in_bytes); ++ explicit Value(base::span in_bytes, uint64_t tag = NO_TAG); + explicit Value(BinaryValue&& in_bytes) noexcept; + + 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(const ArrayValue& in_array); +- explicit Value(ArrayValue&& in_array) noexcept; ++ explicit Value(const ArrayValue& in_array, uint64_t tag = NO_TAG); ++ explicit Value(ArrayValue&& in_array, uint64_t tag = NO_TAG) noexcept; + +- explicit Value(const MapValue& in_map); ++ explicit Value(const MapValue& in_map, uint64_t tag = NO_TAG); + explicit Value(MapValue&& in_map) noexcept; + + Value& operator=(Value&& that) noexcept; ++ Value& SetTag(uint64_t) noexcept; + + Value(const Value&) = delete; + Value& operator=(const Value&) = delete; +@@ -179,6 +180,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; } ++ bool has_tag() const { return tag_ != NO_TAG; } + + // These will all fatally assert if the type doesn't match. + SimpleValue GetSimpleValue() const; +@@ -194,12 +196,13 @@ class CBOR_EXPORT Value { + const ArrayValue& GetArray() const; + const MapValue& GetMap() const; + const BinaryValue& GetInvalidUTF8() const; ++ uint64_t GetTag() const; + + private: + friend class Reader; + // This constructor allows INVALID_UTF8 values to be created, which only + // |Reader| and InvalidUTF8StringValueForTesting() may do. +- Value(base::span in_bytes, Type type); ++ Value(base::span in_bytes, Type type, uint64_t tag = NO_TAG); + + Type type_; + +@@ -213,6 +216,11 @@ class CBOR_EXPORT Value { + MapValue map_value_; + }; + ++ //This value specified as Invalid, ++ // used here to represent absence of TAG ++ constexpr static uint64_t NO_TAG = 0xFFFF; ++ uint64_t tag_ = NO_TAG; ++ + void InternalMoveConstructFrom(Value&& that); + void InternalCleanup(); + }; diff --git a/chromium_edits/125.0.6382.3/components/cbor/writer.cc.patch b/chromium_edits/125.0.6382.3/components/cbor/writer.cc.patch new file mode 100644 index 00000000..bb89c1e6 --- /dev/null +++ b/chromium_edits/125.0.6382.3/components/cbor/writer.cc.patch @@ -0,0 +1,14 @@ +diff --git a/components/cbor/writer.cc b/components/cbor/writer.cc +index f400a65e7b66a..fcdebb8f3b458 100644 +--- a/components/cbor/writer.cc ++++ b/components/cbor/writer.cc +@@ -47,6 +47,9 @@ bool Writer::EncodeCBOR(const Value& node, + if (max_nesting_level < 0) + return false; + ++ if (node.has_tag()) { ++ StartItem(Value::Type::TAG, node.GetTag()); ++ } + switch (node.type()) { + case Value::Type::NONE: { + StartItem(Value::Type::BYTE_STRING, 0); diff --git a/chromium_edits/125.0.6382.3/components/cbor/writer_unittest.cc.patch b/chromium_edits/125.0.6382.3/components/cbor/writer_unittest.cc.patch new file mode 100644 index 00000000..240fee83 --- /dev/null +++ b/chromium_edits/125.0.6382.3/components/cbor/writer_unittest.cc.patch @@ -0,0 +1,36 @@ +diff --git a/components/cbor/writer_unittest.cc b/components/cbor/writer_unittest.cc +index e3bffe20734bc..0ed569ae164a0 100644 +--- a/components/cbor/writer_unittest.cc ++++ b/components/cbor/writer_unittest.cc +@@ -522,4 +522,31 @@ TEST(CBORWriterTest, OverlyNestedCBOR) { + EXPECT_FALSE(Writer::Write(Value(map), 4).has_value()); + } + ++TEST(CBORWriterTest, CanWriteTag) { ++ std::array content{ ++ 0x00, 0x01, 0x71, 0x12, 0x20, ++ 0x69, 0xea, 0x07, 0x40, 0xf9, ++ 0x80, 0x7a, 0x28, 0xf4, 0xd9, ++ 0x32, 0xc6, 0x2e, 0x7c, 0x1c, ++ 0x83, 0xbe, 0x05, 0x5e, 0x55, ++ 0x07, 0x2c, 0x90, 0x26, 0x6a, ++ 0xb3, 0xe7, 0x9d, 0xf6, 0x3a, ++ 0x36, 0x5b ++ }; ++ Value to_write(content); ++ to_write.SetTag(42); ++ auto result = Writer::Write(to_write); ++ EXPECT_TRUE(result.has_value()); ++ auto& bytes = result.value(); ++ EXPECT_EQ(bytes.size(), 41UL); ++ EXPECT_EQ(bytes.at(0), 0xd8); ++ EXPECT_EQ(bytes.at(1), 0x2a); ++ EXPECT_EQ(bytes.at(2), 0x58); ++ EXPECT_EQ(bytes.at(3), 0x25); ++ for (auto i = 0UL; i < content.size(); ++i) { ++ ASSERT_LT(i + 4UL, bytes.size()); ++ ASSERT_EQ(content.at(i), bytes.at(i+4UL)); ++ } ++} ++ + } // namespace cbor diff --git a/chromium_edits/125.0.6382.3/components/open_from_clipboard/clipboard_recent_content_generic.cc.patch b/chromium_edits/125.0.6382.3/components/open_from_clipboard/clipboard_recent_content_generic.cc.patch new file mode 100644 index 00000000..291d84f1 --- /dev/null +++ b/chromium_edits/125.0.6382.3/components/open_from_clipboard/clipboard_recent_content_generic.cc.patch @@ -0,0 +1,13 @@ +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 +--- a/components/open_from_clipboard/clipboard_recent_content_generic.cc ++++ b/components/open_from_clipboard/clipboard_recent_content_generic.cc +@@ -20,7 +20,7 @@ + namespace { + // Schemes appropriate for suggestion by ClipboardRecentContent. + const char* kAuthorizedSchemes[] = { +- url::kAboutScheme, url::kDataScheme, url::kHttpScheme, url::kHttpsScheme, ++ url::kAboutScheme, url::kDataScheme, url::kHttpScheme, url::kHttpsScheme, "ipfs", "ipns" + // TODO(mpearson): add support for chrome:// URLs. Right now the scheme + // for that lives in content and is accessible via + // GetEmbedderRepresentationOfAboutScheme() or content::kChromeUIScheme diff --git a/chromium_edits/125.0.6382.3/net/dns/dns_config_service_linux.cc.patch b/chromium_edits/125.0.6382.3/net/dns/dns_config_service_linux.cc.patch new file mode 100644 index 00000000..3b042d33 --- /dev/null +++ b/chromium_edits/125.0.6382.3/net/dns/dns_config_service_linux.cc.patch @@ -0,0 +1,18 @@ +diff --git a/net/dns/dns_config_service_linux.cc b/net/dns/dns_config_service_linux.cc +index f909f127ba3e1..31d7f9d58c0af 100644 +--- a/net/dns/dns_config_service_linux.cc ++++ b/net/dns/dns_config_service_linux.cc +@@ -271,11 +271,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; +- ++ case NsswitchReader::Service::kResolve: ++ break; + case NsswitchReader::Service::kMdns: + case NsswitchReader::Service::kMdns4: + case NsswitchReader::Service::kMdns6: +- case NsswitchReader::Service::kResolve: + case NsswitchReader::Service::kNis: + RecordIncompatibleNsswitchReason( + IncompatibleNsswitchReason::kIncompatibleService, diff --git a/chromium_edits/125.0.6382.3/third_party/blink/renderer/platform/weborigin/scheme_registry.cc.patch b/chromium_edits/125.0.6382.3/third_party/blink/renderer/platform/weborigin/scheme_registry.cc.patch new file mode 100644 index 00000000..119d72b2 --- /dev/null +++ b/chromium_edits/125.0.6382.3/third_party/blink/renderer/platform/weborigin/scheme_registry.cc.patch @@ -0,0 +1,13 @@ +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 +--- 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 { + // 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"}), ++ fetch_api_schemes({"http", "https", "ipfs", "ipns"}), + allowed_in_referrer_schemes({"http", "https"}) { + for (auto& scheme : url::GetCorsEnabledSchemes()) + cors_enabled_schemes.insert(scheme.c_str()); diff --git a/chromium_edits/125.0.6382.3/url/BUILD.gn.patch b/chromium_edits/125.0.6382.3/url/BUILD.gn.patch new file mode 100644 index 00000000..201770c4 --- /dev/null +++ b/chromium_edits/125.0.6382.3/url/BUILD.gn.patch @@ -0,0 +1,32 @@ +diff --git a/url/BUILD.gn b/url/BUILD.gn +index aedf1bf9f80be..b11c73a88aae5 100644 +--- a/url/BUILD.gn ++++ b/url/BUILD.gn +@@ -5,6 +5,7 @@ + import("//build/buildflag_header.gni") + import("//testing/libfuzzer/fuzzer_test.gni") + import("//testing/test.gni") ++import("//third_party/ipfs_client/args.gni") + import("features.gni") + + import("//build/config/cronet/config.gni") +@@ -67,6 +68,7 @@ component("url") { + public_deps = [ + "//base", + "//build:robolectric_buildflags", ++ "//third_party/ipfs_client:ipfs_buildflags", + ] + + configs += [ "//build/config/compiler:wexit_time_destructors" ] +@@ -89,6 +91,11 @@ component("url") { + public_configs = [ "//third_party/jdk" ] + } + ++ if (enable_ipfs) { ++ sources += [ "url_canon_ipfs.cc" ] ++ deps += [ "//third_party/ipfs_client:ipfs_client" ] ++ } ++ + if (is_win) { + # Don't conflict with Windows' "url.dll". + output_name = "url_lib" diff --git a/chromium_edits/125.0.6382.3/url/url_canon.h.patch b/chromium_edits/125.0.6382.3/url/url_canon.h.patch new file mode 100644 index 00000000..71d7a758 --- /dev/null +++ b/chromium_edits/125.0.6382.3/url/url_canon.h.patch @@ -0,0 +1,28 @@ +diff --git a/url/url_canon.h b/url/url_canon.h +index bd40235e4aa85..05d250fe1b746 100644 +--- a/url/url_canon.h ++++ b/url/url_canon.h +@@ -815,6 +815,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/125.0.6382.3/url/url_canon_ipfs.cc b/chromium_edits/125.0.6382.3/url/url_canon_ipfs.cc new file mode 100644 index 00000000..d7c9fdc7 --- /dev/null +++ b/chromium_edits/125.0.6382.3/url/url_canon_ipfs.cc @@ -0,0 +1,55 @@ +#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/125.0.6382.3/url/url_util.cc.patch b/chromium_edits/125.0.6382.3/url/url_util.cc.patch new file mode 100644 index 00000000..3850fcfe --- /dev/null +++ b/chromium_edits/125.0.6382.3/url/url_util.cc.patch @@ -0,0 +1,22 @@ +diff --git a/url/url_util.cc b/url/url_util.cc +index 82b27b8f59684..2f3045adefaa7 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/125.0.6396.3/chrome/browser/BUILD.gn.patch b/chromium_edits/125.0.6396.3/chrome/browser/BUILD.gn.patch new file mode 100644 index 00000000..6c3b8bd5 --- /dev/null +++ b/chromium_edits/125.0.6396.3/chrome/browser/BUILD.gn.patch @@ -0,0 +1,27 @@ +diff --git a/chrome/browser/BUILD.gn b/chrome/browser/BUILD.gn +index 94380071080fc..6e6e14b64560b 100644 +--- a/chrome/browser/BUILD.gn ++++ b/chrome/browser/BUILD.gn +@@ -39,6 +39,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") +@@ -2693,6 +2694,14 @@ static_library("browser") { + ] + } + ++ if (enable_ipfs) { ++ sources += [ ++ "ipfs_extra_parts.cc", ++ "ipfs_extra_parts.h", ++ ] ++ deps += [ "//components/ipfs" ] ++ } ++ + if (is_chromeos_ash) { + deps += [ "//chrome/browser/screen_ai:screen_ai_dlc_installer" ] + } diff --git a/chromium_edits/125.0.6396.3/chrome/browser/about_flags.cc.patch b/chromium_edits/125.0.6396.3/chrome/browser/about_flags.cc.patch new file mode 100644 index 00000000..7794a4db --- /dev/null +++ b/chromium_edits/125.0.6396.3/chrome/browser/about_flags.cc.patch @@ -0,0 +1,38 @@ +diff --git a/chrome/browser/about_flags.cc b/chrome/browser/about_flags.cc +index 38600860d9e5b..a7d975f1971d3 100644 +--- a/chrome/browser/about_flags.cc ++++ b/chrome/browser/about_flags.cc +@@ -215,6 +215,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" ++#include "third_party/ipfs_client/ipfs_buildflags.h" + #include "ui/accessibility/accessibility_features.h" + #include "ui/accessibility/accessibility_switches.h" + #include "ui/base/ozone_buildflags.h" +@@ -309,6 +310,10 @@ + #include "extensions/common/switches.h" + #endif // BUILDFLAG(ENABLE_EXTENSIONS) + ++#if BUILDFLAG(ENABLE_IPFS) ++#include "components/ipfs/ipfs_features.h" ++#endif ++ + #if BUILDFLAG(ENABLE_PDF) + #include "pdf/pdf_features.h" + #endif +@@ -9554,6 +9559,14 @@ const FeatureEntry kFeatureEntries[] = { + flag_descriptions::kOmitCorsClientCertDescription, kOsAll, + FEATURE_VALUE_TYPE(network::features::kOmitCorsClientCert)}, + ++#if BUILDFLAG(ENABLE_IPFS) ++ {"enable-ipfs", ++ flag_descriptions::kEnableIpfsName, ++ flag_descriptions::kEnableIpfsDescription, ++ kOsMac | kOsWin | kOsLinux,//TODO: These are the only variants currently getting built, but that is not likely to remain the case ++ FEATURE_VALUE_TYPE(ipfs::kEnableIpfs)}, ++#endif ++ + {"use-idna2008-non-transitional", + flag_descriptions::kUseIDNA2008NonTransitionalName, + flag_descriptions::kUseIDNA2008NonTransitionalDescription, kOsAll, diff --git a/chromium_edits/125.0.6396.3/chrome/browser/autocomplete/chrome_autocomplete_scheme_classifier.cc.patch b/chromium_edits/125.0.6396.3/chrome/browser/autocomplete/chrome_autocomplete_scheme_classifier.cc.patch new file mode 100644 index 00000000..4d172311 --- /dev/null +++ b/chromium_edits/125.0.6396.3/chrome/browser/autocomplete/chrome_autocomplete_scheme_classifier.cc.patch @@ -0,0 +1,50 @@ +diff --git a/chrome/browser/autocomplete/chrome_autocomplete_scheme_classifier.cc b/chrome/browser/autocomplete/chrome_autocomplete_scheme_classifier.cc +index 4c88614c68c25..f8bb12a3b0c2e 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" ++#include "third_party/ipfs_client/ipfs_buildflags.h" ++ + #if BUILDFLAG(IS_ANDROID) + #include "chrome/browser/profiles/profile_android.h" + #endif +@@ -18,6 +20,9 @@ + #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 (scheme.empty()) { + return metrics::OmniboxInputType::EMPTY; + } +- if (base::IsStringASCII(scheme) && +- (ProfileIOData::IsHandledProtocol(scheme) || +- base::EqualsCaseInsensitiveASCII(scheme, content::kViewSourceScheme) || +- base::EqualsCaseInsensitiveASCII(scheme, url::kJavaScriptScheme) || +- base::EqualsCaseInsensitiveASCII(scheme, url::kDataScheme))) { +- return metrics::OmniboxInputType::URL; ++ if (base::IsStringASCII(scheme)) { ++ if (ProfileIOData::IsHandledProtocol(scheme) || ++ base::EqualsCaseInsensitiveASCII(scheme, content::kViewSourceScheme) || ++ base::EqualsCaseInsensitiveASCII(scheme, url::kJavaScriptScheme) || ++ base::EqualsCaseInsensitiveASCII(scheme, url::kDataScheme)) { ++ return metrics::OmniboxInputType::URL; ++ } ++#if BUILDFLAG(ENABLE_IPFS) ++ if (base::FeatureList::IsEnabled(ipfs::kEnableIpfs) && ++ (base::EqualsCaseInsensitiveASCII(scheme, "ipfs") || base::EqualsCaseInsensitiveASCII(scheme, "ipns")) ++ ) { ++ return metrics::OmniboxInputType::URL; ++ } ++#endif + } + + // Also check for schemes registered via registerProtocolHandler(), which diff --git a/chromium_edits/125.0.6396.3/chrome/browser/chrome_content_browser_client.cc.patch b/chromium_edits/125.0.6396.3/chrome/browser/chrome_content_browser_client.cc.patch new file mode 100644 index 00000000..b3b5d473 --- /dev/null +++ b/chromium_edits/125.0.6396.3/chrome/browser/chrome_content_browser_client.cc.patch @@ -0,0 +1,77 @@ +diff --git a/chrome/browser/chrome_content_browser_client.cc b/chrome/browser/chrome_content_browser_client.cc +index d5db808781f83..45056e3cfc6f1 100644 +--- a/chrome/browser/chrome_content_browser_client.cc ++++ b/chrome/browser/chrome_content_browser_client.cc +@@ -384,6 +384,7 @@ + #include "third_party/blink/public/common/switches.h" + #include "third_party/blink/public/mojom/browsing_topics/browsing_topics.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" +@@ -506,6 +507,13 @@ + #include "chrome/browser/fuchsia/chrome_browser_main_parts_fuchsia.h" + #endif + ++#if BUILDFLAG(ENABLE_IPFS) ++#include "chrome/browser/ipfs_extra_parts.h" ++#include "components/ipfs/interceptor.h" ++#include "components/ipfs/ipfs_features.h" ++#include "components/ipfs/url_loader_factory.h" ++#endif ++ + #if !BUILDFLAG(IS_ANDROID) + #include "chrome/browser/preloading/preview/preview_navigation_throttle.h" + #include "chrome/browser/web_applications/isolated_web_apps/chrome_content_browser_client_isolated_web_apps_part.h" +@@ -1725,6 +1733,11 @@ ChromeContentBrowserClient::CreateBrowserMainParts(bool is_integration_test) { + main_parts->AddParts( + std::make_unique()); + ++#if BUILDFLAG(ENABLE_IPFS) ++ if (base::FeatureList::IsEnabled(ipfs::kEnableIpfs)) { ++ main_parts->AddParts(std::make_unique()); ++ } ++#endif + return main_parts; + } + +@@ -6175,12 +6188,25 @@ void ChromeContentBrowserClient:: + const std::optional& request_initiator_origin, + NonNetworkURLLoaderFactoryMap* factories) { + #if BUILDFLAG(IS_CHROMEOS_ASH) || BUILDFLAG(ENABLE_EXTENSIONS) || \ +- !BUILDFLAG(IS_ANDROID) ++ !BUILDFLAG(IS_ANDROID) || BUILDFLAG(ENABLE_IPFS) + content::RenderFrameHost* frame_host = + 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) ++#if BUILDFLAG(ENABLE_IPFS) ++ 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( ++ factories, ++ context, ++ default_factory, ++ GetSystemNetworkContext(), ++ Profile::FromBrowserContext(context)->GetPrefs() ++ ); ++ } ++#endif // BUILDFLAG(ENABLE_IPFS) + + #if BUILDFLAG(IS_CHROMEOS_ASH) + if (web_contents) { +@@ -6314,6 +6340,11 @@ ChromeContentBrowserClient::WillCreateURLLoaderRequestInterceptors( + scoped_refptr navigation_response_task_runner) { + std::vector> + interceptors; ++#if BUILDFLAG(ENABLE_IPFS) ++ if (base::FeatureList::IsEnabled(ipfs::kEnableIpfs)) { ++ interceptors.push_back(std::make_unique(g_browser_process->system_network_context_manager()->GetURLLoaderFactory(), GetSystemNetworkContext())); ++ } ++#endif + #if BUILDFLAG(ENABLE_OFFLINE_PAGES) + interceptors.push_back( + std::make_unique( diff --git a/chromium_edits/125.0.6396.3/chrome/browser/flag-metadata.json.patch b/chromium_edits/125.0.6396.3/chrome/browser/flag-metadata.json.patch new file mode 100644 index 00000000..ad068ba9 --- /dev/null +++ b/chromium_edits/125.0.6396.3/chrome/browser/flag-metadata.json.patch @@ -0,0 +1,16 @@ +diff --git a/chrome/browser/flag-metadata.json b/chrome/browser/flag-metadata.json +index f5f5f5081974f..0ee831ea6645b 100644 +--- a/chrome/browser/flag-metadata.json ++++ b/chrome/browser/flag-metadata.json +@@ -3132,6 +3132,11 @@ + "owners": [ "adamta@google.com", "chrome-feed-fundamentals@google.com" ], + "expiry_milestone": 130 + }, ++ { ++ "name": "enable-ipfs", ++ "owners": [ "//components/ipfs/OWNERS" ], ++ "expiry_milestone": 150 ++ }, + { + "name": "enable-isolated-sandboxed-iframes", + "owners": [ "wjmaclean@chromium.org", "alexmos@chromium.org", "creis@chromium.org" ], diff --git a/chromium_edits/125.0.6396.3/chrome/browser/flag_descriptions.cc.patch b/chromium_edits/125.0.6396.3/chrome/browser/flag_descriptions.cc.patch new file mode 100644 index 00000000..b07d85df --- /dev/null +++ b/chromium_edits/125.0.6396.3/chrome/browser/flag_descriptions.cc.patch @@ -0,0 +1,16 @@ +diff --git a/chrome/browser/flag_descriptions.cc b/chrome/browser/flag_descriptions.cc +index 50ab6dddbcddc..0eaaaa3a28fb1 100644 +--- a/chrome/browser/flag_descriptions.cc ++++ b/chrome/browser/flag_descriptions.cc +@@ -312,6 +312,11 @@ const char kEnableBenchmarkingChoiceDefaultFeatureStates[] = + const char kEnableBenchmarkingChoiceMatchFieldTrialTestingConfig[] = + "Match Field Trial Testing Config"; + ++#if BUILDFLAG(ENABLE_IPFS) ++extern const char kEnableIpfsName[] = "Enable IPFS"; ++extern const char kEnableIpfsDescription[] = "Enable ipfs:// and ipns:// URLs"; ++#endif ++ + const char kPreloadingOnPerformancePageName[] = + "Preloading Settings on Performance Page"; + const char kPreloadingOnPerformancePageDescription[] = diff --git a/chromium_edits/125.0.6396.3/chrome/browser/flag_descriptions.h.patch b/chromium_edits/125.0.6396.3/chrome/browser/flag_descriptions.h.patch new file mode 100644 index 00000000..3d137c50 --- /dev/null +++ b/chromium_edits/125.0.6396.3/chrome/browser/flag_descriptions.h.patch @@ -0,0 +1,24 @@ +diff --git a/chrome/browser/flag_descriptions.h b/chrome/browser/flag_descriptions.h +index 12f08dd18eddc..ca2e551b63508 100644 +--- a/chrome/browser/flag_descriptions.h ++++ b/chrome/browser/flag_descriptions.h +@@ -23,6 +23,7 @@ + #include "pdf/buildflags.h" + #include "printing/buildflags/buildflags.h" + #include "third_party/blink/public/common/buildflags.h" ++#include "third_party/ipfs_client/ipfs_buildflags.h" + + // This file declares strings used in chrome://flags. These messages are not + // translated, because instead of end-users they target Chromium developers and +@@ -192,6 +193,11 @@ extern const char kEnableBenchmarkingChoiceDisabled[]; + extern const char kEnableBenchmarkingChoiceDefaultFeatureStates[]; + extern const char kEnableBenchmarkingChoiceMatchFieldTrialTestingConfig[]; + ++#if BUILDFLAG(ENABLE_IPFS) ++extern const char kEnableIpfsName[]; ++extern const char kEnableIpfsDescription[]; ++#endif ++ + #if BUILDFLAG(USE_FONTATIONS_BACKEND) + extern const char kFontationsFontBackendName[]; + extern const char kFontationsFontBackendDescription[]; diff --git a/chromium_edits/125.0.6396.3/chrome/browser/ipfs_extra_parts.cc b/chromium_edits/125.0.6396.3/chrome/browser/ipfs_extra_parts.cc new file mode 100644 index 00000000..90d2596f --- /dev/null +++ b/chromium_edits/125.0.6396.3/chrome/browser/ipfs_extra_parts.cc @@ -0,0 +1,10 @@ +#include "ipfs_extra_parts.h" + +#include "profiles/profile.h" + +#include + +void IpfsExtraParts::PostProfileInit(Profile* profile, bool /* is_initial_profile */ ) { + DCHECK(profile); + ipfs::InterRequestState::CreateForBrowserContext(profile, profile->GetPrefs()); +} diff --git a/chromium_edits/125.0.6396.3/chrome/browser/ipfs_extra_parts.h b/chromium_edits/125.0.6396.3/chrome/browser/ipfs_extra_parts.h new file mode 100644 index 00000000..2059c437 --- /dev/null +++ b/chromium_edits/125.0.6396.3/chrome/browser/ipfs_extra_parts.h @@ -0,0 +1,10 @@ +#ifndef IPFS_EXTRA_PART_H_ +#define IPFS_EXTRA_PART_H_ + +#include + +class IpfsExtraParts : public ChromeBrowserMainExtraParts { + void PostProfileInit(Profile* profile, bool is_initial_profile) override; +}; + +#endif // IPFS_EXTRA_PART_H_ diff --git a/chromium_edits/125.0.6396.3/chrome/browser/prefs/browser_prefs.cc.patch b/chromium_edits/125.0.6396.3/chrome/browser/prefs/browser_prefs.cc.patch new file mode 100644 index 00000000..c7b1d324 --- /dev/null +++ b/chromium_edits/125.0.6396.3/chrome/browser/prefs/browser_prefs.cc.patch @@ -0,0 +1,37 @@ +diff --git a/chrome/browser/prefs/browser_prefs.cc b/chrome/browser/prefs/browser_prefs.cc +index 8c13577c0d847..75932b2fa5e9d 100644 +--- a/chrome/browser/prefs/browser_prefs.cc ++++ b/chrome/browser/prefs/browser_prefs.cc +@@ -189,6 +189,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" +@@ -233,6 +235,11 @@ + #include "chrome/browser/pdf/pdf_pref_names.h" + #endif // BUILDFLAG(ENABLE_PDF) + ++#if BUILDFLAG(ENABLE_IPFS) ++#include "components/ipfs/ipfs_features.h" ++#include "components/ipfs/preferences.h" ++#endif ++ + #if BUILDFLAG(ENABLE_SCREEN_AI_SERVICE) + #include "chrome/browser/screen_ai/pref_names.h" + #endif +@@ -1791,6 +1798,11 @@ void RegisterProfilePrefs(user_prefs::PrefRegistrySyncable* registry, + IncognitoModePrefs::RegisterProfilePrefs(registry); + invalidation::PerUserTopicSubscriptionManager::RegisterProfilePrefs(registry); + invalidation::InvalidatorRegistrarWithMemory::RegisterProfilePrefs(registry); ++#if BUILDFLAG(ENABLE_IPFS) ++ if (base::FeatureList::IsEnabled(ipfs::kEnableIpfs)) { ++ ipfs::RegisterPreferences(registry); ++ } ++#endif + language::LanguagePrefs::RegisterProfilePrefs(registry); + login_detection::prefs::RegisterProfilePrefs(registry); + lookalikes::RegisterProfilePrefs(registry); diff --git a/chromium_edits/125.0.6396.3/chrome/common/chrome_content_client.cc.patch b/chromium_edits/125.0.6396.3/chrome/common/chrome_content_client.cc.patch new file mode 100644 index 00000000..59ea01c2 --- /dev/null +++ b/chromium_edits/125.0.6396.3/chrome/common/chrome_content_client.cc.patch @@ -0,0 +1,17 @@ +diff --git a/chrome/common/chrome_content_client.cc b/chrome/common/chrome_content_client.cc +index 2f016718fdd3c..bc38d5c2e4d8e 100644 +--- a/chrome/common/chrome_content_client.cc ++++ b/chrome/common/chrome_content_client.cc +@@ -302,6 +302,12 @@ void ChromeContentClient::AddAdditionalSchemes(Schemes* schemes) { + #if BUILDFLAG(IS_ANDROID) + schemes->local_schemes.push_back(url::kContentScheme); + #endif ++ for ( const char* ip_s : {"ipfs", "ipns"} ) { ++ schemes->standard_schemes.push_back(ip_s); ++ schemes->cors_enabled_schemes.push_back(ip_s); ++ schemes->secure_schemes.push_back(ip_s); ++ schemes->csp_bypassing_schemes.push_back(ip_s); ++ } + } + + std::u16string ChromeContentClient::GetLocalizedString(int message_id) { diff --git a/chromium_edits/125.0.6396.3/components/cbor/reader.cc.patch b/chromium_edits/125.0.6396.3/components/cbor/reader.cc.patch new file mode 100644 index 00000000..a9c4a7b3 --- /dev/null +++ b/chromium_edits/125.0.6396.3/components/cbor/reader.cc.patch @@ -0,0 +1,44 @@ +diff --git a/components/cbor/reader.cc b/components/cbor/reader.cc +index 3c31e3d05e5d3..5ad0dbb183884 100644 +--- a/components/cbor/reader.cc ++++ b/components/cbor/reader.cc +@@ -22,7 +22,7 @@ + namespace cbor { + + namespace constants { +-const char kUnsupportedMajorType[] = "Unsupported major type."; ++const char kUnsupportedMajorType[] = "Unsupported major type operation."; + } + + namespace { +@@ -156,7 +156,11 @@ std::optional Reader::DecodeCompleteDataItem(const Config& config, + case Value::Type::FLOAT_VALUE: + // Floating point values also go here since they are also type 7. + return DecodeToSimpleValueOrFloat(*header, config); +- case Value::Type::TAG: // We explicitly don't support TAG. ++ case Value::Type::TAG: ++ if (config.parse_tags) { ++ return ReadTagContent(*header, config, max_nesting_level); ++ } ++ break; + case Value::Type::NONE: + case Value::Type::INVALID_UTF8: + break; +@@ -347,6 +351,17 @@ std::optional Reader::ReadByteStringContent( + return Value(std::move(cbor_byte_string)); + } + ++std::optional Reader::ReadTagContent( ++ const Reader::DataItemHeader& header, ++ const Config& config, ++ int max_nesting_level) { ++ auto tagged_content = DecodeCompleteDataItem(config, max_nesting_level); ++ if (tagged_content.has_value()) { ++ tagged_content.value().SetTag(header.value); ++ } ++ return tagged_content; ++} ++ + std::optional Reader::ReadArrayContent( + const Reader::DataItemHeader& header, + const Config& config, diff --git a/chromium_edits/125.0.6396.3/components/cbor/reader.h.patch b/chromium_edits/125.0.6396.3/components/cbor/reader.h.patch new file mode 100644 index 00000000..cd7d9eb0 --- /dev/null +++ b/chromium_edits/125.0.6396.3/components/cbor/reader.h.patch @@ -0,0 +1,26 @@ +diff --git a/components/cbor/reader.h b/components/cbor/reader.h +index 73c5dcb23e555..a933768608d73 100644 +--- a/components/cbor/reader.h ++++ b/components/cbor/reader.h +@@ -130,6 +130,11 @@ class CBOR_EXPORT Reader { + // during decoding will set raise the `UNSUPPORTED_FLOATING_POINT_VALUE` + // error. + bool allow_floating_point = false; ++ ++ // If the parser encounters a TAG element, should it be parsed out and ++ // the tag value saved (true), or should the entire node and its content ++ // be discarded (false) ++ bool parse_tags = false; + }; + + Reader(const Reader&) = delete; +@@ -204,6 +209,9 @@ class CBOR_EXPORT Reader { + std::optional ReadMapContent(const DataItemHeader& header, + const Config& config, + int max_nesting_level); ++ std::optional ReadTagContent(const DataItemHeader& header, ++ const Config& config, ++ int max_nesting_level); + std::optional ReadByte(); + std::optional> ReadBytes(uint64_t num_bytes); + bool IsKeyInOrder(const Value& new_key, diff --git a/chromium_edits/125.0.6396.3/components/cbor/reader_unittest.cc.patch b/chromium_edits/125.0.6396.3/components/cbor/reader_unittest.cc.patch new file mode 100644 index 00000000..150e0c73 --- /dev/null +++ b/chromium_edits/125.0.6396.3/components/cbor/reader_unittest.cc.patch @@ -0,0 +1,47 @@ +diff --git a/components/cbor/reader_unittest.cc b/components/cbor/reader_unittest.cc +index e5c02ceea3402..f26b8e77f6da3 100644 +--- a/components/cbor/reader_unittest.cc ++++ b/components/cbor/reader_unittest.cc +@@ -1449,5 +1449,42 @@ TEST(CBORReaderTest, AllowInvalidUTF8) { + EXPECT_FALSE(cbor); + EXPECT_EQ(Reader::DecoderError::INVALID_UTF8, error); + } ++TEST(CBORReaderTest, RejectsTagUnderDefaultConfig) { ++ static const uint8_t kTaggedCbor[] = { ++ 0xd8, 0x2a, 0x58, 0x25, 0x00, 0x01, 0x71, 0x12, 0x20, 0x69, 0xea, 0x07, ++ 0x40, 0xf9, 0x80, 0x7a, 0x28, 0xf4, 0xd9, 0x32, 0xc6, 0x2e, 0x7c, 0x1c, ++ 0x83, 0xbe, 0x05, 0x5e, 0x55, 0x07, 0x2c, 0x90, 0x26, 0x6a, 0xb3, 0xe7, ++ 0x9d, 0xf6, 0x3a, 0x36, 0x5b ++ }; ++ Reader::Config config; ++ auto cbor = Reader::Read(kTaggedCbor, config); ++ EXPECT_FALSE(cbor.has_value()); ++} ++TEST(CBORReaderTest, ReadsTagWhenConfiguredToDoSo) { ++ static const uint8_t kTaggedCbor[] = { ++ 0xd8, 0x2a, 0x58, 0x25, 0x00, 0x01, 0x71, 0x12, 0x20, 0x69, 0xea, 0x07, ++ 0x40, 0xf9, 0x80, 0x7a, 0x28, 0xf4, 0xd9, 0x32, 0xc6, 0x2e, 0x7c, 0x1c, ++ 0x83, 0xbe, 0x05, 0x5e, 0x55, 0x07, 0x2c, 0x90, 0x26, 0x6a, 0xb3, 0xe7, ++ 0x9d, 0xf6, 0x3a, 0x36, 0x5b ++ }; ++ Reader::Config config; ++ config.parse_tags = true; ++ auto cbor = Reader::Read(kTaggedCbor, config); ++ EXPECT_TRUE(cbor.has_value()); ++ auto& v = cbor.value(); ++ EXPECT_TRUE(v.has_tag()); ++ EXPECT_EQ(v.GetTag(),42UL); ++ EXPECT_TRUE(v.is_bytestring()); ++ EXPECT_EQ(v.type(), Value::Type::BYTE_STRING); ++ auto& bytes = v.GetBytestring(); ++ EXPECT_EQ(bytes.size(), 37UL); ++ EXPECT_EQ(bytes.at(0), 0x00);//identity multibase (e.g. not base-encoded, bytes are themselves) ++ EXPECT_EQ(bytes.at(1), 0x01);//CID version 1 ++ EXPECT_EQ(bytes.at(2), 0x71);//codec = dag-cbor ++ EXPECT_EQ(bytes.at(3), 0x12);//multihash = 18 = sha2-256 ++ EXPECT_EQ(bytes.at(4), 0x20);//hash length = 32 bytes ++ EXPECT_EQ(bytes.at(5), 0x69);//first byte of hash digest ++ EXPECT_EQ(bytes.at(36),0x5b);//last byte of hash digest ++} + + } // namespace cbor diff --git a/chromium_edits/125.0.6396.3/components/cbor/values.cc.patch b/chromium_edits/125.0.6396.3/components/cbor/values.cc.patch new file mode 100644 index 00000000..ddbab2b3 --- /dev/null +++ b/chromium_edits/125.0.6396.3/components/cbor/values.cc.patch @@ -0,0 +1,145 @@ +diff --git a/components/cbor/values.cc b/components/cbor/values.cc +index 02498209c820e..34055aef24cfe 100644 +--- a/components/cbor/values.cc ++++ b/components/cbor/values.cc +@@ -66,32 +66,34 @@ Value::Value(Type type) : type_(type) { + NOTREACHED(); + } + +-Value::Value(SimpleValue in_simple) +- : type_(Type::SIMPLE_VALUE), simple_value_(in_simple) { ++Value::Value(SimpleValue in_simple, uint64_t tag) ++ : type_(Type::SIMPLE_VALUE), simple_value_(in_simple), tag_(tag) { + CHECK(static_cast(in_simple) >= 20 && static_cast(in_simple) <= 23); + } + +-Value::Value(bool boolean_value) : type_(Type::SIMPLE_VALUE) { ++Value::Value(bool boolean_value, uint64_t tag) : type_(Type::SIMPLE_VALUE), tag_(tag) { + simple_value_ = boolean_value ? Value::SimpleValue::TRUE_VALUE + : Value::SimpleValue::FALSE_VALUE; + } + +-Value::Value(double float_value) +- : type_(Type::FLOAT_VALUE), float_value_(float_value) {} ++Value::Value(double float_value, uint64_t tag) ++ : type_(Type::FLOAT_VALUE), float_value_(float_value), tag_(tag) {} + +-Value::Value(int integer_value) +- : Value(base::checked_cast(integer_value)) {} ++Value::Value(int integer_value, uint64_t tag) ++ : Value(base::checked_cast(integer_value), tag) {} + +-Value::Value(int64_t integer_value) : integer_value_(integer_value) { ++Value::Value(int64_t integer_value, uint64_t tag) : integer_value_(integer_value), tag_(tag) { + type_ = integer_value >= 0 ? Type::UNSIGNED : Type::NEGATIVE; + } + +-Value::Value(base::span in_bytes) ++Value::Value(base::span in_bytes, uint64_t tag) + : type_(Type::BYTE_STRING), +- bytestring_value_(in_bytes.begin(), in_bytes.end()) {} ++ bytestring_value_(in_bytes.begin(), in_bytes.end()), ++ tag_(tag) ++ {} + +-Value::Value(base::span in_bytes, Type type) +- : type_(type), bytestring_value_(in_bytes.begin(), in_bytes.end()) { ++Value::Value(base::span in_bytes, Type type, uint64_t tag) ++ : type_(type), bytestring_value_(in_bytes.begin(), in_bytes.end()), tag_(tag) { + DCHECK(type_ == Type::BYTE_STRING || type_ == Type::INVALID_UTF8); + } + +@@ -117,7 +119,8 @@ Value::Value(std::string&& in_string, Type type) noexcept : type_(type) { + } + } + +-Value::Value(base::StringPiece in_string, Type type) : type_(type) { ++Value::Value(base::StringPiece 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) { + } + } + +-Value::Value(const ArrayValue& in_array) : type_(Type::ARRAY), array_value_() { ++Value::Value(const ArrayValue& in_array, uint64_t tag) ++: type_(Type::ARRAY), array_value_(), tag_(tag) { + array_value_.reserve(in_array.size()); + for (const auto& val : in_array) + array_value_.emplace_back(val.Clone()); + } + +-Value::Value(ArrayValue&& in_array) noexcept +- : type_(Type::ARRAY), array_value_(std::move(in_array)) {} ++Value::Value(ArrayValue&& in_array, uint64_t tag) noexcept ++ : type_(Type::ARRAY), array_value_(std::move(in_array)), tag_(tag) {} + +-Value::Value(const MapValue& in_map) : type_(Type::MAP), map_value_() { ++Value::Value(const MapValue& in_map, uint64_t tag) ++: type_(Type::MAP), map_value_(), tag_(tag) { + map_value_.reserve(in_map.size()); + for (const auto& it : in_map) + map_value_.emplace_hint(map_value_.end(), it.first.Clone(), +@@ -168,31 +173,36 @@ Value Value::Clone() const { + case Type::NONE: + return Value(); + case Type::INVALID_UTF8: +- return Value(bytestring_value_, Type::INVALID_UTF8); ++ return Value(bytestring_value_, Type::INVALID_UTF8, tag_); + case Type::UNSIGNED: + case Type::NEGATIVE: +- return Value(integer_value_); ++ return Value(integer_value_, tag_); + case Type::BYTE_STRING: +- return Value(bytestring_value_); ++ return Value(bytestring_value_, tag_); + case Type::STRING: +- return Value(string_value_); ++ return Value(string_value_, Type::STRING, tag_); + case Type::ARRAY: +- return Value(array_value_); ++ return Value(array_value_, tag_); + case Type::MAP: +- return Value(map_value_); ++ return Value(map_value_, tag_); + case Type::TAG: + NOTREACHED() << constants::kUnsupportedMajorType; + return Value(); + case Type::SIMPLE_VALUE: +- return Value(simple_value_); ++ return Value(simple_value_, tag_); + case Type::FLOAT_VALUE: +- return Value(float_value_); ++ return Value(float_value_, tag_); + } + + NOTREACHED(); + return Value(); + } + ++Value& Value::SetTag(uint64_t tag) noexcept { ++ tag_ = tag; ++ return *this; ++} ++ + Value::SimpleValue Value::GetSimpleValue() const { + CHECK(is_simple()); + return simple_value_; +@@ -258,9 +268,14 @@ const Value::BinaryValue& Value::GetInvalidUTF8() const { + return bytestring_value_; + } + ++uint64_t Value::GetTag() const { ++ CHECK(has_tag()); ++ return tag_; ++} ++ + void Value::InternalMoveConstructFrom(Value&& that) { + type_ = that.type_; +- ++ tag_ = that.tag_; + switch (type_) { + case Type::UNSIGNED: + case Type::NEGATIVE: diff --git a/chromium_edits/125.0.6396.3/components/cbor/values.h.patch b/chromium_edits/125.0.6396.3/components/cbor/values.h.patch new file mode 100644 index 00000000..ca39df01 --- /dev/null +++ b/chromium_edits/125.0.6396.3/components/cbor/values.h.patch @@ -0,0 +1,79 @@ +diff --git a/components/cbor/values.h b/components/cbor/values.h +index d81ef5607c55a..10216a8dcdc57 100644 +--- a/components/cbor/values.h ++++ b/components/cbor/values.h +@@ -127,28 +127,29 @@ class CBOR_EXPORT Value { + + explicit Value(Type type); + +- explicit Value(SimpleValue in_simple); +- explicit Value(bool boolean_value); +- explicit Value(double in_float); ++ explicit Value(SimpleValue in_simple, uint64_t tag = NO_TAG); ++ explicit Value(bool boolean_value, uint64_t tag = NO_TAG); ++ explicit Value(double in_float, uint64_t tag = NO_TAG); + +- explicit Value(int integer_value); +- explicit Value(int64_t integer_value); ++ explicit Value(int integer_value, uint64_t tag = NO_TAG); ++ explicit Value(int64_t integer_value, uint64_t tag = NO_TAG); + explicit Value(uint64_t integer_value) = delete; + +- explicit Value(base::span in_bytes); ++ explicit Value(base::span in_bytes, uint64_t tag = NO_TAG); + explicit Value(BinaryValue&& in_bytes) noexcept; + + 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(const ArrayValue& in_array); +- explicit Value(ArrayValue&& in_array) noexcept; ++ explicit Value(const ArrayValue& in_array, uint64_t tag = NO_TAG); ++ explicit Value(ArrayValue&& in_array, uint64_t tag = NO_TAG) noexcept; + +- explicit Value(const MapValue& in_map); ++ explicit Value(const MapValue& in_map, uint64_t tag = NO_TAG); + explicit Value(MapValue&& in_map) noexcept; + + Value& operator=(Value&& that) noexcept; ++ Value& SetTag(uint64_t) noexcept; + + Value(const Value&) = delete; + Value& operator=(const Value&) = delete; +@@ -179,6 +180,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; } ++ bool has_tag() const { return tag_ != NO_TAG; } + + // These will all fatally assert if the type doesn't match. + SimpleValue GetSimpleValue() const; +@@ -194,12 +196,13 @@ class CBOR_EXPORT Value { + const ArrayValue& GetArray() const; + const MapValue& GetMap() const; + const BinaryValue& GetInvalidUTF8() const; ++ uint64_t GetTag() const; + + private: + friend class Reader; + // This constructor allows INVALID_UTF8 values to be created, which only + // |Reader| and InvalidUTF8StringValueForTesting() may do. +- Value(base::span in_bytes, Type type); ++ Value(base::span in_bytes, Type type, uint64_t tag = NO_TAG); + + Type type_; + +@@ -213,6 +216,11 @@ class CBOR_EXPORT Value { + MapValue map_value_; + }; + ++ //This value specified as Invalid, ++ // used here to represent absence of TAG ++ constexpr static uint64_t NO_TAG = 0xFFFF; ++ uint64_t tag_ = NO_TAG; ++ + void InternalMoveConstructFrom(Value&& that); + void InternalCleanup(); + }; diff --git a/chromium_edits/125.0.6396.3/components/cbor/writer.cc.patch b/chromium_edits/125.0.6396.3/components/cbor/writer.cc.patch new file mode 100644 index 00000000..bb89c1e6 --- /dev/null +++ b/chromium_edits/125.0.6396.3/components/cbor/writer.cc.patch @@ -0,0 +1,14 @@ +diff --git a/components/cbor/writer.cc b/components/cbor/writer.cc +index f400a65e7b66a..fcdebb8f3b458 100644 +--- a/components/cbor/writer.cc ++++ b/components/cbor/writer.cc +@@ -47,6 +47,9 @@ bool Writer::EncodeCBOR(const Value& node, + if (max_nesting_level < 0) + return false; + ++ if (node.has_tag()) { ++ StartItem(Value::Type::TAG, node.GetTag()); ++ } + switch (node.type()) { + case Value::Type::NONE: { + StartItem(Value::Type::BYTE_STRING, 0); diff --git a/chromium_edits/125.0.6396.3/components/cbor/writer_unittest.cc.patch b/chromium_edits/125.0.6396.3/components/cbor/writer_unittest.cc.patch new file mode 100644 index 00000000..240fee83 --- /dev/null +++ b/chromium_edits/125.0.6396.3/components/cbor/writer_unittest.cc.patch @@ -0,0 +1,36 @@ +diff --git a/components/cbor/writer_unittest.cc b/components/cbor/writer_unittest.cc +index e3bffe20734bc..0ed569ae164a0 100644 +--- a/components/cbor/writer_unittest.cc ++++ b/components/cbor/writer_unittest.cc +@@ -522,4 +522,31 @@ TEST(CBORWriterTest, OverlyNestedCBOR) { + EXPECT_FALSE(Writer::Write(Value(map), 4).has_value()); + } + ++TEST(CBORWriterTest, CanWriteTag) { ++ std::array content{ ++ 0x00, 0x01, 0x71, 0x12, 0x20, ++ 0x69, 0xea, 0x07, 0x40, 0xf9, ++ 0x80, 0x7a, 0x28, 0xf4, 0xd9, ++ 0x32, 0xc6, 0x2e, 0x7c, 0x1c, ++ 0x83, 0xbe, 0x05, 0x5e, 0x55, ++ 0x07, 0x2c, 0x90, 0x26, 0x6a, ++ 0xb3, 0xe7, 0x9d, 0xf6, 0x3a, ++ 0x36, 0x5b ++ }; ++ Value to_write(content); ++ to_write.SetTag(42); ++ auto result = Writer::Write(to_write); ++ EXPECT_TRUE(result.has_value()); ++ auto& bytes = result.value(); ++ EXPECT_EQ(bytes.size(), 41UL); ++ EXPECT_EQ(bytes.at(0), 0xd8); ++ EXPECT_EQ(bytes.at(1), 0x2a); ++ EXPECT_EQ(bytes.at(2), 0x58); ++ EXPECT_EQ(bytes.at(3), 0x25); ++ for (auto i = 0UL; i < content.size(); ++i) { ++ ASSERT_LT(i + 4UL, bytes.size()); ++ ASSERT_EQ(content.at(i), bytes.at(i+4UL)); ++ } ++} ++ + } // namespace cbor diff --git a/chromium_edits/125.0.6396.3/components/open_from_clipboard/clipboard_recent_content_generic.cc.patch b/chromium_edits/125.0.6396.3/components/open_from_clipboard/clipboard_recent_content_generic.cc.patch new file mode 100644 index 00000000..291d84f1 --- /dev/null +++ b/chromium_edits/125.0.6396.3/components/open_from_clipboard/clipboard_recent_content_generic.cc.patch @@ -0,0 +1,13 @@ +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 +--- a/components/open_from_clipboard/clipboard_recent_content_generic.cc ++++ b/components/open_from_clipboard/clipboard_recent_content_generic.cc +@@ -20,7 +20,7 @@ + namespace { + // Schemes appropriate for suggestion by ClipboardRecentContent. + const char* kAuthorizedSchemes[] = { +- url::kAboutScheme, url::kDataScheme, url::kHttpScheme, url::kHttpsScheme, ++ url::kAboutScheme, url::kDataScheme, url::kHttpScheme, url::kHttpsScheme, "ipfs", "ipns" + // TODO(mpearson): add support for chrome:// URLs. Right now the scheme + // for that lives in content and is accessible via + // GetEmbedderRepresentationOfAboutScheme() or content::kChromeUIScheme diff --git a/chromium_edits/125.0.6396.3/net/dns/dns_config_service_linux.cc.patch b/chromium_edits/125.0.6396.3/net/dns/dns_config_service_linux.cc.patch new file mode 100644 index 00000000..3b042d33 --- /dev/null +++ b/chromium_edits/125.0.6396.3/net/dns/dns_config_service_linux.cc.patch @@ -0,0 +1,18 @@ +diff --git a/net/dns/dns_config_service_linux.cc b/net/dns/dns_config_service_linux.cc +index f909f127ba3e1..31d7f9d58c0af 100644 +--- a/net/dns/dns_config_service_linux.cc ++++ b/net/dns/dns_config_service_linux.cc +@@ -271,11 +271,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; +- ++ case NsswitchReader::Service::kResolve: ++ break; + case NsswitchReader::Service::kMdns: + case NsswitchReader::Service::kMdns4: + case NsswitchReader::Service::kMdns6: +- case NsswitchReader::Service::kResolve: + case NsswitchReader::Service::kNis: + RecordIncompatibleNsswitchReason( + IncompatibleNsswitchReason::kIncompatibleService, diff --git a/chromium_edits/125.0.6396.3/third_party/blink/renderer/platform/weborigin/scheme_registry.cc.patch b/chromium_edits/125.0.6396.3/third_party/blink/renderer/platform/weborigin/scheme_registry.cc.patch new file mode 100644 index 00000000..7fcbedc1 --- /dev/null +++ b/chromium_edits/125.0.6396.3/third_party/blink/renderer/platform/weborigin/scheme_registry.cc.patch @@ -0,0 +1,13 @@ +diff --git a/third_party/blink/renderer/platform/weborigin/scheme_registry.cc b/third_party/blink/renderer/platform/weborigin/scheme_registry.cc +index 62163e44e292e..60d00b8140759 100644 +--- a/third_party/blink/renderer/platform/weborigin/scheme_registry.cc ++++ b/third_party/blink/renderer/platform/weborigin/scheme_registry.cc +@@ -66,7 +66,7 @@ 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"}), ++ fetch_api_schemes({"http", "https", "ipfs", "ipns"}), + allowed_in_referrer_schemes({"http", "https"}) { + for (auto& scheme : url::GetCorsEnabledSchemes()) + cors_enabled_schemes.insert(scheme.c_str()); diff --git a/chromium_edits/125.0.6396.3/url/BUILD.gn.patch b/chromium_edits/125.0.6396.3/url/BUILD.gn.patch new file mode 100644 index 00000000..201770c4 --- /dev/null +++ b/chromium_edits/125.0.6396.3/url/BUILD.gn.patch @@ -0,0 +1,32 @@ +diff --git a/url/BUILD.gn b/url/BUILD.gn +index aedf1bf9f80be..b11c73a88aae5 100644 +--- a/url/BUILD.gn ++++ b/url/BUILD.gn +@@ -5,6 +5,7 @@ + import("//build/buildflag_header.gni") + import("//testing/libfuzzer/fuzzer_test.gni") + import("//testing/test.gni") ++import("//third_party/ipfs_client/args.gni") + import("features.gni") + + import("//build/config/cronet/config.gni") +@@ -67,6 +68,7 @@ component("url") { + public_deps = [ + "//base", + "//build:robolectric_buildflags", ++ "//third_party/ipfs_client:ipfs_buildflags", + ] + + configs += [ "//build/config/compiler:wexit_time_destructors" ] +@@ -89,6 +91,11 @@ component("url") { + public_configs = [ "//third_party/jdk" ] + } + ++ if (enable_ipfs) { ++ sources += [ "url_canon_ipfs.cc" ] ++ deps += [ "//third_party/ipfs_client:ipfs_client" ] ++ } ++ + if (is_win) { + # Don't conflict with Windows' "url.dll". + output_name = "url_lib" diff --git a/chromium_edits/125.0.6396.3/url/url_canon.h.patch b/chromium_edits/125.0.6396.3/url/url_canon.h.patch new file mode 100644 index 00000000..71d7a758 --- /dev/null +++ b/chromium_edits/125.0.6396.3/url/url_canon.h.patch @@ -0,0 +1,28 @@ +diff --git a/url/url_canon.h b/url/url_canon.h +index bd40235e4aa85..05d250fe1b746 100644 +--- a/url/url_canon.h ++++ b/url/url_canon.h +@@ -815,6 +815,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/125.0.6396.3/url/url_canon_ipfs.cc b/chromium_edits/125.0.6396.3/url/url_canon_ipfs.cc new file mode 100644 index 00000000..d7c9fdc7 --- /dev/null +++ b/chromium_edits/125.0.6396.3/url/url_canon_ipfs.cc @@ -0,0 +1,55 @@ +#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/125.0.6396.3/url/url_util.cc.patch b/chromium_edits/125.0.6396.3/url/url_util.cc.patch new file mode 100644 index 00000000..3850fcfe --- /dev/null +++ b/chromium_edits/125.0.6396.3/url/url_util.cc.patch @@ -0,0 +1,22 @@ +diff --git a/url/url_util.cc b/url/url_util.cc +index 82b27b8f59684..2f3045adefaa7 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/125.0.6412.0/chrome/browser/BUILD.gn.patch b/chromium_edits/125.0.6412.0/chrome/browser/BUILD.gn.patch new file mode 100644 index 00000000..c16d077d --- /dev/null +++ b/chromium_edits/125.0.6412.0/chrome/browser/BUILD.gn.patch @@ -0,0 +1,27 @@ +diff --git a/chrome/browser/BUILD.gn b/chrome/browser/BUILD.gn +index fde5042ab2f11..076c80d450ee7 100644 +--- a/chrome/browser/BUILD.gn ++++ b/chrome/browser/BUILD.gn +@@ -39,6 +39,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") +@@ -2702,6 +2703,14 @@ static_library("browser") { + ] + } + ++ if (enable_ipfs) { ++ sources += [ ++ "ipfs_extra_parts.cc", ++ "ipfs_extra_parts.h", ++ ] ++ deps += [ "//components/ipfs" ] ++ } ++ + if (is_chromeos_ash) { + deps += [ "//chrome/browser/screen_ai:screen_ai_dlc_installer" ] + } diff --git a/chromium_edits/125.0.6412.0/chrome/browser/about_flags.cc.patch b/chromium_edits/125.0.6412.0/chrome/browser/about_flags.cc.patch new file mode 100644 index 00000000..e129ad39 --- /dev/null +++ b/chromium_edits/125.0.6412.0/chrome/browser/about_flags.cc.patch @@ -0,0 +1,38 @@ +diff --git a/chrome/browser/about_flags.cc b/chrome/browser/about_flags.cc +index 4e93f36dbc68b..1890cd7b866fa 100644 +--- a/chrome/browser/about_flags.cc ++++ b/chrome/browser/about_flags.cc +@@ -217,6 +217,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" ++#include "third_party/ipfs_client/ipfs_buildflags.h" + #include "ui/accessibility/accessibility_features.h" + #include "ui/accessibility/accessibility_switches.h" + #include "ui/base/ozone_buildflags.h" +@@ -311,6 +312,10 @@ + #include "extensions/common/switches.h" + #endif // BUILDFLAG(ENABLE_EXTENSIONS) + ++#if BUILDFLAG(ENABLE_IPFS) ++#include "components/ipfs/ipfs_features.h" ++#endif ++ + #if BUILDFLAG(ENABLE_PDF) + #include "pdf/pdf_features.h" + #endif +@@ -9601,6 +9606,14 @@ const FeatureEntry kFeatureEntries[] = { + flag_descriptions::kOmitCorsClientCertDescription, kOsAll, + FEATURE_VALUE_TYPE(network::features::kOmitCorsClientCert)}, + ++#if BUILDFLAG(ENABLE_IPFS) ++ {"enable-ipfs", ++ flag_descriptions::kEnableIpfsName, ++ flag_descriptions::kEnableIpfsDescription, ++ kOsMac | kOsWin | kOsLinux,//TODO: These are the only variants currently getting built, but that is not likely to remain the case ++ FEATURE_VALUE_TYPE(ipfs::kEnableIpfs)}, ++#endif ++ + {"use-idna2008-non-transitional", + flag_descriptions::kUseIDNA2008NonTransitionalName, + flag_descriptions::kUseIDNA2008NonTransitionalDescription, kOsAll, diff --git a/chromium_edits/125.0.6412.0/chrome/browser/autocomplete/chrome_autocomplete_scheme_classifier.cc.patch b/chromium_edits/125.0.6412.0/chrome/browser/autocomplete/chrome_autocomplete_scheme_classifier.cc.patch new file mode 100644 index 00000000..4d172311 --- /dev/null +++ b/chromium_edits/125.0.6412.0/chrome/browser/autocomplete/chrome_autocomplete_scheme_classifier.cc.patch @@ -0,0 +1,50 @@ +diff --git a/chrome/browser/autocomplete/chrome_autocomplete_scheme_classifier.cc b/chrome/browser/autocomplete/chrome_autocomplete_scheme_classifier.cc +index 4c88614c68c25..f8bb12a3b0c2e 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" ++#include "third_party/ipfs_client/ipfs_buildflags.h" ++ + #if BUILDFLAG(IS_ANDROID) + #include "chrome/browser/profiles/profile_android.h" + #endif +@@ -18,6 +20,9 @@ + #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 (scheme.empty()) { + return metrics::OmniboxInputType::EMPTY; + } +- if (base::IsStringASCII(scheme) && +- (ProfileIOData::IsHandledProtocol(scheme) || +- base::EqualsCaseInsensitiveASCII(scheme, content::kViewSourceScheme) || +- base::EqualsCaseInsensitiveASCII(scheme, url::kJavaScriptScheme) || +- base::EqualsCaseInsensitiveASCII(scheme, url::kDataScheme))) { +- return metrics::OmniboxInputType::URL; ++ if (base::IsStringASCII(scheme)) { ++ if (ProfileIOData::IsHandledProtocol(scheme) || ++ base::EqualsCaseInsensitiveASCII(scheme, content::kViewSourceScheme) || ++ base::EqualsCaseInsensitiveASCII(scheme, url::kJavaScriptScheme) || ++ base::EqualsCaseInsensitiveASCII(scheme, url::kDataScheme)) { ++ return metrics::OmniboxInputType::URL; ++ } ++#if BUILDFLAG(ENABLE_IPFS) ++ if (base::FeatureList::IsEnabled(ipfs::kEnableIpfs) && ++ (base::EqualsCaseInsensitiveASCII(scheme, "ipfs") || base::EqualsCaseInsensitiveASCII(scheme, "ipns")) ++ ) { ++ return metrics::OmniboxInputType::URL; ++ } ++#endif + } + + // Also check for schemes registered via registerProtocolHandler(), which diff --git a/chromium_edits/125.0.6412.0/chrome/browser/chrome_content_browser_client.cc.patch b/chromium_edits/125.0.6412.0/chrome/browser/chrome_content_browser_client.cc.patch new file mode 100644 index 00000000..d57d264b --- /dev/null +++ b/chromium_edits/125.0.6412.0/chrome/browser/chrome_content_browser_client.cc.patch @@ -0,0 +1,77 @@ +diff --git a/chrome/browser/chrome_content_browser_client.cc b/chrome/browser/chrome_content_browser_client.cc +index c0f9870dbb282..3097911fdf0c3 100644 +--- a/chrome/browser/chrome_content_browser_client.cc ++++ b/chrome/browser/chrome_content_browser_client.cc +@@ -384,6 +384,7 @@ + #include "third_party/blink/public/common/switches.h" + #include "third_party/blink/public/mojom/browsing_topics/browsing_topics.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" +@@ -506,6 +507,13 @@ + #include "chrome/browser/fuchsia/chrome_browser_main_parts_fuchsia.h" + #endif + ++#if BUILDFLAG(ENABLE_IPFS) ++#include "chrome/browser/ipfs_extra_parts.h" ++#include "components/ipfs/interceptor.h" ++#include "components/ipfs/ipfs_features.h" ++#include "components/ipfs/url_loader_factory.h" ++#endif ++ + #if !BUILDFLAG(IS_ANDROID) + #include "chrome/browser/preloading/preview/preview_navigation_throttle.h" + #include "chrome/browser/web_applications/isolated_web_apps/chrome_content_browser_client_isolated_web_apps_part.h" +@@ -1723,6 +1731,11 @@ ChromeContentBrowserClient::CreateBrowserMainParts(bool is_integration_test) { + main_parts->AddParts( + std::make_unique()); + ++#if BUILDFLAG(ENABLE_IPFS) ++ if (base::FeatureList::IsEnabled(ipfs::kEnableIpfs)) { ++ main_parts->AddParts(std::make_unique()); ++ } ++#endif + return main_parts; + } + +@@ -6177,12 +6190,25 @@ void ChromeContentBrowserClient:: + const std::optional& request_initiator_origin, + NonNetworkURLLoaderFactoryMap* factories) { + #if BUILDFLAG(IS_CHROMEOS_ASH) || BUILDFLAG(ENABLE_EXTENSIONS) || \ +- !BUILDFLAG(IS_ANDROID) ++ !BUILDFLAG(IS_ANDROID) || BUILDFLAG(ENABLE_IPFS) + content::RenderFrameHost* frame_host = + 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) ++#if BUILDFLAG(ENABLE_IPFS) ++ 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( ++ factories, ++ context, ++ default_factory, ++ GetSystemNetworkContext(), ++ Profile::FromBrowserContext(context)->GetPrefs() ++ ); ++ } ++#endif // BUILDFLAG(ENABLE_IPFS) + + #if BUILDFLAG(IS_CHROMEOS_ASH) + if (web_contents) { +@@ -6316,6 +6342,11 @@ ChromeContentBrowserClient::WillCreateURLLoaderRequestInterceptors( + scoped_refptr navigation_response_task_runner) { + std::vector> + interceptors; ++#if BUILDFLAG(ENABLE_IPFS) ++ if (base::FeatureList::IsEnabled(ipfs::kEnableIpfs)) { ++ interceptors.push_back(std::make_unique(g_browser_process->system_network_context_manager()->GetURLLoaderFactory(), GetSystemNetworkContext())); ++ } ++#endif + #if BUILDFLAG(ENABLE_OFFLINE_PAGES) + interceptors.push_back( + std::make_unique( diff --git a/chromium_edits/125.0.6412.0/chrome/browser/flag-metadata.json.patch b/chromium_edits/125.0.6412.0/chrome/browser/flag-metadata.json.patch new file mode 100644 index 00000000..cf921ac0 --- /dev/null +++ b/chromium_edits/125.0.6412.0/chrome/browser/flag-metadata.json.patch @@ -0,0 +1,16 @@ +diff --git a/chrome/browser/flag-metadata.json b/chrome/browser/flag-metadata.json +index d48d50ebbce2a..90851e1ec68a2 100644 +--- a/chrome/browser/flag-metadata.json ++++ b/chrome/browser/flag-metadata.json +@@ -3197,6 +3197,11 @@ + "owners": [ "adamta@google.com", "chrome-feed-fundamentals@google.com" ], + "expiry_milestone": 130 + }, ++ { ++ "name": "enable-ipfs", ++ "owners": [ "//components/ipfs/OWNERS" ], ++ "expiry_milestone": 150 ++ }, + { + "name": "enable-isolated-sandboxed-iframes", + "owners": [ "wjmaclean@chromium.org", "alexmos@chromium.org", "creis@chromium.org" ], diff --git a/chromium_edits/125.0.6412.0/chrome/browser/flag_descriptions.cc.patch b/chromium_edits/125.0.6412.0/chrome/browser/flag_descriptions.cc.patch new file mode 100644 index 00000000..cec3980b --- /dev/null +++ b/chromium_edits/125.0.6412.0/chrome/browser/flag_descriptions.cc.patch @@ -0,0 +1,16 @@ +diff --git a/chrome/browser/flag_descriptions.cc b/chrome/browser/flag_descriptions.cc +index 200e5e39b9988..35b4d25dc3805 100644 +--- a/chrome/browser/flag_descriptions.cc ++++ b/chrome/browser/flag_descriptions.cc +@@ -312,6 +312,11 @@ const char kEnableBenchmarkingChoiceDefaultFeatureStates[] = + const char kEnableBenchmarkingChoiceMatchFieldTrialTestingConfig[] = + "Match Field Trial Testing Config"; + ++#if BUILDFLAG(ENABLE_IPFS) ++extern const char kEnableIpfsName[] = "Enable IPFS"; ++extern const char kEnableIpfsDescription[] = "Enable ipfs:// and ipns:// URLs"; ++#endif ++ + const char kPreloadingOnPerformancePageName[] = + "Preloading Settings on Performance Page"; + const char kPreloadingOnPerformancePageDescription[] = diff --git a/chromium_edits/125.0.6412.0/chrome/browser/flag_descriptions.h.patch b/chromium_edits/125.0.6412.0/chrome/browser/flag_descriptions.h.patch new file mode 100644 index 00000000..399a8f5f --- /dev/null +++ b/chromium_edits/125.0.6412.0/chrome/browser/flag_descriptions.h.patch @@ -0,0 +1,24 @@ +diff --git a/chrome/browser/flag_descriptions.h b/chrome/browser/flag_descriptions.h +index 0c6f865ad6cc8..103f1389d4aa8 100644 +--- a/chrome/browser/flag_descriptions.h ++++ b/chrome/browser/flag_descriptions.h +@@ -23,6 +23,7 @@ + #include "pdf/buildflags.h" + #include "printing/buildflags/buildflags.h" + #include "third_party/blink/public/common/buildflags.h" ++#include "third_party/ipfs_client/ipfs_buildflags.h" + + // This file declares strings used in chrome://flags. These messages are not + // translated, because instead of end-users they target Chromium developers and +@@ -204,6 +205,11 @@ extern const char kEnableBenchmarkingChoiceDisabled[]; + extern const char kEnableBenchmarkingChoiceDefaultFeatureStates[]; + extern const char kEnableBenchmarkingChoiceMatchFieldTrialTestingConfig[]; + ++#if BUILDFLAG(ENABLE_IPFS) ++extern const char kEnableIpfsName[]; ++extern const char kEnableIpfsDescription[]; ++#endif ++ + #if BUILDFLAG(USE_FONTATIONS_BACKEND) + extern const char kFontationsFontBackendName[]; + extern const char kFontationsFontBackendDescription[]; diff --git a/chromium_edits/125.0.6412.0/chrome/browser/ipfs_extra_parts.cc b/chromium_edits/125.0.6412.0/chrome/browser/ipfs_extra_parts.cc new file mode 100644 index 00000000..90d2596f --- /dev/null +++ b/chromium_edits/125.0.6412.0/chrome/browser/ipfs_extra_parts.cc @@ -0,0 +1,10 @@ +#include "ipfs_extra_parts.h" + +#include "profiles/profile.h" + +#include + +void IpfsExtraParts::PostProfileInit(Profile* profile, bool /* is_initial_profile */ ) { + DCHECK(profile); + ipfs::InterRequestState::CreateForBrowserContext(profile, profile->GetPrefs()); +} diff --git a/chromium_edits/125.0.6412.0/chrome/browser/ipfs_extra_parts.h b/chromium_edits/125.0.6412.0/chrome/browser/ipfs_extra_parts.h new file mode 100644 index 00000000..2059c437 --- /dev/null +++ b/chromium_edits/125.0.6412.0/chrome/browser/ipfs_extra_parts.h @@ -0,0 +1,10 @@ +#ifndef IPFS_EXTRA_PART_H_ +#define IPFS_EXTRA_PART_H_ + +#include + +class IpfsExtraParts : public ChromeBrowserMainExtraParts { + void PostProfileInit(Profile* profile, bool is_initial_profile) override; +}; + +#endif // IPFS_EXTRA_PART_H_ diff --git a/chromium_edits/125.0.6412.0/chrome/browser/prefs/browser_prefs.cc.patch b/chromium_edits/125.0.6412.0/chrome/browser/prefs/browser_prefs.cc.patch new file mode 100644 index 00000000..9dc1c14e --- /dev/null +++ b/chromium_edits/125.0.6412.0/chrome/browser/prefs/browser_prefs.cc.patch @@ -0,0 +1,37 @@ +diff --git a/chrome/browser/prefs/browser_prefs.cc b/chrome/browser/prefs/browser_prefs.cc +index 5eff3512acbc9..fb8ea9a5e2da9 100644 +--- a/chrome/browser/prefs/browser_prefs.cc ++++ b/chrome/browser/prefs/browser_prefs.cc +@@ -190,6 +190,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 +236,11 @@ + #include "chrome/browser/pdf/pdf_pref_names.h" + #endif // BUILDFLAG(ENABLE_PDF) + ++#if BUILDFLAG(ENABLE_IPFS) ++#include "components/ipfs/ipfs_features.h" ++#include "components/ipfs/preferences.h" ++#endif ++ + #if BUILDFLAG(ENABLE_SCREEN_AI_SERVICE) + #include "chrome/browser/screen_ai/pref_names.h" + #endif +@@ -1808,6 +1815,11 @@ void RegisterProfilePrefs(user_prefs::PrefRegistrySyncable* registry, + IncognitoModePrefs::RegisterProfilePrefs(registry); + invalidation::PerUserTopicSubscriptionManager::RegisterProfilePrefs(registry); + invalidation::InvalidatorRegistrarWithMemory::RegisterProfilePrefs(registry); ++#if BUILDFLAG(ENABLE_IPFS) ++ if (base::FeatureList::IsEnabled(ipfs::kEnableIpfs)) { ++ ipfs::RegisterPreferences(registry); ++ } ++#endif + language::LanguagePrefs::RegisterProfilePrefs(registry); + login_detection::prefs::RegisterProfilePrefs(registry); + lookalikes::RegisterProfilePrefs(registry); diff --git a/chromium_edits/125.0.6412.0/chrome/common/chrome_content_client.cc.patch b/chromium_edits/125.0.6412.0/chrome/common/chrome_content_client.cc.patch new file mode 100644 index 00000000..59ea01c2 --- /dev/null +++ b/chromium_edits/125.0.6412.0/chrome/common/chrome_content_client.cc.patch @@ -0,0 +1,17 @@ +diff --git a/chrome/common/chrome_content_client.cc b/chrome/common/chrome_content_client.cc +index 2f016718fdd3c..bc38d5c2e4d8e 100644 +--- a/chrome/common/chrome_content_client.cc ++++ b/chrome/common/chrome_content_client.cc +@@ -302,6 +302,12 @@ void ChromeContentClient::AddAdditionalSchemes(Schemes* schemes) { + #if BUILDFLAG(IS_ANDROID) + schemes->local_schemes.push_back(url::kContentScheme); + #endif ++ for ( const char* ip_s : {"ipfs", "ipns"} ) { ++ schemes->standard_schemes.push_back(ip_s); ++ schemes->cors_enabled_schemes.push_back(ip_s); ++ schemes->secure_schemes.push_back(ip_s); ++ schemes->csp_bypassing_schemes.push_back(ip_s); ++ } + } + + std::u16string ChromeContentClient::GetLocalizedString(int message_id) { diff --git a/chromium_edits/125.0.6412.0/components/cbor/reader.cc.patch b/chromium_edits/125.0.6412.0/components/cbor/reader.cc.patch new file mode 100644 index 00000000..a9c4a7b3 --- /dev/null +++ b/chromium_edits/125.0.6412.0/components/cbor/reader.cc.patch @@ -0,0 +1,44 @@ +diff --git a/components/cbor/reader.cc b/components/cbor/reader.cc +index 3c31e3d05e5d3..5ad0dbb183884 100644 +--- a/components/cbor/reader.cc ++++ b/components/cbor/reader.cc +@@ -22,7 +22,7 @@ + namespace cbor { + + namespace constants { +-const char kUnsupportedMajorType[] = "Unsupported major type."; ++const char kUnsupportedMajorType[] = "Unsupported major type operation."; + } + + namespace { +@@ -156,7 +156,11 @@ std::optional Reader::DecodeCompleteDataItem(const Config& config, + case Value::Type::FLOAT_VALUE: + // Floating point values also go here since they are also type 7. + return DecodeToSimpleValueOrFloat(*header, config); +- case Value::Type::TAG: // We explicitly don't support TAG. ++ case Value::Type::TAG: ++ if (config.parse_tags) { ++ return ReadTagContent(*header, config, max_nesting_level); ++ } ++ break; + case Value::Type::NONE: + case Value::Type::INVALID_UTF8: + break; +@@ -347,6 +351,17 @@ std::optional Reader::ReadByteStringContent( + return Value(std::move(cbor_byte_string)); + } + ++std::optional Reader::ReadTagContent( ++ const Reader::DataItemHeader& header, ++ const Config& config, ++ int max_nesting_level) { ++ auto tagged_content = DecodeCompleteDataItem(config, max_nesting_level); ++ if (tagged_content.has_value()) { ++ tagged_content.value().SetTag(header.value); ++ } ++ return tagged_content; ++} ++ + std::optional Reader::ReadArrayContent( + const Reader::DataItemHeader& header, + const Config& config, diff --git a/chromium_edits/125.0.6412.0/components/cbor/reader.h.patch b/chromium_edits/125.0.6412.0/components/cbor/reader.h.patch new file mode 100644 index 00000000..cd7d9eb0 --- /dev/null +++ b/chromium_edits/125.0.6412.0/components/cbor/reader.h.patch @@ -0,0 +1,26 @@ +diff --git a/components/cbor/reader.h b/components/cbor/reader.h +index 73c5dcb23e555..a933768608d73 100644 +--- a/components/cbor/reader.h ++++ b/components/cbor/reader.h +@@ -130,6 +130,11 @@ class CBOR_EXPORT Reader { + // during decoding will set raise the `UNSUPPORTED_FLOATING_POINT_VALUE` + // error. + bool allow_floating_point = false; ++ ++ // If the parser encounters a TAG element, should it be parsed out and ++ // the tag value saved (true), or should the entire node and its content ++ // be discarded (false) ++ bool parse_tags = false; + }; + + Reader(const Reader&) = delete; +@@ -204,6 +209,9 @@ class CBOR_EXPORT Reader { + std::optional ReadMapContent(const DataItemHeader& header, + const Config& config, + int max_nesting_level); ++ std::optional ReadTagContent(const DataItemHeader& header, ++ const Config& config, ++ int max_nesting_level); + std::optional ReadByte(); + std::optional> ReadBytes(uint64_t num_bytes); + bool IsKeyInOrder(const Value& new_key, diff --git a/chromium_edits/125.0.6412.0/components/cbor/reader_unittest.cc.patch b/chromium_edits/125.0.6412.0/components/cbor/reader_unittest.cc.patch new file mode 100644 index 00000000..150e0c73 --- /dev/null +++ b/chromium_edits/125.0.6412.0/components/cbor/reader_unittest.cc.patch @@ -0,0 +1,47 @@ +diff --git a/components/cbor/reader_unittest.cc b/components/cbor/reader_unittest.cc +index e5c02ceea3402..f26b8e77f6da3 100644 +--- a/components/cbor/reader_unittest.cc ++++ b/components/cbor/reader_unittest.cc +@@ -1449,5 +1449,42 @@ TEST(CBORReaderTest, AllowInvalidUTF8) { + EXPECT_FALSE(cbor); + EXPECT_EQ(Reader::DecoderError::INVALID_UTF8, error); + } ++TEST(CBORReaderTest, RejectsTagUnderDefaultConfig) { ++ static const uint8_t kTaggedCbor[] = { ++ 0xd8, 0x2a, 0x58, 0x25, 0x00, 0x01, 0x71, 0x12, 0x20, 0x69, 0xea, 0x07, ++ 0x40, 0xf9, 0x80, 0x7a, 0x28, 0xf4, 0xd9, 0x32, 0xc6, 0x2e, 0x7c, 0x1c, ++ 0x83, 0xbe, 0x05, 0x5e, 0x55, 0x07, 0x2c, 0x90, 0x26, 0x6a, 0xb3, 0xe7, ++ 0x9d, 0xf6, 0x3a, 0x36, 0x5b ++ }; ++ Reader::Config config; ++ auto cbor = Reader::Read(kTaggedCbor, config); ++ EXPECT_FALSE(cbor.has_value()); ++} ++TEST(CBORReaderTest, ReadsTagWhenConfiguredToDoSo) { ++ static const uint8_t kTaggedCbor[] = { ++ 0xd8, 0x2a, 0x58, 0x25, 0x00, 0x01, 0x71, 0x12, 0x20, 0x69, 0xea, 0x07, ++ 0x40, 0xf9, 0x80, 0x7a, 0x28, 0xf4, 0xd9, 0x32, 0xc6, 0x2e, 0x7c, 0x1c, ++ 0x83, 0xbe, 0x05, 0x5e, 0x55, 0x07, 0x2c, 0x90, 0x26, 0x6a, 0xb3, 0xe7, ++ 0x9d, 0xf6, 0x3a, 0x36, 0x5b ++ }; ++ Reader::Config config; ++ config.parse_tags = true; ++ auto cbor = Reader::Read(kTaggedCbor, config); ++ EXPECT_TRUE(cbor.has_value()); ++ auto& v = cbor.value(); ++ EXPECT_TRUE(v.has_tag()); ++ EXPECT_EQ(v.GetTag(),42UL); ++ EXPECT_TRUE(v.is_bytestring()); ++ EXPECT_EQ(v.type(), Value::Type::BYTE_STRING); ++ auto& bytes = v.GetBytestring(); ++ EXPECT_EQ(bytes.size(), 37UL); ++ EXPECT_EQ(bytes.at(0), 0x00);//identity multibase (e.g. not base-encoded, bytes are themselves) ++ EXPECT_EQ(bytes.at(1), 0x01);//CID version 1 ++ EXPECT_EQ(bytes.at(2), 0x71);//codec = dag-cbor ++ EXPECT_EQ(bytes.at(3), 0x12);//multihash = 18 = sha2-256 ++ EXPECT_EQ(bytes.at(4), 0x20);//hash length = 32 bytes ++ EXPECT_EQ(bytes.at(5), 0x69);//first byte of hash digest ++ EXPECT_EQ(bytes.at(36),0x5b);//last byte of hash digest ++} + + } // namespace cbor diff --git a/chromium_edits/125.0.6412.0/components/cbor/values.cc.patch b/chromium_edits/125.0.6412.0/components/cbor/values.cc.patch new file mode 100644 index 00000000..ddbab2b3 --- /dev/null +++ b/chromium_edits/125.0.6412.0/components/cbor/values.cc.patch @@ -0,0 +1,145 @@ +diff --git a/components/cbor/values.cc b/components/cbor/values.cc +index 02498209c820e..34055aef24cfe 100644 +--- a/components/cbor/values.cc ++++ b/components/cbor/values.cc +@@ -66,32 +66,34 @@ Value::Value(Type type) : type_(type) { + NOTREACHED(); + } + +-Value::Value(SimpleValue in_simple) +- : type_(Type::SIMPLE_VALUE), simple_value_(in_simple) { ++Value::Value(SimpleValue in_simple, uint64_t tag) ++ : type_(Type::SIMPLE_VALUE), simple_value_(in_simple), tag_(tag) { + CHECK(static_cast(in_simple) >= 20 && static_cast(in_simple) <= 23); + } + +-Value::Value(bool boolean_value) : type_(Type::SIMPLE_VALUE) { ++Value::Value(bool boolean_value, uint64_t tag) : type_(Type::SIMPLE_VALUE), tag_(tag) { + simple_value_ = boolean_value ? Value::SimpleValue::TRUE_VALUE + : Value::SimpleValue::FALSE_VALUE; + } + +-Value::Value(double float_value) +- : type_(Type::FLOAT_VALUE), float_value_(float_value) {} ++Value::Value(double float_value, uint64_t tag) ++ : type_(Type::FLOAT_VALUE), float_value_(float_value), tag_(tag) {} + +-Value::Value(int integer_value) +- : Value(base::checked_cast(integer_value)) {} ++Value::Value(int integer_value, uint64_t tag) ++ : Value(base::checked_cast(integer_value), tag) {} + +-Value::Value(int64_t integer_value) : integer_value_(integer_value) { ++Value::Value(int64_t integer_value, uint64_t tag) : integer_value_(integer_value), tag_(tag) { + type_ = integer_value >= 0 ? Type::UNSIGNED : Type::NEGATIVE; + } + +-Value::Value(base::span in_bytes) ++Value::Value(base::span in_bytes, uint64_t tag) + : type_(Type::BYTE_STRING), +- bytestring_value_(in_bytes.begin(), in_bytes.end()) {} ++ bytestring_value_(in_bytes.begin(), in_bytes.end()), ++ tag_(tag) ++ {} + +-Value::Value(base::span in_bytes, Type type) +- : type_(type), bytestring_value_(in_bytes.begin(), in_bytes.end()) { ++Value::Value(base::span in_bytes, Type type, uint64_t tag) ++ : type_(type), bytestring_value_(in_bytes.begin(), in_bytes.end()), tag_(tag) { + DCHECK(type_ == Type::BYTE_STRING || type_ == Type::INVALID_UTF8); + } + +@@ -117,7 +119,8 @@ Value::Value(std::string&& in_string, Type type) noexcept : type_(type) { + } + } + +-Value::Value(base::StringPiece in_string, Type type) : type_(type) { ++Value::Value(base::StringPiece 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) { + } + } + +-Value::Value(const ArrayValue& in_array) : type_(Type::ARRAY), array_value_() { ++Value::Value(const ArrayValue& in_array, uint64_t tag) ++: type_(Type::ARRAY), array_value_(), tag_(tag) { + array_value_.reserve(in_array.size()); + for (const auto& val : in_array) + array_value_.emplace_back(val.Clone()); + } + +-Value::Value(ArrayValue&& in_array) noexcept +- : type_(Type::ARRAY), array_value_(std::move(in_array)) {} ++Value::Value(ArrayValue&& in_array, uint64_t tag) noexcept ++ : type_(Type::ARRAY), array_value_(std::move(in_array)), tag_(tag) {} + +-Value::Value(const MapValue& in_map) : type_(Type::MAP), map_value_() { ++Value::Value(const MapValue& in_map, uint64_t tag) ++: type_(Type::MAP), map_value_(), tag_(tag) { + map_value_.reserve(in_map.size()); + for (const auto& it : in_map) + map_value_.emplace_hint(map_value_.end(), it.first.Clone(), +@@ -168,31 +173,36 @@ Value Value::Clone() const { + case Type::NONE: + return Value(); + case Type::INVALID_UTF8: +- return Value(bytestring_value_, Type::INVALID_UTF8); ++ return Value(bytestring_value_, Type::INVALID_UTF8, tag_); + case Type::UNSIGNED: + case Type::NEGATIVE: +- return Value(integer_value_); ++ return Value(integer_value_, tag_); + case Type::BYTE_STRING: +- return Value(bytestring_value_); ++ return Value(bytestring_value_, tag_); + case Type::STRING: +- return Value(string_value_); ++ return Value(string_value_, Type::STRING, tag_); + case Type::ARRAY: +- return Value(array_value_); ++ return Value(array_value_, tag_); + case Type::MAP: +- return Value(map_value_); ++ return Value(map_value_, tag_); + case Type::TAG: + NOTREACHED() << constants::kUnsupportedMajorType; + return Value(); + case Type::SIMPLE_VALUE: +- return Value(simple_value_); ++ return Value(simple_value_, tag_); + case Type::FLOAT_VALUE: +- return Value(float_value_); ++ return Value(float_value_, tag_); + } + + NOTREACHED(); + return Value(); + } + ++Value& Value::SetTag(uint64_t tag) noexcept { ++ tag_ = tag; ++ return *this; ++} ++ + Value::SimpleValue Value::GetSimpleValue() const { + CHECK(is_simple()); + return simple_value_; +@@ -258,9 +268,14 @@ const Value::BinaryValue& Value::GetInvalidUTF8() const { + return bytestring_value_; + } + ++uint64_t Value::GetTag() const { ++ CHECK(has_tag()); ++ return tag_; ++} ++ + void Value::InternalMoveConstructFrom(Value&& that) { + type_ = that.type_; +- ++ tag_ = that.tag_; + switch (type_) { + case Type::UNSIGNED: + case Type::NEGATIVE: diff --git a/chromium_edits/125.0.6412.0/components/cbor/values.h.patch b/chromium_edits/125.0.6412.0/components/cbor/values.h.patch new file mode 100644 index 00000000..ca39df01 --- /dev/null +++ b/chromium_edits/125.0.6412.0/components/cbor/values.h.patch @@ -0,0 +1,79 @@ +diff --git a/components/cbor/values.h b/components/cbor/values.h +index d81ef5607c55a..10216a8dcdc57 100644 +--- a/components/cbor/values.h ++++ b/components/cbor/values.h +@@ -127,28 +127,29 @@ class CBOR_EXPORT Value { + + explicit Value(Type type); + +- explicit Value(SimpleValue in_simple); +- explicit Value(bool boolean_value); +- explicit Value(double in_float); ++ explicit Value(SimpleValue in_simple, uint64_t tag = NO_TAG); ++ explicit Value(bool boolean_value, uint64_t tag = NO_TAG); ++ explicit Value(double in_float, uint64_t tag = NO_TAG); + +- explicit Value(int integer_value); +- explicit Value(int64_t integer_value); ++ explicit Value(int integer_value, uint64_t tag = NO_TAG); ++ explicit Value(int64_t integer_value, uint64_t tag = NO_TAG); + explicit Value(uint64_t integer_value) = delete; + +- explicit Value(base::span in_bytes); ++ explicit Value(base::span in_bytes, uint64_t tag = NO_TAG); + explicit Value(BinaryValue&& in_bytes) noexcept; + + 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(const ArrayValue& in_array); +- explicit Value(ArrayValue&& in_array) noexcept; ++ explicit Value(const ArrayValue& in_array, uint64_t tag = NO_TAG); ++ explicit Value(ArrayValue&& in_array, uint64_t tag = NO_TAG) noexcept; + +- explicit Value(const MapValue& in_map); ++ explicit Value(const MapValue& in_map, uint64_t tag = NO_TAG); + explicit Value(MapValue&& in_map) noexcept; + + Value& operator=(Value&& that) noexcept; ++ Value& SetTag(uint64_t) noexcept; + + Value(const Value&) = delete; + Value& operator=(const Value&) = delete; +@@ -179,6 +180,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; } ++ bool has_tag() const { return tag_ != NO_TAG; } + + // These will all fatally assert if the type doesn't match. + SimpleValue GetSimpleValue() const; +@@ -194,12 +196,13 @@ class CBOR_EXPORT Value { + const ArrayValue& GetArray() const; + const MapValue& GetMap() const; + const BinaryValue& GetInvalidUTF8() const; ++ uint64_t GetTag() const; + + private: + friend class Reader; + // This constructor allows INVALID_UTF8 values to be created, which only + // |Reader| and InvalidUTF8StringValueForTesting() may do. +- Value(base::span in_bytes, Type type); ++ Value(base::span in_bytes, Type type, uint64_t tag = NO_TAG); + + Type type_; + +@@ -213,6 +216,11 @@ class CBOR_EXPORT Value { + MapValue map_value_; + }; + ++ //This value specified as Invalid, ++ // used here to represent absence of TAG ++ constexpr static uint64_t NO_TAG = 0xFFFF; ++ uint64_t tag_ = NO_TAG; ++ + void InternalMoveConstructFrom(Value&& that); + void InternalCleanup(); + }; diff --git a/chromium_edits/125.0.6412.0/components/cbor/writer.cc.patch b/chromium_edits/125.0.6412.0/components/cbor/writer.cc.patch new file mode 100644 index 00000000..bb89c1e6 --- /dev/null +++ b/chromium_edits/125.0.6412.0/components/cbor/writer.cc.patch @@ -0,0 +1,14 @@ +diff --git a/components/cbor/writer.cc b/components/cbor/writer.cc +index f400a65e7b66a..fcdebb8f3b458 100644 +--- a/components/cbor/writer.cc ++++ b/components/cbor/writer.cc +@@ -47,6 +47,9 @@ bool Writer::EncodeCBOR(const Value& node, + if (max_nesting_level < 0) + return false; + ++ if (node.has_tag()) { ++ StartItem(Value::Type::TAG, node.GetTag()); ++ } + switch (node.type()) { + case Value::Type::NONE: { + StartItem(Value::Type::BYTE_STRING, 0); diff --git a/chromium_edits/125.0.6412.0/components/cbor/writer_unittest.cc.patch b/chromium_edits/125.0.6412.0/components/cbor/writer_unittest.cc.patch new file mode 100644 index 00000000..240fee83 --- /dev/null +++ b/chromium_edits/125.0.6412.0/components/cbor/writer_unittest.cc.patch @@ -0,0 +1,36 @@ +diff --git a/components/cbor/writer_unittest.cc b/components/cbor/writer_unittest.cc +index e3bffe20734bc..0ed569ae164a0 100644 +--- a/components/cbor/writer_unittest.cc ++++ b/components/cbor/writer_unittest.cc +@@ -522,4 +522,31 @@ TEST(CBORWriterTest, OverlyNestedCBOR) { + EXPECT_FALSE(Writer::Write(Value(map), 4).has_value()); + } + ++TEST(CBORWriterTest, CanWriteTag) { ++ std::array content{ ++ 0x00, 0x01, 0x71, 0x12, 0x20, ++ 0x69, 0xea, 0x07, 0x40, 0xf9, ++ 0x80, 0x7a, 0x28, 0xf4, 0xd9, ++ 0x32, 0xc6, 0x2e, 0x7c, 0x1c, ++ 0x83, 0xbe, 0x05, 0x5e, 0x55, ++ 0x07, 0x2c, 0x90, 0x26, 0x6a, ++ 0xb3, 0xe7, 0x9d, 0xf6, 0x3a, ++ 0x36, 0x5b ++ }; ++ Value to_write(content); ++ to_write.SetTag(42); ++ auto result = Writer::Write(to_write); ++ EXPECT_TRUE(result.has_value()); ++ auto& bytes = result.value(); ++ EXPECT_EQ(bytes.size(), 41UL); ++ EXPECT_EQ(bytes.at(0), 0xd8); ++ EXPECT_EQ(bytes.at(1), 0x2a); ++ EXPECT_EQ(bytes.at(2), 0x58); ++ EXPECT_EQ(bytes.at(3), 0x25); ++ for (auto i = 0UL; i < content.size(); ++i) { ++ ASSERT_LT(i + 4UL, bytes.size()); ++ ASSERT_EQ(content.at(i), bytes.at(i+4UL)); ++ } ++} ++ + } // namespace cbor diff --git a/chromium_edits/125.0.6412.0/components/open_from_clipboard/clipboard_recent_content_generic.cc.patch b/chromium_edits/125.0.6412.0/components/open_from_clipboard/clipboard_recent_content_generic.cc.patch new file mode 100644 index 00000000..291d84f1 --- /dev/null +++ b/chromium_edits/125.0.6412.0/components/open_from_clipboard/clipboard_recent_content_generic.cc.patch @@ -0,0 +1,13 @@ +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 +--- a/components/open_from_clipboard/clipboard_recent_content_generic.cc ++++ b/components/open_from_clipboard/clipboard_recent_content_generic.cc +@@ -20,7 +20,7 @@ + namespace { + // Schemes appropriate for suggestion by ClipboardRecentContent. + const char* kAuthorizedSchemes[] = { +- url::kAboutScheme, url::kDataScheme, url::kHttpScheme, url::kHttpsScheme, ++ url::kAboutScheme, url::kDataScheme, url::kHttpScheme, url::kHttpsScheme, "ipfs", "ipns" + // TODO(mpearson): add support for chrome:// URLs. Right now the scheme + // for that lives in content and is accessible via + // GetEmbedderRepresentationOfAboutScheme() or content::kChromeUIScheme diff --git a/chromium_edits/125.0.6412.0/net/dns/dns_config_service_linux.cc.patch b/chromium_edits/125.0.6412.0/net/dns/dns_config_service_linux.cc.patch new file mode 100644 index 00000000..3b042d33 --- /dev/null +++ b/chromium_edits/125.0.6412.0/net/dns/dns_config_service_linux.cc.patch @@ -0,0 +1,18 @@ +diff --git a/net/dns/dns_config_service_linux.cc b/net/dns/dns_config_service_linux.cc +index f909f127ba3e1..31d7f9d58c0af 100644 +--- a/net/dns/dns_config_service_linux.cc ++++ b/net/dns/dns_config_service_linux.cc +@@ -271,11 +271,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; +- ++ case NsswitchReader::Service::kResolve: ++ break; + case NsswitchReader::Service::kMdns: + case NsswitchReader::Service::kMdns4: + case NsswitchReader::Service::kMdns6: +- case NsswitchReader::Service::kResolve: + case NsswitchReader::Service::kNis: + RecordIncompatibleNsswitchReason( + IncompatibleNsswitchReason::kIncompatibleService, diff --git a/chromium_edits/125.0.6412.0/third_party/blink/renderer/platform/weborigin/scheme_registry.cc.patch b/chromium_edits/125.0.6412.0/third_party/blink/renderer/platform/weborigin/scheme_registry.cc.patch new file mode 100644 index 00000000..7fcbedc1 --- /dev/null +++ b/chromium_edits/125.0.6412.0/third_party/blink/renderer/platform/weborigin/scheme_registry.cc.patch @@ -0,0 +1,13 @@ +diff --git a/third_party/blink/renderer/platform/weborigin/scheme_registry.cc b/third_party/blink/renderer/platform/weborigin/scheme_registry.cc +index 62163e44e292e..60d00b8140759 100644 +--- a/third_party/blink/renderer/platform/weborigin/scheme_registry.cc ++++ b/third_party/blink/renderer/platform/weborigin/scheme_registry.cc +@@ -66,7 +66,7 @@ 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"}), ++ fetch_api_schemes({"http", "https", "ipfs", "ipns"}), + allowed_in_referrer_schemes({"http", "https"}) { + for (auto& scheme : url::GetCorsEnabledSchemes()) + cors_enabled_schemes.insert(scheme.c_str()); diff --git a/chromium_edits/125.0.6412.0/url/BUILD.gn.patch b/chromium_edits/125.0.6412.0/url/BUILD.gn.patch new file mode 100644 index 00000000..201770c4 --- /dev/null +++ b/chromium_edits/125.0.6412.0/url/BUILD.gn.patch @@ -0,0 +1,32 @@ +diff --git a/url/BUILD.gn b/url/BUILD.gn +index aedf1bf9f80be..b11c73a88aae5 100644 +--- a/url/BUILD.gn ++++ b/url/BUILD.gn +@@ -5,6 +5,7 @@ + import("//build/buildflag_header.gni") + import("//testing/libfuzzer/fuzzer_test.gni") + import("//testing/test.gni") ++import("//third_party/ipfs_client/args.gni") + import("features.gni") + + import("//build/config/cronet/config.gni") +@@ -67,6 +68,7 @@ component("url") { + public_deps = [ + "//base", + "//build:robolectric_buildflags", ++ "//third_party/ipfs_client:ipfs_buildflags", + ] + + configs += [ "//build/config/compiler:wexit_time_destructors" ] +@@ -89,6 +91,11 @@ component("url") { + public_configs = [ "//third_party/jdk" ] + } + ++ if (enable_ipfs) { ++ sources += [ "url_canon_ipfs.cc" ] ++ deps += [ "//third_party/ipfs_client:ipfs_client" ] ++ } ++ + if (is_win) { + # Don't conflict with Windows' "url.dll". + output_name = "url_lib" diff --git a/chromium_edits/125.0.6412.0/url/url_canon.h.patch b/chromium_edits/125.0.6412.0/url/url_canon.h.patch new file mode 100644 index 00000000..71d7a758 --- /dev/null +++ b/chromium_edits/125.0.6412.0/url/url_canon.h.patch @@ -0,0 +1,28 @@ +diff --git a/url/url_canon.h b/url/url_canon.h +index bd40235e4aa85..05d250fe1b746 100644 +--- a/url/url_canon.h ++++ b/url/url_canon.h +@@ -815,6 +815,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/125.0.6412.0/url/url_canon_ipfs.cc b/chromium_edits/125.0.6412.0/url/url_canon_ipfs.cc new file mode 100644 index 00000000..d7c9fdc7 --- /dev/null +++ b/chromium_edits/125.0.6412.0/url/url_canon_ipfs.cc @@ -0,0 +1,55 @@ +#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/125.0.6412.0/url/url_util.cc.patch b/chromium_edits/125.0.6412.0/url/url_util.cc.patch new file mode 100644 index 00000000..e61af3d0 --- /dev/null +++ b/chromium_edits/125.0.6412.0/url/url_util.cc.patch @@ -0,0 +1,17 @@ +diff --git a/url/url_util.cc b/url/url_util.cc +index edf357900d9c1..2b8aeb53ff0db 100644 +--- a/url/url_util.cc ++++ b/url/url_util.cc +@@ -276,7 +276,11 @@ 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")) { ++ // 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. + ParseStandardURL(spec, spec_len, &parsed_input); diff --git a/cmake/CodeCoverage.cmake b/cmake/CodeCoverage.cmake index d7c4813b..0596018d 100644 --- a/cmake/CodeCoverage.cmake +++ b/cmake/CodeCoverage.cmake @@ -293,8 +293,14 @@ function(setup_target_for_coverage_lcov) ) # Generate HTML output set(LCOV_GEN_HTML_CMD - ${GENHTML_PATH} ${GENHTML_EXTRA_ARGS} ${Coverage_GENHTML_ARGS} --prefix "${BASEDIR}" -o - ${Coverage_NAME} ${Coverage_NAME}.info + ${GENHTML_PATH} + ${GENHTML_EXTRA_ARGS} + ${Coverage_GENHTML_ARGS} + --rc genhtml_hi_limit=88 + --rc genhtml_med_limit=73 + --prefix "${BASEDIR}" + -o ${Coverage_NAME} + ${Coverage_NAME}.info ) if(${Coverage_SONARQUBE}) # Generate SonarQube output diff --git a/cmake/chrome.cmake b/cmake/chrome.cmake index a74b1820..09c7bb36 100644 --- a/cmake/chrome.cmake +++ b/cmake/chrome.cmake @@ -17,7 +17,7 @@ if(CMAKE_BUILD_TYPE STREQUAL Release) set(gnargs " ${gnargs} dcheck_always_on=false ") endif() elseif(CMAKE_BUILD_TYPE STREQUAL Debug) - set(gnargs " ${gnargs} is_debug=true dcheck_always_on=true ") + set(gnargs " ${gnargs} is_debug=true dcheck_always_on=true symbol_level=2 ") message(STATUS "Will build Chromium also in debug mode. Note, this has performance implications.") else() message(FATAL_ERROR "Please choose either Debug or Release for CMAKE_BUILD_TYPE (was '${CMAKE_BUILD_TYPE}').") diff --git a/cmake/conanfile.txt b/cmake/conanfile.txt index d58662cf..f78b56e2 100644 --- a/cmake/conanfile.txt +++ b/cmake/conanfile.txt @@ -4,7 +4,7 @@ c-ares/1.22.1 gtest/1.13.0 nlohmann_json/3.11.2 - openssl/3.2.1 + openssl/1.1.1w protobuf/3.20.0 [options] boost/*:header_only=True diff --git a/cmake/patch.py b/cmake/patch.py index 9bdb5877..1c0a9f60 100755 --- a/cmake/patch.py +++ b/cmake/patch.py @@ -1,5 +1,5 @@ #!/usr/bin/env python3 -import sys + from enum import auto, Enum from glob import glob from os import listdir, makedirs, remove @@ -7,7 +7,7 @@ from shutil import copyfile, rmtree from subprocess import call, check_call, check_output, DEVNULL from sys import argv, executable, platform, stderr -from time import ctime +from time import ctime, gmtime, strftime from verbose import verbose try: @@ -17,6 +17,9 @@ import requests +FUDGE = 59913 + + def osname(): if platform == 'linux': return 'Linux' @@ -249,7 +252,7 @@ def release_versions(self, channel, pfrm=None): def oldest(self): evs = self.release_versions('Extended', 'Mac') + self.release_versions('Extended', 'Windows') - evs = list(map(lambda x: (as_int(x[1]), x[1]), evs)) + evs = list(map(lambda x: (as_int(x[1]), x[1], x[0]), evs)) evs.sort() return evs[0] @@ -265,13 +268,12 @@ def electron_version(self, branch='main'): def unavailable(self): avail = list(map(as_int, self.available())) version_set = {} - fudge = 59911 def check(version, version_set, s): i = as_int(version) - by = (fudge,0) + by = (FUDGE,0) for a in avail: d = abs(a-i) - if d < fudge: + if d < FUDGE: return True elif d < by[0]: by = ( d, a ) @@ -343,7 +345,7 @@ def list_ood(self, to_check: list[str], sense: bool): oldest = self.oldest() verbose(f'Oldest supportable version: {oldest}') for p in to_check: - if (as_int(p) < oldest[0] or self.out_of_date(p)) == sense: + if (as_int(p) + FUDGE * 2 < oldest[0] or self.out_of_date(p)) == sense: print(p) @@ -371,6 +373,9 @@ def list_ood(self, to_check: list[str], sense: bool): if len(rels) > 2: print(f'Old {chan:9}{os:7}', rels[2][1]) print("Electron's main branch:", p.electron_version()) + o = p.oldest() + d = ctime(o[2]) + print("Oldest maintained Extended:", o[1], f'({d})') elif argv[1] == 'available': pr = Patcher('/mnt/big/lbl/code/chromium/src', 'git', 'Debug') print(list(pr.available())) diff --git a/cmake/valgrind.suppressions.txt b/cmake/valgrind.suppressions.txt index b7f234e7..33da02a4 100644 --- a/cmake/valgrind.suppressions.txt +++ b/cmake/valgrind.suppressions.txt @@ -12,3 +12,10 @@ fun:getenv ... } +{ + ThisMightResultFromAPreviousPutenv + Memcheck:Addr1 + ... + fun:getenv + ... +} diff --git a/component/LICENSE b/component/LICENSE new file mode 100644 index 00000000..d47b0446 --- /dev/null +++ b/component/LICENSE @@ -0,0 +1,27 @@ +// Copyright 2024 Little Bear Labs +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google LLC nor the names of its +// contributors may be used to endorse or promote products derived from +// this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. diff --git a/component/cache_requestor.cc b/component/cache_requestor.cc index f6dcc09a..6265ebf2 100644 --- a/component/cache_requestor.cc +++ b/component/cache_requestor.cc @@ -28,7 +28,7 @@ void Self::Start() { // dc::ResetHandling::kNeverReset, dc::ResetHandling::kResetOnError, nullptr, base::BindOnce(&Self::Assign, base::Unretained(this))); - LOG(INFO) << "Start(" << result.net_error << ')' << result.net_error; + VLOG(1) << "Start(" << result.net_error << ')' << result.net_error; startup_pending_ = result.net_error == net::ERR_IO_PENDING; if (!startup_pending_) { Assign(std::move(result)); @@ -39,7 +39,7 @@ Self::~CacheRequestor() noexcept = default; void Self::Assign(dc::BackendResult res) { startup_pending_ = false; if (res.net_error == net::OK) { - VLOG(1) << "Initialized disk cache"; + VLOG(2) << "Initialized disk cache"; cache_.swap(res.backend); } else { LOG(ERROR) << "Trouble opening " << name() << ": " << res.net_error; @@ -131,13 +131,12 @@ void Self::OnHeaderRead(Task task, int code) { } void Self::OnBodyRead(Task task, int code) { if (code <= 0) { - VLOG(1) << "Failed to read body for entry " << task.key << " in " << name(); + VLOG(2) << "Failed to read body for entry " << task.key << " in " << name(); Miss(task); return; } task.body.assign(task.buf->data(), static_cast(code)); if (task.request) { - task.SetHeaders(name()); task.orig_src.load_duration = std::chrono::system_clock::now() - task.start; task.orig_src.cat.cached = true; bool valid = false; @@ -150,8 +149,6 @@ void Self::OnBodyRead(Task task, int code) { } } void Self::Store(std::string key, std::string headers, ByteView body) { - VLOG(2) << "Store(" << name() << ',' << key << ',' << headers.size() << ',' - << body.size() << ')'; std::string body_s{reinterpret_cast(body.data()), body.size()}; auto bound = base::BindOnce(&Self::OnEntryCreated, base::Unretained(this), key, headers, body_s); @@ -165,7 +162,7 @@ void Self::OnEntryCreated(std::string cid, std::string body, disk_cache::EntryResult result) { if (result.opened()) { - VLOG(1) << "No need to write an entry for " << cid << " in " << name() + VLOG(2) << "No need to write an entry for " << cid << " in " << name() << " as it is already there and immutable."; } else if (result.net_error() == net::OK) { auto entry = GetEntry(result); @@ -198,11 +195,6 @@ void Self::OnHeaderWritten(scoped_refptr buf, entry->WriteData(1, 0, buf.get(), buf->size(), std::move(bound), true); } -void Self::Task::SetHeaders(std::string_view source) { - auto heads = base::MakeRefCounted(header); - // TODO - header = heads->raw_headers(); -} void Self::Expire(std::string const& key) { if (cache_ && !startup_pending_) { cache_->DoomEntry(key, net::RequestPriority::LOWEST, base::DoNothing()); diff --git a/component/cache_requestor.h b/component/cache_requestor.h index 7cd23d40..746fda74 100644 --- a/component/cache_requestor.h +++ b/component/cache_requestor.h @@ -44,8 +44,6 @@ class CacheRequestor : public gw::Requestor { std::shared_ptr entry; gw::RequestPtr request; ipld::BlockSource orig_src; - - void SetHeaders(std::string_view); }; raw_ref state_; std::unique_ptr cache_; diff --git a/component/chromium_cbor_adapter.cc b/component/chromium_cbor_adapter.cc index 401fc17c..b003081d 100644 --- a/component/chromium_cbor_adapter.cc +++ b/component/chromium_cbor_adapter.cc @@ -61,7 +61,8 @@ auto Self::as_bytes() const -> std::optional> { return std::nullopt; } auto Self::as_link() const -> std::optional { - VLOG(1) << "Trying to do an as_link(" << static_cast(cbor_.type()) << ',' << std::boolalpha << cbor_.has_tag() << ")"; + 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."; return std::nullopt; diff --git a/component/chromium_dns_txt_lookup.cc b/component/chromium_dns_txt_lookup.cc index 40031f65..967f9566 100644 --- a/component/chromium_dns_txt_lookup.cc +++ b/component/chromium_dns_txt_lookup.cc @@ -7,17 +7,13 @@ using Self = ipfs::ChromiumDnsTxtLookup; void Self::SendDnsTextRequest(std::string host, DnsTextResultsCallback res, DnsTextCompleteCallback don) { - if (dns_reqs_.find(host) != dns_reqs_.end()) { - // TODO: do combine two or delay this one. Don't drop the first one!! - // VLOG(2) << "Requested resolution of DNSLink host " << host << " - // multiple times."; - } auto don_wrap = [don, this, host]() { don(); dns_reqs_.erase(host); }; auto* nc = state_->network_context(); - dns_reqs_[host] = std::make_unique(host, res, don_wrap, nc); + dns_reqs_[host].push_back( + std::make_unique(host, res, don_wrap, nc)); } Self::ChromiumDnsTxtLookup(InterRequestState& st) : state_{&st} {} Self::~ChromiumDnsTxtLookup() {} \ No newline at end of file diff --git a/component/chromium_dns_txt_lookup.h b/component/chromium_dns_txt_lookup.h index 515656f6..b7719c83 100644 --- a/component/chromium_dns_txt_lookup.h +++ b/component/chromium_dns_txt_lookup.h @@ -9,7 +9,7 @@ namespace ipfs { class InterRequestState; class ChromiumDnsTxtLookup : public ctx::DnsTxtLookup { raw_ptr state_; - std::map> dns_reqs_; + std::map>> dns_reqs_; void SendDnsTextRequest(std::string, DnsTextResultsCallback, diff --git a/component/ipfs_url_loader.cc b/component/ipfs_url_loader.cc index 1d19f75f..bf4f35d8 100644 --- a/component/ipfs_url_loader.cc +++ b/component/ipfs_url_loader.cc @@ -136,10 +136,8 @@ void ipfs::IpfsUrlLoader::BlocksComplete(std::string mime_type, head->mime_type = mime_type; } std::uint32_t byte_count = partial_block_.size(); - VLOG(2) << "Calling WriteData(" << byte_count << ")"; pipe_prod_->WriteData(partial_block_.data(), &byte_count, MOJO_BEGIN_WRITE_DATA_FLAG_ALL_OR_NONE); - VLOG(2) << "Called WriteData(" << byte_count << ")"; head->content_length = byte_count; head->headers = net::HttpResponseHeaders::TryToCreate("access-control-allow-origin: *"); @@ -150,7 +148,6 @@ void ipfs::IpfsUrlLoader::BlocksComplete(std::string mime_type, auto* reason = net::GetHttpReasonPhrase(static_cast(status_)); auto status_line = base::StringPrintf("HTTP/1.1 %d %s", status_, reason); - VLOG(2) << "Returning with status line '" << status_line << "'.\n"; head->headers->ReplaceStatusLine(status_line); if (mime_type.size()) { head->headers->SetHeader("Content-Type", mime_type); @@ -166,10 +163,6 @@ void ipfs::IpfsUrlLoader::BlocksComplete(std::string mime_type, LOG(INFO) << "Sending response for " << original_url_ << " with mime type " << head->mime_type << " and status line '" << status_line << "' @location '" << resp_loc_ << "'"; - } else { - VLOG(2) << "Sending response for " << original_url_ << " with mime type " - << head->mime_type << " and status line '" << status_line - << "' with no location header."; } head->parsed_headers = network::PopulateParsedHeaders(head->headers.get(), GURL{original_url_}); diff --git a/component/preferences.cc b/component/preferences.cc index 1d582045..c49a5a81 100644 --- a/component/preferences.cc +++ b/component/preferences.cc @@ -72,7 +72,7 @@ void Self::SetGatewayRate(std::string_view k, unsigned val) { save(); } else { changes = delt / 2; - VLOG(1) << "Rate changes total (delta) " << delt; + VLOG(2) << "Rate changes total (delta) " << delt; } } } @@ -82,8 +82,8 @@ void Self::AddGateway(std::string_view k, unsigned r) { d->Set(kRateKey, d->FindInt(kRateKey).value_or(r) + 1); } else { auto j = AsJson(GatewaySpec{k, r}); - LOG(INFO) << static_cast(this) << " Adding " << k << " @ " << r - << " = " << j; + VLOG(2) << static_cast(this) << " Adding " << k << " @ " << r + << " = " << j; curr_.Set(k, std::move(j)); } } @@ -124,15 +124,11 @@ std::size_t Self::delta() const { p = prev_dict->FindInt(kRateKey).value_or(0); } auto off = std::abs(c - p); - if (off) { - VLOG(2) << k << " : " << p << " to " << c << " : absdiff=" << off; - rv += static_cast(off); - } + rv += static_cast(off); } return rv; } void Self::save() { - VLOG(2) << "Saving preferences. Threshold: " << update_thresh; // Should be called on UI thread changes = 0; last_ = curr_.Clone(); diff --git a/doc/explainer.md b/doc/explainer.md index d96cc641..3ea4b649 100644 --- a/doc/explainer.md +++ b/doc/explainer.md @@ -96,7 +96,6 @@ However, this also leaves value on the table. Our approach raise the browser to a first-class citizen of the IPFS ecosystem (doing its own content verification). It enables taking advantage of characteristics built into the protocol, for example caching (in the case of an IPFS block, indefinitely; in the case of an IPNS record, until the specified expiration) by binary CID rather than gateway- and multibase-specific URLs. -It also provides for opportunities down the road for natural synergies, for example using Chromium's mDNS abilities to discover [nearby Kubo](https://github.com/ipfs/kubo/blob/master/docs/config.md#discoverymdnsenabled) gateways. ## Key differences with this approach diff --git a/doc/todo.md b/doc/todo.md index f9a8edd4..147e0696 100644 --- a/doc/todo.md +++ b/doc/todo.md @@ -3,20 +3,16 @@ ## Upstreaming - [ChromiumStyle](https://chromium.googlesource.com/chromium/src/+/main/styleguide/c++/c++.md) ## Documentation - - Document re-use of library/ipfs_client classes - Update design.md to as-implemented ## Production features - UI for User settings, also prefs for turning off discovery etc. - - MDNS discovery of gateways ## QoI - Real URLLoader (not just Simple*) for gateway requests (SetPriority, pause, etc.) - Implement SetPriority - Other hash algos - Other multibase encodings - - IPNS name resolution - receive multiple records and pick highest sequence # (partial) - Etag - IPNS recursion limit ## Dev QoL - Docker builds verifying every documented build approach - - Streamline Windows release, e.g. package_browser - library published in Conan diff --git a/library/conanfile.py b/library/conanfile.py index 75cb4f2f..39fc4b43 100644 --- a/library/conanfile.py +++ b/library/conanfile.py @@ -27,7 +27,9 @@ class IpfsChromium(ConanFile): 'bzip2/1.0.8', 'c-ares/1.22.1', 'nlohmann_json/3.11.2', - 'openssl/1.1.1t', + # 'openssl/3.2.1', + # 'openssl/1.1.1t', + 'openssl/1.1.1w', _PB, ] # default_options = {"boost/*:header_only": True} diff --git a/library/include/ipfs_client/ctx/boost_beast_http.h b/library/include/ipfs_client/ctx/boost_beast_http.h index b537f881..665ec194 100644 --- a/library/include/ipfs_client/ctx/boost_beast_http.h +++ b/library/include/ipfs_client/ctx/boost_beast_http.h @@ -13,7 +13,7 @@ namespace ipfs::ctx { class BoostBeastHttp : public HttpApi { boost::asio::io_context& io_; boost::asio::ssl::context mutable ssl_ctx_ = - boost::asio::ssl::context{boost::asio::ssl::context::tls_client}; + boost::asio::ssl::context{boost::asio::ssl::context::sslv23_client}; public: BoostBeastHttp(boost::asio::io_context&); diff --git a/library/include/ipfs_client/opinionated_context.h b/library/include/ipfs_client/opinionated_context.h index a7863b25..1f8370ff 100644 --- a/library/include/ipfs_client/opinionated_context.h +++ b/library/include/ipfs_client/opinionated_context.h @@ -1,10 +1,11 @@ #ifndef IPFS_OPINIONATED_CONTEXT_H_ #define IPFS_OPINIONATED_CONTEXT_H_ -#include #include #include +#include + #include #include diff --git a/library/src/ipfs_client/car.cc b/library/src/ipfs_client/car.cc index 1d63d786..91cfb814 100644 --- a/library/src/ipfs_client/car.cc +++ b/library/src/ipfs_client/car.cc @@ -23,7 +23,7 @@ Self::Car(ByteView bytes, Client& api) { auto version = ReadHeader(after_header, api); switch (version) { case 0: - VLOG(1) << "Problem parsing CAR header."; + VLOG(2) << "Problem parsing CAR header."; break; case 1: data_ = after_header; @@ -31,8 +31,14 @@ Self::Car(ByteView bytes, Client& api) { case 2: { auto [off, siz] = GetV1PayloadPos(after_header); LOG(INFO) << "CARv2 carries a payload of " << siz << "B @ " << off; - // TODO validate off and siz are sane, e.g. not pointing back into pragma - // or whatever + if (bytes.size() - after_header.size() > off) { + LOG(ERROR) << "CARv2 payload is supposedly offset into the V1 header"; + break; + } + if (siz > after_header.size()) { + LOG(ERROR) << "Payload size indicated by V1 header too large."; + break; + } data_ = bytes.subspan(off, siz); ReadHeader(data_, api); break; diff --git a/library/src/ipfs_client/client.cc b/library/src/ipfs_client/client.cc index 9d5bc75f..98e2da9c 100644 --- a/library/src/ipfs_client/client.cc +++ b/library/src/ipfs_client/client.cc @@ -73,7 +73,7 @@ std::string Self::UnescapeUrlComponent(std::string_view url_comp) { auto Self::partition(std::string key) -> std::shared_ptr { auto& part = partitions_[key]; if (!part) { - VLOG(1) << "New partition for key '" << key << "'."; + VLOG(2) << "New partition for key '" << key << "'."; part = std::make_shared(requestor(), shared_from_this()); } return part; diff --git a/library/src/ipfs_client/crypto/openssl_signature_verifier.cc b/library/src/ipfs_client/crypto/openssl_signature_verifier.cc index 47244b66..e94e62bc 100644 --- a/library/src/ipfs_client/crypto/openssl_signature_verifier.cc +++ b/library/src/ipfs_client/crypto/openssl_signature_verifier.cc @@ -28,7 +28,7 @@ bool Self::VerifySignature(ipfs::ByteView signature, } auto result = EVP_DigestVerify(ctx.get(), sig_p, signature.size(), data_p, data.size()); - VLOG(1) << "EVP_DigestVerify returned " << result; + VLOG(2) << "EVP_DigestVerify returned " << result; return result == 1; } diff --git a/library/src/ipfs_client/ctx/boost_beast_http_unittest.cc b/library/src/ipfs_client/ctx/boost_beast_http_unittest.cc new file mode 100644 index 00000000..1b27c39e --- /dev/null +++ b/library/src/ipfs_client/ctx/boost_beast_http_unittest.cc @@ -0,0 +1,28 @@ +#include + +#include + +#include + +TEST(BoostBeastHttpTest, GoogleHomePage) { + boost::asio::ssl::context ssl_sux{boost::asio::ssl::context::sslv23_client}; + boost::asio::io_context io; + ipfs::ctx::BoostBeastHttp t{io}; + ipfs::HttpRequestDescription d_; + d_.timeout_seconds = 9; + d_.accept = "text/html"; + d_.max_response_size = 1024UL * 1024UL; + d_.url = "http://www.google.com/"; + std::int16_t status = 0; + std::string body; + t.SendHttpRequest(d_, [&](auto s, auto b, auto h) { + status = s; + body.assign(b); + }); + for (auto i = 0; !status && i < 9; ++i) { + io.run(); + } + EXPECT_EQ(status, 200); + EXPECT_TRUE(body.find("Google has many special features") < body.size()) + << body; +} diff --git a/library/src/ipfs_client/ctx/default_gateways.cc b/library/src/ipfs_client/ctx/default_gateways.cc index 2a3a1913..dbdcaae6 100644 --- a/library/src/ipfs_client/ctx/default_gateways.cc +++ b/library/src/ipfs_client/ctx/default_gateways.cc @@ -29,32 +29,32 @@ 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/", 12'050}, - {"https://ipfs.io/", 504}, - {"https://jcsl.hopto.org/", 491}, - {"https://gateway.ipfs.io/", 428}, - {"https://ipfs.eth.aragon.network/", 299}, - {"https://cloudflare-ipfs.com/", 264}, - {"https://cf-ipfs.com/", 116}, - {"https://ipfs.joaoleitao.org/", 77}, - {"https://ipfs.fleek.co/", 62}, - {"https://trustless-gateway.link/", 30}, - {"https://delegated-ipfs.dev/", 26}, - {"https://dweb.link/", 14}, - {"https://dag.w3s.link/", 13}, - {"https://hardbin.com/", 12}, - {"https://permaweb.eu.org/", 11}, - {"https://nftstorage.link/", 10}, - {"https://4everland.io/", 9}, - {"https://gateway.pinata.cloud/", 8}, - {"https://w3s.link/", 7}, - {"https://data.filstorage.io/", 6}, - {"https://cesginc.com/", 5}, - {"https://ipfs.runfission.com/", 4}, - {"https://human.mypinata.cloud/", 3}, - {"https://http.f02620.devtty.eu/", 2}, - {"https://ipfs.omnicloudstorage.com:9443/", 1}, - {"https://f010479.twinquasar.io/", 0}}; + std::pair{"http://127.0.0.1:8080/", 12'021}, + {"https://jcsl.hopto.org/", 380}, + {"https://ipfs.io/", 341}, + {"https://gateway.ipfs.io/", 325}, + {"https://ipfs.eth.aragon.network/", 275}, + {"https://cloudflare-ipfs.com/", 194}, + {"https://ipfs.joaoleitao.org/", 50}, + {"https://cf-ipfs.com/", 40}, + {"https://hardbin.com/", 6}, + {"https://trustless-gateway.link/", 6}, + {"https://human.mypinata.cloud/", 6}, + {"https://delegated-ipfs.dev/", 6}, + {"https://ipfs.greyh.at/", 5}, + {"https://nftstorage.link/", 4}, + {"https://dweb.link/", 4}, + {"https://dag.w3s.link/", 4}, + {"https://w3s.link/", 4}, + {"https://ipfs.fleek.co/", 4}, + {"https://permaweb.eu.org/", 3}, + {"https://ipfs.runfission.com/", 3}, + {"https://cesginc.com/", 3}, + {"https://4everland.io/", 3}, + {"https://ipfs.omnicloudstorage.com:9443/", 2}, + {"https://f010479.twinquasar.io/", 2}, + {"https://data.filstorage.io/", 2}, + {"https://gateway.pinata.cloud/", 1}}; for (auto [gw, rt] : static_list) { cfg.AddGateway(gw, rt); } diff --git a/library/src/ipfs_client/ctx/transitory_gateway_config_unittest.cc b/library/src/ipfs_client/ctx/transitory_gateway_config_unittest.cc new file mode 100644 index 00000000..c7f24e98 --- /dev/null +++ b/library/src/ipfs_client/ctx/transitory_gateway_config_unittest.cc @@ -0,0 +1,18 @@ +#include + +#include + +#include + +TEST(TransitoryGatewayConfigTest, EmptyStringEnvLoadsStatic) { + char env[15] = "IPFS_GATEWAY="; + putenv(env); + ipfs::ctx::TransitoryGatewayConfig c; + auto first = c.GetGateway(0); + EXPECT_TRUE(first.has_value()); + auto second = c.GetGateway(1); + EXPECT_TRUE(second.has_value()); + EXPECT_NE(first->prefix, second->prefix); + EXPECT_GE(first->rate, second->rate); + EXPECT_GT(second->rate, 0); +} diff --git a/library/src/ipfs_client/gw/default_requestor_unittest.cc b/library/src/ipfs_client/gw/default_requestor_unittest.cc index e62a5ca6..ddb5adff 100644 --- a/library/src/ipfs_client/gw/default_requestor_unittest.cc +++ b/library/src/ipfs_client/gw/default_requestor_unittest.cc @@ -40,4 +40,4 @@ TEST(DefaultRequestorTest, name_check) { a.next->TestAccess(&a); EXPECT_EQ(a.name, "Terminating requestor"); EXPECT_FALSE(a.next); -} \ No newline at end of file +} diff --git a/library/src/ipfs_client/gw/gateway_state.cc b/library/src/ipfs_client/gw/gateway_state.cc index 523651e8..b5dbea95 100644 --- a/library/src/ipfs_client/gw/gateway_state.cc +++ b/library/src/ipfs_client/gw/gateway_state.cc @@ -46,13 +46,16 @@ unsigned int& Self::current_bucket() { } void Self::hit(GatewayRequestType grt, GatewayRequest const& req) { auto& c = cfg(); - auto aff = c.GetTypeAffinity(prefix_, grt); - c.SetTypeAffinity(prefix_, grt, ++aff); - affinity_success[req.affinity]++; + auto typaff = c.GetTypeAffinity(prefix_, grt); + c.SetTypeAffinity(prefix_, grt, std::max(typaff + 9, typaff / 9)); + affinity_success[req.affinity] += 9; auto rpm = c.GetGatewayRate(prefix_); - if (!over_rate(rpm / 3)) { + if (!over_rate(rpm / 4)) { return; } + if (over_rate(rpm / 3)) { + ++rpm; + } if (over_rate(rpm / 2)) { ++rpm; } diff --git a/library/src/ipfs_client/gw/multi_gateway_requestor.cc b/library/src/ipfs_client/gw/multi_gateway_requestor.cc index 4950d477..de4184f4 100644 --- a/library/src/ipfs_client/gw/multi_gateway_requestor.cc +++ b/library/src/ipfs_client/gw/multi_gateway_requestor.cc @@ -35,9 +35,6 @@ void Self::Next() { } } bool Self::Process(RequestPtr const& req) { - if (req->type == GatewayRequestType::Providers) { - VLOG(2) << "Process(" << req->debug_string() << ")"; - } if (!req->is_http()) { return false; } @@ -50,8 +47,6 @@ bool Self::Process(RequestPtr const& req) { auto& gws = api_->gw_cfg(); while (auto gw = gws.GetGateway(config_idx++)) { if (state_iter == state_.end() || state_iter->first > gw->prefix) { - VLOG(2) << "A new gateway has entered the chat: " << gw->prefix << '=' - << gw->rate; // One can insert like this because state_ is std::map w/ stable iterators state_iter = state_.insert({gw->prefix, GatewayState{gw->prefix, api_}}).first; @@ -147,8 +142,6 @@ void Self::HandleResponse(HttpRequestDescription const& desc, LOG(ERROR) << "No content-type header?"; } else if (desc.accept.size() && ct.find(desc.accept) == std::string::npos) { - VLOG(2) << "Requested with Accept: " << desc.accept - << " but received response with content-type: " << ct; if (state_.end() != i) { i->second.miss(req_type, *req); } @@ -158,10 +151,7 @@ void Self::HandleResponse(HttpRequestDescription const& desc, ipfs::ipld::BlockSource src; src.load_duration = src.fetched_at - start; src.cat.gateway_url = gw; - if (!req->RespondSuccessfully(body, api_, src)) { - VLOG(2) << "Got an unuseful response from " << gw << " for request " - << req->debug_string(); - } else { + if (req->RespondSuccessfully(body, api_, src)) { if (state_.end() != i) { i->second.hit(req_type, *req); } @@ -173,7 +163,6 @@ void Self::HandleResponse(HttpRequestDescription const& desc, req->failures.insert(gw); if (status == 408 || status == 504 || status == 429 || status == 110 || timed_out) { - VLOG(2) << gw << " timed out on request " << req->debug_string(); if (req->type == GatewayRequestType::Block) { if (state_.end() != i) { i->second.timed_out(); diff --git a/library/src/ipfs_client/gw/providers_response.cc b/library/src/ipfs_client/gw/providers_response.cc index 77f9427f..4a0ebe9f 100644 --- a/library/src/ipfs_client/gw/providers_response.cc +++ b/library/src/ipfs_client/gw/providers_response.cc @@ -106,7 +106,7 @@ bool prov::ProcessResponse(std::string_view json_str, Client& api) { bool rv = false; auto parse_one = [&rv, &api](auto& p) { rv = ParseProvider(p, api) || rv; }; if (!list->iterate_list(parse_one)) { - LOG(ERROR) << ".Providers was not a list."; + VLOG(2) << ".Providers was not a list."; } return rv; } diff --git a/library/src/ipfs_client/gw/requestor_unittest.cc b/library/src/ipfs_client/gw/requestor_unittest.cc index 8dc7c51c..491d07c3 100644 --- a/library/src/ipfs_client/gw/requestor_unittest.cc +++ b/library/src/ipfs_client/gw/requestor_unittest.cc @@ -61,4 +61,3 @@ TEST_F(RequestorTest, done_stops_request) { EXPECT_TRUE(a->requests_sent_to_handle.at(0) == req_); } -TEST_F(RequestorTest, success_callsback) {} diff --git a/library/src/ipfs_client/ipld/chunk.cc b/library/src/ipfs_client/ipld/chunk.cc index 303fe410..5f13bfd5 100644 --- a/library/src/ipfs_client/ipld/chunk.cc +++ b/library/src/ipfs_client/ipld/chunk.cc @@ -11,8 +11,8 @@ auto Chunk::resolve(ResolutionState& params) -> ResolveResult { if (params.IsFinalComponent()) { return Response{"", 200, data_, params.MyPath().to_string(), {}}; } else { - LOG(ERROR) << "Can't resolve a path (" << params.MyPath() - << ") inside of a file chunk!"; + LOG(WARNING) << "Can't resolve a path (" << params.MyPath() + << ") inside of a file chunk!"; return ProvenAbsent{}; } } diff --git a/library/src/ipfs_client/ipld/directory_shard.cc b/library/src/ipfs_client/ipld/directory_shard.cc index 4ce7a4db..2508f3de 100644 --- a/library/src/ipfs_client/ipld/directory_shard.cc +++ b/library/src/ipfs_client/ipld/directory_shard.cc @@ -17,6 +17,7 @@ using Self = ipfs::ipld::DirShard; auto Self::resolve(ResolutionState& parms) -> ResolveResult { if (parms.IsFinalComponent()) { + // index.html hashes A0 6D 7E C8 78 79 38 1D B3 8D 36 0D 76 FA 7B BF auto index_parm = parms.WithPath("index.html"sv); auto result = resolve(index_parm); // TODO generate index.html if not present diff --git a/library/src/ipfs_client/ipns_record.cc b/library/src/ipfs_client/ipns_record.cc index bff5582c..2d5846aa 100644 --- a/library/src/ipfs_client/ipns_record.cc +++ b/library/src/ipfs_client/ipns_record.cc @@ -222,7 +222,7 @@ ipfs::ValidatedIpns::ValidatedIpns(IpnsCborEntry const& e) #else use_until = timegm(&t); #endif - VLOG(1) << "use_until=" << use_until << " based on " << e.validity; + VLOG(2) << "use_until=" << use_until << " based on " << e.validity; cache_until = std::time(nullptr) + ttl; } diff --git a/library/src/ipfs_client/partition.cc b/library/src/ipfs_client/partition.cc index 9abc2fbe..1789a5a7 100644 --- a/library/src/ipfs_client/partition.cc +++ b/library/src/ipfs_client/partition.cc @@ -54,10 +54,6 @@ void Self::from_tree(std::shared_ptr req, if (response) { if (response->mime_.empty() && !response->body_.empty()) { if (response->location_.empty()) { - VLOG(2) << "Request for " << req->path() - << " returned no location, so sniffing from request path and " - "body of " - << response->body_.size() << "B."; response->mime_ = sniff(req->path(), response->body_); } else { std::string hit_path{req->path().pop_n(2)}; @@ -66,10 +62,6 @@ void Self::from_tree(std::shared_ptr req, hit_path.push_back('/'); } hit_path.append(response->location_); - VLOG(2) << "Request for " << req->path() << " returned a location of " - << response->location_ << " and a body of " - << response->body_.size() << " bytes, sniffing mime from " - << hit_path; response->mime_ = sniff(SlashDelimited{hit_path}, response->body_); } } @@ -117,11 +109,10 @@ bool Self::add_node(std::string key, ipfs::ipld::NodePtr p) { } auto [it, first] = dags_.insert({key, p}); if (first) { - VLOG(2) << "First node showed up for [" << key << "]."; + // VLOG(2) << "First node showed up for [" << key << "]."; } else if (p->PreferOver(*it->second)) { it->second = p; } else { - // VLOG(2) << "Already had a [" << key << "] node that was as good."; return false; } p->set_api(api_); @@ -137,8 +128,6 @@ std::string Self::sniff(ipfs::SlashDelimited p, std::string const& body) const { ext.assign(file_name, dot + 1); } auto result = api_->MimeType(ext, body, fake_url); - VLOG(2) << "Deduced mime from (ext=" << ext << " body of " << body.size() - << " bytes, 'url'=" << fake_url << ")=" << result; return result; } diff --git a/test_data/blocks/QmVKthLvyy5dFjFmfZsUmHZNqsAi3GNMTjGVAdq4g26BrU b/test_data/blocks/QmVKthLvyy5dFjFmfZsUmHZNqsAi3GNMTjGVAdq4g26BrU deleted file mode 100644 index 3f062b12..00000000 --- a/test_data/blocks/QmVKthLvyy5dFjFmfZsUmHZNqsAi3GNMTjGVAdq4g26BrU +++ /dev/null @@ -1,2 +0,0 @@ - -˜Cq4 Cq5 Cq6 Cq7 Cq8 Cq9 Cr0 Cr1 Cr2 Cr3 Cr4 Cr5 Cr6 Cr7 Cr8 Cr9 Cs0 Cs1 Cs2 Cs3 Cs4 Cs5 Cs6 Cs7 Cs8 Cs9 Ct0 Ct1 Ct2 Ct3 Ct4 Ct5 Ct6 Ct7 Ct8 Ct9  \ No newline at end of file diff --git a/test_data/blocks/QmVeHtEim6pkJHdoknVuMNEa3qvzmJLMdawYALvLQ8fjbf b/test_data/blocks/QmVeHtEim6pkJHdoknVuMNEa3qvzmJLMdawYALvLQ8fjbf deleted file mode 100644 index 3143cf20..00000000 --- a/test_data/blocks/QmVeHtEim6pkJHdoknVuMNEa3qvzmJLMdawYALvLQ8fjbf +++ /dev/null @@ -1,2 +0,0 @@ - -˜Lf6 Lf7 Lf8 Lf9 Lg0 Lg1 Lg2 Lg3 Lg4 Lg5 Lg6 Lg7 Lg8 Lg9 Lh0 Lh1 Lh2 Lh3 Lh4 Lh5 Lh6 Lh7 Lh8 Lh9 Li0 Li1 Li2 Li3 Li4 Li5 Li6 Li7 Li8 Li9 Lj0 Lj1  \ No newline at end of file diff --git a/test_data/blocks/QmYjf9FSFBE35WZsqvHh8T2h3HQ7ZdiLo4xWgFWff9Rf5v b/test_data/blocks/QmYjf9FSFBE35WZsqvHh8T2h3HQ7ZdiLo4xWgFWff9Rf5v deleted file mode 100644 index 432139e7f0b31837be719d79c97655b3ab22d95d..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 8013 zcmeI%&N^>5!7{p`@i7>F!PiM7pFKq&tP7K|m1R^PW%p zk2q`1$7}u8{p{J#z2m`W!J@^d4nI`o{5z)8iH+P#S!=K~=twq!80P^=lN4X;r~Ab? ziH|^%GYV-s)C9Y4P*mUdAy%$y3MTzy9WohY>G&pQ~$e>i>TBRzbaEzy2%Jce`+^%gI9AFVRZ_IH(8HCli+ znrtchZdK30SG!H~Q!*)zDX+YLOUq$XEMg4oDw#I`)Z(hkZnL!dlxLI1XKZo>{gUZO z-7?dnC{N&bEb{h?et;H9!#7>_uuFuGl>(4OacmF|90DO0vuK+NQJ2Y~BBKCBVMQZ2 zcRu7F^E$tiInVb{ zBAX*6HvAjh8VJzU%oKU#NphX^O+SffyyE&fV;Y?zr{9}{L(#|X3yb3bbq_j~Aih5P z0zcIc3PF1@6mhx+)4W^ds21fK>#SEY1?XSs?5*?-f<|@eCvDl7!M>c6gJdFcUyn7S zz&LZACXnVGJ@m*9by^lWq+QKdhcf9fDEh6~1|{o%oHmb$|Lg~(T1{fXg>iMAF#5i9 zth#KHUz~m8rfFG*Lv5&P`}dWS0UCyatKMvxixVH_v2m>NYGWjvsoKN^GfCsyw-+W( zk+%TVbX9#3KLINnY#5+v6oya~jBqRAuVp0U)Vw244r`|dD0`PGQ@WfsfmbIwCYgB@ zlq~|`pNiSWyQ3gZD?CfwT!1&lqx+D0bQK>P^M zm-Y19G?5i%Rl~0jQ!L{)ZFJ*M9e88u`;n)*=*04)06IF5D*S0hUL4;xK1$7rQ#HM5 zk1wFogmc`Z&GCfQ9efLBzMZo@)U@bhYbvH19#NGAxy@~V4ZzQhOBldN|NWN?NIhJf z!X7RqH9`4djWDW0XSJEtk*uSx%Jc%unnb+-20qp%k)hfFHU0Q~b=i>+$pXBm%T~k%#JZeqeu`+z9Pil%9r;5?AwcyK1xXe6D}GcMf3JHa6fvAb3?+a=oR+ zw0mk%!*}__$if->gmmHWYr%R~3ZyOxP?7xE7B4Jc_bVn%A`w0}H){=T+8AJQw;ny2 z?iB|pf$w=35sKW|CpmdMCEkR7u8tmrr$MsmjYD059)6y80R34nAg~?Do*SWca5~#zR`=>+MP=u-fV!!{ZLV#!M%riSjnFYbPyh#=et5@GXEsp-W67#V`g6^wFJ=TXYb8Q?*_Tw@5#cqEMa1COcqmb zqWM%Fp*fRr800X3(lKP&;QJdO4Ehfs&H9BM{uzti9UNO@*=5^Z@Zt=011OE}5f63H zgJOlG^MZp)txEdN3du>2As;eIyXD$f>T`hhk@QJH+@4t2m6Ra|5E{_AdERep zNvFkIJ97R7Xgx}#a8OO?Ci}&e?5iUk_K^mzlLNElVwB&jR|;Zh;B=XISrx3Zd~EUS z&}#4?{1eWJv_YbnXV=fJi#N=Vw47r=YQtKKF6Hk|^x;I-#Ur$fa*3sad-lbX5TV=Q z%kdOu@QtN%p!WMZiM`qiL*{qHT{#V%DPEYiNSAy!eLxZLi^c>ZZ;6g@91$Tr{Osb4iXJU}j`hJni1l*zVyh&N3%xk1&Vl^&p z)c{ESTouaU(*EQbL)ZSf!ZQ|AKj>@op(nfRP3-wke6PdT0BwH1Uqq8wL-|M(~f7r`1x-KNNBC`R3K-rmruAu{`K;C&VmCle$hF@$#iB zkor45LR$9Vd_NOIkt8!W7&}qLS)*Mme4%STP6=PCts0;+_wlUeb0MNP43MDH^E$NT zFHE9zFY(Pr377MOJww0(>J?DTqN-b=0cMVn0yK1EdOp-^ztguW`B)q%O)ElnKx#qq zYI@M>7z|Jm@A z5`%4-nI@h$e!(vWsEF0XPU;M4>tjXoN!k5{2NuKJJiYbq<0`)e`GuJ&J3woazV6cv zqwEPh=G1O3=W*$dhPR=g8LCiv`arKsj;Ae)%R_hQ zEh&o_cCV-nQ<0B=XjTG1JGG2ohaz1+6F~P0bT|m!#5+jJc7Mi#;UNdNj!h~!sZ3~6i^pIgyrCQ;`Y_e=+AR<$XSsw**5=8qu4|0M&ngZ3M&lZP1_<;5NM)_>XIQ9UisRXFFV@TFL)X z!4sgq_d!a~=h8Z76po25x@Gq7U}3e-PRLO%D;V^pu&2xbdhCjVFWZ{z5Mz3RGmKa% z*!9a=OaM+}vFCqC>^4(|4bXWfERr9iqV=53xo^p};yZrWW&U;5Pep}5<{X55p)UXm z;cR(Dn`Y>#8QTzUAm=VlUvx^`Tfic@FvmwYFf@t7v?^`MY>`ZVLB z$e7N?tXM@3(%Y|ec>q;5GdA{-t)!oT@X-bJFpbi11(4HBiU`9>)1ei@1Aj4Hx>C5%+&c* zJoO;^iCLU)6`Ze(KbOL_W_oUCB8k13NG@hPYQILGuCf_^_4nlNsfr5*3a|@p7Omo4 zk!R+ZW*v7mKKDxKi~FX`Dk4crFbQqT=mBU_{G*kljnvt1y5D3SQ(b3K~uacFTr)e zQ|wEwRtWVtoE`othmQRlLJU5ZfY_Oj&KP@l4FiLx#n9pz8fuJbxgNAxpe9@HaBLGi zZ(*RoIoK?GYVtYc%MtFwz6h*N;o>aWlp5DPA})>MJOH)k^cvve^_h_PYE)=A?%$kU zgmEvha>}WR{hVf82)6`xnsg>KJe3z6N>XQW8Y?~#10?6W)S_;yL>GQ*_*WI%)<9}f zo&9ZJwyekMqik$`bq3VrUKI7L;17&?zB9Sdy<`HQ96Vw;Zk8`Pl~D%sddF5&e(%c1 zPPrFDZX(f+eAHOe0Qv^fRcv&Yri!vea8xV!3nrP8W#l}ma~hX1ulU78c?h7;edbpJ zFKNOXS3}K-IgC=g?9T(?@V1?oQ|P%g`8j_8+TQgcNXIj|$-1m;hTz9$l!2HD+10aL zNMM#IqN~^^K7ig5ZY$kAa7N?BOOxI=a+B8{Lo~}0c3l}_ver~7y1;!FS62-4o*h-Q z-9SE7a-fWf76nB6Y9=!JWxP_Vwdbu6kg9fdfqwl>i#6MMcnV(h({^!-hQ|Uwt^lIQ z?L2EJg9y-OLXtYCrW=ndfpFj7+Cu8VBUf0L{bbInygL^=^OYC?HKIaFvb9t(Jr|{8 zcd*%Hq}u+Q_x-p!iE~5LHS?kc+`*rUH2NO=ZQ`nA+;a<~XxoPtmFd!zQ)%Jy$Wb*~ z(SY6M1{H^5@OkuU&8lV1=VBrLAVPKJ$#Z$Q)Rn)5M0qR$PyibVQ+=BggVUO}mtNt; zl-RTG#*u=V5j8cfRyq=`M_YiN?clVAH7lm1&581{)zy}dP{+XB{ikNsbqdLJX~TX4 zwBeW^=|w#12`*W>g#DR}ag1%2RIwyWOjLe$OsFj-7eINQU(v6;PrIXI8?+3HFtp9V zDL}L+)=+x0xVHS|xW5aa^Lsx=S##JG$*OQ_h9s7`=?t?LD>ni~#El|tOF}rnT`{wr z*5(qXuBPo^6UwVW{&eYrO9sCueya!@BO`rF4DiTXf?-{%|B=#0nxT_r@ROpNh{;K4 zIb~=$Zqx3QL?$7)#EGV;V7H54NW`9^J-JmM+h0|_FP0R$Jn1nz_#)Yv_W`JNI@40% zFTIm!uLbtiCgS+TTgIrnsG5i!7Tr6-T!j@MfEv&kdv!m+Q#hTF*Lb6pG!f!0C#_m@ zX^d449O}*-qX6nRA*{q}xf8^ly<2-v=$mdX!ntl`9<8jTtV7CZ>jpN>Mdc13k?WNC ze#`KZo%fBfPoo;ZJ0AT@kNf4b3fdwmA;kdv1AV%UBR52E$LQKk-B zEMoEGG2a|*ofc}Y@YMDw^Jal|_^3=Abjpr`+;V09MYfNyHZg&we zHCVu07|9mvNa>`cocqbU*b@EhS^TET{WG1N#tFs@fl@Hlf-FAlLB57uk=NF)???L; zuegN{+T`6=O>Muu3@qDxpn#-ODze?o)ekty4QKoQxDw%}YQ@tcimY{23si_|DLMds zGxkNO9^V(eKHDB2A@JCWN_Behb{hAYz%V8E$r@x8po{siUoiV2O>YlWUbY^Ym@{lX z{Fu~>m;+XypuNmfu)PU~xL@LkILkUx6W`#zeOS+!K`Xg~(D)&@l&*YW&jI(Z`+cx_ zE=Px)&L0?#YP~C7)&+&5yUd#dx_fDLt-KC9!!MwUHIUApoT9O(SE(#3 z>~bHYQcVkT01AJPx0Y%z9i6v$T0M&{Y`u>u7=S)5+ETPnL9fJ+)C^E=ewNN4rVi_O zmPZs{^Li4_Kgf9zAy~h9sOq!P?Zr?4X#2g)02ZakNidrh&4fKH7Uj1LnOFftD~u~v zO?GL+3!oceBMptmamZ4e>C3k>X+`5$1?HY^AnAOy*XFl1tn32%+MKlOdR0FBy zhEwDDvjQ?fPRn^hcFiR2~peLwzrlO4n33MuvT^-v5yJiF`u@)n& z2yA7bXYVO%Ede0EY54ivyFEUCofH>9r5Mf?J_#)Nd)KaqGS66fXz zhRELP_ZDz!Lw`ahtTo}ysQJ4cgTfIzO+xQt2lSoIB^#RsyRXW@tJ+HMn3SjVcIGJR zTKa_XLfE)B|8RQY`%$%qJKb>cZULZx{Yc^7V*<=@+kV+O_+q!?@{bo`p}pR#)!%&zF!r!jnKZTk#J9sBHr4 zM&N4L5W+@6CZFjL#j;W+k4GXDTSGw+Y)Ga~Ox6x_N?QbXZ;LT0pO_`41Q}Q;3%FlIG{$*j#IZykOe`}fTAIf7aaCpTr1BIz z8(LWmVg=yU?XZkW7$46ZBh1vaGOd_%9??Tq&&*Jktbx>_#}pYAs=@HDLeF9Ff{9GM=!NfcCtcvvuZ$hpc>I zN85=J=E%|~aN)$jhQDvCD+v!e=t!?97{|>x+Q&hCrjp#{V z$RFOl8YYI82(Rm1l?c=uJzho+RZfAx1_hbRGwxXXG+5y>=ajBrSkmW(3q4hK=fad-&OKeLhA7d1gc2(SvR1CWuJ2Sxard&qg*ApqVD>m|uJqlumZ* zem(aqDA0HDeMVQuKS2LW^ISL&t9mVO4H#>*g>Hiu8^oQnva@r`GVnv z^q!YMs?LDMT}Qh=skBh5^uNf8)7+mtimtuLeU+tNeOR1D(J`6l_|6urJDp3)k`HG`Mpyiu);`he7YZA%u^}?b&J9pDQ bz5k|S#iL*#k#6)NQpf-A_rDSN{}K2<`cF_) diff --git a/test_data/blocks/QmYoB5iP6QF1FYjT3svb7k6XNspRbkSGvbFPv1r7f494JZ b/test_data/blocks/QmYoB5iP6QF1FYjT3svb7k6XNspRbkSGvbFPv1r7f494JZ deleted file mode 100644 index 74265944..00000000 --- a/test_data/blocks/QmYoB5iP6QF1FYjT3svb7k6XNspRbkSGvbFPv1r7f494JZ +++ /dev/null @@ -1,2 +0,0 @@ - -˜Xk4 Xk5 Xk6 Xk7 Xk8 Xk9 Xl0 Xl1 Xl2 Xl3 Xl4 Xl5 Xl6 Xl7 Xl8 Xl9 Xm0 Xm1 Xm2 Xm3 Xm4 Xm5 Xm6 Xm7 Xm8 Xm9 Xn0 Xn1 Xn2 Xn3 Xn4 Xn5 Xn6 Xn7 Xn8 Xn9  \ No newline at end of file diff --git a/test_data/blocks/QmZ2PuKJXiX4p2kD8A6Ah8PyKjipsbvfGdsypNhkx5JXoN b/test_data/blocks/QmZ2PuKJXiX4p2kD8A6Ah8PyKjipsbvfGdsypNhkx5JXoN deleted file mode 100644 index c868c4f6..00000000 --- a/test_data/blocks/QmZ2PuKJXiX4p2kD8A6Ah8PyKjipsbvfGdsypNhkx5JXoN +++ /dev/null @@ -1,2 +0,0 @@ - -˜Mm0 Mm1 Mm2 Mm3 Mm4 Mm5 Mm6 Mm7 Mm8 Mm9 Mn0 Mn1 Mn2 Mn3 Mn4 Mn5 Mn6 Mn7 Mn8 Mn9 Mo0 Mo1 Mo2 Mo3 Mo4 Mo5 Mo6 Mo7 Mo8 Mo9 Mp0 Mp1 Mp2 Mp3 Mp4 Mp5  \ No newline at end of file diff --git a/test_data/blocks/QmZ8zEVZH71iTjYqS1gHyTAjkRjvW51HeNBotrjTTaGYme b/test_data/blocks/QmZ8zEVZH71iTjYqS1gHyTAjkRjvW51HeNBotrjTTaGYme deleted file mode 100644 index c11eeff0..00000000 --- a/test_data/blocks/QmZ8zEVZH71iTjYqS1gHyTAjkRjvW51HeNBotrjTTaGYme +++ /dev/null @@ -1,2 +0,0 @@ - -˜Ws4 Ws5 Ws6 Ws7 Ws8 Ws9 Wt0 Wt1 Wt2 Wt3 Wt4 Wt5 Wt6 Wt7 Wt8 Wt9 Wu0 Wu1 Wu2 Wu3 Wu4 Wu5 Wu6 Wu7 Wu8 Wu9 Wv0 Wv1 Wv2 Wv3 Wv4 Wv5 Wv6 Wv7 Wv8 Wv9  \ No newline at end of file diff --git a/test_data/blocks/QmZApedSHDoZuxDgVa8AiHoQpTGtiC8cjPAqwos28VSri9 b/test_data/blocks/QmZApedSHDoZuxDgVa8AiHoQpTGtiC8cjPAqwos28VSri9 deleted file mode 100644 index 7cd774f0..00000000 --- a/test_data/blocks/QmZApedSHDoZuxDgVa8AiHoQpTGtiC8cjPAqwos28VSri9 +++ /dev/null @@ -1,2 +0,0 @@ - -˜Cm8 Cm9 Cn0 Cn1 Cn2 Cn3 Cn4 Cn5 Cn6 Cn7 Cn8 Cn9 Co0 Co1 Co2 Co3 Co4 Co5 Co6 Co7 Co8 Co9 Cp0 Cp1 Cp2 Cp3 Cp4 Cp5 Cp6 Cp7 Cp8 Cp9 Cq0 Cq1 Cq2 Cq3  \ No newline at end of file diff --git a/test_data/blocks/QmZHKJGP6tGhPQwgBW8SRwyGNxTAeZ1JEPCUQ6iGQ7sxZa b/test_data/blocks/QmZHKJGP6tGhPQwgBW8SRwyGNxTAeZ1JEPCUQ6iGQ7sxZa deleted file mode 100644 index 8812d276..00000000 --- a/test_data/blocks/QmZHKJGP6tGhPQwgBW8SRwyGNxTAeZ1JEPCUQ6iGQ7sxZa +++ /dev/null @@ -1,2 +0,0 @@ - -˜Il6 Il7 Il8 Il9 Im0 Im1 Im2 Im3 Im4 Im5 Im6 Im7 Im8 Im9 In0 In1 In2 In3 In4 In5 In6 In7 In8 In9 Io0 Io1 Io2 Io3 Io4 Io5 Io6 Io7 Io8 Io9 Ip0 Ip1  \ No newline at end of file diff --git a/test_data/blocks/QmZPrm6TK5QuquwwQExxxAJwt4zQTrTz5GtaPQcE8Lw43m b/test_data/blocks/QmZPrm6TK5QuquwwQExxxAJwt4zQTrTz5GtaPQcE8Lw43m deleted file mode 100644 index a55e2a33..00000000 --- a/test_data/blocks/QmZPrm6TK5QuquwwQExxxAJwt4zQTrTz5GtaPQcE8Lw43m +++ /dev/null @@ -1,2 +0,0 @@ - -˜Br2 Br3 Br4 Br5 Br6 Br7 Br8 Br9 Bs0 Bs1 Bs2 Bs3 Bs4 Bs5 Bs6 Bs7 Bs8 Bs9 Bt0 Bt1 Bt2 Bt3 Bt4 Bt5 Bt6 Bt7 Bt8 Bt9 Bu0 Bu1 Bu2 Bu3 Bu4 Bu5 Bu6 Bu7  \ No newline at end of file diff --git a/test_data/blocks/QmZU3kboiyi9jV59D8Mw8wzuvsr3HmvskqhYRRhdFA8wRq b/test_data/blocks/QmZU3kboiyi9jV59D8Mw8wzuvsr3HmvskqhYRRhdFA8wRq deleted file mode 100644 index 91f34f08..00000000 --- a/test_data/blocks/QmZU3kboiyi9jV59D8Mw8wzuvsr3HmvskqhYRRhdFA8wRq +++ /dev/null @@ -1,12 +0,0 @@ - -Ž/redirect-one /one.html -/301-redirect-one /one.html 301 -/302-redirect-two /two.html 302 -/200-index /index.html 200 -/posts/:year/:month/:day/:title /articles/:year/:month/:day/:title 301 -/splat/* /redirected-splat/:splat 301 -/not-found/* /404.html 404 -/gone/* /410.html 410 -/unavail/* /451.html 451 -/* /index.html 200 -½ \ No newline at end of file diff --git a/test_data/blocks/QmZWmpki8rHHKM5JapR5V1orGKdSmjxfPG98rr33t4v7yz b/test_data/blocks/QmZWmpki8rHHKM5JapR5V1orGKdSmjxfPG98rr33t4v7yz deleted file mode 100644 index e8c43c2c..00000000 --- a/test_data/blocks/QmZWmpki8rHHKM5JapR5V1orGKdSmjxfPG98rr33t4v7yz +++ /dev/null @@ -1,2 +0,0 @@ - -˜Pg0 Pg1 Pg2 Pg3 Pg4 Pg5 Pg6 Pg7 Pg8 Pg9 Ph0 Ph1 Ph2 Ph3 Ph4 Ph5 Ph6 Ph7 Ph8 Ph9 Pi0 Pi1 Pi2 Pi3 Pi4 Pi5 Pi6 Pi7 Pi8 Pi9 Pj0 Pj1 Pj2 Pj3 Pj4 Pj5  \ No newline at end of file diff --git a/test_data/blocks/QmZjnTPho8usnuvTnYW76npS8GVNahehZq7pHkqoDBB3yK b/test_data/blocks/QmZjnTPho8usnuvTnYW76npS8GVNahehZq7pHkqoDBB3yK deleted file mode 100644 index f948b1ed..00000000 --- a/test_data/blocks/QmZjnTPho8usnuvTnYW76npS8GVNahehZq7pHkqoDBB3yK +++ /dev/null @@ -1,2 +0,0 @@ - -˜Tk0 Tk1 Tk2 Tk3 Tk4 Tk5 Tk6 Tk7 Tk8 Tk9 Tl0 Tl1 Tl2 Tl3 Tl4 Tl5 Tl6 Tl7 Tl8 Tl9 Tm0 Tm1 Tm2 Tm3 Tm4 Tm5 Tm6 Tm7 Tm8 Tm9 Tn0 Tn1 Tn2 Tn3 Tn4 Tn5  \ No newline at end of file diff --git a/test_data/blocks/bafkreicmsref4dbbvzwedtq57z5wx6wo5jnlndsaujdw6ubarzjg6udaqa b/test_data/blocks/bafkreicmsref4dbbvzwedtq57z5wx6wo5jnlndsaujdw6ubarzjg6udaqa deleted file mode 100644 index bb79ec2d..00000000 --- a/test_data/blocks/bafkreicmsref4dbbvzwedtq57z5wx6wo5jnlndsaujdw6ubarzjg6udaqa +++ /dev/null @@ -1 +0,0 @@ -v \ No newline at end of file diff --git a/test_data/blocks/bafkreicoa5aikyv63ofwbtqfyhpm7y5nc23semewpxqb6zalpzdstne7zy b/test_data/blocks/bafkreicoa5aikyv63ofwbtqfyhpm7y5nc23semewpxqb6zalpzdstne7zy deleted file mode 100644 index e440e5c8..00000000 --- a/test_data/blocks/bafkreicoa5aikyv63ofwbtqfyhpm7y5nc23semewpxqb6zalpzdstne7zy +++ /dev/null @@ -1 +0,0 @@ -3 \ No newline at end of file diff --git a/test_data/blocks/bafkreicq44q6jhabh4ammlhvt4qwgvbktwg7ajde57vwcxjraunq7xodey b/test_data/blocks/bafkreicq44q6jhabh4ammlhvt4qwgvbktwg7ajde57vwcxjraunq7xodey deleted file mode 100644 index 6bf0c97a..00000000 --- a/test_data/blocks/bafkreicq44q6jhabh4ammlhvt4qwgvbktwg7ajde57vwcxjraunq7xodey +++ /dev/null @@ -1 +0,0 @@ -w \ No newline at end of file diff --git a/test_data/blocks/bafkreicvtlvnbate2v4v2oijoggn2bnl2skxf2cp4vkzb3xtdkekbd677u b/test_data/blocks/bafkreicvtlvnbate2v4v2oijoggn2bnl2skxf2cp4vkzb3xtdkekbd677u deleted file mode 100644 index 8c7e5a66..00000000 --- a/test_data/blocks/bafkreicvtlvnbate2v4v2oijoggn2bnl2skxf2cp4vkzb3xtdkekbd677u +++ /dev/null @@ -1 +0,0 @@ -A \ No newline at end of file diff --git a/test_data/blocks/bafkreiczjzizvzezgevssqz3pxmks77qndppzouxkw3nluaoqtcsjvt3ay b/test_data/blocks/bafkreiczjzizvzezgevssqz3pxmks77qndppzouxkw3nluaoqtcsjvt3ay deleted file mode 100644 index fa7af8bf..00000000 --- a/test_data/blocks/bafkreiczjzizvzezgevssqz3pxmks77qndppzouxkw3nluaoqtcsjvt3ay +++ /dev/null @@ -1 +0,0 @@ -z \ No newline at end of file