diff --git a/.github/workflows/library.yml b/.github/workflows/library.yml index 81753fc5..88295ade 100644 --- a/.github/workflows/library.yml +++ b/.github/workflows/library.yml @@ -1,8 +1,9 @@ name: Basic library (ipfs_client) build on: pull_request: + workflow_dispatch: release: - types: [created] + types: [published] jobs: prechecks: runs-on: ubuntu-latest @@ -141,10 +142,10 @@ jobs: shell: bash run: cmake --build build --config ${{ matrix.config.build_type }} --target package - name: Upload to release - if: github.event_name == 'release' && matrix.config.build_type == 'Release' + if: (github.event_name == 'release' || github.event_name == 'workflow_dispatch') && matrix.config.build_type == 'Release' env: GH_TOKEN: ${{ secrets.GH_TOKEN }} GITHUB_TOKEN: ${{ secrets.GH_TOKEN }} run: | cd build - python3 ../cmake/release.py --library-only + python3 ./cmake/release.py diff --git a/.gitignore b/.gitignore index 5f9dce0f..ea21093a 100644 --- a/.gitignore +++ b/.gitignore @@ -6,3 +6,4 @@ CMakeUserPresets.json .*.swp gotit.json .kdev4/ipfs-chromium.kdev4 +*.autosave.* diff --git a/CMakeLists.txt b/CMakeLists.txt index 4eaa604e..7d71b7a4 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -26,7 +26,7 @@ set(DEPOT_TOOLS_DIRECTORY "${default_dt}" CACHE PATH ) set(TEST_BY_DEFAULT FALSE CACHE BOOL "Update unit tests as part of the 'all' default target.") set(USE_DOXYGEN TRUE CACHE BOOL "If we should attempt to use Doxygen to generate documentation.") -set(BRANDING_DIR "branding" CACHE PATH "Directory conataining branding files to synchronize. If empty, don't apply any branding changes.") +set(BRANDING_DIR "${CMAKE_CURRENT_LIST_DIR}/branding" CACHE PATH "Directory conataining branding files to synchronize. If empty, don't apply any branding changes.") #End of user-configuration cache variables. if(CXX_VERSION GREATER_EQUAL 20) diff --git a/chromium_edits/124.0.6329.0/chrome/browser/autocomplete/chrome_autocomplete_scheme_classifier.cc.patch b/chromium_edits/124.0.6329.0/chrome/browser/autocomplete/chrome_autocomplete_scheme_classifier.cc.patch deleted file mode 100644 index 4d172311..00000000 --- a/chromium_edits/124.0.6329.0/chrome/browser/autocomplete/chrome_autocomplete_scheme_classifier.cc.patch +++ /dev/null @@ -1,50 +0,0 @@ -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/124.0.6329.0/chrome/browser/chrome_content_browser_client.cc.patch b/chromium_edits/124.0.6329.0/chrome/browser/chrome_content_browser_client.cc.patch deleted file mode 100644 index 6d2a2881..00000000 --- a/chromium_edits/124.0.6329.0/chrome/browser/chrome_content_browser_client.cc.patch +++ /dev/null @@ -1,78 +0,0 @@ -diff --git a/chrome/browser/chrome_content_browser_client.cc b/chrome/browser/chrome_content_browser_client.cc -index 10240bdcbc380..b9e82dac849c7 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" - #endif // !BUILDFLAG(IS_ANDROID) -@@ -1691,6 +1699,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; - } - -@@ -6076,12 +6089,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) -+ // !BUILDFLAG(IS_ANDROID) || BUILDFLAG(ENABLE_IPFS) -+#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) { -@@ -6218,6 +6244,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/124.0.6329.0/chrome/browser/flag_descriptions.h.patch b/chromium_edits/124.0.6329.0/chrome/browser/flag_descriptions.h.patch deleted file mode 100644 index e950f3bb..00000000 --- a/chromium_edits/124.0.6329.0/chrome/browser/flag_descriptions.h.patch +++ /dev/null @@ -1,24 +0,0 @@ -diff --git a/chrome/browser/flag_descriptions.h b/chrome/browser/flag_descriptions.h -index 61be8f64d42fd..c48ed1e54d4ed 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 -@@ -182,6 +183,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/124.0.6329.0/chrome/common/chrome_content_client.cc.patch b/chromium_edits/124.0.6329.0/chrome/common/chrome_content_client.cc.patch deleted file mode 100644 index 8e7677e6..00000000 --- a/chromium_edits/124.0.6329.0/chrome/common/chrome_content_client.cc.patch +++ /dev/null @@ -1,17 +0,0 @@ -diff --git a/chrome/common/chrome_content_client.cc b/chrome/common/chrome_content_client.cc -index 76a5e7ea40232..60ae61f15612e 100644 ---- a/chrome/common/chrome_content_client.cc -+++ b/chrome/common/chrome_content_client.cc -@@ -296,6 +296,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/124.0.6329.0/components/cbor/values.h.patch b/chromium_edits/124.0.6329.0/components/cbor/values.h.patch deleted file mode 100644 index ca39df01..00000000 --- a/chromium_edits/124.0.6329.0/components/cbor/values.h.patch +++ /dev/null @@ -1,79 +0,0 @@ -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/124.0.6329.0/components/cbor/writer.cc.patch b/chromium_edits/124.0.6329.0/components/cbor/writer.cc.patch deleted file mode 100644 index bb89c1e6..00000000 --- a/chromium_edits/124.0.6329.0/components/cbor/writer.cc.patch +++ /dev/null @@ -1,14 +0,0 @@ -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/124.0.6329.0/components/cbor/writer_unittest.cc.patch b/chromium_edits/124.0.6329.0/components/cbor/writer_unittest.cc.patch deleted file mode 100644 index 240fee83..00000000 --- a/chromium_edits/124.0.6329.0/components/cbor/writer_unittest.cc.patch +++ /dev/null @@ -1,36 +0,0 @@ -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/124.0.6329.0/url/url_canon.h.patch b/chromium_edits/124.0.6329.0/url/url_canon.h.patch deleted file mode 100644 index 9f47d9c8..00000000 --- a/chromium_edits/124.0.6329.0/url/url_canon.h.patch +++ /dev/null @@ -1,28 +0,0 @@ -diff --git a/url/url_canon.h b/url/url_canon.h -index e8778694a9c46..b0bf281e557db 100644 ---- a/url/url_canon.h -+++ b/url/url_canon.h -@@ -804,6 +804,23 @@ bool CanonicalizeMailtoURL(const char16_t* spec, - CanonOutput* output, - Parsed* new_parsed); - -+COMPONENT_EXPORT(URL) -+bool CanonicalizeIpfsURL(const char* spec, -+ int spec_len, -+ const Parsed& parsed, -+ SchemeType scheme_type, -+ CharsetConverter* query_converter, -+ CanonOutput* output, -+ Parsed* new_parsed); -+COMPONENT_EXPORT(URL) -+bool CanonicalizeIpfsURL(const char16_t* spec, -+ int spec_len, -+ const Parsed& parsed, -+ SchemeType scheme_type, -+ CharsetConverter* query_converter, -+ CanonOutput* output, -+ Parsed* new_parsed); -+ - // Part replacer -------------------------------------------------------------- - - // Internal structure used for storing separate strings for each component. diff --git a/chromium_edits/124.0.6329.0/url/url_canon_ipfs.cc b/chromium_edits/124.0.6329.0/url/url_canon_ipfs.cc deleted file mode 100644 index d7c9fdc7..00000000 --- a/chromium_edits/124.0.6329.0/url/url_canon_ipfs.cc +++ /dev/null @@ -1,55 +0,0 @@ -#include "url_canon_internal.h" - -#include -#include - -#include - -bool url::CanonicalizeIpfsURL(const char* spec, - int spec_len, - const Parsed& parsed, - SchemeType scheme_type, - CharsetConverter* charset_converter, - CanonOutput* output, - Parsed* output_parsed) { - if ( spec_len < 1 || !spec ) { - return false; - } - if ( parsed.host.len < 1 ) { - return false; - } - std::string_view cid_str{ spec + parsed.host.begin, static_cast(parsed.host.len) }; - auto cid = ipfs::Cid(cid_str); - if ( !cid.valid() ) { - cid = ipfs::id_cid::forText( std::string{cid_str} + " is not a valid CID." ); - } - auto as_str = cid.to_string(); - if ( as_str.empty() ) { - return false; - } - std::string stdurl{ spec, static_cast(parsed.host.begin) }; - stdurl.append( as_str ); - stdurl.append( spec + parsed.host.end(), spec_len - parsed.host.end() ); - spec = stdurl.data(); - spec_len = static_cast(stdurl.size()); - Parsed parsed_input; - ParseStandardURL(spec, spec_len, &parsed_input); - return CanonicalizeStandardURL( - spec, - parsed_input, - scheme_type, - charset_converter, - output, output_parsed - ); -} -bool url::CanonicalizeIpfsURL(const char16_t* spec, - int spec_len, - const Parsed& parsed, - SchemeType scheme_type, - CharsetConverter* query_converter, - CanonOutput* output, - Parsed* new_parsed) { - RawCanonOutput<2048> as8; - ConvertUTF16ToUTF8(spec, spec_len, &as8); - return CanonicalizeIpfsURL(as8.data(), as8.length(), parsed, scheme_type, query_converter, output, new_parsed); -} diff --git a/chromium_edits/124.0.6329.0/url/url_util.cc.patch b/chromium_edits/124.0.6329.0/url/url_util.cc.patch deleted file mode 100644 index caa001ee..00000000 --- a/chromium_edits/124.0.6329.0/url/url_util.cc.patch +++ /dev/null @@ -1,22 +0,0 @@ -diff --git a/url/url_util.cc b/url/url_util.cc -index 16875957448d2..b6ddd7a6c075c 100644 ---- a/url/url_util.cc -+++ b/url/url_util.cc -@@ -274,8 +274,15 @@ bool DoCanonicalize(const CHAR* spec, - } else if (DoCompareSchemeComponent(spec, scheme, url::kFileSystemScheme)) { - // Filesystem URLs are special. - ParseFileSystemURL(spec, spec_len, &parsed_input); -- success = CanonicalizeFileSystemURL(spec, parsed_input, charset_converter, -- output, output_parsed); -+ success = CanonicalizeFileSystemURL(spec, parsed_input, -+ charset_converter, output, -+ output_parsed); -+ -+ } else if (DoCompareSchemeComponent(spec, scheme, "ipfs")) { -+ // Switch multibase away from case-sensitive ones before continuing canonicalization. -+ ParseStandardURL(spec, spec_len, &parsed_input); -+ success = CanonicalizeIpfsURL(spec, spec_len, parsed_input, scheme_type, -+ charset_converter, output, output_parsed); - - } else if (DoIsStandard(spec, scheme, &scheme_type)) { - // All "normal" URLs. diff --git a/chromium_edits/124.0.6342.3/chrome/browser/BUILD.gn.patch b/chromium_edits/124.0.6342.3/chrome/browser/BUILD.gn.patch deleted file mode 100644 index 12864d09..00000000 --- a/chromium_edits/124.0.6342.3/chrome/browser/BUILD.gn.patch +++ /dev/null @@ -1,27 +0,0 @@ -diff --git a/chrome/browser/BUILD.gn b/chrome/browser/BUILD.gn -index 27c0162dd1016..c58119d9c9da1 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") -@@ -2646,6 +2647,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/124.0.6342.3/chrome/browser/about_flags.cc.patch b/chromium_edits/124.0.6342.3/chrome/browser/about_flags.cc.patch deleted file mode 100644 index b9b57425..00000000 --- a/chromium_edits/124.0.6342.3/chrome/browser/about_flags.cc.patch +++ /dev/null @@ -1,38 +0,0 @@ -diff --git a/chrome/browser/about_flags.cc b/chrome/browser/about_flags.cc -index 277494625d44e..4154e05528bbc 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 -@@ -9447,6 +9452,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/124.0.6342.3/chrome/browser/prefs/browser_prefs.cc.patch b/chromium_edits/124.0.6342.3/chrome/browser/prefs/browser_prefs.cc.patch deleted file mode 100644 index c43d86bf..00000000 --- a/chromium_edits/124.0.6342.3/chrome/browser/prefs/browser_prefs.cc.patch +++ /dev/null @@ -1,37 +0,0 @@ -diff --git a/chrome/browser/prefs/browser_prefs.cc b/chrome/browser/prefs/browser_prefs.cc -index ead26a869cfe0..a979df933cd2f 100644 ---- a/chrome/browser/prefs/browser_prefs.cc -+++ b/chrome/browser/prefs/browser_prefs.cc -@@ -192,6 +192,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" -@@ -236,6 +238,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 -@@ -1775,6 +1782,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/124.0.6342.3/components/cbor/reader.cc.patch b/chromium_edits/124.0.6342.3/components/cbor/reader.cc.patch deleted file mode 100644 index a9c4a7b3..00000000 --- a/chromium_edits/124.0.6342.3/components/cbor/reader.cc.patch +++ /dev/null @@ -1,44 +0,0 @@ -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/124.0.6342.3/components/cbor/reader.h.patch b/chromium_edits/124.0.6342.3/components/cbor/reader.h.patch deleted file mode 100644 index cd7d9eb0..00000000 --- a/chromium_edits/124.0.6342.3/components/cbor/reader.h.patch +++ /dev/null @@ -1,26 +0,0 @@ -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/124.0.6342.3/components/cbor/values.cc.patch b/chromium_edits/124.0.6342.3/components/cbor/values.cc.patch deleted file mode 100644 index ddbab2b3..00000000 --- a/chromium_edits/124.0.6342.3/components/cbor/values.cc.patch +++ /dev/null @@ -1,145 +0,0 @@ -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/124.0.6342.3/components/open_from_clipboard/clipboard_recent_content_generic.cc.patch b/chromium_edits/124.0.6342.3/components/open_from_clipboard/clipboard_recent_content_generic.cc.patch deleted file mode 100644 index 291d84f1..00000000 --- a/chromium_edits/124.0.6342.3/components/open_from_clipboard/clipboard_recent_content_generic.cc.patch +++ /dev/null @@ -1,13 +0,0 @@ -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/124.0.6342.3/url/BUILD.gn.patch b/chromium_edits/124.0.6342.3/url/BUILD.gn.patch deleted file mode 100644 index cc358ad4..00000000 --- a/chromium_edits/124.0.6342.3/url/BUILD.gn.patch +++ /dev/null @@ -1,32 +0,0 @@ -diff --git a/url/BUILD.gn b/url/BUILD.gn -index b5edb89f7698f..d299856674d7d 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") -@@ -68,6 +69,7 @@ component("url") { - public_deps = [ - "//base", - "//build:robolectric_buildflags", -+ "//third_party/ipfs_client:ipfs_buildflags", - ] - - configs += [ "//build/config/compiler:wexit_time_destructors" ] -@@ -90,6 +92,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/124.0.6342.3/url/url_canon.h.patch b/chromium_edits/124.0.6342.3/url/url_canon.h.patch deleted file mode 100644 index 9f47d9c8..00000000 --- a/chromium_edits/124.0.6342.3/url/url_canon.h.patch +++ /dev/null @@ -1,28 +0,0 @@ -diff --git a/url/url_canon.h b/url/url_canon.h -index e8778694a9c46..b0bf281e557db 100644 ---- a/url/url_canon.h -+++ b/url/url_canon.h -@@ -804,6 +804,23 @@ bool CanonicalizeMailtoURL(const char16_t* spec, - CanonOutput* output, - Parsed* new_parsed); - -+COMPONENT_EXPORT(URL) -+bool CanonicalizeIpfsURL(const char* spec, -+ int spec_len, -+ const Parsed& parsed, -+ SchemeType scheme_type, -+ CharsetConverter* query_converter, -+ CanonOutput* output, -+ Parsed* new_parsed); -+COMPONENT_EXPORT(URL) -+bool CanonicalizeIpfsURL(const char16_t* spec, -+ int spec_len, -+ const Parsed& parsed, -+ SchemeType scheme_type, -+ CharsetConverter* query_converter, -+ CanonOutput* output, -+ Parsed* new_parsed); -+ - // Part replacer -------------------------------------------------------------- - - // Internal structure used for storing separate strings for each component. diff --git a/chromium_edits/124.0.6342.3/url/url_canon_ipfs.cc b/chromium_edits/124.0.6342.3/url/url_canon_ipfs.cc deleted file mode 100644 index d7c9fdc7..00000000 --- a/chromium_edits/124.0.6342.3/url/url_canon_ipfs.cc +++ /dev/null @@ -1,55 +0,0 @@ -#include "url_canon_internal.h" - -#include -#include - -#include - -bool url::CanonicalizeIpfsURL(const char* spec, - int spec_len, - const Parsed& parsed, - SchemeType scheme_type, - CharsetConverter* charset_converter, - CanonOutput* output, - Parsed* output_parsed) { - if ( spec_len < 1 || !spec ) { - return false; - } - if ( parsed.host.len < 1 ) { - return false; - } - std::string_view cid_str{ spec + parsed.host.begin, static_cast(parsed.host.len) }; - auto cid = ipfs::Cid(cid_str); - if ( !cid.valid() ) { - cid = ipfs::id_cid::forText( std::string{cid_str} + " is not a valid CID." ); - } - auto as_str = cid.to_string(); - if ( as_str.empty() ) { - return false; - } - std::string stdurl{ spec, static_cast(parsed.host.begin) }; - stdurl.append( as_str ); - stdurl.append( spec + parsed.host.end(), spec_len - parsed.host.end() ); - spec = stdurl.data(); - spec_len = static_cast(stdurl.size()); - Parsed parsed_input; - ParseStandardURL(spec, spec_len, &parsed_input); - return CanonicalizeStandardURL( - spec, - parsed_input, - scheme_type, - charset_converter, - output, output_parsed - ); -} -bool url::CanonicalizeIpfsURL(const char16_t* spec, - int spec_len, - const Parsed& parsed, - SchemeType scheme_type, - CharsetConverter* query_converter, - CanonOutput* output, - Parsed* new_parsed) { - RawCanonOutput<2048> as8; - ConvertUTF16ToUTF8(spec, spec_len, &as8); - return CanonicalizeIpfsURL(as8.data(), as8.length(), parsed, scheme_type, query_converter, output, new_parsed); -} diff --git a/chromium_edits/124.0.6342.3/url/url_util.cc.patch b/chromium_edits/124.0.6342.3/url/url_util.cc.patch deleted file mode 100644 index caa001ee..00000000 --- a/chromium_edits/124.0.6342.3/url/url_util.cc.patch +++ /dev/null @@ -1,22 +0,0 @@ -diff --git a/url/url_util.cc b/url/url_util.cc -index 16875957448d2..b6ddd7a6c075c 100644 ---- a/url/url_util.cc -+++ b/url/url_util.cc -@@ -274,8 +274,15 @@ bool DoCanonicalize(const CHAR* spec, - } else if (DoCompareSchemeComponent(spec, scheme, url::kFileSystemScheme)) { - // Filesystem URLs are special. - ParseFileSystemURL(spec, spec_len, &parsed_input); -- success = CanonicalizeFileSystemURL(spec, parsed_input, charset_converter, -- output, output_parsed); -+ success = CanonicalizeFileSystemURL(spec, parsed_input, -+ charset_converter, output, -+ output_parsed); -+ -+ } else if (DoCompareSchemeComponent(spec, scheme, "ipfs")) { -+ // Switch multibase away from case-sensitive ones before continuing canonicalization. -+ ParseStandardURL(spec, spec_len, &parsed_input); -+ success = CanonicalizeIpfsURL(spec, spec_len, parsed_input, scheme_type, -+ charset_converter, output, output_parsed); - - } else if (DoIsStandard(spec, scheme, &scheme_type)) { - // All "normal" URLs. diff --git a/chromium_edits/124.0.6356.2/chrome/browser/flag_descriptions.cc.patch b/chromium_edits/124.0.6356.2/chrome/browser/flag_descriptions.cc.patch deleted file mode 100644 index 4db60b7f..00000000 --- a/chromium_edits/124.0.6356.2/chrome/browser/flag_descriptions.cc.patch +++ /dev/null @@ -1,16 +0,0 @@ -diff --git a/chrome/browser/flag_descriptions.cc b/chrome/browser/flag_descriptions.cc -index 587ec47caae52..afdee9f49f77b 100644 ---- a/chrome/browser/flag_descriptions.cc -+++ b/chrome/browser/flag_descriptions.cc -@@ -304,6 +304,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/124.0.6356.2/net/dns/dns_config_service_linux.cc.patch b/chromium_edits/124.0.6356.2/net/dns/dns_config_service_linux.cc.patch deleted file mode 100644 index 3b042d33..00000000 --- a/chromium_edits/124.0.6356.2/net/dns/dns_config_service_linux.cc.patch +++ /dev/null @@ -1,18 +0,0 @@ -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/124.0.6356.2/url/url_canon.h.patch b/chromium_edits/124.0.6356.2/url/url_canon.h.patch deleted file mode 100644 index 9f47d9c8..00000000 --- a/chromium_edits/124.0.6356.2/url/url_canon.h.patch +++ /dev/null @@ -1,28 +0,0 @@ -diff --git a/url/url_canon.h b/url/url_canon.h -index e8778694a9c46..b0bf281e557db 100644 ---- a/url/url_canon.h -+++ b/url/url_canon.h -@@ -804,6 +804,23 @@ bool CanonicalizeMailtoURL(const char16_t* spec, - CanonOutput* output, - Parsed* new_parsed); - -+COMPONENT_EXPORT(URL) -+bool CanonicalizeIpfsURL(const char* spec, -+ int spec_len, -+ const Parsed& parsed, -+ SchemeType scheme_type, -+ CharsetConverter* query_converter, -+ CanonOutput* output, -+ Parsed* new_parsed); -+COMPONENT_EXPORT(URL) -+bool CanonicalizeIpfsURL(const char16_t* spec, -+ int spec_len, -+ const Parsed& parsed, -+ SchemeType scheme_type, -+ CharsetConverter* query_converter, -+ CanonOutput* output, -+ Parsed* new_parsed); -+ - // Part replacer -------------------------------------------------------------- - - // Internal structure used for storing separate strings for each component. diff --git a/chromium_edits/124.0.6356.2/url/url_canon_ipfs.cc b/chromium_edits/124.0.6356.2/url/url_canon_ipfs.cc deleted file mode 100644 index d7c9fdc7..00000000 --- a/chromium_edits/124.0.6356.2/url/url_canon_ipfs.cc +++ /dev/null @@ -1,55 +0,0 @@ -#include "url_canon_internal.h" - -#include -#include - -#include - -bool url::CanonicalizeIpfsURL(const char* spec, - int spec_len, - const Parsed& parsed, - SchemeType scheme_type, - CharsetConverter* charset_converter, - CanonOutput* output, - Parsed* output_parsed) { - if ( spec_len < 1 || !spec ) { - return false; - } - if ( parsed.host.len < 1 ) { - return false; - } - std::string_view cid_str{ spec + parsed.host.begin, static_cast(parsed.host.len) }; - auto cid = ipfs::Cid(cid_str); - if ( !cid.valid() ) { - cid = ipfs::id_cid::forText( std::string{cid_str} + " is not a valid CID." ); - } - auto as_str = cid.to_string(); - if ( as_str.empty() ) { - return false; - } - std::string stdurl{ spec, static_cast(parsed.host.begin) }; - stdurl.append( as_str ); - stdurl.append( spec + parsed.host.end(), spec_len - parsed.host.end() ); - spec = stdurl.data(); - spec_len = static_cast(stdurl.size()); - Parsed parsed_input; - ParseStandardURL(spec, spec_len, &parsed_input); - return CanonicalizeStandardURL( - spec, - parsed_input, - scheme_type, - charset_converter, - output, output_parsed - ); -} -bool url::CanonicalizeIpfsURL(const char16_t* spec, - int spec_len, - const Parsed& parsed, - SchemeType scheme_type, - CharsetConverter* query_converter, - CanonOutput* output, - Parsed* new_parsed) { - RawCanonOutput<2048> as8; - ConvertUTF16ToUTF8(spec, spec_len, &as8); - return CanonicalizeIpfsURL(as8.data(), as8.length(), parsed, scheme_type, query_converter, output, new_parsed); -} diff --git a/chromium_edits/124.0.6356.2/url/url_util.cc.patch b/chromium_edits/124.0.6356.2/url/url_util.cc.patch deleted file mode 100644 index 3850fcfe..00000000 --- a/chromium_edits/124.0.6356.2/url/url_util.cc.patch +++ /dev/null @@ -1,22 +0,0 @@ -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/129.0.6616.0/chrome/browser/BUILD.gn.patch b/chromium_edits/128.0.6613.113/chrome/browser/BUILD.gn.patch similarity index 89% rename from chromium_edits/129.0.6616.0/chrome/browser/BUILD.gn.patch rename to chromium_edits/128.0.6613.113/chrome/browser/BUILD.gn.patch index fd63a9ff..54a6921f 100644 --- a/chromium_edits/129.0.6616.0/chrome/browser/BUILD.gn.patch +++ b/chromium_edits/128.0.6613.113/chrome/browser/BUILD.gn.patch @@ -1,5 +1,5 @@ diff --git a/chrome/browser/BUILD.gn b/chrome/browser/BUILD.gn -index 4e5bc3a5d19cf..0c58c26d83304 100644 +index fe0452e8bd462..575137d6dbbf9 100644 --- a/chrome/browser/BUILD.gn +++ b/chrome/browser/BUILD.gn @@ -41,6 +41,7 @@ import("//sandbox/features.gni") @@ -10,7 +10,7 @@ index 4e5bc3a5d19cf..0c58c26d83304 100644 import("//third_party/protobuf/proto_library.gni") import("//third_party/webrtc/webrtc.gni") import("//third_party/widevine/cdm/widevine.gni") -@@ -2724,6 +2725,14 @@ static_library("browser") { +@@ -2717,6 +2718,14 @@ static_library("browser") { ] } diff --git a/chromium_edits/129.0.6616.0/chrome/browser/about_flags.cc.patch b/chromium_edits/128.0.6613.113/chrome/browser/about_flags.cc.patch similarity index 93% rename from chromium_edits/129.0.6616.0/chrome/browser/about_flags.cc.patch rename to chromium_edits/128.0.6613.113/chrome/browser/about_flags.cc.patch index 1ea68599..6dc27a42 100644 --- a/chromium_edits/129.0.6616.0/chrome/browser/about_flags.cc.patch +++ b/chromium_edits/128.0.6613.113/chrome/browser/about_flags.cc.patch @@ -1,5 +1,5 @@ diff --git a/chrome/browser/about_flags.cc b/chrome/browser/about_flags.cc -index 10ed8f16616a4..e21eb81fafa00 100644 +index 96370d4ac35a9..82bf3f78caccc 100644 --- a/chrome/browser/about_flags.cc +++ b/chrome/browser/about_flags.cc @@ -220,6 +220,7 @@ @@ -21,7 +21,7 @@ index 10ed8f16616a4..e21eb81fafa00 100644 #if BUILDFLAG(ENABLE_PDF) #include "pdf/pdf_features.h" #endif -@@ -10118,6 +10123,14 @@ const FeatureEntry kFeatureEntries[] = { +@@ -10130,6 +10135,14 @@ const FeatureEntry kFeatureEntries[] = { flag_descriptions::kOmitCorsClientCertDescription, kOsAll, FEATURE_VALUE_TYPE(network::features::kOmitCorsClientCert)}, diff --git a/chromium_edits/129.0.6616.0/chrome/browser/autocomplete/chrome_autocomplete_scheme_classifier.cc.patch b/chromium_edits/128.0.6613.113/chrome/browser/autocomplete/chrome_autocomplete_scheme_classifier.cc.patch similarity index 100% rename from chromium_edits/129.0.6616.0/chrome/browser/autocomplete/chrome_autocomplete_scheme_classifier.cc.patch rename to chromium_edits/128.0.6613.113/chrome/browser/autocomplete/chrome_autocomplete_scheme_classifier.cc.patch diff --git a/chromium_edits/129.0.6616.0/chrome/browser/chrome_content_browser_client.cc.patch b/chromium_edits/128.0.6613.113/chrome/browser/chrome_content_browser_client.cc.patch similarity index 93% rename from chromium_edits/129.0.6616.0/chrome/browser/chrome_content_browser_client.cc.patch rename to chromium_edits/128.0.6613.113/chrome/browser/chrome_content_browser_client.cc.patch index 89a20d31..f506d677 100644 --- a/chromium_edits/129.0.6616.0/chrome/browser/chrome_content_browser_client.cc.patch +++ b/chromium_edits/128.0.6613.113/chrome/browser/chrome_content_browser_client.cc.patch @@ -1,5 +1,5 @@ diff --git a/chrome/browser/chrome_content_browser_client.cc b/chrome/browser/chrome_content_browser_client.cc -index bfe3ffa67ccd5..5b7333ebdd8a0 100644 +index c4b98aa0e759f..0b645f5482fca 100644 --- a/chrome/browser/chrome_content_browser_client.cc +++ b/chrome/browser/chrome_content_browser_client.cc @@ -396,6 +396,7 @@ @@ -10,7 +10,7 @@ index bfe3ffa67ccd5..5b7333ebdd8a0 100644 #include "third_party/widevine/cdm/buildflags.h" #include "ui/base/clipboard/clipboard_format_type.h" #include "ui/base/l10n/l10n_util.h" -@@ -518,6 +519,13 @@ +@@ -516,6 +517,13 @@ #include "chrome/browser/chrome_browser_main_posix.h" #endif @@ -24,7 +24,7 @@ index bfe3ffa67ccd5..5b7333ebdd8a0 100644 #if !BUILDFLAG(IS_ANDROID) #include "chrome/browser/digital_credentials/digital_identity_provider_desktop.h" #include "chrome/browser/preloading/preview/preview_navigation_throttle.h" -@@ -1867,6 +1875,11 @@ ChromeContentBrowserClient::CreateBrowserMainParts(bool is_integration_test) { +@@ -1870,6 +1878,11 @@ ChromeContentBrowserClient::CreateBrowserMainParts(bool is_integration_test) { main_parts->AddParts( std::make_unique()); @@ -36,7 +36,7 @@ index bfe3ffa67ccd5..5b7333ebdd8a0 100644 return main_parts; } -@@ -6474,12 +6487,29 @@ void ChromeContentBrowserClient:: +@@ -6482,12 +6495,29 @@ void ChromeContentBrowserClient:: const std::optional& request_initiator_origin, NonNetworkURLLoaderFactoryMap* factories) { #if BUILDFLAG(IS_CHROMEOS_ASH) || BUILDFLAG(ENABLE_EXTENSIONS) || \ @@ -67,7 +67,7 @@ index bfe3ffa67ccd5..5b7333ebdd8a0 100644 #if BUILDFLAG(IS_CHROMEOS_ASH) if (web_contents) { -@@ -6625,6 +6655,11 @@ ChromeContentBrowserClient::WillCreateURLLoaderRequestInterceptors( +@@ -6633,6 +6663,11 @@ ChromeContentBrowserClient::WillCreateURLLoaderRequestInterceptors( scoped_refptr navigation_response_task_runner) { std::vector> interceptors; diff --git a/chromium_edits/124.0.6329.0/chrome/browser/flag-metadata.json.patch b/chromium_edits/128.0.6613.113/chrome/browser/flag-metadata.json.patch similarity index 89% rename from chromium_edits/124.0.6329.0/chrome/browser/flag-metadata.json.patch rename to chromium_edits/128.0.6613.113/chrome/browser/flag-metadata.json.patch index 4357b1d3..f954d6b0 100644 --- a/chromium_edits/124.0.6329.0/chrome/browser/flag-metadata.json.patch +++ b/chromium_edits/128.0.6613.113/chrome/browser/flag-metadata.json.patch @@ -1,8 +1,8 @@ diff --git a/chrome/browser/flag-metadata.json b/chrome/browser/flag-metadata.json -index 5d16c3affafb9..b8b25c386a3fc 100644 +index fa225f6564471..e8444d0f88e84 100644 --- a/chrome/browser/flag-metadata.json +++ b/chrome/browser/flag-metadata.json -@@ -3022,6 +3022,11 @@ +@@ -3386,6 +3386,11 @@ "owners": [ "adamta@google.com", "chrome-feed-fundamentals@google.com" ], "expiry_milestone": 130 }, diff --git a/chromium_edits/129.0.6616.0/chrome/browser/flag_descriptions.cc.patch b/chromium_edits/128.0.6613.113/chrome/browser/flag_descriptions.cc.patch similarity index 94% rename from chromium_edits/129.0.6616.0/chrome/browser/flag_descriptions.cc.patch rename to chromium_edits/128.0.6613.113/chrome/browser/flag_descriptions.cc.patch index 82b6f893..4d5c4d25 100644 --- a/chromium_edits/129.0.6616.0/chrome/browser/flag_descriptions.cc.patch +++ b/chromium_edits/128.0.6613.113/chrome/browser/flag_descriptions.cc.patch @@ -1,5 +1,5 @@ diff --git a/chrome/browser/flag_descriptions.cc b/chrome/browser/flag_descriptions.cc -index 9a4eedd24e9a1..f1a4728f47149 100644 +index be5b3f2e79a5f..d61281fca8be5 100644 --- a/chrome/browser/flag_descriptions.cc +++ b/chrome/browser/flag_descriptions.cc @@ -302,6 +302,11 @@ const char kEnableBenchmarkingChoiceDefaultFeatureStates[] = diff --git a/chromium_edits/129.0.6616.0/chrome/browser/flag_descriptions.h.patch b/chromium_edits/128.0.6613.113/chrome/browser/flag_descriptions.h.patch similarity index 95% rename from chromium_edits/129.0.6616.0/chrome/browser/flag_descriptions.h.patch rename to chromium_edits/128.0.6613.113/chrome/browser/flag_descriptions.h.patch index 4169f2d6..ea921b20 100644 --- a/chromium_edits/129.0.6616.0/chrome/browser/flag_descriptions.h.patch +++ b/chromium_edits/128.0.6613.113/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 9b8b39e5af23d..163cfaafa9bec 100644 +index b14d6612eaa86..34aa125a87e57 100644 --- a/chrome/browser/flag_descriptions.h +++ b/chrome/browser/flag_descriptions.h @@ -24,6 +24,7 @@ diff --git a/chromium_edits/124.0.6329.0/chrome/browser/ipfs_extra_parts.cc b/chromium_edits/128.0.6613.113/chrome/browser/ipfs_extra_parts.cc similarity index 100% rename from chromium_edits/124.0.6329.0/chrome/browser/ipfs_extra_parts.cc rename to chromium_edits/128.0.6613.113/chrome/browser/ipfs_extra_parts.cc diff --git a/chromium_edits/124.0.6329.0/chrome/browser/ipfs_extra_parts.h b/chromium_edits/128.0.6613.113/chrome/browser/ipfs_extra_parts.h similarity index 100% rename from chromium_edits/124.0.6329.0/chrome/browser/ipfs_extra_parts.h rename to chromium_edits/128.0.6613.113/chrome/browser/ipfs_extra_parts.h diff --git a/chromium_edits/129.0.6616.0/chrome/browser/prefs/browser_prefs.cc.patch b/chromium_edits/128.0.6613.113/chrome/browser/prefs/browser_prefs.cc.patch similarity index 97% rename from chromium_edits/129.0.6616.0/chrome/browser/prefs/browser_prefs.cc.patch rename to chromium_edits/128.0.6613.113/chrome/browser/prefs/browser_prefs.cc.patch index 3a25dbef..6464d20f 100644 --- a/chromium_edits/129.0.6616.0/chrome/browser/prefs/browser_prefs.cc.patch +++ b/chromium_edits/128.0.6613.113/chrome/browser/prefs/browser_prefs.cc.patch @@ -1,5 +1,5 @@ diff --git a/chrome/browser/prefs/browser_prefs.cc b/chrome/browser/prefs/browser_prefs.cc -index fe07c23953ff2..90d05b5bd5cd4 100644 +index 8cf6b5d7d4281..699490b84fc37 100644 --- a/chrome/browser/prefs/browser_prefs.cc +++ b/chrome/browser/prefs/browser_prefs.cc @@ -199,6 +199,8 @@ diff --git a/chromium_edits/128.0.6613.113/chrome/browser/shell_integration_mac.mm.patch b/chromium_edits/128.0.6613.113/chrome/browser/shell_integration_mac.mm.patch new file mode 100644 index 00000000..220e2546 --- /dev/null +++ b/chromium_edits/128.0.6613.113/chrome/browser/shell_integration_mac.mm.patch @@ -0,0 +1,13 @@ +diff --git a/chrome/browser/shell_integration_mac.mm b/chrome/browser/shell_integration_mac.mm +index c6bb768979453..c0d0abb9c78f3 100644 +--- a/chrome/browser/shell_integration_mac.mm ++++ b/chrome/browser/shell_integration_mac.mm +@@ -79,6 +79,8 @@ bool SetAsDefaultBrowser() { + if (LSSetDefaultHandlerForURLScheme(CFSTR("https"), identifier) != noErr) { + return false; + } ++ LSSetDefaultHandlerForURLScheme(CFSTR("ipfs"), identifier); ++ LSSetDefaultHandlerForURLScheme(CFSTR("ipns"), identifier); + if (LSSetDefaultRoleHandlerForContentType(kUTTypeHTML, kLSRolesViewer, + identifier) != noErr) { + return false; diff --git a/chromium_edits/129.0.6616.0/chrome/common/chrome_content_client.cc.patch b/chromium_edits/128.0.6613.113/chrome/common/chrome_content_client.cc.patch similarity index 100% rename from chromium_edits/129.0.6616.0/chrome/common/chrome_content_client.cc.patch rename to chromium_edits/128.0.6613.113/chrome/common/chrome_content_client.cc.patch diff --git a/chromium_edits/128.0.6613.113/chrome/installer/linux/common/desktop.template.patch b/chromium_edits/128.0.6613.113/chrome/installer/linux/common/desktop.template.patch new file mode 100644 index 00000000..dcd9460b --- /dev/null +++ b/chromium_edits/128.0.6613.113/chrome/installer/linux/common/desktop.template.patch @@ -0,0 +1,13 @@ +diff --git a/chrome/installer/linux/common/desktop.template b/chrome/installer/linux/common/desktop.template +index 2eb13ee1aba46..9af65726bde89 100644 +--- a/chrome/installer/linux/common/desktop.template ++++ b/chrome/installer/linux/common/desktop.template +@@ -111,7 +111,7 @@ Terminal=false + Icon=@@PACKAGE@@ + Type=Application + Categories=Network;WebBrowser; +-MimeType=application/pdf;application/rdf+xml;application/rss+xml;application/xhtml+xml;application/xhtml_xml;application/xml;image/gif;image/jpeg;image/png;image/webp;text/html;text/xml;x-scheme-handler/http;x-scheme-handler/https; ++MimeType=application/pdf;application/rdf+xml;application/rss+xml;application/xhtml+xml;application/xhtml_xml;application/xml;image/gif;image/jpeg;image/png;image/webp;text/html;text/xml;x-scheme-handler/http;x-scheme-handler/https;x-scheme-handler/ipfs;x-scheme-handler/ipns; + Actions=new-window;new-private-window; + + [Desktop Action new-window] diff --git a/chromium_edits/128.0.6613.113/chrome/installer/util/shell_util.cc.patch b/chromium_edits/128.0.6613.113/chrome/installer/util/shell_util.cc.patch new file mode 100644 index 00000000..ff731765 --- /dev/null +++ b/chromium_edits/128.0.6613.113/chrome/installer/util/shell_util.cc.patch @@ -0,0 +1,20 @@ +diff --git a/chrome/installer/util/shell_util.cc b/chrome/installer/util/shell_util.cc +index 87a2c70b6cb1a..50c52f1ef579e 100644 +--- a/chrome/installer/util/shell_util.cc ++++ b/chrome/installer/util/shell_util.cc +@@ -1523,11 +1523,12 @@ const wchar_t* ShellUtil::kDefaultFileAssociations[] = { + const wchar_t* ShellUtil::kPotentialFileAssociations[] = { + L".htm", L".html", L".pdf", L".shtml", L".svg", + L".xht", L".xhtml", L".webp", nullptr}; +-const wchar_t* ShellUtil::kBrowserProtocolAssociations[] = {L"http", L"https", +- nullptr}; ++const wchar_t* ShellUtil::kBrowserProtocolAssociations[] = { ++ L"http", L"https", L"ipfs", L"ipns", nullptr}; + const wchar_t* ShellUtil::kPotentialProtocolAssociations[] = { + L"http", L"https", L"irc", L"mailto", L"mms", L"news", L"nntp", +- L"sms", L"smsto", L"snews", L"tel", L"urn", L"webcal", nullptr}; ++ L"sms", L"smsto", L"snews", L"tel", L"urn", L"webcal", L"ipfs", ++ L"ipns", nullptr}; + const wchar_t* ShellUtil::kRegUrlProtocol = L"URL Protocol"; + const wchar_t* ShellUtil::kRegApplication = L"\\Application"; + const wchar_t* ShellUtil::kRegAppUserModelId = L"AppUserModelId"; diff --git a/chromium_edits/129.0.6616.0/components/cbor/reader.cc.patch b/chromium_edits/128.0.6613.113/components/cbor/reader.cc.patch similarity index 100% rename from chromium_edits/129.0.6616.0/components/cbor/reader.cc.patch rename to chromium_edits/128.0.6613.113/components/cbor/reader.cc.patch diff --git a/chromium_edits/129.0.6616.0/components/cbor/reader.h.patch b/chromium_edits/128.0.6613.113/components/cbor/reader.h.patch similarity index 100% rename from chromium_edits/129.0.6616.0/components/cbor/reader.h.patch rename to chromium_edits/128.0.6613.113/components/cbor/reader.h.patch diff --git a/chromium_edits/124.0.6329.0/components/cbor/reader_unittest.cc.patch b/chromium_edits/128.0.6613.113/components/cbor/reader_unittest.cc.patch similarity index 100% rename from chromium_edits/124.0.6329.0/components/cbor/reader_unittest.cc.patch rename to chromium_edits/128.0.6613.113/components/cbor/reader_unittest.cc.patch diff --git a/chromium_edits/129.0.6616.0/components/cbor/values.cc.patch b/chromium_edits/128.0.6613.113/components/cbor/values.cc.patch similarity index 100% rename from chromium_edits/129.0.6616.0/components/cbor/values.cc.patch rename to chromium_edits/128.0.6613.113/components/cbor/values.cc.patch diff --git a/chromium_edits/129.0.6616.0/components/cbor/values.h.patch b/chromium_edits/128.0.6613.113/components/cbor/values.h.patch similarity index 100% rename from chromium_edits/129.0.6616.0/components/cbor/values.h.patch rename to chromium_edits/128.0.6613.113/components/cbor/values.h.patch diff --git a/chromium_edits/129.0.6616.0/components/cbor/writer.cc.patch b/chromium_edits/128.0.6613.113/components/cbor/writer.cc.patch similarity index 100% rename from chromium_edits/129.0.6616.0/components/cbor/writer.cc.patch rename to chromium_edits/128.0.6613.113/components/cbor/writer.cc.patch diff --git a/chromium_edits/129.0.6616.0/components/cbor/writer_unittest.cc.patch b/chromium_edits/128.0.6613.113/components/cbor/writer_unittest.cc.patch similarity index 100% rename from chromium_edits/129.0.6616.0/components/cbor/writer_unittest.cc.patch rename to chromium_edits/128.0.6613.113/components/cbor/writer_unittest.cc.patch diff --git a/chromium_edits/129.0.6616.0/components/open_from_clipboard/clipboard_recent_content_generic.cc.patch b/chromium_edits/128.0.6613.113/components/open_from_clipboard/clipboard_recent_content_generic.cc.patch similarity index 100% rename from chromium_edits/129.0.6616.0/components/open_from_clipboard/clipboard_recent_content_generic.cc.patch rename to chromium_edits/128.0.6613.113/components/open_from_clipboard/clipboard_recent_content_generic.cc.patch diff --git a/chromium_edits/129.0.6616.0/net/dns/dns_config_service_linux.cc.patch b/chromium_edits/128.0.6613.113/net/dns/dns_config_service_linux.cc.patch similarity index 100% rename from chromium_edits/129.0.6616.0/net/dns/dns_config_service_linux.cc.patch rename to chromium_edits/128.0.6613.113/net/dns/dns_config_service_linux.cc.patch diff --git a/chromium_edits/124.0.6329.0/third_party/blink/renderer/platform/weborigin/scheme_registry.cc.patch b/chromium_edits/128.0.6613.113/third_party/blink/renderer/platform/weborigin/scheme_registry.cc.patch similarity index 70% rename from chromium_edits/124.0.6329.0/third_party/blink/renderer/platform/weborigin/scheme_registry.cc.patch rename to chromium_edits/128.0.6613.113/third_party/blink/renderer/platform/weborigin/scheme_registry.cc.patch index 119d72b2..663fe49e 100644 --- a/chromium_edits/124.0.6329.0/third_party/blink/renderer/platform/weborigin/scheme_registry.cc.patch +++ b/chromium_edits/128.0.6613.113/third_party/blink/renderer/platform/weborigin/scheme_registry.cc.patch @@ -1,13 +1,15 @@ diff --git a/third_party/blink/renderer/platform/weborigin/scheme_registry.cc b/third_party/blink/renderer/platform/weborigin/scheme_registry.cc -index 4eadf46ea0c24..d62fc7fb14e01 100644 +index e1bc209c337c5..6fbac29fcddfd 100644 --- a/third_party/blink/renderer/platform/weborigin/scheme_registry.cc +++ b/third_party/blink/renderer/platform/weborigin/scheme_registry.cc -@@ -67,7 +67,7 @@ class URLSchemesRegistry final { +@@ -68,8 +68,8 @@ class URLSchemesRegistry final { // is considered secure. Additional checks are performed to ensure that // other http pages are filtered out. service_worker_schemes({"http", "https"}), - fetch_api_schemes({"http", "https"}), +- allowed_in_referrer_schemes({"http", "https"}) { + fetch_api_schemes({"http", "https", "ipfs", "ipns"}), - allowed_in_referrer_schemes({"http", "https"}) { ++ allowed_in_referrer_schemes({"http", "https", "ipfs", "ipns"}) { for (auto& scheme : url::GetCorsEnabledSchemes()) cors_enabled_schemes.insert(scheme.c_str()); + for (auto& scheme : url::GetCSPBypassingSchemes()) { diff --git a/chromium_edits/129.0.6616.0/url/BUILD.gn.patch b/chromium_edits/128.0.6613.113/url/BUILD.gn.patch similarity index 100% rename from chromium_edits/129.0.6616.0/url/BUILD.gn.patch rename to chromium_edits/128.0.6613.113/url/BUILD.gn.patch diff --git a/chromium_edits/129.0.6616.0/url/url_canon.h.patch b/chromium_edits/128.0.6613.113/url/url_canon.h.patch similarity index 100% rename from chromium_edits/129.0.6616.0/url/url_canon.h.patch rename to chromium_edits/128.0.6613.113/url/url_canon.h.patch diff --git a/chromium_edits/129.0.6616.0/url/url_canon_ipfs.cc b/chromium_edits/128.0.6613.113/url/url_canon_ipfs.cc similarity index 100% rename from chromium_edits/129.0.6616.0/url/url_canon_ipfs.cc rename to chromium_edits/128.0.6613.113/url/url_canon_ipfs.cc diff --git a/chromium_edits/128.0.6613.113/url/url_util.cc.patch b/chromium_edits/128.0.6613.113/url/url_util.cc.patch new file mode 100644 index 00000000..988797b0 --- /dev/null +++ b/chromium_edits/128.0.6613.113/url/url_util.cc.patch @@ -0,0 +1,45 @@ +diff --git a/url/url_util.cc b/url/url_util.cc +index ce5225e121f5d..79e33208f728e 100644 +--- a/url/url_util.cc ++++ b/url/url_util.cc +@@ -76,6 +76,8 @@ struct SchemeRegistry { + std::vector referrer_schemes = { + {kHttpsScheme, SCHEME_WITH_HOST_PORT_AND_USER_INFORMATION}, + {kHttpScheme, SCHEME_WITH_HOST_PORT_AND_USER_INFORMATION}, ++ {"ipfs", SCHEME_WITH_HOST}, ++ {"ipns", SCHEME_WITH_HOST}, + }; + + // Schemes that do not trigger mixed content warning. +@@ -84,6 +86,8 @@ struct SchemeRegistry { + kWssScheme, + kDataScheme, + kAboutScheme, ++ {"ipfs", SCHEME_WITH_HOST}, ++ {"ipns", SCHEME_WITH_HOST}, + }; + + // Schemes that normal pages cannot link to or access (i.e., with the same +@@ -105,6 +109,8 @@ struct SchemeRegistry { + kHttpsScheme, + kHttpScheme, + kDataScheme, ++ {"ipfs", SCHEME_WITH_HOST}, ++ {"ipns", SCHEME_WITH_HOST}, + }; + + // Schemes that can be used by web to store data (local storage, etc). +@@ -308,7 +314,12 @@ bool DoCanonicalize(const CHAR* spec, + success = CanonicalizeFileSystemURL( + spec, ParseFileSystemURL(std::basic_string_view(spec, spec_len)), + charset_converter, output, output_parsed); +- ++ } else if (DoCompareSchemeComponent(spec, scheme, "ipfs")) { ++ auto spec_view = std::basic_string_view(spec, spec_len); ++ // Switch multibase away from case-sensitive ones before continuing canonicalization. ++ auto parsed_input = ParseStandardURL(spec_view); ++ success = CanonicalizeIpfsURL(spec_view, parsed_input, scheme_type, ++ charset_converter, output, output_parsed); + } else if (DoIsStandard(spec, scheme, &scheme_type)) { + // All "normal" URLs. + success = CanonicalizeStandardURL( diff --git a/chromium_edits/124.0.6329.0/chrome/browser/BUILD.gn.patch b/chromium_edits/128.0.6613.120/chrome/browser/BUILD.gn.patch similarity index 84% rename from chromium_edits/124.0.6329.0/chrome/browser/BUILD.gn.patch rename to chromium_edits/128.0.6613.120/chrome/browser/BUILD.gn.patch index 9c134da3..54a6921f 100644 --- a/chromium_edits/124.0.6329.0/chrome/browser/BUILD.gn.patch +++ b/chromium_edits/128.0.6613.120/chrome/browser/BUILD.gn.patch @@ -1,8 +1,8 @@ diff --git a/chrome/browser/BUILD.gn b/chrome/browser/BUILD.gn -index 78087b873bd28..f33f72a86d7f1 100644 +index fe0452e8bd462..575137d6dbbf9 100644 --- a/chrome/browser/BUILD.gn +++ b/chrome/browser/BUILD.gn -@@ -39,6 +39,7 @@ import("//sandbox/features.gni") +@@ -41,6 +41,7 @@ import("//sandbox/features.gni") import("//services/screen_ai/buildflags/features.gni") import("//testing/libfuzzer/fuzzer_test.gni") import("//third_party/blink/public/public_features.gni") @@ -10,7 +10,7 @@ index 78087b873bd28..f33f72a86d7f1 100644 import("//third_party/protobuf/proto_library.gni") import("//third_party/webrtc/webrtc.gni") import("//third_party/widevine/cdm/widevine.gni") -@@ -2644,6 +2645,14 @@ static_library("browser") { +@@ -2717,6 +2718,14 @@ static_library("browser") { ] } diff --git a/chromium_edits/124.0.6356.2/chrome/browser/about_flags.cc.patch b/chromium_edits/128.0.6613.120/chrome/browser/about_flags.cc.patch similarity index 90% rename from chromium_edits/124.0.6356.2/chrome/browser/about_flags.cc.patch rename to chromium_edits/128.0.6613.120/chrome/browser/about_flags.cc.patch index 801fb2e9..6dc27a42 100644 --- a/chromium_edits/124.0.6356.2/chrome/browser/about_flags.cc.patch +++ b/chromium_edits/128.0.6613.120/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 57721d673d22b..355e46b6965f3 100644 +index 96370d4ac35a9..82bf3f78caccc 100644 --- a/chrome/browser/about_flags.cc +++ b/chrome/browser/about_flags.cc -@@ -214,6 +214,7 @@ +@@ -220,6 +220,7 @@ #include "third_party/blink/public/common/features_generated.h" #include "third_party/blink/public/common/forcedark/forcedark_switches.h" #include "third_party/blink/public/common/switches.h" @@ -10,7 +10,7 @@ index 57721d673d22b..355e46b6965f3 100644 #include "ui/accessibility/accessibility_features.h" #include "ui/accessibility/accessibility_switches.h" #include "ui/base/ozone_buildflags.h" -@@ -308,6 +309,10 @@ +@@ -320,6 +321,10 @@ #include "extensions/common/switches.h" #endif // BUILDFLAG(ENABLE_EXTENSIONS) @@ -21,7 +21,7 @@ index 57721d673d22b..355e46b6965f3 100644 #if BUILDFLAG(ENABLE_PDF) #include "pdf/pdf_features.h" #endif -@@ -9459,6 +9464,14 @@ const FeatureEntry kFeatureEntries[] = { +@@ -10130,6 +10135,14 @@ const FeatureEntry kFeatureEntries[] = { flag_descriptions::kOmitCorsClientCertDescription, kOsAll, FEATURE_VALUE_TYPE(network::features::kOmitCorsClientCert)}, diff --git a/chromium_edits/124.0.6342.3/chrome/browser/autocomplete/chrome_autocomplete_scheme_classifier.cc.patch b/chromium_edits/128.0.6613.120/chrome/browser/autocomplete/chrome_autocomplete_scheme_classifier.cc.patch similarity index 82% rename from chromium_edits/124.0.6342.3/chrome/browser/autocomplete/chrome_autocomplete_scheme_classifier.cc.patch rename to chromium_edits/128.0.6613.120/chrome/browser/autocomplete/chrome_autocomplete_scheme_classifier.cc.patch index 4d172311..f9965a24 100644 --- a/chromium_edits/124.0.6342.3/chrome/browser/autocomplete/chrome_autocomplete_scheme_classifier.cc.patch +++ b/chromium_edits/128.0.6613.120/chrome/browser/autocomplete/chrome_autocomplete_scheme_classifier.cc.patch @@ -1,27 +1,28 @@ diff --git a/chrome/browser/autocomplete/chrome_autocomplete_scheme_classifier.cc b/chrome/browser/autocomplete/chrome_autocomplete_scheme_classifier.cc -index 4c88614c68c25..f8bb12a3b0c2e 100644 +index 9f234a2a7d41d..a9378ca80dc1e 100644 --- a/chrome/browser/autocomplete/chrome_autocomplete_scheme_classifier.cc +++ b/chrome/browser/autocomplete/chrome_autocomplete_scheme_classifier.cc -@@ -10,6 +10,8 @@ - #include "chrome/browser/custom_handlers/protocol_handler_registry_factory.h" - #include "chrome/browser/external_protocol/external_protocol_handler.h" - #include "chrome/browser/profiles/profile.h" +@@ -13,6 +13,7 @@ + #include "chrome/browser/profiles/profile_io_data.h" + #include "components/custom_handlers/protocol_handler_registry.h" + #include "content/public/common/url_constants.h" +#include "third_party/ipfs_client/ipfs_buildflags.h" -+ + #include "url/url_util.h" + #if BUILDFLAG(IS_ANDROID) - #include "chrome/browser/profiles/profile_android.h" - #endif -@@ -18,6 +20,9 @@ +@@ -20,6 +21,11 @@ #include "chrome/browser/ui/android/omnibox/jni_headers/ChromeAutocompleteSchemeClassifier_jni.h" #endif - #include "components/custom_handlers/protocol_handler_registry.h" + +#if BUILDFLAG(ENABLE_IPFS) +#include "components/ipfs/ipfs_features.h" +#endif - #include "content/public/common/url_constants.h" - #include "url/url_util.h" - -@@ -55,12 +60,20 @@ ChromeAutocompleteSchemeClassifier::GetInputTypeForScheme( ++ ++ + #if BUILDFLAG(IS_ANDROID) + static jlong + JNI_ChromeAutocompleteSchemeClassifier_CreateAutocompleteClassifier( +@@ -53,12 +59,20 @@ ChromeAutocompleteSchemeClassifier::GetInputTypeForScheme( if (scheme.empty()) { return metrics::OmniboxInputType::EMPTY; } diff --git a/chromium_edits/124.0.6356.2/chrome/browser/chrome_content_browser_client.cc.patch b/chromium_edits/128.0.6613.120/chrome/browser/chrome_content_browser_client.cc.patch similarity index 80% rename from chromium_edits/124.0.6356.2/chrome/browser/chrome_content_browser_client.cc.patch rename to chromium_edits/128.0.6613.120/chrome/browser/chrome_content_browser_client.cc.patch index c813bbd4..f506d677 100644 --- a/chromium_edits/124.0.6356.2/chrome/browser/chrome_content_browser_client.cc.patch +++ b/chromium_edits/128.0.6613.120/chrome/browser/chrome_content_browser_client.cc.patch @@ -1,17 +1,17 @@ diff --git a/chrome/browser/chrome_content_browser_client.cc b/chrome/browser/chrome_content_browser_client.cc -index cc7756b82d876..221f22b423953 100644 +index c4b98aa0e759f..0b645f5482fca 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" +@@ -396,6 +396,7 @@ #include "third_party/blink/public/mojom/browsing_topics/browsing_topics.mojom.h" + #include "third_party/blink/public/mojom/use_counter/metrics/web_feature.mojom.h" #include "third_party/blink/public/public_buildflags.h" +#include "third_party/ipfs_client/ipfs_buildflags.h" #include "third_party/widevine/cdm/buildflags.h" #include "ui/base/clipboard/clipboard_format_type.h" #include "ui/base/l10n/l10n_util.h" -@@ -500,6 +501,13 @@ - #include "chrome/browser/fuchsia/chrome_browser_main_parts_fuchsia.h" +@@ -516,6 +517,13 @@ + #include "chrome/browser/chrome_browser_main_posix.h" #endif +#if BUILDFLAG(ENABLE_IPFS) @@ -22,9 +22,9 @@ index cc7756b82d876..221f22b423953 100644 +#endif + #if !BUILDFLAG(IS_ANDROID) + #include "chrome/browser/digital_credentials/digital_identity_provider_desktop.h" #include "chrome/browser/preloading/preview/preview_navigation_throttle.h" - #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) { +@@ -1870,6 +1878,11 @@ ChromeContentBrowserClient::CreateBrowserMainParts(bool is_integration_test) { main_parts->AddParts( std::make_unique()); @@ -36,7 +36,7 @@ index cc7756b82d876..221f22b423953 100644 return main_parts; } -@@ -6100,12 +6113,25 @@ void ChromeContentBrowserClient:: +@@ -6482,12 +6495,29 @@ void ChromeContentBrowserClient:: const std::optional& request_initiator_origin, NonNetworkURLLoaderFactoryMap* factories) { #if BUILDFLAG(IS_CHROMEOS_ASH) || BUILDFLAG(ENABLE_EXTENSIONS) || \ @@ -48,7 +48,9 @@ index cc7756b82d876..221f22b423953 100644 #endif // BUILDFLAG(IS_CHROMEOS_ASH) || BUILDFLAG(ENABLE_EXTENSIONS) || \ // !BUILDFLAG(IS_ANDROID) +#if BUILDFLAG(ENABLE_IPFS) -+ if (base::FeatureList::IsEnabled(ipfs::kEnableIpfs)) { ++ if (!web_contents) { ++ VLOG(2) << "No web contents, can't register url loader factory."; ++ } else if (base::FeatureList::IsEnabled(ipfs::kEnableIpfs)) { + network::mojom::URLLoaderFactory* default_factory = g_browser_process->system_network_context_manager()->GetURLLoaderFactory(); + auto* context = web_contents->GetBrowserContext(); + ipfs::IpfsURLLoaderFactory::Create( @@ -58,12 +60,14 @@ index cc7756b82d876..221f22b423953 100644 + GetSystemNetworkContext(), + Profile::FromBrowserContext(context)->GetPrefs() + ); ++ } else { ++ LOG(INFO) << "IPFS disabled."; + } +#endif // BUILDFLAG(ENABLE_IPFS) #if BUILDFLAG(IS_CHROMEOS_ASH) if (web_contents) { -@@ -6242,6 +6268,11 @@ ChromeContentBrowserClient::WillCreateURLLoaderRequestInterceptors( +@@ -6633,6 +6663,11 @@ ChromeContentBrowserClient::WillCreateURLLoaderRequestInterceptors( scoped_refptr navigation_response_task_runner) { std::vector> interceptors; diff --git a/chromium_edits/124.0.6342.3/chrome/browser/flag-metadata.json.patch b/chromium_edits/128.0.6613.120/chrome/browser/flag-metadata.json.patch similarity index 89% rename from chromium_edits/124.0.6342.3/chrome/browser/flag-metadata.json.patch rename to chromium_edits/128.0.6613.120/chrome/browser/flag-metadata.json.patch index 955f992b..f954d6b0 100644 --- a/chromium_edits/124.0.6342.3/chrome/browser/flag-metadata.json.patch +++ b/chromium_edits/128.0.6613.120/chrome/browser/flag-metadata.json.patch @@ -1,8 +1,8 @@ diff --git a/chrome/browser/flag-metadata.json b/chrome/browser/flag-metadata.json -index 8214aa0b84a2a..0b98c262a5487 100644 +index fa225f6564471..e8444d0f88e84 100644 --- a/chrome/browser/flag-metadata.json +++ b/chrome/browser/flag-metadata.json -@@ -3044,6 +3044,11 @@ +@@ -3386,6 +3386,11 @@ "owners": [ "adamta@google.com", "chrome-feed-fundamentals@google.com" ], "expiry_milestone": 130 }, diff --git a/chromium_edits/124.0.6342.3/chrome/browser/flag_descriptions.cc.patch b/chromium_edits/128.0.6613.120/chrome/browser/flag_descriptions.cc.patch similarity index 85% rename from chromium_edits/124.0.6342.3/chrome/browser/flag_descriptions.cc.patch rename to chromium_edits/128.0.6613.120/chrome/browser/flag_descriptions.cc.patch index 28faa8b4..4d5c4d25 100644 --- a/chromium_edits/124.0.6342.3/chrome/browser/flag_descriptions.cc.patch +++ b/chromium_edits/128.0.6613.120/chrome/browser/flag_descriptions.cc.patch @@ -1,8 +1,8 @@ diff --git a/chrome/browser/flag_descriptions.cc b/chrome/browser/flag_descriptions.cc -index eb406d3eefd64..35ad09ca26293 100644 +index be5b3f2e79a5f..d61281fca8be5 100644 --- a/chrome/browser/flag_descriptions.cc +++ b/chrome/browser/flag_descriptions.cc -@@ -297,6 +297,11 @@ const char kEnableBenchmarkingChoiceDefaultFeatureStates[] = +@@ -302,6 +302,11 @@ const char kEnableBenchmarkingChoiceDefaultFeatureStates[] = const char kEnableBenchmarkingChoiceMatchFieldTrialTestingConfig[] = "Match Field Trial Testing Config"; diff --git a/chromium_edits/124.0.6356.2/chrome/browser/flag_descriptions.h.patch b/chromium_edits/128.0.6613.120/chrome/browser/flag_descriptions.h.patch similarity index 84% rename from chromium_edits/124.0.6356.2/chrome/browser/flag_descriptions.h.patch rename to chromium_edits/128.0.6613.120/chrome/browser/flag_descriptions.h.patch index 1093b803..ea921b20 100644 --- a/chromium_edits/124.0.6356.2/chrome/browser/flag_descriptions.h.patch +++ b/chromium_edits/128.0.6613.120/chrome/browser/flag_descriptions.h.patch @@ -1,8 +1,8 @@ diff --git a/chrome/browser/flag_descriptions.h b/chrome/browser/flag_descriptions.h -index 7881bf105c387..f6360179b9a33 100644 +index b14d6612eaa86..34aa125a87e57 100644 --- a/chrome/browser/flag_descriptions.h +++ b/chrome/browser/flag_descriptions.h -@@ -23,6 +23,7 @@ +@@ -24,6 +24,7 @@ #include "pdf/buildflags.h" #include "printing/buildflags/buildflags.h" #include "third_party/blink/public/common/buildflags.h" @@ -10,7 +10,7 @@ index 7881bf105c387..f6360179b9a33 100644 // This file declares strings used in chrome://flags. These messages are not // translated, because instead of end-users they target Chromium developers and -@@ -187,6 +188,11 @@ extern const char kEnableBenchmarkingChoiceDisabled[]; +@@ -195,6 +196,11 @@ extern const char kEnableBenchmarkingChoiceDisabled[]; extern const char kEnableBenchmarkingChoiceDefaultFeatureStates[]; extern const char kEnableBenchmarkingChoiceMatchFieldTrialTestingConfig[]; @@ -19,6 +19,6 @@ index 7881bf105c387..f6360179b9a33 100644 +extern const char kEnableIpfsDescription[]; +#endif + - #if BUILDFLAG(USE_FONTATIONS_BACKEND) extern const char kFontationsFontBackendName[]; extern const char kFontationsFontBackendDescription[]; + diff --git a/chromium_edits/124.0.6342.3/chrome/browser/ipfs_extra_parts.cc b/chromium_edits/128.0.6613.120/chrome/browser/ipfs_extra_parts.cc similarity index 100% rename from chromium_edits/124.0.6342.3/chrome/browser/ipfs_extra_parts.cc rename to chromium_edits/128.0.6613.120/chrome/browser/ipfs_extra_parts.cc diff --git a/chromium_edits/124.0.6342.3/chrome/browser/ipfs_extra_parts.h b/chromium_edits/128.0.6613.120/chrome/browser/ipfs_extra_parts.h similarity index 100% rename from chromium_edits/124.0.6342.3/chrome/browser/ipfs_extra_parts.h rename to chromium_edits/128.0.6613.120/chrome/browser/ipfs_extra_parts.h diff --git a/chromium_edits/124.0.6329.0/chrome/browser/prefs/browser_prefs.cc.patch b/chromium_edits/128.0.6613.120/chrome/browser/prefs/browser_prefs.cc.patch similarity index 90% rename from chromium_edits/124.0.6329.0/chrome/browser/prefs/browser_prefs.cc.patch rename to chromium_edits/128.0.6613.120/chrome/browser/prefs/browser_prefs.cc.patch index c43d86bf..6464d20f 100644 --- a/chromium_edits/124.0.6329.0/chrome/browser/prefs/browser_prefs.cc.patch +++ b/chromium_edits/128.0.6613.120/chrome/browser/prefs/browser_prefs.cc.patch @@ -1,8 +1,8 @@ diff --git a/chrome/browser/prefs/browser_prefs.cc b/chrome/browser/prefs/browser_prefs.cc -index ead26a869cfe0..a979df933cd2f 100644 +index 8cf6b5d7d4281..699490b84fc37 100644 --- a/chrome/browser/prefs/browser_prefs.cc +++ b/chrome/browser/prefs/browser_prefs.cc -@@ -192,6 +192,8 @@ +@@ -199,6 +199,8 @@ #include "printing/buildflags/buildflags.h" #include "rlz/buildflags/buildflags.h" #include "services/screen_ai/buildflags/buildflags.h" @@ -11,7 +11,7 @@ index ead26a869cfe0..a979df933cd2f 100644 #if BUILDFLAG(ENABLE_BACKGROUND_MODE) #include "chrome/browser/background/background_mode_manager.h" -@@ -236,6 +238,11 @@ +@@ -244,6 +246,11 @@ #include "chrome/browser/pdf/pdf_pref_names.h" #endif // BUILDFLAG(ENABLE_PDF) @@ -23,7 +23,7 @@ index ead26a869cfe0..a979df933cd2f 100644 #if BUILDFLAG(ENABLE_SCREEN_AI_SERVICE) #include "chrome/browser/screen_ai/pref_names.h" #endif -@@ -1775,6 +1782,11 @@ void RegisterProfilePrefs(user_prefs::PrefRegistrySyncable* registry, +@@ -1783,6 +1790,11 @@ void RegisterProfilePrefs(user_prefs::PrefRegistrySyncable* registry, IncognitoModePrefs::RegisterProfilePrefs(registry); invalidation::PerUserTopicSubscriptionManager::RegisterProfilePrefs(registry); invalidation::InvalidatorRegistrarWithMemory::RegisterProfilePrefs(registry); diff --git a/chromium_edits/128.0.6613.120/chrome/browser/shell_integration_mac.mm.patch b/chromium_edits/128.0.6613.120/chrome/browser/shell_integration_mac.mm.patch new file mode 100644 index 00000000..220e2546 --- /dev/null +++ b/chromium_edits/128.0.6613.120/chrome/browser/shell_integration_mac.mm.patch @@ -0,0 +1,13 @@ +diff --git a/chrome/browser/shell_integration_mac.mm b/chrome/browser/shell_integration_mac.mm +index c6bb768979453..c0d0abb9c78f3 100644 +--- a/chrome/browser/shell_integration_mac.mm ++++ b/chrome/browser/shell_integration_mac.mm +@@ -79,6 +79,8 @@ bool SetAsDefaultBrowser() { + if (LSSetDefaultHandlerForURLScheme(CFSTR("https"), identifier) != noErr) { + return false; + } ++ LSSetDefaultHandlerForURLScheme(CFSTR("ipfs"), identifier); ++ LSSetDefaultHandlerForURLScheme(CFSTR("ipns"), identifier); + if (LSSetDefaultRoleHandlerForContentType(kUTTypeHTML, kLSRolesViewer, + identifier) != noErr) { + return false; diff --git a/chromium_edits/124.0.6356.2/chrome/common/chrome_content_client.cc.patch b/chromium_edits/128.0.6613.120/chrome/common/chrome_content_client.cc.patch similarity index 85% rename from chromium_edits/124.0.6356.2/chrome/common/chrome_content_client.cc.patch rename to chromium_edits/128.0.6613.120/chrome/common/chrome_content_client.cc.patch index 59ea01c2..d0ce5acb 100644 --- a/chromium_edits/124.0.6356.2/chrome/common/chrome_content_client.cc.patch +++ b/chromium_edits/128.0.6613.120/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 2f016718fdd3c..bc38d5c2e4d8e 100644 +index 23baff86bfc1f..df9417b28e153 100644 --- a/chrome/common/chrome_content_client.cc +++ b/chrome/common/chrome_content_client.cc -@@ -302,6 +302,12 @@ void ChromeContentClient::AddAdditionalSchemes(Schemes* schemes) { +@@ -308,6 +308,12 @@ void ChromeContentClient::AddAdditionalSchemes(Schemes* schemes) { #if BUILDFLAG(IS_ANDROID) schemes->local_schemes.push_back(url::kContentScheme); #endif diff --git a/chromium_edits/128.0.6613.120/chrome/installer/linux/common/desktop.template.patch b/chromium_edits/128.0.6613.120/chrome/installer/linux/common/desktop.template.patch new file mode 100644 index 00000000..dcd9460b --- /dev/null +++ b/chromium_edits/128.0.6613.120/chrome/installer/linux/common/desktop.template.patch @@ -0,0 +1,13 @@ +diff --git a/chrome/installer/linux/common/desktop.template b/chrome/installer/linux/common/desktop.template +index 2eb13ee1aba46..9af65726bde89 100644 +--- a/chrome/installer/linux/common/desktop.template ++++ b/chrome/installer/linux/common/desktop.template +@@ -111,7 +111,7 @@ Terminal=false + Icon=@@PACKAGE@@ + Type=Application + Categories=Network;WebBrowser; +-MimeType=application/pdf;application/rdf+xml;application/rss+xml;application/xhtml+xml;application/xhtml_xml;application/xml;image/gif;image/jpeg;image/png;image/webp;text/html;text/xml;x-scheme-handler/http;x-scheme-handler/https; ++MimeType=application/pdf;application/rdf+xml;application/rss+xml;application/xhtml+xml;application/xhtml_xml;application/xml;image/gif;image/jpeg;image/png;image/webp;text/html;text/xml;x-scheme-handler/http;x-scheme-handler/https;x-scheme-handler/ipfs;x-scheme-handler/ipns; + Actions=new-window;new-private-window; + + [Desktop Action new-window] diff --git a/chromium_edits/128.0.6613.120/chrome/installer/util/shell_util.cc.patch b/chromium_edits/128.0.6613.120/chrome/installer/util/shell_util.cc.patch new file mode 100644 index 00000000..ff731765 --- /dev/null +++ b/chromium_edits/128.0.6613.120/chrome/installer/util/shell_util.cc.patch @@ -0,0 +1,20 @@ +diff --git a/chrome/installer/util/shell_util.cc b/chrome/installer/util/shell_util.cc +index 87a2c70b6cb1a..50c52f1ef579e 100644 +--- a/chrome/installer/util/shell_util.cc ++++ b/chrome/installer/util/shell_util.cc +@@ -1523,11 +1523,12 @@ const wchar_t* ShellUtil::kDefaultFileAssociations[] = { + const wchar_t* ShellUtil::kPotentialFileAssociations[] = { + L".htm", L".html", L".pdf", L".shtml", L".svg", + L".xht", L".xhtml", L".webp", nullptr}; +-const wchar_t* ShellUtil::kBrowserProtocolAssociations[] = {L"http", L"https", +- nullptr}; ++const wchar_t* ShellUtil::kBrowserProtocolAssociations[] = { ++ L"http", L"https", L"ipfs", L"ipns", nullptr}; + const wchar_t* ShellUtil::kPotentialProtocolAssociations[] = { + L"http", L"https", L"irc", L"mailto", L"mms", L"news", L"nntp", +- L"sms", L"smsto", L"snews", L"tel", L"urn", L"webcal", nullptr}; ++ L"sms", L"smsto", L"snews", L"tel", L"urn", L"webcal", L"ipfs", ++ L"ipns", nullptr}; + const wchar_t* ShellUtil::kRegUrlProtocol = L"URL Protocol"; + const wchar_t* ShellUtil::kRegApplication = L"\\Application"; + const wchar_t* ShellUtil::kRegAppUserModelId = L"AppUserModelId"; diff --git a/chromium_edits/124.0.6356.2/components/cbor/reader.cc.patch b/chromium_edits/128.0.6613.120/components/cbor/reader.cc.patch similarity index 97% rename from chromium_edits/124.0.6356.2/components/cbor/reader.cc.patch rename to chromium_edits/128.0.6613.120/components/cbor/reader.cc.patch index a9c4a7b3..88eef088 100644 --- a/chromium_edits/124.0.6356.2/components/cbor/reader.cc.patch +++ b/chromium_edits/128.0.6613.120/components/cbor/reader.cc.patch @@ -1,5 +1,5 @@ diff --git a/components/cbor/reader.cc b/components/cbor/reader.cc -index 3c31e3d05e5d3..5ad0dbb183884 100644 +index 464e93937d8d7..220dd4960cd2b 100644 --- a/components/cbor/reader.cc +++ b/components/cbor/reader.cc @@ -22,7 +22,7 @@ diff --git a/chromium_edits/124.0.6356.2/components/cbor/reader.h.patch b/chromium_edits/128.0.6613.120/components/cbor/reader.h.patch similarity index 88% rename from chromium_edits/124.0.6356.2/components/cbor/reader.h.patch rename to chromium_edits/128.0.6613.120/components/cbor/reader.h.patch index cd7d9eb0..2dbc0534 100644 --- a/chromium_edits/124.0.6356.2/components/cbor/reader.h.patch +++ b/chromium_edits/128.0.6613.120/components/cbor/reader.h.patch @@ -1,8 +1,8 @@ diff --git a/components/cbor/reader.h b/components/cbor/reader.h -index 73c5dcb23e555..a933768608d73 100644 +index 5f11ba48ba494..d4c9c489da4b6 100644 --- a/components/cbor/reader.h +++ b/components/cbor/reader.h -@@ -130,6 +130,11 @@ class CBOR_EXPORT Reader { +@@ -131,6 +131,11 @@ class CBOR_EXPORT Reader { // during decoding will set raise the `UNSUPPORTED_FLOATING_POINT_VALUE` // error. bool allow_floating_point = false; @@ -14,7 +14,7 @@ index 73c5dcb23e555..a933768608d73 100644 }; Reader(const Reader&) = delete; -@@ -204,6 +209,9 @@ class CBOR_EXPORT Reader { +@@ -205,6 +210,9 @@ class CBOR_EXPORT Reader { std::optional ReadMapContent(const DataItemHeader& header, const Config& config, int max_nesting_level); diff --git a/chromium_edits/124.0.6342.3/components/cbor/reader_unittest.cc.patch b/chromium_edits/128.0.6613.120/components/cbor/reader_unittest.cc.patch similarity index 100% rename from chromium_edits/124.0.6342.3/components/cbor/reader_unittest.cc.patch rename to chromium_edits/128.0.6613.120/components/cbor/reader_unittest.cc.patch diff --git a/chromium_edits/124.0.6329.0/components/cbor/values.cc.patch b/chromium_edits/128.0.6613.120/components/cbor/values.cc.patch similarity index 92% rename from chromium_edits/124.0.6329.0/components/cbor/values.cc.patch rename to chromium_edits/128.0.6613.120/components/cbor/values.cc.patch index ddbab2b3..2832d248 100644 --- a/chromium_edits/124.0.6329.0/components/cbor/values.cc.patch +++ b/chromium_edits/128.0.6613.120/components/cbor/values.cc.patch @@ -1,9 +1,9 @@ diff --git a/components/cbor/values.cc b/components/cbor/values.cc -index 02498209c820e..34055aef24cfe 100644 +index 7c6b7a0aeaae3..5096311ba2a20 100644 --- a/components/cbor/values.cc +++ b/components/cbor/values.cc @@ -66,32 +66,34 @@ Value::Value(Type type) : type_(type) { - NOTREACHED(); + NOTREACHED_IN_MIGRATION(); } -Value::Value(SimpleValue in_simple) @@ -53,13 +53,13 @@ index 02498209c820e..34055aef24cfe 100644 } } --Value::Value(base::StringPiece in_string, Type type) : type_(type) { -+Value::Value(base::StringPiece in_string, Type type, uint64_t tag) +-Value::Value(std::string_view in_string, Type type) : type_(type) { ++Value::Value(std::string_view in_string, Type type, uint64_t tag) +: type_(type), tag_(tag) { switch (type_) { case Type::STRING: new (&string_value_) std::string(); -@@ -133,16 +136,18 @@ Value::Value(base::StringPiece in_string, Type type) : type_(type) { +@@ -133,16 +136,18 @@ Value::Value(std::string_view in_string, Type type) : type_(type) { } } @@ -105,7 +105,7 @@ index 02498209c820e..34055aef24cfe 100644 - return Value(map_value_); + return Value(map_value_, tag_); case Type::TAG: - NOTREACHED() << constants::kUnsupportedMajorType; + NOTREACHED_IN_MIGRATION() << constants::kUnsupportedMajorType; return Value(); case Type::SIMPLE_VALUE: - return Value(simple_value_); @@ -115,7 +115,7 @@ index 02498209c820e..34055aef24cfe 100644 + return Value(float_value_, tag_); } - NOTREACHED(); + NOTREACHED_IN_MIGRATION(); return Value(); } diff --git a/chromium_edits/124.0.6342.3/components/cbor/values.h.patch b/chromium_edits/128.0.6613.120/components/cbor/values.h.patch similarity index 87% rename from chromium_edits/124.0.6342.3/components/cbor/values.h.patch rename to chromium_edits/128.0.6613.120/components/cbor/values.h.patch index ca39df01..5556e8c5 100644 --- a/chromium_edits/124.0.6342.3/components/cbor/values.h.patch +++ b/chromium_edits/128.0.6613.120/components/cbor/values.h.patch @@ -1,8 +1,8 @@ diff --git a/components/cbor/values.h b/components/cbor/values.h -index d81ef5607c55a..10216a8dcdc57 100644 +index d55369f1a71bf..7dabb368c51d6 100644 --- a/components/cbor/values.h +++ b/components/cbor/values.h -@@ -127,28 +127,29 @@ class CBOR_EXPORT Value { +@@ -125,28 +125,29 @@ class CBOR_EXPORT Value { explicit Value(Type type); @@ -25,8 +25,8 @@ index d81ef5607c55a..10216a8dcdc57 100644 explicit Value(const char* in_string, Type type = Type::STRING); explicit Value(std::string&& in_string, Type type = Type::STRING) noexcept; -- explicit Value(base::StringPiece in_string, Type type = Type::STRING); -+ explicit Value(base::StringPiece in_string, Type type = Type::STRING, uint64_t tag = NO_TAG); +- explicit Value(std::string_view in_string, Type type = Type::STRING); ++ explicit Value(std::string_view in_string, Type type = Type::STRING, uint64_t tag = NO_TAG); - explicit Value(const ArrayValue& in_array); - explicit Value(ArrayValue&& in_array) noexcept; @@ -42,7 +42,7 @@ index d81ef5607c55a..10216a8dcdc57 100644 Value(const Value&) = delete; Value& operator=(const Value&) = delete; -@@ -179,6 +180,7 @@ class CBOR_EXPORT Value { +@@ -177,6 +178,7 @@ class CBOR_EXPORT Value { bool is_string() const { return type() == Type::STRING; } bool is_array() const { return type() == Type::ARRAY; } bool is_map() const { return type() == Type::MAP; } @@ -50,7 +50,7 @@ index d81ef5607c55a..10216a8dcdc57 100644 // These will all fatally assert if the type doesn't match. SimpleValue GetSimpleValue() const; -@@ -194,12 +196,13 @@ class CBOR_EXPORT Value { +@@ -192,12 +194,13 @@ class CBOR_EXPORT Value { const ArrayValue& GetArray() const; const MapValue& GetMap() const; const BinaryValue& GetInvalidUTF8() const; @@ -65,7 +65,7 @@ index d81ef5607c55a..10216a8dcdc57 100644 Type type_; -@@ -213,6 +216,11 @@ class CBOR_EXPORT Value { +@@ -211,6 +214,11 @@ class CBOR_EXPORT Value { MapValue map_value_; }; diff --git a/chromium_edits/124.0.6342.3/components/cbor/writer.cc.patch b/chromium_edits/128.0.6613.120/components/cbor/writer.cc.patch similarity index 91% rename from chromium_edits/124.0.6342.3/components/cbor/writer.cc.patch rename to chromium_edits/128.0.6613.120/components/cbor/writer.cc.patch index bb89c1e6..150c3fca 100644 --- a/chromium_edits/124.0.6342.3/components/cbor/writer.cc.patch +++ b/chromium_edits/128.0.6613.120/components/cbor/writer.cc.patch @@ -1,5 +1,5 @@ diff --git a/components/cbor/writer.cc b/components/cbor/writer.cc -index f400a65e7b66a..fcdebb8f3b458 100644 +index e7e47774abe9a..4c085d5693a38 100644 --- a/components/cbor/writer.cc +++ b/components/cbor/writer.cc @@ -47,6 +47,9 @@ bool Writer::EncodeCBOR(const Value& node, diff --git a/chromium_edits/124.0.6356.2/components/cbor/writer_unittest.cc.patch b/chromium_edits/128.0.6613.120/components/cbor/writer_unittest.cc.patch similarity index 91% rename from chromium_edits/124.0.6356.2/components/cbor/writer_unittest.cc.patch rename to chromium_edits/128.0.6613.120/components/cbor/writer_unittest.cc.patch index 240fee83..1acf5f7f 100644 --- a/chromium_edits/124.0.6356.2/components/cbor/writer_unittest.cc.patch +++ b/chromium_edits/128.0.6613.120/components/cbor/writer_unittest.cc.patch @@ -1,8 +1,8 @@ diff --git a/components/cbor/writer_unittest.cc b/components/cbor/writer_unittest.cc -index e3bffe20734bc..0ed569ae164a0 100644 +index ee11e7cb86712..b8942f1829a37 100644 --- a/components/cbor/writer_unittest.cc +++ b/components/cbor/writer_unittest.cc -@@ -522,4 +522,31 @@ TEST(CBORWriterTest, OverlyNestedCBOR) { +@@ -523,4 +523,31 @@ TEST(CBORWriterTest, OverlyNestedCBOR) { EXPECT_FALSE(Writer::Write(Value(map), 4).has_value()); } diff --git a/chromium_edits/124.0.6356.2/components/open_from_clipboard/clipboard_recent_content_generic.cc.patch b/chromium_edits/128.0.6613.120/components/open_from_clipboard/clipboard_recent_content_generic.cc.patch similarity index 95% rename from chromium_edits/124.0.6356.2/components/open_from_clipboard/clipboard_recent_content_generic.cc.patch rename to chromium_edits/128.0.6613.120/components/open_from_clipboard/clipboard_recent_content_generic.cc.patch index 291d84f1..31e2e173 100644 --- a/chromium_edits/124.0.6356.2/components/open_from_clipboard/clipboard_recent_content_generic.cc.patch +++ b/chromium_edits/128.0.6613.120/components/open_from_clipboard/clipboard_recent_content_generic.cc.patch @@ -1,5 +1,5 @@ diff --git a/components/open_from_clipboard/clipboard_recent_content_generic.cc b/components/open_from_clipboard/clipboard_recent_content_generic.cc -index 32c4138ec358c..e9c62d51bf59b 100644 +index 9c0cda2dfb314..fea1c527c6d1d 100644 --- a/components/open_from_clipboard/clipboard_recent_content_generic.cc +++ b/components/open_from_clipboard/clipboard_recent_content_generic.cc @@ -20,7 +20,7 @@ diff --git a/chromium_edits/124.0.6329.0/net/dns/dns_config_service_linux.cc.patch b/chromium_edits/128.0.6613.120/net/dns/dns_config_service_linux.cc.patch similarity index 88% rename from chromium_edits/124.0.6329.0/net/dns/dns_config_service_linux.cc.patch rename to chromium_edits/128.0.6613.120/net/dns/dns_config_service_linux.cc.patch index 3b042d33..fd7227a5 100644 --- a/chromium_edits/124.0.6329.0/net/dns/dns_config_service_linux.cc.patch +++ b/chromium_edits/128.0.6613.120/net/dns/dns_config_service_linux.cc.patch @@ -1,8 +1,8 @@ diff --git a/net/dns/dns_config_service_linux.cc b/net/dns/dns_config_service_linux.cc -index f909f127ba3e1..31d7f9d58c0af 100644 +index 7aaf9fa5b0b78..5a9f5b5a70dd9 100644 --- a/net/dns/dns_config_service_linux.cc +++ b/net/dns/dns_config_service_linux.cc -@@ -271,11 +271,11 @@ bool IsNsswitchConfigCompatible( +@@ -276,11 +276,11 @@ bool IsNsswitchConfigCompatible( // Ignore any entries after `kDns` because Chrome will fallback to the // system resolver if a result was not found in DNS. return true; diff --git a/chromium_edits/124.0.6342.3/third_party/blink/renderer/platform/weborigin/scheme_registry.cc.patch b/chromium_edits/128.0.6613.120/third_party/blink/renderer/platform/weborigin/scheme_registry.cc.patch similarity index 70% rename from chromium_edits/124.0.6342.3/third_party/blink/renderer/platform/weborigin/scheme_registry.cc.patch rename to chromium_edits/128.0.6613.120/third_party/blink/renderer/platform/weborigin/scheme_registry.cc.patch index 119d72b2..663fe49e 100644 --- a/chromium_edits/124.0.6342.3/third_party/blink/renderer/platform/weborigin/scheme_registry.cc.patch +++ b/chromium_edits/128.0.6613.120/third_party/blink/renderer/platform/weborigin/scheme_registry.cc.patch @@ -1,13 +1,15 @@ diff --git a/third_party/blink/renderer/platform/weborigin/scheme_registry.cc b/third_party/blink/renderer/platform/weborigin/scheme_registry.cc -index 4eadf46ea0c24..d62fc7fb14e01 100644 +index e1bc209c337c5..6fbac29fcddfd 100644 --- a/third_party/blink/renderer/platform/weborigin/scheme_registry.cc +++ b/third_party/blink/renderer/platform/weborigin/scheme_registry.cc -@@ -67,7 +67,7 @@ class URLSchemesRegistry final { +@@ -68,8 +68,8 @@ class URLSchemesRegistry final { // is considered secure. Additional checks are performed to ensure that // other http pages are filtered out. service_worker_schemes({"http", "https"}), - fetch_api_schemes({"http", "https"}), +- allowed_in_referrer_schemes({"http", "https"}) { + fetch_api_schemes({"http", "https", "ipfs", "ipns"}), - allowed_in_referrer_schemes({"http", "https"}) { ++ allowed_in_referrer_schemes({"http", "https", "ipfs", "ipns"}) { for (auto& scheme : url::GetCorsEnabledSchemes()) cors_enabled_schemes.insert(scheme.c_str()); + for (auto& scheme : url::GetCSPBypassingSchemes()) { diff --git a/chromium_edits/124.0.6356.2/url/BUILD.gn.patch b/chromium_edits/128.0.6613.120/url/BUILD.gn.patch similarity index 87% rename from chromium_edits/124.0.6356.2/url/BUILD.gn.patch rename to chromium_edits/128.0.6613.120/url/BUILD.gn.patch index cc358ad4..be4bfca8 100644 --- a/chromium_edits/124.0.6356.2/url/BUILD.gn.patch +++ b/chromium_edits/128.0.6613.120/url/BUILD.gn.patch @@ -1,5 +1,5 @@ diff --git a/url/BUILD.gn b/url/BUILD.gn -index b5edb89f7698f..d299856674d7d 100644 +index f22b73bc29f06..df36977322ec7 100644 --- a/url/BUILD.gn +++ b/url/BUILD.gn @@ -5,6 +5,7 @@ @@ -10,7 +10,7 @@ index b5edb89f7698f..d299856674d7d 100644 import("features.gni") import("//build/config/cronet/config.gni") -@@ -68,6 +69,7 @@ component("url") { +@@ -67,6 +68,7 @@ component("url") { public_deps = [ "//base", "//build:robolectric_buildflags", @@ -18,7 +18,7 @@ index b5edb89f7698f..d299856674d7d 100644 ] configs += [ "//build/config/compiler:wexit_time_destructors" ] -@@ -90,6 +92,11 @@ component("url") { +@@ -89,6 +91,11 @@ component("url") { public_configs = [ "//third_party/jdk" ] } diff --git a/chromium_edits/128.0.6613.120/url/url_canon.h.patch b/chromium_edits/128.0.6613.120/url/url_canon.h.patch new file mode 100644 index 00000000..57a53f5b --- /dev/null +++ b/chromium_edits/128.0.6613.120/url/url_canon.h.patch @@ -0,0 +1,26 @@ +diff --git a/url/url_canon.h b/url/url_canon.h +index ab5ec90988943..d28d325a01fc0 100644 +--- a/url/url_canon.h ++++ b/url/url_canon.h +@@ -821,6 +821,21 @@ bool CanonicalizeMailtoURL(const char16_t* spec, + CanonOutput* output, + Parsed* new_parsed); + ++COMPONENT_EXPORT(URL) ++bool CanonicalizeIpfsURL(std::string_view spec, ++ const Parsed& parsed, ++ SchemeType scheme_type, ++ CharsetConverter* query_converter, ++ CanonOutput* output, ++ Parsed* new_parsed); ++COMPONENT_EXPORT(URL) ++bool CanonicalizeIpfsURL(std::basic_string_view spec, ++ const Parsed& parsed, ++ SchemeType scheme_type, ++ CharsetConverter* query_converter, ++ CanonOutput* output, ++ Parsed* new_parsed); ++ + // Part replacer -------------------------------------------------------------- + + // Internal structure used for storing separate strings for each component. diff --git a/chromium_edits/128.0.6613.120/url/url_canon_ipfs.cc b/chromium_edits/128.0.6613.120/url/url_canon_ipfs.cc new file mode 100644 index 00000000..e40732ee --- /dev/null +++ b/chromium_edits/128.0.6613.120/url/url_canon_ipfs.cc @@ -0,0 +1,54 @@ +#include "url_canon_internal.h" + +#include +#include + +#include + +bool url::CanonicalizeIpfsURL(std::string_view spec, + const Parsed& parsed, + SchemeType scheme_type, + CharsetConverter* charset_converter, + CanonOutput* output, + Parsed* output_parsed) { + if (spec.size() < 1) { + return false; + } + if ( parsed.host.len < 1 ) { + return false; + } + auto cid_str = spec.substr( parsed.host.begin, static_cast(parsed.host.len) ); + auto cid = ipfs::Cid(cid_str); + if ( !cid.valid() ) { + cid = ipfs::id_cid::forText( std::string{cid_str} + " is not a valid CID." ); + } + auto as_str = cid.to_string(); + if ( as_str.empty() ) { + return false; + } + std::string stdurl{ spec.substr(0UL, static_cast(parsed.host.begin)) }; + stdurl.append( as_str ); + spec.remove_prefix(parsed.host.end()); + stdurl.append(spec); + auto len = static_cast(stdurl.size()); + Parsed parsed_input; + ParseStandardURL(stdurl.data(), len, &parsed_input); + return CanonicalizeStandardURL( + stdurl.data(), + parsed_input, + scheme_type, + charset_converter, + output, output_parsed + ); +} +bool url::CanonicalizeIpfsURL(std::basic_string_view spec, + const Parsed& parsed, + SchemeType scheme_type, + CharsetConverter* query_converter, + CanonOutput* output, + Parsed* new_parsed) { + RawCanonOutput<2048> as8; + ConvertUTF16ToUTF8(spec.data(), spec.size(), &as8); + return CanonicalizeIpfsURL({as8.data(), as8.length()}, parsed, scheme_type, + query_converter, output, new_parsed); +} diff --git a/chromium_edits/128.0.6613.120/url/url_util.cc.patch b/chromium_edits/128.0.6613.120/url/url_util.cc.patch new file mode 100644 index 00000000..988797b0 --- /dev/null +++ b/chromium_edits/128.0.6613.120/url/url_util.cc.patch @@ -0,0 +1,45 @@ +diff --git a/url/url_util.cc b/url/url_util.cc +index ce5225e121f5d..79e33208f728e 100644 +--- a/url/url_util.cc ++++ b/url/url_util.cc +@@ -76,6 +76,8 @@ struct SchemeRegistry { + std::vector referrer_schemes = { + {kHttpsScheme, SCHEME_WITH_HOST_PORT_AND_USER_INFORMATION}, + {kHttpScheme, SCHEME_WITH_HOST_PORT_AND_USER_INFORMATION}, ++ {"ipfs", SCHEME_WITH_HOST}, ++ {"ipns", SCHEME_WITH_HOST}, + }; + + // Schemes that do not trigger mixed content warning. +@@ -84,6 +86,8 @@ struct SchemeRegistry { + kWssScheme, + kDataScheme, + kAboutScheme, ++ {"ipfs", SCHEME_WITH_HOST}, ++ {"ipns", SCHEME_WITH_HOST}, + }; + + // Schemes that normal pages cannot link to or access (i.e., with the same +@@ -105,6 +109,8 @@ struct SchemeRegistry { + kHttpsScheme, + kHttpScheme, + kDataScheme, ++ {"ipfs", SCHEME_WITH_HOST}, ++ {"ipns", SCHEME_WITH_HOST}, + }; + + // Schemes that can be used by web to store data (local storage, etc). +@@ -308,7 +314,12 @@ bool DoCanonicalize(const CHAR* spec, + success = CanonicalizeFileSystemURL( + spec, ParseFileSystemURL(std::basic_string_view(spec, spec_len)), + charset_converter, output, output_parsed); +- ++ } else if (DoCompareSchemeComponent(spec, scheme, "ipfs")) { ++ auto spec_view = std::basic_string_view(spec, spec_len); ++ // Switch multibase away from case-sensitive ones before continuing canonicalization. ++ auto parsed_input = ParseStandardURL(spec_view); ++ success = CanonicalizeIpfsURL(spec_view, parsed_input, scheme_type, ++ charset_converter, output, output_parsed); + } else if (DoIsStandard(spec, scheme, &scheme_type)) { + // All "normal" URLs. + success = CanonicalizeStandardURL( diff --git a/chromium_edits/124.0.6356.2/chrome/browser/BUILD.gn.patch b/chromium_edits/128.0.6613.86/chrome/browser/BUILD.gn.patch similarity index 84% rename from chromium_edits/124.0.6356.2/chrome/browser/BUILD.gn.patch rename to chromium_edits/128.0.6613.86/chrome/browser/BUILD.gn.patch index 042a1797..54a6921f 100644 --- a/chromium_edits/124.0.6356.2/chrome/browser/BUILD.gn.patch +++ b/chromium_edits/128.0.6613.86/chrome/browser/BUILD.gn.patch @@ -1,8 +1,8 @@ diff --git a/chrome/browser/BUILD.gn b/chrome/browser/BUILD.gn -index e69751645f895..715e7a795a711 100644 +index fe0452e8bd462..575137d6dbbf9 100644 --- a/chrome/browser/BUILD.gn +++ b/chrome/browser/BUILD.gn -@@ -39,6 +39,7 @@ import("//sandbox/features.gni") +@@ -41,6 +41,7 @@ import("//sandbox/features.gni") import("//services/screen_ai/buildflags/features.gni") import("//testing/libfuzzer/fuzzer_test.gni") import("//third_party/blink/public/public_features.gni") @@ -10,7 +10,7 @@ index e69751645f895..715e7a795a711 100644 import("//third_party/protobuf/proto_library.gni") import("//third_party/webrtc/webrtc.gni") import("//third_party/widevine/cdm/widevine.gni") -@@ -2642,6 +2643,14 @@ static_library("browser") { +@@ -2717,6 +2718,14 @@ static_library("browser") { ] } diff --git a/chromium_edits/124.0.6329.0/chrome/browser/about_flags.cc.patch b/chromium_edits/128.0.6613.86/chrome/browser/about_flags.cc.patch similarity index 90% rename from chromium_edits/124.0.6329.0/chrome/browser/about_flags.cc.patch rename to chromium_edits/128.0.6613.86/chrome/browser/about_flags.cc.patch index 37631693..6dc27a42 100644 --- a/chromium_edits/124.0.6329.0/chrome/browser/about_flags.cc.patch +++ b/chromium_edits/128.0.6613.86/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 f5761878e4373..e6cbc9e9719db 100644 +index 96370d4ac35a9..82bf3f78caccc 100644 --- a/chrome/browser/about_flags.cc +++ b/chrome/browser/about_flags.cc -@@ -214,6 +214,7 @@ +@@ -220,6 +220,7 @@ #include "third_party/blink/public/common/features_generated.h" #include "third_party/blink/public/common/forcedark/forcedark_switches.h" #include "third_party/blink/public/common/switches.h" @@ -10,7 +10,7 @@ index f5761878e4373..e6cbc9e9719db 100644 #include "ui/accessibility/accessibility_features.h" #include "ui/accessibility/accessibility_switches.h" #include "ui/base/ozone_buildflags.h" -@@ -308,6 +309,10 @@ +@@ -320,6 +321,10 @@ #include "extensions/common/switches.h" #endif // BUILDFLAG(ENABLE_EXTENSIONS) @@ -21,7 +21,7 @@ index f5761878e4373..e6cbc9e9719db 100644 #if BUILDFLAG(ENABLE_PDF) #include "pdf/pdf_features.h" #endif -@@ -9480,6 +9485,14 @@ const FeatureEntry kFeatureEntries[] = { +@@ -10130,6 +10135,14 @@ const FeatureEntry kFeatureEntries[] = { flag_descriptions::kOmitCorsClientCertDescription, kOsAll, FEATURE_VALUE_TYPE(network::features::kOmitCorsClientCert)}, diff --git a/chromium_edits/124.0.6356.2/chrome/browser/autocomplete/chrome_autocomplete_scheme_classifier.cc.patch b/chromium_edits/128.0.6613.86/chrome/browser/autocomplete/chrome_autocomplete_scheme_classifier.cc.patch similarity index 82% rename from chromium_edits/124.0.6356.2/chrome/browser/autocomplete/chrome_autocomplete_scheme_classifier.cc.patch rename to chromium_edits/128.0.6613.86/chrome/browser/autocomplete/chrome_autocomplete_scheme_classifier.cc.patch index 4d172311..f9965a24 100644 --- a/chromium_edits/124.0.6356.2/chrome/browser/autocomplete/chrome_autocomplete_scheme_classifier.cc.patch +++ b/chromium_edits/128.0.6613.86/chrome/browser/autocomplete/chrome_autocomplete_scheme_classifier.cc.patch @@ -1,27 +1,28 @@ diff --git a/chrome/browser/autocomplete/chrome_autocomplete_scheme_classifier.cc b/chrome/browser/autocomplete/chrome_autocomplete_scheme_classifier.cc -index 4c88614c68c25..f8bb12a3b0c2e 100644 +index 9f234a2a7d41d..a9378ca80dc1e 100644 --- a/chrome/browser/autocomplete/chrome_autocomplete_scheme_classifier.cc +++ b/chrome/browser/autocomplete/chrome_autocomplete_scheme_classifier.cc -@@ -10,6 +10,8 @@ - #include "chrome/browser/custom_handlers/protocol_handler_registry_factory.h" - #include "chrome/browser/external_protocol/external_protocol_handler.h" - #include "chrome/browser/profiles/profile.h" +@@ -13,6 +13,7 @@ + #include "chrome/browser/profiles/profile_io_data.h" + #include "components/custom_handlers/protocol_handler_registry.h" + #include "content/public/common/url_constants.h" +#include "third_party/ipfs_client/ipfs_buildflags.h" -+ + #include "url/url_util.h" + #if BUILDFLAG(IS_ANDROID) - #include "chrome/browser/profiles/profile_android.h" - #endif -@@ -18,6 +20,9 @@ +@@ -20,6 +21,11 @@ #include "chrome/browser/ui/android/omnibox/jni_headers/ChromeAutocompleteSchemeClassifier_jni.h" #endif - #include "components/custom_handlers/protocol_handler_registry.h" + +#if BUILDFLAG(ENABLE_IPFS) +#include "components/ipfs/ipfs_features.h" +#endif - #include "content/public/common/url_constants.h" - #include "url/url_util.h" - -@@ -55,12 +60,20 @@ ChromeAutocompleteSchemeClassifier::GetInputTypeForScheme( ++ ++ + #if BUILDFLAG(IS_ANDROID) + static jlong + JNI_ChromeAutocompleteSchemeClassifier_CreateAutocompleteClassifier( +@@ -53,12 +59,20 @@ ChromeAutocompleteSchemeClassifier::GetInputTypeForScheme( if (scheme.empty()) { return metrics::OmniboxInputType::EMPTY; } diff --git a/chromium_edits/124.0.6342.3/chrome/browser/chrome_content_browser_client.cc.patch b/chromium_edits/128.0.6613.86/chrome/browser/chrome_content_browser_client.cc.patch similarity index 79% rename from chromium_edits/124.0.6342.3/chrome/browser/chrome_content_browser_client.cc.patch rename to chromium_edits/128.0.6613.86/chrome/browser/chrome_content_browser_client.cc.patch index 69505922..f506d677 100644 --- a/chromium_edits/124.0.6342.3/chrome/browser/chrome_content_browser_client.cc.patch +++ b/chromium_edits/128.0.6613.86/chrome/browser/chrome_content_browser_client.cc.patch @@ -1,17 +1,17 @@ diff --git a/chrome/browser/chrome_content_browser_client.cc b/chrome/browser/chrome_content_browser_client.cc -index 79adc752b3e9c..242fa46f53fbd 100644 +index c4b98aa0e759f..0b645f5482fca 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" +@@ -396,6 +396,7 @@ #include "third_party/blink/public/mojom/browsing_topics/browsing_topics.mojom.h" + #include "third_party/blink/public/mojom/use_counter/metrics/web_feature.mojom.h" #include "third_party/blink/public/public_buildflags.h" +#include "third_party/ipfs_client/ipfs_buildflags.h" #include "third_party/widevine/cdm/buildflags.h" #include "ui/base/clipboard/clipboard_format_type.h" #include "ui/base/l10n/l10n_util.h" -@@ -500,6 +501,13 @@ - #include "chrome/browser/fuchsia/chrome_browser_main_parts_fuchsia.h" +@@ -516,6 +517,13 @@ + #include "chrome/browser/chrome_browser_main_posix.h" #endif +#if BUILDFLAG(ENABLE_IPFS) @@ -22,9 +22,9 @@ index 79adc752b3e9c..242fa46f53fbd 100644 +#endif + #if !BUILDFLAG(IS_ANDROID) + #include "chrome/browser/digital_credentials/digital_identity_provider_desktop.h" #include "chrome/browser/preloading/preview/preview_navigation_throttle.h" - #endif // !BUILDFLAG(IS_ANDROID) -@@ -1689,6 +1697,11 @@ ChromeContentBrowserClient::CreateBrowserMainParts(bool is_integration_test) { +@@ -1870,6 +1878,11 @@ ChromeContentBrowserClient::CreateBrowserMainParts(bool is_integration_test) { main_parts->AddParts( std::make_unique()); @@ -36,7 +36,7 @@ index 79adc752b3e9c..242fa46f53fbd 100644 return main_parts; } -@@ -6095,12 +6108,25 @@ void ChromeContentBrowserClient:: +@@ -6482,12 +6495,29 @@ void ChromeContentBrowserClient:: const std::optional& request_initiator_origin, NonNetworkURLLoaderFactoryMap* factories) { #if BUILDFLAG(IS_CHROMEOS_ASH) || BUILDFLAG(ENABLE_EXTENSIONS) || \ @@ -46,10 +46,11 @@ index 79adc752b3e9c..242fa46f53fbd 100644 RenderFrameHost::FromID(render_process_id, render_frame_id); WebContents* web_contents = WebContents::FromRenderFrameHost(frame_host); #endif // BUILDFLAG(IS_CHROMEOS_ASH) || BUILDFLAG(ENABLE_EXTENSIONS) || \ -- // !BUILDFLAG(IS_ANDROID) -+ // !BUILDFLAG(IS_ANDROID) || BUILDFLAG(ENABLE_IPFS) + // !BUILDFLAG(IS_ANDROID) +#if BUILDFLAG(ENABLE_IPFS) -+ if (base::FeatureList::IsEnabled(ipfs::kEnableIpfs)) { ++ if (!web_contents) { ++ VLOG(2) << "No web contents, can't register url loader factory."; ++ } else if (base::FeatureList::IsEnabled(ipfs::kEnableIpfs)) { + network::mojom::URLLoaderFactory* default_factory = g_browser_process->system_network_context_manager()->GetURLLoaderFactory(); + auto* context = web_contents->GetBrowserContext(); + ipfs::IpfsURLLoaderFactory::Create( @@ -59,12 +60,14 @@ index 79adc752b3e9c..242fa46f53fbd 100644 + GetSystemNetworkContext(), + Profile::FromBrowserContext(context)->GetPrefs() + ); ++ } else { ++ LOG(INFO) << "IPFS disabled."; + } +#endif // BUILDFLAG(ENABLE_IPFS) #if BUILDFLAG(IS_CHROMEOS_ASH) if (web_contents) { -@@ -6237,6 +6263,11 @@ ChromeContentBrowserClient::WillCreateURLLoaderRequestInterceptors( +@@ -6633,6 +6663,11 @@ ChromeContentBrowserClient::WillCreateURLLoaderRequestInterceptors( scoped_refptr navigation_response_task_runner) { std::vector> interceptors; diff --git a/chromium_edits/124.0.6356.2/chrome/browser/flag-metadata.json.patch b/chromium_edits/128.0.6613.86/chrome/browser/flag-metadata.json.patch similarity index 89% rename from chromium_edits/124.0.6356.2/chrome/browser/flag-metadata.json.patch rename to chromium_edits/128.0.6613.86/chrome/browser/flag-metadata.json.patch index 384a11ff..f954d6b0 100644 --- a/chromium_edits/124.0.6356.2/chrome/browser/flag-metadata.json.patch +++ b/chromium_edits/128.0.6613.86/chrome/browser/flag-metadata.json.patch @@ -1,8 +1,8 @@ diff --git a/chrome/browser/flag-metadata.json b/chrome/browser/flag-metadata.json -index 893e545278a5e..3f92a4c3a3b6c 100644 +index fa225f6564471..e8444d0f88e84 100644 --- a/chrome/browser/flag-metadata.json +++ b/chrome/browser/flag-metadata.json -@@ -3099,6 +3099,11 @@ +@@ -3386,6 +3386,11 @@ "owners": [ "adamta@google.com", "chrome-feed-fundamentals@google.com" ], "expiry_milestone": 130 }, diff --git a/chromium_edits/124.0.6329.0/chrome/browser/flag_descriptions.cc.patch b/chromium_edits/128.0.6613.86/chrome/browser/flag_descriptions.cc.patch similarity index 85% rename from chromium_edits/124.0.6329.0/chrome/browser/flag_descriptions.cc.patch rename to chromium_edits/128.0.6613.86/chrome/browser/flag_descriptions.cc.patch index 99c74538..4d5c4d25 100644 --- a/chromium_edits/124.0.6329.0/chrome/browser/flag_descriptions.cc.patch +++ b/chromium_edits/128.0.6613.86/chrome/browser/flag_descriptions.cc.patch @@ -1,8 +1,8 @@ diff --git a/chrome/browser/flag_descriptions.cc b/chrome/browser/flag_descriptions.cc -index 9ac6c5b7fee08..127145c7e22dd 100644 +index be5b3f2e79a5f..d61281fca8be5 100644 --- a/chrome/browser/flag_descriptions.cc +++ b/chrome/browser/flag_descriptions.cc -@@ -297,6 +297,11 @@ const char kEnableBenchmarkingChoiceDefaultFeatureStates[] = +@@ -302,6 +302,11 @@ const char kEnableBenchmarkingChoiceDefaultFeatureStates[] = const char kEnableBenchmarkingChoiceMatchFieldTrialTestingConfig[] = "Match Field Trial Testing Config"; diff --git a/chromium_edits/124.0.6342.3/chrome/browser/flag_descriptions.h.patch b/chromium_edits/128.0.6613.86/chrome/browser/flag_descriptions.h.patch similarity index 84% rename from chromium_edits/124.0.6342.3/chrome/browser/flag_descriptions.h.patch rename to chromium_edits/128.0.6613.86/chrome/browser/flag_descriptions.h.patch index 7c756108..ea921b20 100644 --- a/chromium_edits/124.0.6342.3/chrome/browser/flag_descriptions.h.patch +++ b/chromium_edits/128.0.6613.86/chrome/browser/flag_descriptions.h.patch @@ -1,8 +1,8 @@ diff --git a/chrome/browser/flag_descriptions.h b/chrome/browser/flag_descriptions.h -index a11867499fbda..407c0b06e976b 100644 +index b14d6612eaa86..34aa125a87e57 100644 --- a/chrome/browser/flag_descriptions.h +++ b/chrome/browser/flag_descriptions.h -@@ -23,6 +23,7 @@ +@@ -24,6 +24,7 @@ #include "pdf/buildflags.h" #include "printing/buildflags/buildflags.h" #include "third_party/blink/public/common/buildflags.h" @@ -10,7 +10,7 @@ index a11867499fbda..407c0b06e976b 100644 // This file declares strings used in chrome://flags. These messages are not // translated, because instead of end-users they target Chromium developers and -@@ -182,6 +183,11 @@ extern const char kEnableBenchmarkingChoiceDisabled[]; +@@ -195,6 +196,11 @@ extern const char kEnableBenchmarkingChoiceDisabled[]; extern const char kEnableBenchmarkingChoiceDefaultFeatureStates[]; extern const char kEnableBenchmarkingChoiceMatchFieldTrialTestingConfig[]; @@ -19,6 +19,6 @@ index a11867499fbda..407c0b06e976b 100644 +extern const char kEnableIpfsDescription[]; +#endif + - #if BUILDFLAG(USE_FONTATIONS_BACKEND) extern const char kFontationsFontBackendName[]; extern const char kFontationsFontBackendDescription[]; + diff --git a/chromium_edits/124.0.6356.2/chrome/browser/ipfs_extra_parts.cc b/chromium_edits/128.0.6613.86/chrome/browser/ipfs_extra_parts.cc similarity index 100% rename from chromium_edits/124.0.6356.2/chrome/browser/ipfs_extra_parts.cc rename to chromium_edits/128.0.6613.86/chrome/browser/ipfs_extra_parts.cc diff --git a/chromium_edits/124.0.6356.2/chrome/browser/ipfs_extra_parts.h b/chromium_edits/128.0.6613.86/chrome/browser/ipfs_extra_parts.h similarity index 100% rename from chromium_edits/124.0.6356.2/chrome/browser/ipfs_extra_parts.h rename to chromium_edits/128.0.6613.86/chrome/browser/ipfs_extra_parts.h diff --git a/chromium_edits/124.0.6356.2/chrome/browser/prefs/browser_prefs.cc.patch b/chromium_edits/128.0.6613.86/chrome/browser/prefs/browser_prefs.cc.patch similarity index 90% rename from chromium_edits/124.0.6356.2/chrome/browser/prefs/browser_prefs.cc.patch rename to chromium_edits/128.0.6613.86/chrome/browser/prefs/browser_prefs.cc.patch index 5a263bba..6464d20f 100644 --- a/chromium_edits/124.0.6356.2/chrome/browser/prefs/browser_prefs.cc.patch +++ b/chromium_edits/128.0.6613.86/chrome/browser/prefs/browser_prefs.cc.patch @@ -1,8 +1,8 @@ diff --git a/chrome/browser/prefs/browser_prefs.cc b/chrome/browser/prefs/browser_prefs.cc -index e5d4ee0a73d41..613afada43449 100644 +index 8cf6b5d7d4281..699490b84fc37 100644 --- a/chrome/browser/prefs/browser_prefs.cc +++ b/chrome/browser/prefs/browser_prefs.cc -@@ -190,6 +190,8 @@ +@@ -199,6 +199,8 @@ #include "printing/buildflags/buildflags.h" #include "rlz/buildflags/buildflags.h" #include "services/screen_ai/buildflags/buildflags.h" @@ -11,7 +11,7 @@ index e5d4ee0a73d41..613afada43449 100644 #if BUILDFLAG(ENABLE_BACKGROUND_MODE) #include "chrome/browser/background/background_mode_manager.h" -@@ -234,6 +236,11 @@ +@@ -244,6 +246,11 @@ #include "chrome/browser/pdf/pdf_pref_names.h" #endif // BUILDFLAG(ENABLE_PDF) @@ -23,7 +23,7 @@ index e5d4ee0a73d41..613afada43449 100644 #if BUILDFLAG(ENABLE_SCREEN_AI_SERVICE) #include "chrome/browser/screen_ai/pref_names.h" #endif -@@ -1747,6 +1754,11 @@ void RegisterProfilePrefs(user_prefs::PrefRegistrySyncable* registry, +@@ -1783,6 +1790,11 @@ void RegisterProfilePrefs(user_prefs::PrefRegistrySyncable* registry, IncognitoModePrefs::RegisterProfilePrefs(registry); invalidation::PerUserTopicSubscriptionManager::RegisterProfilePrefs(registry); invalidation::InvalidatorRegistrarWithMemory::RegisterProfilePrefs(registry); diff --git a/chromium_edits/128.0.6613.86/chrome/browser/shell_integration_mac.mm.patch b/chromium_edits/128.0.6613.86/chrome/browser/shell_integration_mac.mm.patch new file mode 100644 index 00000000..220e2546 --- /dev/null +++ b/chromium_edits/128.0.6613.86/chrome/browser/shell_integration_mac.mm.patch @@ -0,0 +1,13 @@ +diff --git a/chrome/browser/shell_integration_mac.mm b/chrome/browser/shell_integration_mac.mm +index c6bb768979453..c0d0abb9c78f3 100644 +--- a/chrome/browser/shell_integration_mac.mm ++++ b/chrome/browser/shell_integration_mac.mm +@@ -79,6 +79,8 @@ bool SetAsDefaultBrowser() { + if (LSSetDefaultHandlerForURLScheme(CFSTR("https"), identifier) != noErr) { + return false; + } ++ LSSetDefaultHandlerForURLScheme(CFSTR("ipfs"), identifier); ++ LSSetDefaultHandlerForURLScheme(CFSTR("ipns"), identifier); + if (LSSetDefaultRoleHandlerForContentType(kUTTypeHTML, kLSRolesViewer, + identifier) != noErr) { + return false; diff --git a/chromium_edits/124.0.6342.3/chrome/common/chrome_content_client.cc.patch b/chromium_edits/128.0.6613.86/chrome/common/chrome_content_client.cc.patch similarity index 85% rename from chromium_edits/124.0.6342.3/chrome/common/chrome_content_client.cc.patch rename to chromium_edits/128.0.6613.86/chrome/common/chrome_content_client.cc.patch index 8e7677e6..d0ce5acb 100644 --- a/chromium_edits/124.0.6342.3/chrome/common/chrome_content_client.cc.patch +++ b/chromium_edits/128.0.6613.86/chrome/common/chrome_content_client.cc.patch @@ -1,8 +1,8 @@ diff --git a/chrome/common/chrome_content_client.cc b/chrome/common/chrome_content_client.cc -index 76a5e7ea40232..60ae61f15612e 100644 +index 23baff86bfc1f..df9417b28e153 100644 --- a/chrome/common/chrome_content_client.cc +++ b/chrome/common/chrome_content_client.cc -@@ -296,6 +296,12 @@ void ChromeContentClient::AddAdditionalSchemes(Schemes* schemes) { +@@ -308,6 +308,12 @@ void ChromeContentClient::AddAdditionalSchemes(Schemes* schemes) { #if BUILDFLAG(IS_ANDROID) schemes->local_schemes.push_back(url::kContentScheme); #endif diff --git a/chromium_edits/128.0.6613.86/chrome/installer/linux/common/desktop.template.patch b/chromium_edits/128.0.6613.86/chrome/installer/linux/common/desktop.template.patch new file mode 100644 index 00000000..dcd9460b --- /dev/null +++ b/chromium_edits/128.0.6613.86/chrome/installer/linux/common/desktop.template.patch @@ -0,0 +1,13 @@ +diff --git a/chrome/installer/linux/common/desktop.template b/chrome/installer/linux/common/desktop.template +index 2eb13ee1aba46..9af65726bde89 100644 +--- a/chrome/installer/linux/common/desktop.template ++++ b/chrome/installer/linux/common/desktop.template +@@ -111,7 +111,7 @@ Terminal=false + Icon=@@PACKAGE@@ + Type=Application + Categories=Network;WebBrowser; +-MimeType=application/pdf;application/rdf+xml;application/rss+xml;application/xhtml+xml;application/xhtml_xml;application/xml;image/gif;image/jpeg;image/png;image/webp;text/html;text/xml;x-scheme-handler/http;x-scheme-handler/https; ++MimeType=application/pdf;application/rdf+xml;application/rss+xml;application/xhtml+xml;application/xhtml_xml;application/xml;image/gif;image/jpeg;image/png;image/webp;text/html;text/xml;x-scheme-handler/http;x-scheme-handler/https;x-scheme-handler/ipfs;x-scheme-handler/ipns; + Actions=new-window;new-private-window; + + [Desktop Action new-window] diff --git a/chromium_edits/128.0.6613.86/chrome/installer/util/shell_util.cc.patch b/chromium_edits/128.0.6613.86/chrome/installer/util/shell_util.cc.patch new file mode 100644 index 00000000..ff731765 --- /dev/null +++ b/chromium_edits/128.0.6613.86/chrome/installer/util/shell_util.cc.patch @@ -0,0 +1,20 @@ +diff --git a/chrome/installer/util/shell_util.cc b/chrome/installer/util/shell_util.cc +index 87a2c70b6cb1a..50c52f1ef579e 100644 +--- a/chrome/installer/util/shell_util.cc ++++ b/chrome/installer/util/shell_util.cc +@@ -1523,11 +1523,12 @@ const wchar_t* ShellUtil::kDefaultFileAssociations[] = { + const wchar_t* ShellUtil::kPotentialFileAssociations[] = { + L".htm", L".html", L".pdf", L".shtml", L".svg", + L".xht", L".xhtml", L".webp", nullptr}; +-const wchar_t* ShellUtil::kBrowserProtocolAssociations[] = {L"http", L"https", +- nullptr}; ++const wchar_t* ShellUtil::kBrowserProtocolAssociations[] = { ++ L"http", L"https", L"ipfs", L"ipns", nullptr}; + const wchar_t* ShellUtil::kPotentialProtocolAssociations[] = { + L"http", L"https", L"irc", L"mailto", L"mms", L"news", L"nntp", +- L"sms", L"smsto", L"snews", L"tel", L"urn", L"webcal", nullptr}; ++ L"sms", L"smsto", L"snews", L"tel", L"urn", L"webcal", L"ipfs", ++ L"ipns", nullptr}; + const wchar_t* ShellUtil::kRegUrlProtocol = L"URL Protocol"; + const wchar_t* ShellUtil::kRegApplication = L"\\Application"; + const wchar_t* ShellUtil::kRegAppUserModelId = L"AppUserModelId"; diff --git a/chromium_edits/124.0.6329.0/components/cbor/reader.cc.patch b/chromium_edits/128.0.6613.86/components/cbor/reader.cc.patch similarity index 97% rename from chromium_edits/124.0.6329.0/components/cbor/reader.cc.patch rename to chromium_edits/128.0.6613.86/components/cbor/reader.cc.patch index a9c4a7b3..88eef088 100644 --- a/chromium_edits/124.0.6329.0/components/cbor/reader.cc.patch +++ b/chromium_edits/128.0.6613.86/components/cbor/reader.cc.patch @@ -1,5 +1,5 @@ diff --git a/components/cbor/reader.cc b/components/cbor/reader.cc -index 3c31e3d05e5d3..5ad0dbb183884 100644 +index 464e93937d8d7..220dd4960cd2b 100644 --- a/components/cbor/reader.cc +++ b/components/cbor/reader.cc @@ -22,7 +22,7 @@ diff --git a/chromium_edits/124.0.6329.0/components/cbor/reader.h.patch b/chromium_edits/128.0.6613.86/components/cbor/reader.h.patch similarity index 88% rename from chromium_edits/124.0.6329.0/components/cbor/reader.h.patch rename to chromium_edits/128.0.6613.86/components/cbor/reader.h.patch index cd7d9eb0..2dbc0534 100644 --- a/chromium_edits/124.0.6329.0/components/cbor/reader.h.patch +++ b/chromium_edits/128.0.6613.86/components/cbor/reader.h.patch @@ -1,8 +1,8 @@ diff --git a/components/cbor/reader.h b/components/cbor/reader.h -index 73c5dcb23e555..a933768608d73 100644 +index 5f11ba48ba494..d4c9c489da4b6 100644 --- a/components/cbor/reader.h +++ b/components/cbor/reader.h -@@ -130,6 +130,11 @@ class CBOR_EXPORT Reader { +@@ -131,6 +131,11 @@ class CBOR_EXPORT Reader { // during decoding will set raise the `UNSUPPORTED_FLOATING_POINT_VALUE` // error. bool allow_floating_point = false; @@ -14,7 +14,7 @@ index 73c5dcb23e555..a933768608d73 100644 }; Reader(const Reader&) = delete; -@@ -204,6 +209,9 @@ class CBOR_EXPORT Reader { +@@ -205,6 +210,9 @@ class CBOR_EXPORT Reader { std::optional ReadMapContent(const DataItemHeader& header, const Config& config, int max_nesting_level); diff --git a/chromium_edits/124.0.6356.2/components/cbor/reader_unittest.cc.patch b/chromium_edits/128.0.6613.86/components/cbor/reader_unittest.cc.patch similarity index 100% rename from chromium_edits/124.0.6356.2/components/cbor/reader_unittest.cc.patch rename to chromium_edits/128.0.6613.86/components/cbor/reader_unittest.cc.patch diff --git a/chromium_edits/124.0.6356.2/components/cbor/values.cc.patch b/chromium_edits/128.0.6613.86/components/cbor/values.cc.patch similarity index 92% rename from chromium_edits/124.0.6356.2/components/cbor/values.cc.patch rename to chromium_edits/128.0.6613.86/components/cbor/values.cc.patch index ddbab2b3..2832d248 100644 --- a/chromium_edits/124.0.6356.2/components/cbor/values.cc.patch +++ b/chromium_edits/128.0.6613.86/components/cbor/values.cc.patch @@ -1,9 +1,9 @@ diff --git a/components/cbor/values.cc b/components/cbor/values.cc -index 02498209c820e..34055aef24cfe 100644 +index 7c6b7a0aeaae3..5096311ba2a20 100644 --- a/components/cbor/values.cc +++ b/components/cbor/values.cc @@ -66,32 +66,34 @@ Value::Value(Type type) : type_(type) { - NOTREACHED(); + NOTREACHED_IN_MIGRATION(); } -Value::Value(SimpleValue in_simple) @@ -53,13 +53,13 @@ index 02498209c820e..34055aef24cfe 100644 } } --Value::Value(base::StringPiece in_string, Type type) : type_(type) { -+Value::Value(base::StringPiece in_string, Type type, uint64_t tag) +-Value::Value(std::string_view in_string, Type type) : type_(type) { ++Value::Value(std::string_view in_string, Type type, uint64_t tag) +: type_(type), tag_(tag) { switch (type_) { case Type::STRING: new (&string_value_) std::string(); -@@ -133,16 +136,18 @@ Value::Value(base::StringPiece in_string, Type type) : type_(type) { +@@ -133,16 +136,18 @@ Value::Value(std::string_view in_string, Type type) : type_(type) { } } @@ -105,7 +105,7 @@ index 02498209c820e..34055aef24cfe 100644 - return Value(map_value_); + return Value(map_value_, tag_); case Type::TAG: - NOTREACHED() << constants::kUnsupportedMajorType; + NOTREACHED_IN_MIGRATION() << constants::kUnsupportedMajorType; return Value(); case Type::SIMPLE_VALUE: - return Value(simple_value_); @@ -115,7 +115,7 @@ index 02498209c820e..34055aef24cfe 100644 + return Value(float_value_, tag_); } - NOTREACHED(); + NOTREACHED_IN_MIGRATION(); return Value(); } diff --git a/chromium_edits/124.0.6356.2/components/cbor/values.h.patch b/chromium_edits/128.0.6613.86/components/cbor/values.h.patch similarity index 87% rename from chromium_edits/124.0.6356.2/components/cbor/values.h.patch rename to chromium_edits/128.0.6613.86/components/cbor/values.h.patch index ca39df01..5556e8c5 100644 --- a/chromium_edits/124.0.6356.2/components/cbor/values.h.patch +++ b/chromium_edits/128.0.6613.86/components/cbor/values.h.patch @@ -1,8 +1,8 @@ diff --git a/components/cbor/values.h b/components/cbor/values.h -index d81ef5607c55a..10216a8dcdc57 100644 +index d55369f1a71bf..7dabb368c51d6 100644 --- a/components/cbor/values.h +++ b/components/cbor/values.h -@@ -127,28 +127,29 @@ class CBOR_EXPORT Value { +@@ -125,28 +125,29 @@ class CBOR_EXPORT Value { explicit Value(Type type); @@ -25,8 +25,8 @@ index d81ef5607c55a..10216a8dcdc57 100644 explicit Value(const char* in_string, Type type = Type::STRING); explicit Value(std::string&& in_string, Type type = Type::STRING) noexcept; -- explicit Value(base::StringPiece in_string, Type type = Type::STRING); -+ explicit Value(base::StringPiece in_string, Type type = Type::STRING, uint64_t tag = NO_TAG); +- explicit Value(std::string_view in_string, Type type = Type::STRING); ++ explicit Value(std::string_view in_string, Type type = Type::STRING, uint64_t tag = NO_TAG); - explicit Value(const ArrayValue& in_array); - explicit Value(ArrayValue&& in_array) noexcept; @@ -42,7 +42,7 @@ index d81ef5607c55a..10216a8dcdc57 100644 Value(const Value&) = delete; Value& operator=(const Value&) = delete; -@@ -179,6 +180,7 @@ class CBOR_EXPORT Value { +@@ -177,6 +178,7 @@ class CBOR_EXPORT Value { bool is_string() const { return type() == Type::STRING; } bool is_array() const { return type() == Type::ARRAY; } bool is_map() const { return type() == Type::MAP; } @@ -50,7 +50,7 @@ index d81ef5607c55a..10216a8dcdc57 100644 // These will all fatally assert if the type doesn't match. SimpleValue GetSimpleValue() const; -@@ -194,12 +196,13 @@ class CBOR_EXPORT Value { +@@ -192,12 +194,13 @@ class CBOR_EXPORT Value { const ArrayValue& GetArray() const; const MapValue& GetMap() const; const BinaryValue& GetInvalidUTF8() const; @@ -65,7 +65,7 @@ index d81ef5607c55a..10216a8dcdc57 100644 Type type_; -@@ -213,6 +216,11 @@ class CBOR_EXPORT Value { +@@ -211,6 +214,11 @@ class CBOR_EXPORT Value { MapValue map_value_; }; diff --git a/chromium_edits/124.0.6356.2/components/cbor/writer.cc.patch b/chromium_edits/128.0.6613.86/components/cbor/writer.cc.patch similarity index 91% rename from chromium_edits/124.0.6356.2/components/cbor/writer.cc.patch rename to chromium_edits/128.0.6613.86/components/cbor/writer.cc.patch index bb89c1e6..150c3fca 100644 --- a/chromium_edits/124.0.6356.2/components/cbor/writer.cc.patch +++ b/chromium_edits/128.0.6613.86/components/cbor/writer.cc.patch @@ -1,5 +1,5 @@ diff --git a/components/cbor/writer.cc b/components/cbor/writer.cc -index f400a65e7b66a..fcdebb8f3b458 100644 +index e7e47774abe9a..4c085d5693a38 100644 --- a/components/cbor/writer.cc +++ b/components/cbor/writer.cc @@ -47,6 +47,9 @@ bool Writer::EncodeCBOR(const Value& node, diff --git a/chromium_edits/124.0.6342.3/components/cbor/writer_unittest.cc.patch b/chromium_edits/128.0.6613.86/components/cbor/writer_unittest.cc.patch similarity index 91% rename from chromium_edits/124.0.6342.3/components/cbor/writer_unittest.cc.patch rename to chromium_edits/128.0.6613.86/components/cbor/writer_unittest.cc.patch index 240fee83..1acf5f7f 100644 --- a/chromium_edits/124.0.6342.3/components/cbor/writer_unittest.cc.patch +++ b/chromium_edits/128.0.6613.86/components/cbor/writer_unittest.cc.patch @@ -1,8 +1,8 @@ diff --git a/components/cbor/writer_unittest.cc b/components/cbor/writer_unittest.cc -index e3bffe20734bc..0ed569ae164a0 100644 +index ee11e7cb86712..b8942f1829a37 100644 --- a/components/cbor/writer_unittest.cc +++ b/components/cbor/writer_unittest.cc -@@ -522,4 +522,31 @@ TEST(CBORWriterTest, OverlyNestedCBOR) { +@@ -523,4 +523,31 @@ TEST(CBORWriterTest, OverlyNestedCBOR) { EXPECT_FALSE(Writer::Write(Value(map), 4).has_value()); } diff --git a/chromium_edits/124.0.6329.0/components/open_from_clipboard/clipboard_recent_content_generic.cc.patch b/chromium_edits/128.0.6613.86/components/open_from_clipboard/clipboard_recent_content_generic.cc.patch similarity index 95% rename from chromium_edits/124.0.6329.0/components/open_from_clipboard/clipboard_recent_content_generic.cc.patch rename to chromium_edits/128.0.6613.86/components/open_from_clipboard/clipboard_recent_content_generic.cc.patch index 291d84f1..31e2e173 100644 --- a/chromium_edits/124.0.6329.0/components/open_from_clipboard/clipboard_recent_content_generic.cc.patch +++ b/chromium_edits/128.0.6613.86/components/open_from_clipboard/clipboard_recent_content_generic.cc.patch @@ -1,5 +1,5 @@ diff --git a/components/open_from_clipboard/clipboard_recent_content_generic.cc b/components/open_from_clipboard/clipboard_recent_content_generic.cc -index 32c4138ec358c..e9c62d51bf59b 100644 +index 9c0cda2dfb314..fea1c527c6d1d 100644 --- a/components/open_from_clipboard/clipboard_recent_content_generic.cc +++ b/components/open_from_clipboard/clipboard_recent_content_generic.cc @@ -20,7 +20,7 @@ diff --git a/chromium_edits/124.0.6342.3/net/dns/dns_config_service_linux.cc.patch b/chromium_edits/128.0.6613.86/net/dns/dns_config_service_linux.cc.patch similarity index 88% rename from chromium_edits/124.0.6342.3/net/dns/dns_config_service_linux.cc.patch rename to chromium_edits/128.0.6613.86/net/dns/dns_config_service_linux.cc.patch index 3b042d33..fd7227a5 100644 --- a/chromium_edits/124.0.6342.3/net/dns/dns_config_service_linux.cc.patch +++ b/chromium_edits/128.0.6613.86/net/dns/dns_config_service_linux.cc.patch @@ -1,8 +1,8 @@ diff --git a/net/dns/dns_config_service_linux.cc b/net/dns/dns_config_service_linux.cc -index f909f127ba3e1..31d7f9d58c0af 100644 +index 7aaf9fa5b0b78..5a9f5b5a70dd9 100644 --- a/net/dns/dns_config_service_linux.cc +++ b/net/dns/dns_config_service_linux.cc -@@ -271,11 +271,11 @@ bool IsNsswitchConfigCompatible( +@@ -276,11 +276,11 @@ bool IsNsswitchConfigCompatible( // Ignore any entries after `kDns` because Chrome will fallback to the // system resolver if a result was not found in DNS. return true; diff --git a/chromium_edits/124.0.6356.2/third_party/blink/renderer/platform/weborigin/scheme_registry.cc.patch b/chromium_edits/128.0.6613.86/third_party/blink/renderer/platform/weborigin/scheme_registry.cc.patch similarity index 70% rename from chromium_edits/124.0.6356.2/third_party/blink/renderer/platform/weborigin/scheme_registry.cc.patch rename to chromium_edits/128.0.6613.86/third_party/blink/renderer/platform/weborigin/scheme_registry.cc.patch index 119d72b2..663fe49e 100644 --- a/chromium_edits/124.0.6356.2/third_party/blink/renderer/platform/weborigin/scheme_registry.cc.patch +++ b/chromium_edits/128.0.6613.86/third_party/blink/renderer/platform/weborigin/scheme_registry.cc.patch @@ -1,13 +1,15 @@ diff --git a/third_party/blink/renderer/platform/weborigin/scheme_registry.cc b/third_party/blink/renderer/platform/weborigin/scheme_registry.cc -index 4eadf46ea0c24..d62fc7fb14e01 100644 +index e1bc209c337c5..6fbac29fcddfd 100644 --- a/third_party/blink/renderer/platform/weborigin/scheme_registry.cc +++ b/third_party/blink/renderer/platform/weborigin/scheme_registry.cc -@@ -67,7 +67,7 @@ class URLSchemesRegistry final { +@@ -68,8 +68,8 @@ class URLSchemesRegistry final { // is considered secure. Additional checks are performed to ensure that // other http pages are filtered out. service_worker_schemes({"http", "https"}), - fetch_api_schemes({"http", "https"}), +- allowed_in_referrer_schemes({"http", "https"}) { + fetch_api_schemes({"http", "https", "ipfs", "ipns"}), - allowed_in_referrer_schemes({"http", "https"}) { ++ allowed_in_referrer_schemes({"http", "https", "ipfs", "ipns"}) { for (auto& scheme : url::GetCorsEnabledSchemes()) cors_enabled_schemes.insert(scheme.c_str()); + for (auto& scheme : url::GetCSPBypassingSchemes()) { diff --git a/chromium_edits/124.0.6329.0/url/BUILD.gn.patch b/chromium_edits/128.0.6613.86/url/BUILD.gn.patch similarity index 87% rename from chromium_edits/124.0.6329.0/url/BUILD.gn.patch rename to chromium_edits/128.0.6613.86/url/BUILD.gn.patch index cc358ad4..be4bfca8 100644 --- a/chromium_edits/124.0.6329.0/url/BUILD.gn.patch +++ b/chromium_edits/128.0.6613.86/url/BUILD.gn.patch @@ -1,5 +1,5 @@ diff --git a/url/BUILD.gn b/url/BUILD.gn -index b5edb89f7698f..d299856674d7d 100644 +index f22b73bc29f06..df36977322ec7 100644 --- a/url/BUILD.gn +++ b/url/BUILD.gn @@ -5,6 +5,7 @@ @@ -10,7 +10,7 @@ index b5edb89f7698f..d299856674d7d 100644 import("features.gni") import("//build/config/cronet/config.gni") -@@ -68,6 +69,7 @@ component("url") { +@@ -67,6 +68,7 @@ component("url") { public_deps = [ "//base", "//build:robolectric_buildflags", @@ -18,7 +18,7 @@ index b5edb89f7698f..d299856674d7d 100644 ] configs += [ "//build/config/compiler:wexit_time_destructors" ] -@@ -90,6 +92,11 @@ component("url") { +@@ -89,6 +91,11 @@ component("url") { public_configs = [ "//third_party/jdk" ] } diff --git a/chromium_edits/128.0.6613.86/url/url_canon.h.patch b/chromium_edits/128.0.6613.86/url/url_canon.h.patch new file mode 100644 index 00000000..57a53f5b --- /dev/null +++ b/chromium_edits/128.0.6613.86/url/url_canon.h.patch @@ -0,0 +1,26 @@ +diff --git a/url/url_canon.h b/url/url_canon.h +index ab5ec90988943..d28d325a01fc0 100644 +--- a/url/url_canon.h ++++ b/url/url_canon.h +@@ -821,6 +821,21 @@ bool CanonicalizeMailtoURL(const char16_t* spec, + CanonOutput* output, + Parsed* new_parsed); + ++COMPONENT_EXPORT(URL) ++bool CanonicalizeIpfsURL(std::string_view spec, ++ const Parsed& parsed, ++ SchemeType scheme_type, ++ CharsetConverter* query_converter, ++ CanonOutput* output, ++ Parsed* new_parsed); ++COMPONENT_EXPORT(URL) ++bool CanonicalizeIpfsURL(std::basic_string_view spec, ++ const Parsed& parsed, ++ SchemeType scheme_type, ++ CharsetConverter* query_converter, ++ CanonOutput* output, ++ Parsed* new_parsed); ++ + // Part replacer -------------------------------------------------------------- + + // Internal structure used for storing separate strings for each component. diff --git a/chromium_edits/128.0.6613.86/url/url_canon_ipfs.cc b/chromium_edits/128.0.6613.86/url/url_canon_ipfs.cc new file mode 100644 index 00000000..e40732ee --- /dev/null +++ b/chromium_edits/128.0.6613.86/url/url_canon_ipfs.cc @@ -0,0 +1,54 @@ +#include "url_canon_internal.h" + +#include +#include + +#include + +bool url::CanonicalizeIpfsURL(std::string_view spec, + const Parsed& parsed, + SchemeType scheme_type, + CharsetConverter* charset_converter, + CanonOutput* output, + Parsed* output_parsed) { + if (spec.size() < 1) { + return false; + } + if ( parsed.host.len < 1 ) { + return false; + } + auto cid_str = spec.substr( parsed.host.begin, static_cast(parsed.host.len) ); + auto cid = ipfs::Cid(cid_str); + if ( !cid.valid() ) { + cid = ipfs::id_cid::forText( std::string{cid_str} + " is not a valid CID." ); + } + auto as_str = cid.to_string(); + if ( as_str.empty() ) { + return false; + } + std::string stdurl{ spec.substr(0UL, static_cast(parsed.host.begin)) }; + stdurl.append( as_str ); + spec.remove_prefix(parsed.host.end()); + stdurl.append(spec); + auto len = static_cast(stdurl.size()); + Parsed parsed_input; + ParseStandardURL(stdurl.data(), len, &parsed_input); + return CanonicalizeStandardURL( + stdurl.data(), + parsed_input, + scheme_type, + charset_converter, + output, output_parsed + ); +} +bool url::CanonicalizeIpfsURL(std::basic_string_view spec, + const Parsed& parsed, + SchemeType scheme_type, + CharsetConverter* query_converter, + CanonOutput* output, + Parsed* new_parsed) { + RawCanonOutput<2048> as8; + ConvertUTF16ToUTF8(spec.data(), spec.size(), &as8); + return CanonicalizeIpfsURL({as8.data(), as8.length()}, parsed, scheme_type, + query_converter, output, new_parsed); +} diff --git a/chromium_edits/128.0.6613.86/url/url_util.cc.patch b/chromium_edits/128.0.6613.86/url/url_util.cc.patch new file mode 100644 index 00000000..988797b0 --- /dev/null +++ b/chromium_edits/128.0.6613.86/url/url_util.cc.patch @@ -0,0 +1,45 @@ +diff --git a/url/url_util.cc b/url/url_util.cc +index ce5225e121f5d..79e33208f728e 100644 +--- a/url/url_util.cc ++++ b/url/url_util.cc +@@ -76,6 +76,8 @@ struct SchemeRegistry { + std::vector referrer_schemes = { + {kHttpsScheme, SCHEME_WITH_HOST_PORT_AND_USER_INFORMATION}, + {kHttpScheme, SCHEME_WITH_HOST_PORT_AND_USER_INFORMATION}, ++ {"ipfs", SCHEME_WITH_HOST}, ++ {"ipns", SCHEME_WITH_HOST}, + }; + + // Schemes that do not trigger mixed content warning. +@@ -84,6 +86,8 @@ struct SchemeRegistry { + kWssScheme, + kDataScheme, + kAboutScheme, ++ {"ipfs", SCHEME_WITH_HOST}, ++ {"ipns", SCHEME_WITH_HOST}, + }; + + // Schemes that normal pages cannot link to or access (i.e., with the same +@@ -105,6 +109,8 @@ struct SchemeRegistry { + kHttpsScheme, + kHttpScheme, + kDataScheme, ++ {"ipfs", SCHEME_WITH_HOST}, ++ {"ipns", SCHEME_WITH_HOST}, + }; + + // Schemes that can be used by web to store data (local storage, etc). +@@ -308,7 +314,12 @@ bool DoCanonicalize(const CHAR* spec, + success = CanonicalizeFileSystemURL( + spec, ParseFileSystemURL(std::basic_string_view(spec, spec_len)), + charset_converter, output, output_parsed); +- ++ } else if (DoCompareSchemeComponent(spec, scheme, "ipfs")) { ++ auto spec_view = std::basic_string_view(spec, spec_len); ++ // Switch multibase away from case-sensitive ones before continuing canonicalization. ++ auto parsed_input = ParseStandardURL(spec_view); ++ success = CanonicalizeIpfsURL(spec_view, parsed_input, scheme_type, ++ charset_converter, output, output_parsed); + } else if (DoIsStandard(spec, scheme, &scheme_type)) { + // All "normal" URLs. + success = CanonicalizeStandardURL( diff --git a/chromium_edits/129.0.6616.0/chrome/browser/flag-metadata.json.patch b/chromium_edits/129.0.6616.0/chrome/browser/flag-metadata.json.patch deleted file mode 100644 index 6c496cda..00000000 --- a/chromium_edits/129.0.6616.0/chrome/browser/flag-metadata.json.patch +++ /dev/null @@ -1,16 +0,0 @@ -diff --git a/chrome/browser/flag-metadata.json b/chrome/browser/flag-metadata.json -index 308795f21a3ca..1cb4a0fd667d9 100644 ---- a/chrome/browser/flag-metadata.json -+++ b/chrome/browser/flag-metadata.json -@@ -3398,6 +3398,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/129.0.6616.0/chrome/browser/ipfs_extra_parts.cc b/chromium_edits/129.0.6616.0/chrome/browser/ipfs_extra_parts.cc deleted file mode 100644 index 90d2596f..00000000 --- a/chromium_edits/129.0.6616.0/chrome/browser/ipfs_extra_parts.cc +++ /dev/null @@ -1,10 +0,0 @@ -#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/129.0.6616.0/chrome/browser/ipfs_extra_parts.h b/chromium_edits/129.0.6616.0/chrome/browser/ipfs_extra_parts.h deleted file mode 100644 index 2059c437..00000000 --- a/chromium_edits/129.0.6616.0/chrome/browser/ipfs_extra_parts.h +++ /dev/null @@ -1,10 +0,0 @@ -#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/129.0.6616.0/components/cbor/reader_unittest.cc.patch b/chromium_edits/129.0.6616.0/components/cbor/reader_unittest.cc.patch deleted file mode 100644 index 150e0c73..00000000 --- a/chromium_edits/129.0.6616.0/components/cbor/reader_unittest.cc.patch +++ /dev/null @@ -1,47 +0,0 @@ -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/129.0.6616.0/third_party/blink/renderer/platform/weborigin/scheme_registry.cc.patch b/chromium_edits/129.0.6616.0/third_party/blink/renderer/platform/weborigin/scheme_registry.cc.patch deleted file mode 100644 index 5779267b..00000000 --- a/chromium_edits/129.0.6616.0/third_party/blink/renderer/platform/weborigin/scheme_registry.cc.patch +++ /dev/null @@ -1,13 +0,0 @@ -diff --git a/third_party/blink/renderer/platform/weborigin/scheme_registry.cc b/third_party/blink/renderer/platform/weborigin/scheme_registry.cc -index e1bc209c337c5..844ce502464d4 100644 ---- a/third_party/blink/renderer/platform/weborigin/scheme_registry.cc -+++ b/third_party/blink/renderer/platform/weborigin/scheme_registry.cc -@@ -68,7 +68,7 @@ class URLSchemesRegistry final { - // 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/129.0.6616.0/url/url_util.cc.patch b/chromium_edits/129.0.6616.0/url/url_util.cc.patch deleted file mode 100644 index 2f430e17..00000000 --- a/chromium_edits/129.0.6616.0/url/url_util.cc.patch +++ /dev/null @@ -1,18 +0,0 @@ -diff --git a/url/url_util.cc b/url/url_util.cc -index ce5225e121f5d..e2ddfd9323214 100644 ---- a/url/url_util.cc -+++ b/url/url_util.cc -@@ -308,7 +308,12 @@ bool DoCanonicalize(const CHAR* spec, - success = CanonicalizeFileSystemURL( - spec, ParseFileSystemURL(std::basic_string_view(spec, spec_len)), - charset_converter, output, output_parsed); -- -+ } else if (DoCompareSchemeComponent(spec, scheme, "ipfs")) { -+ auto spec_view = std::basic_string_view(spec, spec_len); -+ // Switch multibase away from case-sensitive ones before continuing canonicalization. -+ auto parsed_input = ParseStandardURL(spec_view); -+ success = CanonicalizeIpfsURL(spec_view, parsed_input, scheme_type, -+ charset_converter, output, output_parsed); - } else if (DoIsStandard(spec, scheme, &scheme_type)) { - // All "normal" URLs. - success = CanonicalizeStandardURL( diff --git a/cmake/chrome.cmake b/cmake/chrome.cmake index 09c7bb36..b27bfd23 100644 --- a/cmake/chrome.cmake +++ b/cmake/chrome.cmake @@ -2,13 +2,20 @@ find_program(CCACHE_EXECUTABLE ccache) set(chromium_build_dir "${CHROMIUM_SOURCE_TREE}/out/${CHROMIUM_PROFILE}") cmake_host_system_information(RESULT core_count QUERY NUMBER_OF_PHYSICAL_CORES) -if(core_count GREATER 1) - set(parallel_jobs ${core_count} CACHE STRING "The number of parallel jobs chromium build commands should use.") -else() - set(parallel_jobs 1 CACHE STRING "The number of parallel jobs chromium build commands should use.") +if(core_count GREATER 16) + if("${CHROMIUM_PROFILE}" STREQUAL "win") + set(core_count 8) + else() + math(EXPR core_count "${core_count} / 2") + endif() +elseif(core_count GREATER 1) + math(EXPR core_count "${core_count} * 2 / 3") endif() +set(parallel_jobs ${core_count} CACHE STRING "The number of parallel jobs chromium build commands should use.") set(gnargs " enable_ipfs=true ") -if(CCACHE_EXECUTABLE) +if("${CHROMIUM_PROFILE}" STREQUAL "win") + message(STATUS "Don't use ccache with clang-cl") +elseif(CCACHE_EXECUTABLE) set(gnargs " ${gnargs} cc_wrapper=\"${CCACHE_EXECUTABLE}\" ") endif() if(CMAKE_BUILD_TYPE STREQUAL Release) @@ -23,7 +30,7 @@ else() message(FATAL_ERROR "Please choose either Debug or Release for CMAKE_BUILD_TYPE (was '${CMAKE_BUILD_TYPE}').") endif() if("${CHROMIUM_PROFILE}" STREQUAL "win") - set(gnargs " ${gnargs} target_os=\"win\" target_cpu=\"x64\" ") + set(gnargs " ${gnargs} target_os=\"win\" target_cpu=\"x64\" treat_warnings_as_errors=false ") endif() if("${CMAKE_SYSTEM_NAME}" STREQUAL "Darwin") set(gnargs " ${gnargs} mac_deployment_target=\"13.0\" treat_warnings_as_errors=false ") diff --git a/cmake/chromium.py b/cmake/chromium.py index 5898b244..efb42b6b 100755 --- a/cmake/chromium.py +++ b/cmake/chromium.py @@ -8,7 +8,7 @@ from os import environ, makedirs, remove from os.path import basename, dirname, getmtime, isdir, isfile, join, pathsep, realpath, relpath, splitext from shutil import copyfile, which -from sys import argv, executable, stderr +from sys import argv, stderr import filecmp import subprocess @@ -25,12 +25,16 @@ gnargs = vars['GN_ARGS'] build_type = vars['CMAKE_BUILD_TYPE'] branding_dir = vars['BRANDING_DIR'] -python = executable +python = vars['_Python3_EXECUTABLE'] patcher = Patcher(src, git_binary, build_type) UPDATED = 'chromium_source_updated' prof_gn = profile.lower() -electron_args_file = join(src, 'electron', 'build', 'args', prof_gn + '.gn') +if 'test' in prof_gn or 'debug' in prof_gn: + gn_inc = 'testing' +else: + gn_inc = 'release' +electron_args_file = join(src, 'electron', 'build', 'args', gn_inc + '.gn') if isfile(electron_args_file): toks = gnargs.split() # electron defines is_debug by profile convention, and unfortunately they disagree with me @@ -257,13 +261,13 @@ def sync_dir(source_relative, target_relative, complete=True): if isdir(elec_dir): sync_dir('electron-spin', 'electron-spin') -if not branding_dir: - verbose("Branding turned off via emptyBRANDING_DIR.") +if not branding_dir or len(branding_dir) == 0: + verbose("Branding turned off via empty BRANDING_DIR.") elif isdir(branding_dir): sync_dir(join(branding_dir, 'installer'), join('chrome', 'installer'), False) sync_dir(join(branding_dir, 'theme'), join('chrome', 'app', 'theme', 'chromium'), False) else: - print("BRANDING_DIR", branding_dir, "does not point to a directory.", file=stderr) + print(f"BRANDING_DIR '{branding_dir}' does not point to a directory.", file=stderr) exit(8) if 'PYTHONPATH' in environ: environ['PYTHONPATH'] = src + '/third_party/protobuf/python' + pathsep + environ['PYTHONPATH'] diff --git a/cmake/inc_link.py b/cmake/inc_link.py index 4602c75b..c097ad59 100755 --- a/cmake/inc_link.py +++ b/cmake/inc_link.py @@ -180,8 +180,11 @@ def search() -> bool: if exists(target): continue verbose('Consider source',source) - if isfile(source) and splitext(entry)[-1] == '.h': - symlink(source, target) + if isfile(source) and not isfile(target) and splitext(entry)[-1] == '.h': + try: + symlink(source, target) + except FileExistsError: + continue print("Premptively symlink",entry,source,'=>',target) preempt = True break diff --git a/cmake/release.py b/cmake/release.py index 3d4a2cd1..c0e94755 100755 --- a/cmake/release.py +++ b/cmake/release.py @@ -3,21 +3,30 @@ from version import deduce, on_tag +from glob import glob from os import chdir, environ, getcwd, listdir from os.path import join, isdir, isfile -from subprocess import check_call, check_output +from subprocess import call, check_output from sys import argv, executable, stderr GITHUB_ORG = 'little-bear-labs' GITHUB_REPO = 'ipfs-chromium' +version = deduce() +build_dir = getcwd() + try: from ghapi.all import GhApi except ModuleNotFoundError: - check_call([executable, '-m', 'pip', 'install', 'ghapi']) - from ghapi.all import GhApi - -build_dir = getcwd() + call([executable, '-m', 'pip', '--user', 'install', 'ghapi']) + try: + from ghapi.all import GhApi + except ModuleNotFoundError: + for artifact in glob(f"{build_dir}/ipfs-client-*"): + args = ['gh', 'release', 'upload', version, artifact] + print('Running via cli forking', args) + call(args) + exit(0) def cli_arg(a): @@ -69,7 +78,7 @@ def line_to_var(line): print(chromium_out, 'is not a directory?!', file=stderr) exit(4) build_target('package') -version = deduce() + if on_tag(): print('Will be adding to release', version) gh_rel = gh.repos.get_release_by_tag(owner=GITHUB_ORG, repo=GITHUB_REPO, tag=version) @@ -86,7 +95,10 @@ def upload(contains): for ext in artifact_extensions: if f.endswith(ext): print('Uploading', f, 'to', GITHUB_ORG, GITHUB_REPO, 'release', version) - gh.upload_file(gh_rel, f) + try: + gh.upload_file(gh_rel, f) + except Exception as e: + print(' ... Error uploading ', f, ':', e) break diff --git a/component/CMakeLists.txt b/component/CMakeLists.txt index 2ce14088..b377f361 100644 --- a/component/CMakeLists.txt +++ b/component/CMakeLists.txt @@ -116,15 +116,31 @@ add_custom_target(build_browser DEPENDS chromium_ordering_issue ) -if(CHROMIUM_PROFILE STREQUAL win) - set(CHROMIUM_PACKAGE_TARGET mini_installer) -else() - set(CHROMIUM_PACKAGE_TARGET chrome/installer) -endif() -if(CMAKE_BUILD_TYPE STREQUAL "Release") +if(CMAKE_BUILD_TYPE STREQUAL "Release" ) + if("${CMAKE_SYSTEM_NAME}" STREQUAL "Darwin") + add_custom_target(package_browser + COMMENT "Packaging" + COMMAND "${Python3_EXECUTABLE}" "${CMAKE_SOURCE_DIR}/cmake/chromium.py" "${CMAKE_BINARY_DIR}" mini_installer + DEPENDS build_browser + ) + add_custom_target(package_electron + COMMAND "${Python3_EXECUTABLE}" "${CMAKE_SOURCE_DIR}/cmake/chromium.py" "${CMAKE_BINARY_DIR}" "electron:electron_dist_zip" + DEPENDS build_electron + ) + elseif("${CHROMIUM_PROFILE}" STREQUAL "win") + add_custom_target(package_browser + COMMENT "Packaging" + COMMAND "${Python3_EXECUTABLE}" "${CMAKE_SOURCE_DIR}/cmake/chromium.py" "${CMAKE_BINARY_DIR}" chrome/installer + DEPENDS build_browser + ) + add_custom_target(package_electron + COMMAND "${Python3_EXECUTABLE}" "${CMAKE_SOURCE_DIR}/cmake/chromium.py" "${CMAKE_BINARY_DIR}" "electron:electron_dist_zip" + DEPENDS build_electron + ) + else() add_custom_target(build_stripped_browser COMMENT "Stripping browser, output is out/${CHROMIUM_PROFILE}/chrome.stripped" - COMMAND "${Python3_EXECUTABLE}" "${CMAKE_SOURCE_DIR}/cmake/chromium.py" "${CMAKE_BINARY_DIR}" chrome.stripped + COMMAND "${Python3_EXECUTABLE}" "${CMAKE_SOURCE_DIR}/cmake/chromium.py" "${CMAKE_BINARY_DIR}" strip_chrome_binary DEPENDS build_browser ) add_custom_target(build_browser_sandbox @@ -155,29 +171,26 @@ if(CMAKE_BUILD_TYPE STREQUAL "Release") endforeach() add_custom_target(package_browser COMMENT "Packaging" - COMMAND "${Python3_EXECUTABLE}" "${CMAKE_SOURCE_DIR}/cmake/chromium.py" "${CMAKE_BINARY_DIR}" ${CHROMIUM_PACKAGE_TARGET} + COMMAND "${Python3_EXECUTABLE}" "${CMAKE_SOURCE_DIR}/cmake/chromium.py" "${CMAKE_BINARY_DIR}" chrome/installer DEPENDS build_stripped_browser build_stripped_browser_sandbox ) - add_custom_target(upload_browser - DEPENDS package_browser - COMMENT "Sending browser installer to gcloud" - COMMAND "${Python3_EXECUTABLE}" "${CMAKE_SOURCE_DIR}/cmake/upload.py" "${CMAKE_PROJECT_VERSION}" - WORKING_DIRECTORY "${CHROMIUM_SOURCE_TREE}/out/${CHROMIUM_PROFILE}" - ) add_custom_target(package_electron COMMAND "${Python3_EXECUTABLE}" "${CHROMIUM_SOURCE_TREE}/electron/script/strip-binaries.py" -d "${CHROMIUM_SOURCE_TREE}/out/${CHROMIUM_PROFILE}" COMMAND "${Python3_EXECUTABLE}" "${CMAKE_SOURCE_DIR}/cmake/chromium.py" "${CMAKE_BINARY_DIR}" "electron:electron_dist_zip" DEPENDS build_electron ) + endif() endif() -#Symlinks for convenience -add_custom_command( - TARGET build_browser - POST_BUILD - COMMAND "${CMAKE_COMMAND}" -E create_symlink "${CHROMIUM_SOURCE_TREE}/out/${CHROMIUM_PROFILE}/chrome" "${CMAKE_BINARY_DIR}/browser" - COMMENT "Symlinking... your browser can be found here: ${CMAKE_BINARY_DIR}/browser or ${CHROMIUM_SOURCE_TREE}/out/${CHROMIUM_PROFILE}/chrome" -) +if("${CMAKE_SYSTEM_NAME}" STREQUAL "Linux") + #Symlinks for convenience + add_custom_command( + TARGET build_browser + POST_BUILD + COMMAND "${CMAKE_COMMAND}" -E create_symlink "${CHROMIUM_SOURCE_TREE}/out/${CHROMIUM_PROFILE}/chrome" "${CMAKE_BINARY_DIR}/browser" + COMMENT "Symlinking... your browser can be found here: ${CMAKE_BINARY_DIR}/browser or ${CHROMIUM_SOURCE_TREE}/out/${CHROMIUM_PROFILE}/chrome" + ) +endif() add_custom_command( TARGET build_electron POST_BUILD diff --git a/component/README.md b/component/README.md index a5141a85..3e0a7074 100644 --- a/component/README.md +++ b/component/README.md @@ -26,35 +26,6 @@ Personally, I would: * ${VISUAL} pretty_printed.json * mv pretty_printed.json ~/.config/chromium/Default/Preferences -### The relevants settings are: +### User Preferences -#### ipfs.discovery.rate -Unsigned integer. -The requests-per-minute to be used for gateways when they're first discovered through the routing V1 api. -A value of 0 will disable that discovery. -The default value is 120 (i.e. 2 requests per second on average) - -#### ipfs.discovery.http -Boolean. -Whether gateways discovered with an http:// scheme (that is, not https i.e. not encrypted) will be added to the list. -Default true. - -#### ipfs.gateway - -A dictionary where the keys are URL prefixes for different gateways, -and the values are dictionaries of settings for that gateay. - -#### `ipfs.gateway["https://ipfs.io/"].max_requests_per_minute` - -Unsigned integer. -Not actually a strict maximum. -However, if there have been more requests sent there recently than the rate will suggest, -other gateways will be strongly preferred over this one. -Does help with rate limits set by gateway providers. - -#### `ipfs.gateway["https://ipfs.io/"].Car` - -Automatically set, not generally expected to be user-facing. -There are several of these, actually. -They track the history of that gateway with requests of that type, -as a soft way of inferring the capabilities of that gateway. +For more info see [Preferences](../doc/preferences.md). diff --git a/doc/preferences.md b/doc/preferences.md new file mode 100644 index 00000000..74229c9d --- /dev/null +++ b/doc/preferences.md @@ -0,0 +1,48 @@ +# User Preferences + +## Library + +Users of the library configure behavior directly, via `ipfs::Client`. + +All of the overloads to `with(X)` are there for you to alter/extend behavior. +The ones related to the user preferences in Chromium are `ipfs::ctx::GatewayConfig` and `DnslinkFallbackSwitch`. + +## Chromium (components/ipfs) + +As of today there is no UI for editing the user preferences that change the behavior. +Some values alter themselves from feedback, e.g. if a gateway returns desired content successfully more often it will be used more frequently in the future. +Others are simply left to their default values, unless one manually intervenes by changing the `Preferences` file. + +### Preferences file. + +Find the file named Prefernces in your +[profile directory](https://chromium.googlesource.com/chromium/src.git/+/HEAD/docs/user_data_dir.md#Current-Location). +For example, for me it would be `~/.config/chromium/Default/Preferences` + +Don't write to it while that profile is active. Race conditions are a bad idea. + +All IPFS-related are under the ipfs key. +The file is not pretty-printed when the browser reads it, but if you reformat it the browser can still read it. +So you may want to do that before hand-editing. +To view my current settings, for example, I'd use + +`jq .ipfs ~/.config/chromium/Default/Preferences` + +The keys are as follows: + + +1. ipfs : All IPFS settings are under ipfs + 1. dnslink : settings related to resolving human-readable names to IPFS CIDs, including [DNSLink](https://dnslink.dev/) + 1. fallback_to_gateway : boolean (default true) - In cases where the in-browser DNSClient fails to resolve the `_dnslink` name via system DNS setup... is it OK to send a request to gateways to have them resolve the name for you + 2. discovery : settings related to discovering new gateways + 1. rate : integer (default 120) - the requests-per-minit to initialize new gateways with when they are discovered + 2. http : bool (default true) - is it OK to start using insecure (HTTP not HTTPS) gateways when discovered + 3. gateway : the list of gateways to use, and settings for them. This section is updated at runtime. + 1. "gateway URL prefix" : The keys in gateway can be pasted in front of requests to form a full http(s) URL, e.g. "https://ipfs.io/". Naturally it has to include the scheme and host, it may also contain the beginning of a path if there's strange routiung rules going on. User info is also acceptable. Should end in / + 1. max_requests_per_minute : integer - the number of requests per minute. Not a hard limit, but it will get de-prioritized if on average more than this is being sent. + 2. Block : integer - how preferred this gateway should be for `format=raw`, single-block trustless block requests. + 3. Car : integer - how preferred this gateway should be for `?dag-scope=entity` CAR requests + 4. DnsLink : integer - how preferred this gateway should be for requests meant to resolve names. These are, in fact, trusted block requests. However different gateways have different resolvers enabled. + 5. Identity : integer - completely irrelevant. Inline CIDs contain the data for the response, so they should not be sent to a gateway. + 6. Ipns : integer - how preferred this gateway should be for `format=raw`, trustless requests for an IPNS record. + 7. Providers: integer - how preferred this gateway should be for `/routing/v1` requests. diff --git a/library/include/ipfs_client/json_cbor_adapter.h b/library/include/ipfs_client/json_cbor_adapter.h index 5ed52ad4..5a0d7fae 100644 --- a/library/include/ipfs_client/json_cbor_adapter.h +++ b/library/include/ipfs_client/json_cbor_adapter.h @@ -19,11 +19,7 @@ class JsonCborAdapter final : public DagCborValue, public DagJsonValue { public: using Cid = ipfs::Cid; - JsonCborAdapter(nlohmann::json data) : data_{data} { - if (data_.is_array() && data_.size() == 1UL) { - data_ = data_[0]; - } - } + JsonCborAdapter(nlohmann::json const& data) : data_(data) {} std::unique_ptr at(std::string_view k) const override { if (data_.is_object() && data_.contains(k)) { return std::make_unique(data_.at(k)); @@ -42,7 +38,7 @@ class JsonCborAdapter final : public DagCborValue, public DagJsonValue { } return std::nullopt; } - std::optional as_signed() const { + std::optional as_signed() const override { if (data_.is_number_integer()) { return data_.get(); } else if (auto ui = as_unsigned()) { diff --git a/library/src/ipfs_client/ctx/default_gateways.cc b/library/src/ipfs_client/ctx/default_gateways.cc index aab03d42..d49a3a0e 100644 --- a/library/src/ipfs_client/ctx/default_gateways.cc +++ b/library/src/ipfs_client/ctx/default_gateways.cc @@ -29,20 +29,23 @@ 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/", 1012}, - {"https://ipfs.io/", 980}, - {"https://dweb.link/", 973}, - {"https://hardbin.com/", 957}, - {"https://ipfs.joaoleitao.org/", 892}, - {"https://ipfs.greyh.at/", 891}, - {"https://trustless-gateway.link/", 778}, - {"https://human.mypinata.cloud/", 442}, - {"https://jcsl.hopto.org/", 354}, - {"https://delegated-ipfs.dev/", 351}, - {"https://4everland.io/", 327}, - {"https://ipfs.runfission.com/", 295}, - {"https://gateway.pinata.cloud/", 175}, - {"https://dag.w3s.link/", 166}, + std::pair{"http://127.0.0.1:8080/", 1017}, + {"https://ipfs.io/", 995}, + {"https://dweb.link/", 968}, + {"https://hardbin.com/", 952}, + {"https://ipfs.joaoleitao.org/", 888}, + {"https://ipfs.greyh.at/", 884}, + {"https://trustless-gateway.link/", 878}, + {"https://dlunar.net/", 730}, + {"https://flk-ipfs.io/", 697}, + {"https://ipfs.cyou/", 498}, + {"https://human.mypinata.cloud/", 437}, + {"https://jcsl.hopto.org/", 357}, + {"https://delegated-ipfs.dev/", 346}, + {"https://4everland.io/", 322}, + {"https://ipfs.runfission.com/", 292}, + {"https://gateway.pinata.cloud/", 166}, + {"https://dag.w3s.link/", 160}, {"https://ipfs.eth.aragon.network/", 11}, {"https://data.filstorage.io/", 10}, {"https://storry.tv/", 9}, diff --git a/library/src/ipfs_client/ctx/default_gateways_unittest.cc b/library/src/ipfs_client/ctx/default_gateways_unittest.cc new file mode 100644 index 00000000..e7cc13af --- /dev/null +++ b/library/src/ipfs_client/ctx/default_gateways_unittest.cc @@ -0,0 +1,24 @@ +#include + +#include + +#include + +#include + +namespace ic = ipfs::ctx; + +TEST(DefaultGatewaysTest,EnvironmentOverride) { + auto failed_to_set_env = ::setenv("IPFS_GATEWAY", "a b", 1); + EXPECT_EQ(failed_to_set_env,0); + ic::TransitoryGatewayConfig cfg; + auto overridden = ic::LoadGatewaysFromEnvironmentVariable(cfg); + ::unsetenv("IPFS_GATEWAY"); + EXPECT_TRUE(overridden); + auto a = cfg.GetGateway(0); + ASSERT_TRUE(a.has_value()); + EXPECT_EQ(a.value().prefix,"a/"); + auto b = cfg.GetGateway(1); + ASSERT_TRUE(b.has_value()); + EXPECT_EQ(b.value().prefix,"b/"); +} diff --git a/library/src/ipfs_client/ctx/transitory_gateway_config_unittest.cc b/library/src/ipfs_client/ctx/transitory_gateway_config_unittest.cc index 0c1f87bf..cd134780 100644 --- a/library/src/ipfs_client/ctx/transitory_gateway_config_unittest.cc +++ b/library/src/ipfs_client/ctx/transitory_gateway_config_unittest.cc @@ -2,12 +2,13 @@ #include -#include +using T = ipfs::ctx::TransitoryGatewayConfig; +using RT = ipfs::gw::GatewayRequestType; TEST(TransitoryGatewayConfigTest, EmptyStringEnvLoadsStatic) { char env[15] = "IPFS_GATEWAY="; putenv(env); - ipfs::ctx::TransitoryGatewayConfig c; + T c; auto first = c.GetGateway(0); EXPECT_TRUE(first.has_value()); auto second = c.GetGateway(1); @@ -17,7 +18,7 @@ TEST(TransitoryGatewayConfigTest, EmptyStringEnvLoadsStatic) { EXPECT_GT(second->rate, 0); } TEST(TransitoryGatewayConfigTest, SetGatewayRateObservable) { - ipfs::ctx::TransitoryGatewayConfig c; + T c; auto b4 = c.GetGateway(0); ASSERT_TRUE(b4.has_value()); auto pre = b4.value().prefix; @@ -26,3 +27,15 @@ TEST(TransitoryGatewayConfigTest, SetGatewayRateObservable) { auto result = c.GetGatewayRate(pre); EXPECT_EQ(result, val + 9); } +TEST(TransitoryGatewayConfigTest, RoutingApiDiscoveryDefaultRateIs60) { + T t; + EXPECT_EQ(t.RoutingApiDiscoveryDefaultRate(),60); +} +TEST(TransitoryGatewayConfigTest, RoutingApiDiscoveryOfUnencryptedGatewaysIsFalse) { + T t; + EXPECT_FALSE(t.RoutingApiDiscoveryOfUnencryptedGateways()); +} +TEST(TransitoryGatewayConfigTest, TypeAffinityIs9) { + T t; + EXPECT_EQ(9, t.GetTypeAffinity("whatevs", RT::Identity)); +} diff --git a/library/src/ipfs_client/gw/gateway_state.cc b/library/src/ipfs_client/gw/gateway_state.cc index a04d6a1b..e7ed78f6 100644 --- a/library/src/ipfs_client/gw/gateway_state.cc +++ b/library/src/ipfs_client/gw/gateway_state.cc @@ -50,7 +50,7 @@ void Self::hit(GatewayRequestType grt, GatewayRequest const& req) { c.SetTypeAffinity(prefix_, grt, std::max(typaff + 9, 1)); affinity_success[req.affinity] += 9; auto rpm = c.GetGatewayRate(prefix_); - for (auto i = 10; i; --i) { + for (auto i = 9; i; --i) { if (over_rate(rpm / i)) { ++rpm; } else { diff --git a/library/src/ipfs_client/gw/multi_gateway_requestor.cc b/library/src/ipfs_client/gw/multi_gateway_requestor.cc index 11adabc8..9d00cb89 100644 --- a/library/src/ipfs_client/gw/multi_gateway_requestor.cc +++ b/library/src/ipfs_client/gw/multi_gateway_requestor.cc @@ -84,7 +84,7 @@ bool Self::Process(RequestPtr const& req) { forward(req); return false; } - auto min_plel = req->type == GatewayRequestType::Block ? 2UL : 1UL; + auto min_plel = req->type == GatewayRequestType::Block ? 3UL : 1UL; auto to_send = std::max(bored / 2UL, min_plel); std::sort(candidates.begin(), candidates.end(), std::greater{}); static std::size_t extra = 0UL; diff --git a/library/src/ipfs_client/gw/providers_response.cc b/library/src/ipfs_client/gw/providers_response.cc index bf5d83f3..5816e947 100644 --- a/library/src/ipfs_client/gw/providers_response.cc +++ b/library/src/ipfs_client/gw/providers_response.cc @@ -81,8 +81,11 @@ bool ParseProvider(ipfs::DagJsonValue const& provider, ipfs::Client& api) { LOG(ERROR) << ".Providers[x].Addrs[x] is not a string"; } }; - if (!addrs->iterate_list(handle_addr)) { - LOG(ERROR) << ".Providers[x].Addrs is not a list"; + if (addrs->iterate_list(handle_addr)) { + LOG(INFO) << "Handled provider address(es) in list."; + } else { + LOG(WARNING) << ".Providers[x].Addrs is not a list"; + handle_addr(*addrs); } return rv; } diff --git a/library/src/ipfs_client/ipld/chunk.cc b/library/src/ipfs_client/ipld/chunk.cc index 57aea890..2737a448 100644 --- a/library/src/ipfs_client/ipld/chunk.cc +++ b/library/src/ipfs_client/ipld/chunk.cc @@ -5,7 +5,7 @@ using Chunk = ipfs::ipld::Chunk; Chunk::Chunk(std::string data) : data_{data} {} -Chunk::~Chunk() = default; +Chunk::~Chunk() noexcept = default; auto Chunk::resolve(ResolutionState& params) -> ResolveResult { if (params.IsFinalComponent()) { diff --git a/library/src/ipfs_client/ipld/dag_json_node_unittest.cc b/library/src/ipfs_client/ipld/dag_json_node_unittest.cc index f8e853bf..920fa0e2 100644 --- a/library/src/ipfs_client/ipld/dag_json_node_unittest.cc +++ b/library/src/ipfs_client/ipld/dag_json_node_unittest.cc @@ -32,7 +32,7 @@ struct DagJsonNodeTest : public ::testing::Test { {"/", "bafyreiejkvsvdq4smz44yuwhfymcuvqzavveoj2at3utujwqlllspsqr6q"} }}, {"payload", "AXESIIlVZVHDkmZ5zFLHLhgqVhkFakcnQJ7pOibQWtcnyhH0"}, - {"signatures", {//array with 1 element + {"signatures", n::json::array_t{//array with 1 element {//map with keys protected;signature {"protected", "eyJhbGciOiJFZERTQSJ9"}, {"signature", "-_9J5OZcl5lVuRlgI1NJEzc0FqEb6_2yVskUaQPducRQ4oe-N5ynCl57wDm4SPtm1L1bltrphpQeBOeWjVW1BQ"} @@ -59,6 +59,8 @@ struct DagJsonNodeTest : public ::testing::Test { auto adapt = std::make_unique(data); EXPECT_TRUE(adapt->is_map()); + EXPECT_TRUE(adapt->at("signatures")->is_array()); + tested_ = std::make_unique(std::move(adapt)); } return *tested_; @@ -68,7 +70,11 @@ struct DagJsonNodeTest : public ::testing::Test { TEST_F(DagJsonNodeTest, preview) { std::string p; - ipfs::ipld::ResolutionState state{i::SlashDelimited{""}, ipfs::ResponseSemantic::Http, noop_blu()}; + ipfs::ipld::ResolutionState state{ + i::SlashDelimited{""} + , ipfs::ResponseSemantic::Http + , noop_blu() + }; auto result = super().Resolve(state); auto& resp = std::get(result); EXPECT_EQ(resp.status_, 200); diff --git a/library/src/ipfs_client/partition_unittest.cc b/library/src/ipfs_client/partition_unittest.cc index 79c90b26..11f4439e 100644 --- a/library/src/ipfs_client/partition_unittest.cc +++ b/library/src/ipfs_client/partition_unittest.cc @@ -1,5 +1,6 @@ #include "ipfs_client/partition.h" +#include #include #include @@ -156,6 +157,7 @@ struct TestRequestor final : public ig::Requestor { } }; struct OrchestratingRealData : public ::testing::Test { + LogRecorder logs_; std::shared_ptr api_ = std::make_shared(); std::shared_ptr orc_; OrchestratingRealData() { diff --git a/library/version.txt b/library/version.txt index 3eface34..6911b2c1 100644 --- a/library/version.txt +++ b/library/version.txt @@ -1 +1 @@ -0.0.1.1 +0.0.1.2 diff --git a/test_data/blocks/QmXZ7Nqc61GoviH9WwjK7e99pJ34PoRW1gfZBSVZUqPArb b/test_data/blocks/QmXZ7Nqc61GoviH9WwjK7e99pJ34PoRW1gfZBSVZUqPArb deleted file mode 100644 index 0bc65263..00000000 --- a/test_data/blocks/QmXZ7Nqc61GoviH9WwjK7e99pJ34PoRW1gfZBSVZUqPArb +++ /dev/null @@ -1,2 +0,0 @@ - -Aa0 Aa1 Aa2 Aa3 Aa4 Aa5 Aa6 Aa7 Aa8 Aa9 Ab0 Ab1 Ab2 Ab3 Ab4 Ab5 Ab6 Ab7 Ab8 Ab9 Ac0 Ac1 Ac2 Ac3 Ac4 Ac5 Ac6 Ac7 Ac8 Ac9 Ad0 Ad1 Ad2 Ad3 Ad4 Ad5  \ No newline at end of file diff --git a/test_data/blocks/QmXmpdiqdkGxKac2T4rFhqhbFWuqfsGaS2LETa2ZeDKUzQ b/test_data/blocks/QmXmpdiqdkGxKac2T4rFhqhbFWuqfsGaS2LETa2ZeDKUzQ deleted file mode 100644 index 14092fab..00000000 --- a/test_data/blocks/QmXmpdiqdkGxKac2T4rFhqhbFWuqfsGaS2LETa2ZeDKUzQ +++ /dev/null @@ -1,2 +0,0 @@ - -Ux6 Ux7 Ux8 Ux9 Uy0 Uy1 Uy2 Uy3 Uy4 Uy5 Uy6 Uy7 Uy8 Uy9 Uz0 Uz1 Uz2 Uz3 Uz4 Uz5 Uz6 Uz7 Uz8 Uz9 Va0 Va1 Va2 Va3 Va4 Va5 Va6 Va7 Va8 Va9 Vb0 Vb1  \ No newline at end of file diff --git a/test_data/blocks/bafkreig7pzyokaqvit2igs564zfj4n4j726ex2auodpwfhfnnxnqgmqklq b/test_data/blocks/bafkreig7pzyokaqvit2igs564zfj4n4j726ex2auodpwfhfnnxnqgmqklq deleted file mode 100644 index 7371f47a..00000000 --- a/test_data/blocks/bafkreig7pzyokaqvit2igs564zfj4n4j726ex2auodpwfhfnnxnqgmqklq +++ /dev/null @@ -1 +0,0 @@ -B \ No newline at end of file