diff --git a/chromium_edits/122.0.6261.156/chrome/browser/BUILD.gn.patch b/chromium_edits/122.0.6261.156/chrome/browser/BUILD.gn.patch deleted file mode 100644 index f1f087a0..00000000 --- a/chromium_edits/122.0.6261.156/chrome/browser/BUILD.gn.patch +++ /dev/null @@ -1,27 +0,0 @@ -diff --git a/chrome/browser/BUILD.gn b/chrome/browser/BUILD.gn -index 0811d62fd215d..d1538420009d2 100644 ---- a/chrome/browser/BUILD.gn -+++ b/chrome/browser/BUILD.gn -@@ -39,6 +39,7 @@ import("//rlz/buildflags/buildflags.gni") - import("//sandbox/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") -@@ -2629,6 +2630,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/122.0.6261.156/chrome/browser/about_flags.cc.patch b/chromium_edits/122.0.6261.156/chrome/browser/about_flags.cc.patch deleted file mode 100644 index b70a4758..00000000 --- a/chromium_edits/122.0.6261.156/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 de3be2eec25cc..810e9fae2e509 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" -@@ -311,6 +312,10 @@ - #include "extensions/common/switches.h" - #endif // BUILDFLAG(ENABLE_EXTENSIONS) - -+#if BUILDFLAG(ENABLE_IPFS) -+#include "components/ipfs/ipfs_features.h" -+#endif -+ - #if BUILDFLAG(ENABLE_PDF) - #include "pdf/pdf_features.h" - #endif -@@ -9587,6 +9592,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/122.0.6261.156/chrome/browser/autocomplete/chrome_autocomplete_scheme_classifier.cc.patch b/chromium_edits/122.0.6261.156/chrome/browser/autocomplete/chrome_autocomplete_scheme_classifier.cc.patch deleted file mode 100644 index 4d172311..00000000 --- a/chromium_edits/122.0.6261.156/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/122.0.6261.156/chrome/browser/chrome_content_browser_client.cc.patch b/chromium_edits/122.0.6261.156/chrome/browser/chrome_content_browser_client.cc.patch deleted file mode 100644 index 899b6316..00000000 --- a/chromium_edits/122.0.6261.156/chrome/browser/chrome_content_browser_client.cc.patch +++ /dev/null @@ -1,77 +0,0 @@ -diff --git a/chrome/browser/chrome_content_browser_client.cc b/chrome/browser/chrome_content_browser_client.cc -index 8e21b0a1e691a..b3497783ad96e 100644 ---- a/chrome/browser/chrome_content_browser_client.cc -+++ b/chrome/browser/chrome_content_browser_client.cc -@@ -375,6 +375,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" -@@ -496,6 +497,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_CHROMEOS) - #include "base/debug/leak_annotations.h" - #include "chrome/browser/apps/app_service/app_install/app_install_navigation_throttle.h" -@@ -1677,6 +1685,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; - } - -@@ -5984,12 +5997,25 @@ void ChromeContentBrowserClient:: - const std::optional& request_initiator_origin, - NonNetworkURLLoaderFactoryMap* factories) { - #if BUILDFLAG(IS_CHROMEOS_ASH) || BUILDFLAG(ENABLE_EXTENSIONS) || \ -- !BUILDFLAG(IS_ANDROID) -+ !BUILDFLAG(IS_ANDROID) || BUILDFLAG(ENABLE_IPFS) - content::RenderFrameHost* frame_host = - RenderFrameHost::FromID(render_process_id, render_frame_id); - WebContents* web_contents = WebContents::FromRenderFrameHost(frame_host); - #endif // BUILDFLAG(IS_CHROMEOS_ASH) || BUILDFLAG(ENABLE_EXTENSIONS) || \ - // !BUILDFLAG(IS_ANDROID) -+#if BUILDFLAG(ENABLE_IPFS) -+ if (base::FeatureList::IsEnabled(ipfs::kEnableIpfs)) { -+ network::mojom::URLLoaderFactory* default_factory = g_browser_process->system_network_context_manager()->GetURLLoaderFactory(); -+ auto* context = web_contents->GetBrowserContext(); -+ ipfs::IpfsURLLoaderFactory::Create( -+ factories, -+ context, -+ default_factory, -+ GetSystemNetworkContext(), -+ Profile::FromBrowserContext(context)->GetPrefs() -+ ); -+ } -+#endif // BUILDFLAG(ENABLE_IPFS) - - #if BUILDFLAG(IS_CHROMEOS_ASH) - if (web_contents) { -@@ -6131,6 +6157,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/122.0.6261.156/chrome/browser/flag-metadata.json.patch b/chromium_edits/122.0.6261.156/chrome/browser/flag-metadata.json.patch deleted file mode 100644 index 1dda345b..00000000 --- a/chromium_edits/122.0.6261.156/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 d70932e1ad965..2563456296bca 100644 ---- a/chrome/browser/flag-metadata.json -+++ b/chrome/browser/flag-metadata.json -@@ -3016,6 +3016,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/122.0.6261.156/chrome/browser/flag_descriptions.cc.patch b/chromium_edits/122.0.6261.156/chrome/browser/flag_descriptions.cc.patch deleted file mode 100644 index f2897426..00000000 --- a/chromium_edits/122.0.6261.156/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 8385c597f050e..e2794545964a0 100644 ---- a/chrome/browser/flag_descriptions.cc -+++ b/chrome/browser/flag_descriptions.cc -@@ -292,6 +292,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/122.0.6261.156/chrome/browser/flag_descriptions.h.patch b/chromium_edits/122.0.6261.156/chrome/browser/flag_descriptions.h.patch deleted file mode 100644 index 2a38f74a..00000000 --- a/chromium_edits/122.0.6261.156/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 a023e473a3c31..33998dff7197c 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 -@@ -179,6 +180,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/122.0.6261.156/chrome/browser/ipfs_extra_parts.cc b/chromium_edits/122.0.6261.156/chrome/browser/ipfs_extra_parts.cc deleted file mode 100644 index 90d2596f..00000000 --- a/chromium_edits/122.0.6261.156/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/122.0.6261.156/chrome/browser/ipfs_extra_parts.h b/chromium_edits/122.0.6261.156/chrome/browser/ipfs_extra_parts.h deleted file mode 100644 index 2059c437..00000000 --- a/chromium_edits/122.0.6261.156/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/122.0.6261.156/chrome/browser/prefs/browser_prefs.cc.patch b/chromium_edits/122.0.6261.156/chrome/browser/prefs/browser_prefs.cc.patch deleted file mode 100644 index f4a91a32..00000000 --- a/chromium_edits/122.0.6261.156/chrome/browser/prefs/browser_prefs.cc.patch +++ /dev/null @@ -1,36 +0,0 @@ -diff --git a/chrome/browser/prefs/browser_prefs.cc b/chrome/browser/prefs/browser_prefs.cc -index 94a93ca5c715c..2841d034eec14 100644 ---- a/chrome/browser/prefs/browser_prefs.cc -+++ b/chrome/browser/prefs/browser_prefs.cc -@@ -189,6 +189,7 @@ - #include "ppapi/buildflags/buildflags.h" - #include "printing/buildflags/buildflags.h" - #include "rlz/buildflags/buildflags.h" -+#include "third_party/ipfs_client/ipfs_buildflags.h" - - #if BUILDFLAG(ENABLE_BACKGROUND_MODE) - #include "chrome/browser/background/background_mode_manager.h" -@@ -233,6 +234,11 @@ - #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 -@@ -1685,6 +1691,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/122.0.6261.156/chrome/common/chrome_content_client.cc.patch b/chromium_edits/122.0.6261.156/chrome/common/chrome_content_client.cc.patch deleted file mode 100644 index 5bd09f16..00000000 --- a/chromium_edits/122.0.6261.156/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 246ec9c5c911f..5d66d133a7907 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/122.0.6261.156/components/cbor/reader.cc.patch b/chromium_edits/122.0.6261.156/components/cbor/reader.cc.patch deleted file mode 100644 index 84c15190..00000000 --- a/chromium_edits/122.0.6261.156/components/cbor/reader.cc.patch +++ /dev/null @@ -1,42 +0,0 @@ -diff --git a/components/cbor/reader.cc b/components/cbor/reader.cc -index 306ba52fa4944..122ac8ae08923 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 { -@@ -157,6 +157,10 @@ absl::optional Reader::DecodeCompleteDataItem(const Config& config, - // 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. -+ 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 @@ absl::optional Reader::ReadByteStringContent( - return Value(std::move(cbor_byte_string)); - } - -+absl::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; -+} -+ - absl::optional Reader::ReadArrayContent( - const Reader::DataItemHeader& header, - const Config& config, diff --git a/chromium_edits/122.0.6261.156/components/cbor/reader.h.patch b/chromium_edits/122.0.6261.156/components/cbor/reader.h.patch deleted file mode 100644 index fb821165..00000000 --- a/chromium_edits/122.0.6261.156/components/cbor/reader.h.patch +++ /dev/null @@ -1,26 +0,0 @@ -diff --git a/components/cbor/reader.h b/components/cbor/reader.h -index f0b43a5517528..a57e277a1bc66 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 { - absl::optional ReadMapContent(const DataItemHeader& header, - const Config& config, - int max_nesting_level); -+ absl::optional ReadTagContent(const DataItemHeader& header, -+ const Config& config, -+ int max_nesting_level); - absl::optional ReadByte(); - absl::optional> ReadBytes(uint64_t num_bytes); - bool IsKeyInOrder(const Value& new_key, diff --git a/chromium_edits/122.0.6261.156/components/cbor/reader_unittest.cc.patch b/chromium_edits/122.0.6261.156/components/cbor/reader_unittest.cc.patch deleted file mode 100644 index e25945b1..00000000 --- a/chromium_edits/122.0.6261.156/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 83d44a48d6dfa..a260fb5e25150 100644 ---- a/components/cbor/reader_unittest.cc -+++ b/components/cbor/reader_unittest.cc -@@ -1451,5 +1451,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/122.0.6261.156/components/cbor/values.cc.patch b/chromium_edits/122.0.6261.156/components/cbor/values.cc.patch deleted file mode 100644 index ddbab2b3..00000000 --- a/chromium_edits/122.0.6261.156/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/122.0.6261.156/components/cbor/values.h.patch b/chromium_edits/122.0.6261.156/components/cbor/values.h.patch deleted file mode 100644 index ca39df01..00000000 --- a/chromium_edits/122.0.6261.156/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/122.0.6261.156/components/cbor/writer.cc.patch b/chromium_edits/122.0.6261.156/components/cbor/writer.cc.patch deleted file mode 100644 index 21fe28ce..00000000 --- a/chromium_edits/122.0.6261.156/components/cbor/writer.cc.patch +++ /dev/null @@ -1,14 +0,0 @@ -diff --git a/components/cbor/writer.cc b/components/cbor/writer.cc -index bb22754d36a07..aae4027836377 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/122.0.6261.156/components/cbor/writer_unittest.cc.patch b/chromium_edits/122.0.6261.156/components/cbor/writer_unittest.cc.patch deleted file mode 100644 index 240fee83..00000000 --- a/chromium_edits/122.0.6261.156/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/122.0.6261.156/components/open_from_clipboard/clipboard_recent_content_generic.cc.patch b/chromium_edits/122.0.6261.156/components/open_from_clipboard/clipboard_recent_content_generic.cc.patch deleted file mode 100644 index 891b53df..00000000 --- a/chromium_edits/122.0.6261.156/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 4dcafecbc66c6..d205209c08162 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/122.0.6261.156/net/dns/dns_config_service_linux.cc.patch b/chromium_edits/122.0.6261.156/net/dns/dns_config_service_linux.cc.patch deleted file mode 100644 index 1d694639..00000000 --- a/chromium_edits/122.0.6261.156/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 3c01e724ff069..24788851ff39f 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/122.0.6261.156/third_party/blink/renderer/core/css/perftest_data/.031d5599c8a21118754e30dbea141be66104f556_hash b/chromium_edits/122.0.6261.156/third_party/blink/renderer/core/css/perftest_data/.031d5599c8a21118754e30dbea141be66104f556_hash deleted file mode 100644 index 157c7d82..00000000 --- a/chromium_edits/122.0.6261.156/third_party/blink/renderer/core/css/perftest_data/.031d5599c8a21118754e30dbea141be66104f556_hash +++ /dev/null @@ -1 +0,0 @@ -8e7b765d72bb8e7742f5bf955f4bf64d5469f61197dad8b632304095a52322d7 diff --git a/chromium_edits/122.0.6261.156/third_party/blink/renderer/core/css/perftest_data/.031d5599c8a21118754e30dbea141be66104f556_is_first_class_gcs b/chromium_edits/122.0.6261.156/third_party/blink/renderer/core/css/perftest_data/.031d5599c8a21118754e30dbea141be66104f556_is_first_class_gcs deleted file mode 100644 index d00491fd..00000000 --- a/chromium_edits/122.0.6261.156/third_party/blink/renderer/core/css/perftest_data/.031d5599c8a21118754e30dbea141be66104f556_is_first_class_gcs +++ /dev/null @@ -1 +0,0 @@ -1 diff --git a/chromium_edits/122.0.6261.156/third_party/blink/renderer/core/css/perftest_data/.314e4e0d5e89ea9e9e9a234c617b4413adf48aa9_hash b/chromium_edits/122.0.6261.156/third_party/blink/renderer/core/css/perftest_data/.314e4e0d5e89ea9e9e9a234c617b4413adf48aa9_hash deleted file mode 100644 index 34c3ef02..00000000 --- a/chromium_edits/122.0.6261.156/third_party/blink/renderer/core/css/perftest_data/.314e4e0d5e89ea9e9e9a234c617b4413adf48aa9_hash +++ /dev/null @@ -1 +0,0 @@ -a721ada40011a286631baae6d76878f2023ff000151792228c83b1958ea8a197 diff --git a/chromium_edits/122.0.6261.156/third_party/blink/renderer/core/css/perftest_data/.314e4e0d5e89ea9e9e9a234c617b4413adf48aa9_is_first_class_gcs b/chromium_edits/122.0.6261.156/third_party/blink/renderer/core/css/perftest_data/.314e4e0d5e89ea9e9e9a234c617b4413adf48aa9_is_first_class_gcs deleted file mode 100644 index d00491fd..00000000 --- a/chromium_edits/122.0.6261.156/third_party/blink/renderer/core/css/perftest_data/.314e4e0d5e89ea9e9e9a234c617b4413adf48aa9_is_first_class_gcs +++ /dev/null @@ -1 +0,0 @@ -1 diff --git a/chromium_edits/122.0.6261.156/third_party/blink/renderer/core/css/perftest_data/.3a19b42a7c46257b716d55d6733f070c87180b1e_hash b/chromium_edits/122.0.6261.156/third_party/blink/renderer/core/css/perftest_data/.3a19b42a7c46257b716d55d6733f070c87180b1e_hash deleted file mode 100644 index 506725c9..00000000 --- a/chromium_edits/122.0.6261.156/third_party/blink/renderer/core/css/perftest_data/.3a19b42a7c46257b716d55d6733f070c87180b1e_hash +++ /dev/null @@ -1 +0,0 @@ -f203ff9e8c8a6a3b714f0a26db38cc940544a907435c62c79b21f4bd3f8bee8e diff --git a/chromium_edits/122.0.6261.156/third_party/blink/renderer/core/css/perftest_data/.3a19b42a7c46257b716d55d6733f070c87180b1e_is_first_class_gcs b/chromium_edits/122.0.6261.156/third_party/blink/renderer/core/css/perftest_data/.3a19b42a7c46257b716d55d6733f070c87180b1e_is_first_class_gcs deleted file mode 100644 index d00491fd..00000000 --- a/chromium_edits/122.0.6261.156/third_party/blink/renderer/core/css/perftest_data/.3a19b42a7c46257b716d55d6733f070c87180b1e_is_first_class_gcs +++ /dev/null @@ -1 +0,0 @@ -1 diff --git a/chromium_edits/122.0.6261.156/third_party/blink/renderer/core/css/perftest_data/.756068da5e551516b23b0ba133e55c144f623d38_hash b/chromium_edits/122.0.6261.156/third_party/blink/renderer/core/css/perftest_data/.756068da5e551516b23b0ba133e55c144f623d38_hash deleted file mode 100644 index 8b92ff46..00000000 --- a/chromium_edits/122.0.6261.156/third_party/blink/renderer/core/css/perftest_data/.756068da5e551516b23b0ba133e55c144f623d38_hash +++ /dev/null @@ -1 +0,0 @@ -84ef87a8163335a95111d9709306596f96742539da0b34fbe7397f799946a168 diff --git a/chromium_edits/122.0.6261.156/third_party/blink/renderer/core/css/perftest_data/.756068da5e551516b23b0ba133e55c144f623d38_is_first_class_gcs b/chromium_edits/122.0.6261.156/third_party/blink/renderer/core/css/perftest_data/.756068da5e551516b23b0ba133e55c144f623d38_is_first_class_gcs deleted file mode 100644 index d00491fd..00000000 --- a/chromium_edits/122.0.6261.156/third_party/blink/renderer/core/css/perftest_data/.756068da5e551516b23b0ba133e55c144f623d38_is_first_class_gcs +++ /dev/null @@ -1 +0,0 @@ -1 diff --git a/chromium_edits/122.0.6261.156/third_party/blink/renderer/core/css/perftest_data/.7fc9338af75b7d9d185c91ddf262a356def5623d_hash b/chromium_edits/122.0.6261.156/third_party/blink/renderer/core/css/perftest_data/.7fc9338af75b7d9d185c91ddf262a356def5623d_hash deleted file mode 100644 index a5a7fee4..00000000 --- a/chromium_edits/122.0.6261.156/third_party/blink/renderer/core/css/perftest_data/.7fc9338af75b7d9d185c91ddf262a356def5623d_hash +++ /dev/null @@ -1 +0,0 @@ -34e92acae8aade2a186abe79ed1f379c266f04f72f1eb54bd3a912e889bc5cc0 diff --git a/chromium_edits/122.0.6261.156/third_party/blink/renderer/core/css/perftest_data/.7fc9338af75b7d9d185c91ddf262a356def5623d_is_first_class_gcs b/chromium_edits/122.0.6261.156/third_party/blink/renderer/core/css/perftest_data/.7fc9338af75b7d9d185c91ddf262a356def5623d_is_first_class_gcs deleted file mode 100644 index d00491fd..00000000 --- a/chromium_edits/122.0.6261.156/third_party/blink/renderer/core/css/perftest_data/.7fc9338af75b7d9d185c91ddf262a356def5623d_is_first_class_gcs +++ /dev/null @@ -1 +0,0 @@ -1 diff --git a/chromium_edits/122.0.6261.156/third_party/blink/renderer/core/css/perftest_data/.8aac3db2a8c9e44babec81e539a3d60aeab4985c_hash b/chromium_edits/122.0.6261.156/third_party/blink/renderer/core/css/perftest_data/.8aac3db2a8c9e44babec81e539a3d60aeab4985c_hash deleted file mode 100644 index cb1bdf6a..00000000 --- a/chromium_edits/122.0.6261.156/third_party/blink/renderer/core/css/perftest_data/.8aac3db2a8c9e44babec81e539a3d60aeab4985c_hash +++ /dev/null @@ -1 +0,0 @@ -6aeb0036dfafaf5e905abdb0ffe515a3952ffe35a7c59afb0fc8b233b27c6ce4 diff --git a/chromium_edits/122.0.6261.156/third_party/blink/renderer/core/css/perftest_data/.8aac3db2a8c9e44babec81e539a3d60aeab4985c_is_first_class_gcs b/chromium_edits/122.0.6261.156/third_party/blink/renderer/core/css/perftest_data/.8aac3db2a8c9e44babec81e539a3d60aeab4985c_is_first_class_gcs deleted file mode 100644 index d00491fd..00000000 --- a/chromium_edits/122.0.6261.156/third_party/blink/renderer/core/css/perftest_data/.8aac3db2a8c9e44babec81e539a3d60aeab4985c_is_first_class_gcs +++ /dev/null @@ -1 +0,0 @@ -1 diff --git a/chromium_edits/122.0.6261.156/third_party/blink/renderer/core/css/perftest_data/.c2d7e9ce67522dad138c7feb0a6911b828bfb130_hash b/chromium_edits/122.0.6261.156/third_party/blink/renderer/core/css/perftest_data/.c2d7e9ce67522dad138c7feb0a6911b828bfb130_hash deleted file mode 100644 index d907f475..00000000 --- a/chromium_edits/122.0.6261.156/third_party/blink/renderer/core/css/perftest_data/.c2d7e9ce67522dad138c7feb0a6911b828bfb130_hash +++ /dev/null @@ -1 +0,0 @@ -95c6b148577b891310c024b2daa5d68faf644a37707ac0cb21501eefe8a399a3 diff --git a/chromium_edits/122.0.6261.156/third_party/blink/renderer/core/css/perftest_data/.c2d7e9ce67522dad138c7feb0a6911b828bfb130_is_first_class_gcs b/chromium_edits/122.0.6261.156/third_party/blink/renderer/core/css/perftest_data/.c2d7e9ce67522dad138c7feb0a6911b828bfb130_is_first_class_gcs deleted file mode 100644 index d00491fd..00000000 --- a/chromium_edits/122.0.6261.156/third_party/blink/renderer/core/css/perftest_data/.c2d7e9ce67522dad138c7feb0a6911b828bfb130_is_first_class_gcs +++ /dev/null @@ -1 +0,0 @@ -1 diff --git a/chromium_edits/122.0.6261.156/third_party/blink/renderer/core/css/perftest_data/.e9ce994346c62f8c9fd6d0cecb2b2b0b93b4c2d8_hash b/chromium_edits/122.0.6261.156/third_party/blink/renderer/core/css/perftest_data/.e9ce994346c62f8c9fd6d0cecb2b2b0b93b4c2d8_hash deleted file mode 100644 index 6147ae3f..00000000 --- a/chromium_edits/122.0.6261.156/third_party/blink/renderer/core/css/perftest_data/.e9ce994346c62f8c9fd6d0cecb2b2b0b93b4c2d8_hash +++ /dev/null @@ -1 +0,0 @@ -519019df16c628c6c0893df18928faeaa3150a9d8f26a787a16ce7c6b2cec2ad diff --git a/chromium_edits/122.0.6261.156/third_party/blink/renderer/core/css/perftest_data/.e9ce994346c62f8c9fd6d0cecb2b2b0b93b4c2d8_is_first_class_gcs b/chromium_edits/122.0.6261.156/third_party/blink/renderer/core/css/perftest_data/.e9ce994346c62f8c9fd6d0cecb2b2b0b93b4c2d8_is_first_class_gcs deleted file mode 100644 index d00491fd..00000000 --- a/chromium_edits/122.0.6261.156/third_party/blink/renderer/core/css/perftest_data/.e9ce994346c62f8c9fd6d0cecb2b2b0b93b4c2d8_is_first_class_gcs +++ /dev/null @@ -1 +0,0 @@ -1 diff --git a/chromium_edits/122.0.6261.156/third_party/blink/renderer/core/css/perftest_data/.fdc43ee18cbd65487249441849f58aa13484aaef_hash b/chromium_edits/122.0.6261.156/third_party/blink/renderer/core/css/perftest_data/.fdc43ee18cbd65487249441849f58aa13484aaef_hash deleted file mode 100644 index edd37d35..00000000 --- a/chromium_edits/122.0.6261.156/third_party/blink/renderer/core/css/perftest_data/.fdc43ee18cbd65487249441849f58aa13484aaef_hash +++ /dev/null @@ -1 +0,0 @@ -0e92de92f49abc9a521f7175106c80744196f8cefc0263bc0f4a6b4f724a7d10 diff --git a/chromium_edits/122.0.6261.156/third_party/blink/renderer/core/css/perftest_data/.fdc43ee18cbd65487249441849f58aa13484aaef_is_first_class_gcs b/chromium_edits/122.0.6261.156/third_party/blink/renderer/core/css/perftest_data/.fdc43ee18cbd65487249441849f58aa13484aaef_is_first_class_gcs deleted file mode 100644 index d00491fd..00000000 --- a/chromium_edits/122.0.6261.156/third_party/blink/renderer/core/css/perftest_data/.fdc43ee18cbd65487249441849f58aa13484aaef_is_first_class_gcs +++ /dev/null @@ -1 +0,0 @@ -1 diff --git a/chromium_edits/122.0.6261.156/third_party/blink/renderer/platform/weborigin/scheme_registry.cc.patch b/chromium_edits/122.0.6261.156/third_party/blink/renderer/platform/weborigin/scheme_registry.cc.patch deleted file mode 100644 index 119d72b2..00000000 --- a/chromium_edits/122.0.6261.156/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 4eadf46ea0c24..d62fc7fb14e01 100644 ---- a/third_party/blink/renderer/platform/weborigin/scheme_registry.cc -+++ b/third_party/blink/renderer/platform/weborigin/scheme_registry.cc -@@ -67,7 +67,7 @@ class URLSchemesRegistry final { - // is considered secure. Additional checks are performed to ensure that - // other http pages are filtered out. - service_worker_schemes({"http", "https"}), -- fetch_api_schemes({"http", "https"}), -+ fetch_api_schemes({"http", "https", "ipfs", "ipns"}), - allowed_in_referrer_schemes({"http", "https"}) { - for (auto& scheme : url::GetCorsEnabledSchemes()) - cors_enabled_schemes.insert(scheme.c_str()); diff --git a/chromium_edits/122.0.6261.156/third_party/opus/tests/resources/.009a3ee778767c2402b1d2c920bc2449265f5a2c_content_names b/chromium_edits/122.0.6261.156/third_party/opus/tests/resources/.009a3ee778767c2402b1d2c920bc2449265f5a2c_content_names deleted file mode 100644 index fe51488c..00000000 --- a/chromium_edits/122.0.6261.156/third_party/opus/tests/resources/.009a3ee778767c2402b1d2c920bc2449265f5a2c_content_names +++ /dev/null @@ -1 +0,0 @@ -[] diff --git a/chromium_edits/122.0.6261.156/third_party/opus/tests/resources/.009a3ee778767c2402b1d2c920bc2449265f5a2c_hash b/chromium_edits/122.0.6261.156/third_party/opus/tests/resources/.009a3ee778767c2402b1d2c920bc2449265f5a2c_hash deleted file mode 100644 index 862af88e..00000000 --- a/chromium_edits/122.0.6261.156/third_party/opus/tests/resources/.009a3ee778767c2402b1d2c920bc2449265f5a2c_hash +++ /dev/null @@ -1 +0,0 @@ -34de3161f242895a682d9cdcbbf4ad50246742b6db46873386104cfde8a24332 diff --git a/chromium_edits/122.0.6261.156/third_party/opus/tests/resources/.009a3ee778767c2402b1d2c920bc2449265f5a2c_is_first_class_gcs b/chromium_edits/122.0.6261.156/third_party/opus/tests/resources/.009a3ee778767c2402b1d2c920bc2449265f5a2c_is_first_class_gcs deleted file mode 100644 index d00491fd..00000000 --- a/chromium_edits/122.0.6261.156/third_party/opus/tests/resources/.009a3ee778767c2402b1d2c920bc2449265f5a2c_is_first_class_gcs +++ /dev/null @@ -1 +0,0 @@ -1 diff --git a/chromium_edits/122.0.6261.156/third_party/subresource-filter-ruleset/data/.e4d1c702ca1b5497a3abcdd9495a5d0758f19ffc_hash b/chromium_edits/122.0.6261.156/third_party/subresource-filter-ruleset/data/.e4d1c702ca1b5497a3abcdd9495a5d0758f19ffc_hash deleted file mode 100644 index 6265bdd0..00000000 --- a/chromium_edits/122.0.6261.156/third_party/subresource-filter-ruleset/data/.e4d1c702ca1b5497a3abcdd9495a5d0758f19ffc_hash +++ /dev/null @@ -1 +0,0 @@ -ae2fd01d2908591e0f39343a5b4a78baa8e7d6cac9d78ba79c502fe0a15ce3ee diff --git a/chromium_edits/122.0.6261.156/third_party/subresource-filter-ruleset/data/.e4d1c702ca1b5497a3abcdd9495a5d0758f19ffc_is_first_class_gcs b/chromium_edits/122.0.6261.156/third_party/subresource-filter-ruleset/data/.e4d1c702ca1b5497a3abcdd9495a5d0758f19ffc_is_first_class_gcs deleted file mode 100644 index d00491fd..00000000 --- a/chromium_edits/122.0.6261.156/third_party/subresource-filter-ruleset/data/.e4d1c702ca1b5497a3abcdd9495a5d0758f19ffc_is_first_class_gcs +++ /dev/null @@ -1 +0,0 @@ -1 diff --git a/chromium_edits/122.0.6261.156/third_party/test_fonts/.336e775eec536b2d785cc80eff6ac39051931286 b/chromium_edits/122.0.6261.156/third_party/test_fonts/.336e775eec536b2d785cc80eff6ac39051931286 deleted file mode 100644 index 8b0c4796..00000000 Binary files a/chromium_edits/122.0.6261.156/third_party/test_fonts/.336e775eec536b2d785cc80eff6ac39051931286 and /dev/null differ diff --git a/chromium_edits/122.0.6261.156/third_party/test_fonts/.336e775eec536b2d785cc80eff6ac39051931286_content_names b/chromium_edits/122.0.6261.156/third_party/test_fonts/.336e775eec536b2d785cc80eff6ac39051931286_content_names deleted file mode 100644 index fac12e50..00000000 --- a/chromium_edits/122.0.6261.156/third_party/test_fonts/.336e775eec536b2d785cc80eff6ac39051931286_content_names +++ /dev/null @@ -1 +0,0 @@ -["test_fonts", "test_fonts/.uuid", "test_fonts/Ahem.ttf", "test_fonts/Arimo-Bold.ttf", "test_fonts/Arimo-BoldItalic.ttf", "test_fonts/Arimo-Italic.ttf", "test_fonts/Arimo-Regular.ttf", "test_fonts/Cousine-Bold.ttf", "test_fonts/Cousine-BoldItalic.ttf", "test_fonts/Cousine-Italic.ttf", "test_fonts/Cousine-Regular.ttf", "test_fonts/DejaVuSans-Bold.ttf", "test_fonts/DejaVuSans.ttf", "test_fonts/GardinerModBug.ttf", "test_fonts/GardinerModCat.ttf", "test_fonts/Garuda.ttf", "test_fonts/Gelasio-Bold.ttf", "test_fonts/Gelasio-BoldItalic.ttf", "test_fonts/Gelasio-Italic.ttf", "test_fonts/Gelasio-Regular.ttf", "test_fonts/Lohit-Devanagari.ttf", "test_fonts/Lohit-Gurmukhi.ttf", "test_fonts/Lohit-Tamil.ttf", "test_fonts/MuktiNarrow.ttf", "test_fonts/NotoColorEmoji.ttf", "test_fonts/NotoSansCJK-VF.otf.ttc", "test_fonts/NotoSansKhmer-Regular.ttf", "test_fonts/NotoSansSymbols2-Regular.ttf", "test_fonts/NotoSansTibetan-Regular.ttf", "test_fonts/Tinos-Bold.ttf", "test_fonts/Tinos-BoldItalic.ttf", "test_fonts/Tinos-Italic.ttf", "test_fonts/Tinos-Regular.ttf"] diff --git a/chromium_edits/122.0.6261.156/third_party/test_fonts/.336e775eec536b2d785cc80eff6ac39051931286_hash b/chromium_edits/122.0.6261.156/third_party/test_fonts/.336e775eec536b2d785cc80eff6ac39051931286_hash deleted file mode 100644 index b2242fe3..00000000 --- a/chromium_edits/122.0.6261.156/third_party/test_fonts/.336e775eec536b2d785cc80eff6ac39051931286_hash +++ /dev/null @@ -1 +0,0 @@ -a2ca2962daf482a8f943163541e1c73ba4b2694fabcd2510981f2db4eda493c8 diff --git a/chromium_edits/122.0.6261.156/third_party/test_fonts/.336e775eec536b2d785cc80eff6ac39051931286_is_first_class_gcs b/chromium_edits/122.0.6261.156/third_party/test_fonts/.336e775eec536b2d785cc80eff6ac39051931286_is_first_class_gcs deleted file mode 100644 index d00491fd..00000000 --- a/chromium_edits/122.0.6261.156/third_party/test_fonts/.336e775eec536b2d785cc80eff6ac39051931286_is_first_class_gcs +++ /dev/null @@ -1 +0,0 @@ -1 diff --git a/chromium_edits/122.0.6261.156/third_party/tfhub_models/.0f037afd23a02321520951afd5c2c6078d26cbf1 b/chromium_edits/122.0.6261.156/third_party/tfhub_models/.0f037afd23a02321520951afd5c2c6078d26cbf1 deleted file mode 100644 index b877300c..00000000 Binary files a/chromium_edits/122.0.6261.156/third_party/tfhub_models/.0f037afd23a02321520951afd5c2c6078d26cbf1 and /dev/null differ diff --git a/chromium_edits/122.0.6261.156/third_party/tfhub_models/.0f037afd23a02321520951afd5c2c6078d26cbf1_content_names b/chromium_edits/122.0.6261.156/third_party/tfhub_models/.0f037afd23a02321520951afd5c2c6078d26cbf1_content_names deleted file mode 100644 index 4957738a..00000000 --- a/chromium_edits/122.0.6261.156/third_party/tfhub_models/.0f037afd23a02321520951afd5c2c6078d26cbf1_content_names +++ /dev/null @@ -1 +0,0 @@ -["models/lite-model_universal-sentence-encoder-qa-ondevice_1.tflite", "models/rehead_embedding_from_mobilebert.tflite"] diff --git a/chromium_edits/122.0.6261.156/third_party/tfhub_models/.0f037afd23a02321520951afd5c2c6078d26cbf1_hash b/chromium_edits/122.0.6261.156/third_party/tfhub_models/.0f037afd23a02321520951afd5c2c6078d26cbf1_hash deleted file mode 100644 index 0a74642a..00000000 --- a/chromium_edits/122.0.6261.156/third_party/tfhub_models/.0f037afd23a02321520951afd5c2c6078d26cbf1_hash +++ /dev/null @@ -1 +0,0 @@ -7130f43eb9889ff4dcd36ed2c5352053b88216e6b9186dfce08ea41b7dd142f3 diff --git a/chromium_edits/122.0.6261.156/third_party/tfhub_models/.0f037afd23a02321520951afd5c2c6078d26cbf1_is_first_class_gcs b/chromium_edits/122.0.6261.156/third_party/tfhub_models/.0f037afd23a02321520951afd5c2c6078d26cbf1_is_first_class_gcs deleted file mode 100644 index d00491fd..00000000 --- a/chromium_edits/122.0.6261.156/third_party/tfhub_models/.0f037afd23a02321520951afd5c2c6078d26cbf1_is_first_class_gcs +++ /dev/null @@ -1 +0,0 @@ -1 diff --git a/chromium_edits/122.0.6261.156/tools/perf/page_sets/maps_perf_test/.e6bf26977c2fd80c18789d1f279d474096a7b0d1_hash b/chromium_edits/122.0.6261.156/tools/perf/page_sets/maps_perf_test/.e6bf26977c2fd80c18789d1f279d474096a7b0d1_hash deleted file mode 100644 index 08be0b34..00000000 --- a/chromium_edits/122.0.6261.156/tools/perf/page_sets/maps_perf_test/.e6bf26977c2fd80c18789d1f279d474096a7b0d1_hash +++ /dev/null @@ -1 +0,0 @@ -f5f7fe360ad2b9c3d9dda2612f17336c0541bac15b4e4992f2c167e059a190fa diff --git a/chromium_edits/122.0.6261.156/tools/perf/page_sets/maps_perf_test/.e6bf26977c2fd80c18789d1f279d474096a7b0d1_is_first_class_gcs b/chromium_edits/122.0.6261.156/tools/perf/page_sets/maps_perf_test/.e6bf26977c2fd80c18789d1f279d474096a7b0d1_is_first_class_gcs deleted file mode 100644 index d00491fd..00000000 --- a/chromium_edits/122.0.6261.156/tools/perf/page_sets/maps_perf_test/.e6bf26977c2fd80c18789d1f279d474096a7b0d1_is_first_class_gcs +++ /dev/null @@ -1 +0,0 @@ -1 diff --git a/chromium_edits/122.0.6261.156/url/BUILD.gn.patch b/chromium_edits/122.0.6261.156/url/BUILD.gn.patch deleted file mode 100644 index cc358ad4..00000000 --- a/chromium_edits/122.0.6261.156/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/122.0.6261.156/url/url_canon.h.patch b/chromium_edits/122.0.6261.156/url/url_canon.h.patch deleted file mode 100644 index 7ffd3a2f..00000000 --- a/chromium_edits/122.0.6261.156/url/url_canon.h.patch +++ /dev/null @@ -1,28 +0,0 @@ -diff --git a/url/url_canon.h b/url/url_canon.h -index 8c48f9825d8cf..b9ad961e1b123 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/122.0.6261.156/url/url_canon_ipfs.cc b/chromium_edits/122.0.6261.156/url/url_canon_ipfs.cc deleted file mode 100644 index d7c9fdc7..00000000 --- a/chromium_edits/122.0.6261.156/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/122.0.6261.156/url/url_util.cc.patch b/chromium_edits/122.0.6261.156/url/url_util.cc.patch deleted file mode 100644 index ee9cb33b..00000000 --- a/chromium_edits/122.0.6261.156/url/url_util.cc.patch +++ /dev/null @@ -1,22 +0,0 @@ -diff --git a/url/url_util.cc b/url/url_util.cc -index c57c19ba2773a..7951b1e1145c9 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/123.0.6286.0/chrome/browser/BUILD.gn.patch b/chromium_edits/123.0.6286.0/chrome/browser/BUILD.gn.patch deleted file mode 100644 index 03c9b111..00000000 --- a/chromium_edits/123.0.6286.0/chrome/browser/BUILD.gn.patch +++ /dev/null @@ -1,27 +0,0 @@ -diff --git a/chrome/browser/BUILD.gn b/chrome/browser/BUILD.gn -index 8e919e76fbc57..04e1f2d1a3f4a 100644 ---- a/chrome/browser/BUILD.gn -+++ b/chrome/browser/BUILD.gn -@@ -39,6 +39,7 @@ import("//rlz/buildflags/buildflags.gni") - import("//sandbox/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") -@@ -2636,6 +2637,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/123.0.6286.0/chrome/browser/about_flags.cc.patch b/chromium_edits/123.0.6286.0/chrome/browser/about_flags.cc.patch deleted file mode 100644 index f097e6c9..00000000 --- a/chromium_edits/123.0.6286.0/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 15d1ba877ef34..a70725f832649 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" -@@ -311,6 +312,10 @@ - #include "extensions/common/switches.h" - #endif // BUILDFLAG(ENABLE_EXTENSIONS) - -+#if BUILDFLAG(ENABLE_IPFS) -+#include "components/ipfs/ipfs_features.h" -+#endif -+ - #if BUILDFLAG(ENABLE_PDF) - #include "pdf/pdf_features.h" - #endif -@@ -9574,6 +9579,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/123.0.6286.0/chrome/browser/autocomplete/chrome_autocomplete_scheme_classifier.cc.patch b/chromium_edits/123.0.6286.0/chrome/browser/autocomplete/chrome_autocomplete_scheme_classifier.cc.patch deleted file mode 100644 index 4d172311..00000000 --- a/chromium_edits/123.0.6286.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/123.0.6286.0/chrome/browser/chrome_content_browser_client.cc.patch b/chromium_edits/123.0.6286.0/chrome/browser/chrome_content_browser_client.cc.patch deleted file mode 100644 index c1289515..00000000 --- a/chromium_edits/123.0.6286.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 e1b56509414f5..42694b970f7c9 100644 ---- a/chrome/browser/chrome_content_browser_client.cc -+++ b/chrome/browser/chrome_content_browser_client.cc -@@ -374,6 +374,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" -@@ -496,6 +497,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) -@@ -1667,6 +1675,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; - } - -@@ -6027,12 +6040,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) { -@@ -6169,6 +6195,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/123.0.6286.0/chrome/browser/flag-metadata.json.patch b/chromium_edits/123.0.6286.0/chrome/browser/flag-metadata.json.patch deleted file mode 100644 index addc1d8d..00000000 --- a/chromium_edits/123.0.6286.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 3bc24147ccd42..fb9ab999872d6 100644 ---- a/chrome/browser/flag-metadata.json -+++ b/chrome/browser/flag-metadata.json -@@ -3045,6 +3045,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/123.0.6286.0/chrome/browser/flag_descriptions.cc.patch b/chromium_edits/123.0.6286.0/chrome/browser/flag_descriptions.cc.patch deleted file mode 100644 index bc2f6115..00000000 --- a/chromium_edits/123.0.6286.0/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 f60d0d7d0090b..e9954d7ac80c9 100644 ---- a/chrome/browser/flag_descriptions.cc -+++ b/chrome/browser/flag_descriptions.cc -@@ -291,6 +291,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/123.0.6286.0/chrome/browser/flag_descriptions.h.patch b/chromium_edits/123.0.6286.0/chrome/browser/flag_descriptions.h.patch deleted file mode 100644 index bb9d0ed6..00000000 --- a/chromium_edits/123.0.6286.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 d45339c113aaa..d93599e8d9e17 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 -@@ -179,6 +180,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/123.0.6286.0/chrome/browser/ipfs_extra_parts.cc b/chromium_edits/123.0.6286.0/chrome/browser/ipfs_extra_parts.cc deleted file mode 100644 index 90d2596f..00000000 --- a/chromium_edits/123.0.6286.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/123.0.6286.0/chrome/browser/ipfs_extra_parts.h b/chromium_edits/123.0.6286.0/chrome/browser/ipfs_extra_parts.h deleted file mode 100644 index 2059c437..00000000 --- a/chromium_edits/123.0.6286.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/123.0.6286.0/chrome/browser/prefs/browser_prefs.cc.patch b/chromium_edits/123.0.6286.0/chrome/browser/prefs/browser_prefs.cc.patch deleted file mode 100644 index 64a7a5bc..00000000 --- a/chromium_edits/123.0.6286.0/chrome/browser/prefs/browser_prefs.cc.patch +++ /dev/null @@ -1,36 +0,0 @@ -diff --git a/chrome/browser/prefs/browser_prefs.cc b/chrome/browser/prefs/browser_prefs.cc -index ce18ea6c63242..6ca131536e805 100644 ---- a/chrome/browser/prefs/browser_prefs.cc -+++ b/chrome/browser/prefs/browser_prefs.cc -@@ -189,6 +189,7 @@ - #include "ppapi/buildflags/buildflags.h" - #include "printing/buildflags/buildflags.h" - #include "rlz/buildflags/buildflags.h" -+#include "third_party/ipfs_client/ipfs_buildflags.h" - - #if BUILDFLAG(ENABLE_BACKGROUND_MODE) - #include "chrome/browser/background/background_mode_manager.h" -@@ -233,6 +234,11 @@ - #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 -@@ -1756,6 +1762,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/123.0.6286.0/chrome/common/chrome_content_client.cc.patch b/chromium_edits/123.0.6286.0/chrome/common/chrome_content_client.cc.patch deleted file mode 100644 index 5bd09f16..00000000 --- a/chromium_edits/123.0.6286.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 246ec9c5c911f..5d66d133a7907 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/123.0.6286.0/components/cbor/reader.cc.patch b/chromium_edits/123.0.6286.0/components/cbor/reader.cc.patch deleted file mode 100644 index 5acfd45c..00000000 --- a/chromium_edits/123.0.6286.0/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..b0cf411b350e2 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 { -@@ -157,6 +157,10 @@ 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/123.0.6286.0/components/cbor/reader.h.patch b/chromium_edits/123.0.6286.0/components/cbor/reader.h.patch deleted file mode 100644 index cd7d9eb0..00000000 --- a/chromium_edits/123.0.6286.0/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/123.0.6286.0/components/cbor/reader_unittest.cc.patch b/chromium_edits/123.0.6286.0/components/cbor/reader_unittest.cc.patch deleted file mode 100644 index 1566f783..00000000 --- a/chromium_edits/123.0.6286.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..07168e636d6bd 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/123.0.6286.0/components/cbor/values.cc.patch b/chromium_edits/123.0.6286.0/components/cbor/values.cc.patch deleted file mode 100644 index ddbab2b3..00000000 --- a/chromium_edits/123.0.6286.0/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/123.0.6286.0/components/cbor/values.h.patch b/chromium_edits/123.0.6286.0/components/cbor/values.h.patch deleted file mode 100644 index ca39df01..00000000 --- a/chromium_edits/123.0.6286.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/123.0.6286.0/components/cbor/writer.cc.patch b/chromium_edits/123.0.6286.0/components/cbor/writer.cc.patch deleted file mode 100644 index bb89c1e6..00000000 --- a/chromium_edits/123.0.6286.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/123.0.6286.0/components/cbor/writer_unittest.cc.patch b/chromium_edits/123.0.6286.0/components/cbor/writer_unittest.cc.patch deleted file mode 100644 index 240fee83..00000000 --- a/chromium_edits/123.0.6286.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/123.0.6286.0/components/open_from_clipboard/clipboard_recent_content_generic.cc.patch b/chromium_edits/123.0.6286.0/components/open_from_clipboard/clipboard_recent_content_generic.cc.patch deleted file mode 100644 index 291d84f1..00000000 --- a/chromium_edits/123.0.6286.0/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/123.0.6286.0/net/dns/dns_config_service_linux.cc.patch b/chromium_edits/123.0.6286.0/net/dns/dns_config_service_linux.cc.patch deleted file mode 100644 index 3b042d33..00000000 --- a/chromium_edits/123.0.6286.0/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/123.0.6286.0/third_party/blink/renderer/platform/weborigin/scheme_registry.cc.patch b/chromium_edits/123.0.6286.0/third_party/blink/renderer/platform/weborigin/scheme_registry.cc.patch deleted file mode 100644 index 119d72b2..00000000 --- a/chromium_edits/123.0.6286.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 4eadf46ea0c24..d62fc7fb14e01 100644 ---- a/third_party/blink/renderer/platform/weborigin/scheme_registry.cc -+++ b/third_party/blink/renderer/platform/weborigin/scheme_registry.cc -@@ -67,7 +67,7 @@ class URLSchemesRegistry final { - // is considered secure. Additional checks are performed to ensure that - // other http pages are filtered out. - service_worker_schemes({"http", "https"}), -- fetch_api_schemes({"http", "https"}), -+ fetch_api_schemes({"http", "https", "ipfs", "ipns"}), - allowed_in_referrer_schemes({"http", "https"}) { - for (auto& scheme : url::GetCorsEnabledSchemes()) - cors_enabled_schemes.insert(scheme.c_str()); diff --git a/chromium_edits/123.0.6286.0/url/BUILD.gn.patch b/chromium_edits/123.0.6286.0/url/BUILD.gn.patch deleted file mode 100644 index cc358ad4..00000000 --- a/chromium_edits/123.0.6286.0/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/123.0.6286.0/url/url_canon.h.patch b/chromium_edits/123.0.6286.0/url/url_canon.h.patch deleted file mode 100644 index 9f47d9c8..00000000 --- a/chromium_edits/123.0.6286.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/123.0.6286.0/url/url_canon_ipfs.cc b/chromium_edits/123.0.6286.0/url/url_canon_ipfs.cc deleted file mode 100644 index d7c9fdc7..00000000 --- a/chromium_edits/123.0.6286.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/123.0.6286.0/url/url_util.cc.patch b/chromium_edits/123.0.6286.0/url/url_util.cc.patch deleted file mode 100644 index caa001ee..00000000 --- a/chromium_edits/123.0.6286.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/129.0.6643.2/chrome/browser/shell_integration_mac.mm.patch b/chromium_edits/129.0.6643.2/chrome/browser/shell_integration_mac.mm.patch new file mode 100644 index 00000000..220e2546 --- /dev/null +++ b/chromium_edits/129.0.6643.2/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.6643.2/chrome/installer/linux/common/desktop.template.patch b/chromium_edits/129.0.6643.2/chrome/installer/linux/common/desktop.template.patch new file mode 100644 index 00000000..dcd9460b --- /dev/null +++ b/chromium_edits/129.0.6643.2/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/129.0.6643.2/chrome/installer/util/shell_util.cc.patch b/chromium_edits/129.0.6643.2/chrome/installer/util/shell_util.cc.patch new file mode 100644 index 00000000..07096b83 --- /dev/null +++ b/chromium_edits/129.0.6643.2/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 183bf96be3741..116c5b838c8c5 100644 +--- a/chrome/installer/util/shell_util.cc ++++ b/chrome/installer/util/shell_util.cc +@@ -1526,11 +1526,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/component/cache_requestor.cc b/component/cache_requestor.cc index 53bb4396..7f0304c8 100644 --- a/component/cache_requestor.cc +++ b/component/cache_requestor.cc @@ -138,7 +138,7 @@ void Self::OnBodyRead(Task task, int code) { task.orig_src.load_duration = std::chrono::system_clock::now() - task.start; task.orig_src.cat.cached = true; bool valid = false; - task.request->RespondSuccessfully(task.body, api_, task.orig_src, &valid); + task.request->RespondSuccessfully(task.body, api_, task.orig_src, "", &valid); if (!valid) { VLOG(2) << "Had a bad or expired cached response for " << task.key; Expire(task.key); diff --git a/component/chromium_ipfs_context.cc b/component/chromium_ipfs_context.cc index e22b105b..53bfd673 100644 --- a/component/chromium_ipfs_context.cc +++ b/component/chromium_ipfs_context.cc @@ -64,6 +64,8 @@ auto ipfs::CreateContext(InterRequestState& stat, PrefService* pref) .with(K::RSA, std::make_unique(EVP_PKEY_RSA)) .with(K::Ed25519, std::make_unique( - EVP_PKEY_ED25519)); + EVP_PKEY_ED25519)) + .with([pref](){return DnsFallbackPref(pref);}) + ; return result; } diff --git a/component/preferences.cc b/component/preferences.cc index 1628cb89..da4d9d23 100644 --- a/component/preferences.cc +++ b/component/preferences.cc @@ -11,6 +11,7 @@ namespace { std::string const kGateway{"ipfs.gateway"}; +std::string const kDnslinkFallback{"ipfs.dnslink.fallback_to_gateway"}; std::string const kDiscoveryRate{"ipfs.discovery.rate"}; std::string const kDiscoveryOfUnencrypted{"ipfs.discovery.http"}; @@ -35,7 +36,16 @@ void ipfs::RegisterPreferences(PrefRegistrySimple* service) { service->RegisterDictionaryPref(kGateway, std::move(vals)); service->RegisterIntegerPref(kDiscoveryRate, 120); service->RegisterBooleanPref(kDiscoveryOfUnencrypted, true); + service->RegisterBooleanPref(kDnslinkFallback, true); } +bool ipfs::DnsFallbackPref(PrefService const* p) { + if (!p) { + LOG(ERROR) << "No preferences available, assuming we don't fallback to DNSLink-over-gateway."; + return false; + } + return p->GetBoolean(kDnslinkFallback); +} + using Self = ipfs::ChromiumIpfsGatewayConfig; Self::ChromiumIpfsGatewayConfig(PrefService* prefs) : prefs_{prefs} { if (prefs) { diff --git a/component/preferences.h b/component/preferences.h index 596be319..791a1fcd 100644 --- a/component/preferences.h +++ b/component/preferences.h @@ -15,6 +15,7 @@ class PrefService; namespace ipfs { COMPONENT_EXPORT(IPFS) void RegisterPreferences(PrefRegistrySimple*); +bool DnsFallbackPref(PrefService const*); class ChromiumIpfsGatewayConfig final : public ipfs::ctx::GatewayConfig { raw_ptr prefs_; base::Value::Dict last_; diff --git a/library/include/ipfs_client/client.h b/library/include/ipfs_client/client.h index 27334335..1942b213 100644 --- a/library/include/ipfs_client/client.h +++ b/library/include/ipfs_client/client.h @@ -45,6 +45,7 @@ class Client : public std::enable_shared_from_this { using MimeTypeDeduction = std::function< std::string(std::string, std::string_view, std::string const&)>; using UrlUnescaping = std::function; + using DnslinkFallbackSwitch = std::function; Client(); virtual ~Client() noexcept {} @@ -66,6 +67,7 @@ class Client : public std::enable_shared_from_this { Client& with(SigningKeyType, std::unique_ptr); Client& with(MimeTypeDeduction); Client& with(UrlUnescaping); + Client& with(DnslinkFallbackSwitch); /*! * \brief Determine a mime type for a given file. @@ -93,6 +95,8 @@ class Client : public std::enable_shared_from_this { std::optional> Hash(HashType, ByteView data); + bool DnslinkFallback() const; + protected: std::unordered_map> hashers_; std::unordered_map> @@ -106,6 +110,7 @@ class Client : public std::enable_shared_from_this { UrlUnescaping unescape_; std::shared_ptr rtor_; std::unordered_map> partitions_; + DnslinkFallbackSwitch dns_fb_; }; } // namespace ipfs diff --git a/library/include/ipfs_client/gw/gateway_request.h b/library/include/ipfs_client/gw/gateway_request.h index d626ebb6..d4743df1 100644 --- a/library/include/ipfs_client/gw/gateway_request.h +++ b/library/include/ipfs_client/gw/gateway_request.h @@ -30,9 +30,10 @@ std::string_view name(GatewayRequestType); constexpr std::size_t BLOCK_RESPONSE_BUFFER_SIZE = 2 * 1024 * 1024; +// TODO this class has gotten large enough that it should probably be a base class + // with subclasses instead of switch statements on type class GatewayRequest : public std::enable_shared_from_this { public: - // TODO add BlockSource param using BytesReceivedHook = std::function; @@ -41,9 +42,17 @@ class GatewayRequest : public std::enable_shared_from_this { std::vector bytes_received_hooks; void FleshOut(ipld::BlockSource&) const; + void AddDnsLink(std::string_view target, bool& success, ipld::BlockSource src); + void AddBlock(std::string_view bytes, + bool& success, + ipld::BlockSource src, + std::shared_ptr const& api, + bool* valid); public: GatewayRequestType type = GatewayRequestType::Zombie; + + // TODO - encapsulate. It's not that these public data members are directly accessed everywhere std::string main_param; ///< CID, IPNS name, hostname std::string path; ///< For CAR requests std::shared_ptr dependent; @@ -66,6 +75,7 @@ class GatewayRequest : public std::enable_shared_from_this { bool RespondSuccessfully(std::string_view, std::shared_ptr const& api, ipld::BlockSource src, + std::string_view roots = "", bool* valid = nullptr); void Hook(BytesReceivedHook); bool PartiallyRedundant() const; diff --git a/library/src/ipfs_client/client.cc b/library/src/ipfs_client/client.cc index 6c36fe11..4940c03f 100644 --- a/library/src/ipfs_client/client.cc +++ b/library/src/ipfs_client/client.cc @@ -69,6 +69,12 @@ std::string Self::UnescapeUrlComponent(std::string_view url_comp) { } return unescape_(url_comp); } +bool Self::DnslinkFallback() const { + if (dns_fb_) { + return dns_fb_(); + } + return false; +} auto Self::partition(std::string key) -> std::shared_ptr { auto& part = partitions_[key]; @@ -167,3 +173,7 @@ Self& Self::with(std::shared_ptr p) { rtor_ = p; return *this; } +Self& Self::with(DnslinkFallbackSwitch sw) { + dns_fb_ = sw; + return *this; +} diff --git a/library/src/ipfs_client/ctx/default_gateways.cc b/library/src/ipfs_client/ctx/default_gateways.cc index b8d8dc7f..69ecc449 100644 --- a/library/src/ipfs_client/ctx/default_gateways.cc +++ b/library/src/ipfs_client/ctx/default_gateways.cc @@ -29,19 +29,19 @@ 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/", 1307}, - {"https://ipfs.io/", 1082}, - {"https://dweb.link/", 996}, - {"https://hardbin.com/", 980}, - {"https://ipfs.greyh.at/", 914}, - {"https://ipfs.joaoleitao.org/", 903}, - {"https://trustless-gateway.link/", 771}, - {"https://human.mypinata.cloud/", 332}, - {"https://delegated-ipfs.dev/", 257}, - {"https://jcsl.hopto.org/", 253}, - {"https://4everland.io/", 252}, - {"https://ipfs.runfission.com/", 67}, - {"https://gateway.pinata.cloud/", 49}, + std::pair{"http://127.0.0.1:8080/", 1039}, + {"https://ipfs.io/", 999}, + {"https://dweb.link/", 992}, + {"https://hardbin.com/", 976}, + {"https://ipfs.greyh.at/", 910}, + {"https://ipfs.joaoleitao.org/", 899}, + {"https://trustless-gateway.link/", 797}, + {"https://human.mypinata.cloud/", 461}, + {"https://delegated-ipfs.dev/", 375}, + {"https://jcsl.hopto.org/", 364}, + {"https://4everland.io/", 346}, + {"https://ipfs.runfission.com/", 315}, + {"https://gateway.pinata.cloud/", 212}, {"https://ipfs.eth.aragon.network/", 12}, {"https://data.filstorage.io/", 11}, {"https://dag.w3s.link/", 10}, diff --git a/library/src/ipfs_client/gw/dnslink_requestor.cc b/library/src/ipfs_client/gw/dnslink_requestor.cc index 1ce0e39b..9bac1289 100644 --- a/library/src/ipfs_client/gw/dnslink_requestor.cc +++ b/library/src/ipfs_client/gw/dnslink_requestor.cc @@ -42,9 +42,13 @@ auto Self::handle(ipfs::gw::RequestPtr req) -> HandleOutcome { auto res = [req, success, a, start](std::vector const& results) { *success = *success || parse_results(req, results, a, start); }; - auto don = [success, req]() { + auto don = [this,success, req]() { if (!*success) { - req->dependent->finish(ipfs::Response::HOST_NOT_FOUND_RESPONSE); + if (api_->DnslinkFallback()) { + forward(req); + } else { + req->dependent->finish(ipfs::Response::HOST_NOT_FOUND_RESPONSE); + } } }; api_->dns_txt().SendDnsTextRequest("_dnslink." + req->main_param, res, diff --git a/library/src/ipfs_client/gw/gateway_request.cc b/library/src/ipfs_client/gw/gateway_request.cc index f9f9badb..5cdb215e 100644 --- a/library/src/ipfs_client/gw/gateway_request.cc +++ b/library/src/ipfs_client/gw/gateway_request.cc @@ -72,16 +72,15 @@ std::string Self::url_suffix() const { case GatewayRequestType::Providers: return "/routing/v1/providers/" + main_param; case GatewayRequestType::DnsLink: - LOG(FATAL) << "Don't try to use HTTP(s) for DNS TXT records."; -#ifdef __clang__ -#pragma clang diagnostic ignored "-Wunreachable-code-return" -#endif - return {}; + return "/ipns/" + main_param; case GatewayRequestType::Identity: case GatewayRequestType::Zombie: return {}; } LOG(FATAL) << "Unhandled gateway request type: " << static_cast(type); + #ifdef __clang__ + #pragma clang diagnostic ignored "-Wunreachable-code-return" + #endif return {}; } std::string_view Self::accept() const { @@ -95,15 +94,7 @@ std::string_view Self::accept() const { case GatewayRequestType::Providers: return "application/json"sv; case GatewayRequestType::DnsLink: - // TODO : not sure this advice is 100% good, actually. - // If the user's system setup allows for text records to actually work, - // it would be good to respect their autonomy and try to follow the - // system's DNS setup. However, it's extremely easy to get yourself in a - // situation where Chromium _cannot_ access text records. If you're in - // that scenario, it might be better to try to use an IPFS gateway with - // DNSLink capability. - LOG(FATAL) << "Don't try to use HTTP(s) for DNS TXT records."; - return {}; + return "application/vnd.ipld.raw"sv; case GatewayRequestType::Identity: case GatewayRequestType::Zombie: return {}; @@ -114,7 +105,7 @@ std::string_view Self::accept() const { short Self::timeout_seconds() const { switch (type) { case GatewayRequestType::DnsLink: - return 8; + return 33; case GatewayRequestType::Providers: return 16; case GatewayRequestType::Block: @@ -147,9 +138,9 @@ bool Self::is_http() const { case GatewayRequestType::Car: case GatewayRequestType::Block: case GatewayRequestType::Providers: + case GatewayRequestType::DnsLink: return true; case GatewayRequestType::Identity: - case GatewayRequestType::DnsLink: case GatewayRequestType::Zombie: return false; } @@ -176,7 +167,7 @@ std::optional Self::max_response_size() const { case GatewayRequestType::Identity: return 0; case GatewayRequestType::DnsLink: - return std::nullopt; + return BLOCK_RESPONSE_BUFFER_SIZE; case GatewayRequestType::Ipns: return MAX_IPNS_PB_SERIALIZED_SIZE; case GatewayRequestType::Block: @@ -237,6 +228,7 @@ std::string Self::Key() const { bool Self::RespondSuccessfully(std::string_view bytes, std::shared_ptr const& api, ipld::BlockSource src, + std::string_view roots, bool* valid) { using namespace ipfs::ipld; bool success = false; @@ -246,22 +238,7 @@ bool Self::RespondSuccessfully(std::string_view bytes, FleshOut(src); switch (type) { case GatewayRequestType::Block: { - DCHECK(cid.has_value()); - if (!cid.has_value()) { - LOG(ERROR) << "Your CID doesn't even have a value!"; - return false; - } - DCHECK(api); - auto node = DagNode::fromBytes(api, cid.value(), bytes); - if (!node) { - return false; - } else { - node->source(src); - if (valid) { - *valid = true; - } - } - success = orchestrator_->add_node(main_param, node); + AddBlock(bytes, success, src, api, valid); } break; case GatewayRequestType::Identity: { auto node = std::make_shared(std::string{bytes}); @@ -296,17 +273,13 @@ bool Self::RespondSuccessfully(std::string_view bytes, } break; case GatewayRequestType::DnsLink: { - auto node = std::make_shared(bytes); - if (node) { - node->source(src); - } - if (orchestrator_) { - success = orchestrator_->add_node(main_param, node); + Cid c{roots}; + if (c.valid()) { + AddDnsLink("/ipfs/" + c.to_string(), success, src); + cid = c; + AddBlock(bytes, success, src, api, valid); } else { - LOG(FATAL) << "I have no orchestrator!!"; - } - if (valid) { - *valid = !node->expired(); + AddDnsLink(bytes, success, src); } } break; case GatewayRequestType::Car: { @@ -398,3 +371,39 @@ void Self::FleshOut(ipld::BlockSource& s) const { } s.cat.request_type = type; } +void Self::AddDnsLink(std::string_view target, bool& success, ipld::BlockSource src) { + auto node = std::make_shared(target); + if (node) { + node->source(src); + VLOG(2) << "Added a DNSLink node pointing to " << target; + } + if (orchestrator_) { + success = orchestrator_->add_node(main_param, node) || success; + } else { + LOG(ERROR) << "I have no orchestrator!!"; + } +} +void Self::AddBlock(std::string_view bytes, + bool& success, + ipld::BlockSource src, + std::shared_ptr const& api, + bool* valid) { + DCHECK(cid.has_value()); + if (!cid.has_value()) { + LOG(ERROR) << "Your CID doesn't even have a value!"; + success = false; + return; + } + DCHECK(api); + auto node = ipld::DagNode::fromBytes(api, cid.value(), bytes); + if (!node) { + success = false; + VLOG(1) << "Added a block with CID " << cid->to_string(); + } else { + node->source(src); + if (valid) { + *valid = true; + } + success = orchestrator_->add_node(main_param, node) || success; + } +} diff --git a/library/src/ipfs_client/gw/multi_gateway_requestor.cc b/library/src/ipfs_client/gw/multi_gateway_requestor.cc index dc8aaa12..46f1c0a3 100644 --- a/library/src/ipfs_client/gw/multi_gateway_requestor.cc +++ b/library/src/ipfs_client/gw/multi_gateway_requestor.cc @@ -142,6 +142,7 @@ void Self::HandleResponse(HttpRequestDescription const& desc, bool timed_out, std::chrono::system_clock::time_point start) { auto req_type = req->type; + VLOG(2) << "Request status " << status << " for " << desc.url; if (req->Finished() || (req->PartiallyRedundant() && req_type == GatewayRequestType::Block)) { return; @@ -149,23 +150,33 @@ void Self::HandleResponse(HttpRequestDescription const& desc, auto i = state_.find(gw); if (status == 200 || !status) { auto ct = hdrs("content-type"); + auto roots = hdrs("X-Ipfs-Roots"); std::transform(ct.begin(), ct.end(), ct.begin(), ::tolower); + ipfs::ipld::BlockSource src; + src.load_duration = src.fetched_at - start; + src.cat.gateway_url = gw; if (ct.empty()) { LOG(ERROR) << "No content-type header?"; } else if (desc.accept.size() && ct.find(desc.accept) == std::string::npos) { + if (roots.size() && req->type == GatewayRequestType::DnsLink && req->RespondSuccessfully("", api_, src, roots)) { + LOG(INFO) << "Wrong accept on a DNSLink request, but we still got the resolution."; + return; + } if (state_.end() != i) { + VLOG(1) << "Wrong accept (" << ct << ") on " << req->debug_string(); i->second.miss(req_type, *req); + req->failures.insert(gw); } else { LOG(WARNING) << "No state for " << gw << " to record hit on " << desc.url; } Next(); return; } - ipfs::ipld::BlockSource src; - src.load_duration = src.fetched_at - start; - src.cat.gateway_url = gw; - if (req->RespondSuccessfully(body, api_, src)) { + if (req->RespondSuccessfully(body, api_, src, roots)) { + if (gw.find("dag.w3s.link") < gw.size()) { + LOG(INFO) << "Success on " << desc.url; + } if (state_.end() != i) { i->second.hit(req_type, *req); } else { diff --git a/library/src/ipfs_client/gw/requestor.cc b/library/src/ipfs_client/gw/requestor.cc index 114ddd33..32b044a0 100644 --- a/library/src/ipfs_client/gw/requestor.cc +++ b/library/src/ipfs_client/gw/requestor.cc @@ -30,7 +30,7 @@ void Self::request(ReqPtr req) { return; } if (req->Finished()) { - VLOG(2) << "Dropping a finished/zombie request."; + LOG(INFO) << "Dropping a finished/zombie request " << req->debug_string(); return; } switch (handle(req)) { @@ -59,7 +59,11 @@ void Self::request(ReqPtr req) { void Self::definitive_failure(ipfs::gw::RequestPtr r) const { DCHECK(r); DCHECK(r->dependent); - r->dependent->finish(Response::PLAIN_NOT_FOUND); + if (r->type == GatewayRequestType::DnsLink) { + r->dependent->finish(Response::HOST_NOT_FOUND_RESPONSE); + } else { + r->dependent->finish(Response::PLAIN_NOT_FOUND); + } } void Self::forward(ipfs::gw::RequestPtr req) const { @@ -70,4 +74,4 @@ void Self::forward(ipfs::gw::RequestPtr req) const { Self& Self::api(std::shared_ptr a) { api_ = a; return *this; -} \ No newline at end of file +} diff --git a/library/src/ipfs_client/ipns_record_unittest.cc b/library/src/ipfs_client/ipns_record_unittest.cc index 6ff2b833..63b02938 100644 --- a/library/src/ipfs_client/ipns_record_unittest.cc +++ b/library/src/ipfs_client/ipns_record_unittest.cc @@ -10,6 +10,7 @@ #include namespace i = ipfs; +namespace il= i::log; namespace { struct Api final : public i::Client { @@ -20,8 +21,8 @@ struct Api final : public i::Client { } bool VerifyKeySignature(SigningKeyType, ByteView signature, - ByteView data, - ByteView key_bytes) const { + ByteView data, + ByteView key_bytes) const { return true; } std::string UnescapeUrlComponent(std::string_view url_comp) const { throw 1; } @@ -72,6 +73,12 @@ struct Api final : public i::Client { void AddGateway(std::string_view) {} virtual ~Api() noexcept {} }; + std::vector log_lines; + std::string all_log; + void save_log(std::string const& msg, char const*, int, il::Level) { + log_lines.push_back(msg); + all_log.append(msg).push_back(';'); + } } // namespace TEST(IpnsRecordTest, AKnownKuboRecord) { @@ -357,4 +364,68 @@ TEST(IpnsRecordTest, has_pubkey_field) { auto actual = ipfs::ValidateIpnsRecord(as_seen_in_spec, c, api); EXPECT_TRUE(actual); } +TEST(IpnsRecordTest, ValueMismatch) { + std::array xxd{ + 0x0a, 0x41, 0x2f, 0x69, 0x70, 0x66, 0x73, 0x2f, 0x62, 0x61, 0x66, 0x79, + 0x62, 0x65, 0x69, 0x62, 0x37, 0x72, 0x7a, 0x71, 0x70, 0x6b, 0x65, 0x75, + 0x69, 0x6d, 0x61, 0x64, 0x72, 0x65, 0x66, 0x73, 0x6f, 0x63, 0x64, 0x66, + 0x76, 0x79, 0x6e, 0x36, 0x32, 0x37, 0x6b, 0x33, 0x6a, 0x76, 0x61, 0x63, + 0x77, 0x75, 0x32, 0x70, 0x6d, 0x66, 0x75, 0x70, 0x6a, 0x6e, 0x79, 0x74, + 0x33, 0x67, 0x6f, 0x6e, 0x70, 0x32, 0x75, 0x12, 0x40, 0x7f, 0x0d, 0x5e, + 0x0d, 0x1b, 0xf9, 0x3f, 0x9b, 0x85, 0x98, 0xe5, 0xcf, 0xda, 0xc4, 0x34, + 0xed, 0x17, 0x7a, 0xa8, 0x61, 0xdc, 0xef, 0x7e, 0x76, 0x67, 0x06, 0x0e, + 0x1f, 0x86, 0xe7, 0x1d, 0x3b, 0x91, 0x25, 0x30, 0x37, 0xb8, 0xb9, 0xae, + 0x19, 0x41, 0xc8, 0x27, 0xe5, 0x88, 0xdb, 0x6a, 0x2d, 0x60, 0xf2, 0xca, + 0x52, 0x57, 0x2b, 0x57, 0xc4, 0x78, 0xa8, 0x78, 0xcc, 0x71, 0xe6, 0xe2, + 0x04, 0x18, 0x00, 0x22, 0x1e, 0x32, 0x30, 0x32, 0x34, 0x2d, 0x30, 0x38, + 0x2d, 0x32, 0x32, 0x54, 0x31, 0x34, 0x3a, 0x31, 0x31, 0x3a, 0x31, 0x34, + 0x2e, 0x37, 0x35, 0x35, 0x33, 0x37, 0x36, 0x39, 0x30, 0x36, 0x5a, 0x28, + 0x48, 0x30, 0x80, 0xc0, 0xe2, 0x85, 0xe3, 0x68, 0x42, 0x40, 0xec, 0x09, + 0xc1, 0x97, 0xf6, 0xb9, 0xc8, 0x39, 0x72, 0x06, 0x4f, 0x33, 0x3b, 0x1c, + 0x6c, 0x43, 0x6d, 0x35, 0x4b, 0x10, 0xd1, 0x4b, 0x77, 0x4e, 0xa2, 0xd6, + 0xe5, 0xcc, 0x6e, 0x76, 0x45, 0x1c, 0xaa, 0x74, 0xa1, 0x91, 0xb1, 0xd7, + 0xa9, 0x58, 0xbb, 0x59, 0x59, 0x33, 0x63, 0x11, 0xc5, 0xfb, 0x03, 0x9c, + 0xe5, 0x39, 0x88, 0x33, 0xd5, 0x34, 0xbf, 0x26, 0xe6, 0x90, 0x60, 0x86, + 0xf2, 0x0c, 0x4a, 0x99, 0x01, 0xa5, 0x63, 0x54, 0x54, 0x4c, 0x1b, 0x00, + 0x00, 0x03, 0x46, 0x30, 0xb8, 0xa0, 0x00, 0x65, 0x56, 0x61, 0x6c, 0x75, + 0x65, 0x58, 0x41, 0x2f, 0x69, 0x70, 0x66, 0x73, 0x2f, 0x62, 0x61, 0x66, + 0x79, 0x62, 0x65, 0x69, 0x62, 0x37, 0x72, 0x7a, 0x71, 0x70, 0x6b, 0x65, + 0x75, 0x69, 0x6d, 0x61, 0x64, 0x72, 0x65, 0x66, 0x73, 0x6f, 0x63, 0x64, + 0x66, 0x76, 0x79, 0x6e, 0x36, 0x32, 0x37, 0x6b, 0x33, 0x6a, 0x76, 0x61, + 0x63, 0x77, 0x75, 0x32, 0x70, 0x6d, 0x66, 0x75, 0x70, 0x6a, 0x6e, 0x79, + 0x74, 0x33, 0x67, 0x6f, 0x6e, 0x70, 0x32, 0x75, 0x68, 0x53, 0x65, 0x71, + 0x75, 0x65, 0x6e, 0x63, 0x65, 0x18, 0x48, 0x68, 0x56, 0x61, 0x6c, 0x69, + 0x64, 0x69, 0x74, 0x79, 0x58, 0x1e, 0x32, 0x30, 0x32, 0x34, 0x2d, 0x30, + 0x38, 0x2d, 0x32, 0x32, 0x54, 0x31, 0x34, 0x3a, 0x31, 0x31, 0x3a, 0x31, + 0x34, 0x2e, 0x37, 0x35, 0x35, 0x33, 0x37, 0x36, 0x39, 0x30, 0x36, 0x5a, + 0x6c, 0x56, 0x61, 0x6c, 0x69, 0x64, 0x69, 0x74, 0x79, 0x54, 0x79, 0x70, + 0x65, 0x00 + }; + EXPECT_EQ(xxd[8], 0x62);//b + EXPECT_EQ(xxd[9], 0x61);//a + EXPECT_EQ(xxd[10], 0x66);//f + EXPECT_EQ(xxd[11], 0x79);//y + EXPECT_EQ(xxd[12], 0x62);//b + i::Cid cid{"k51qzi5uqu5dkq4jxcqvujfm2woh4p9y6inrojofxflzdnfht168zf8ynfzuu1"}; + Api api{[](ipfs::ByteView c) { + auto v = j::from_cbor(c); + // std::cout << std::setw(2) << v << std::endl; + ipfs::IpnsCborEntry e; + e.sequence = v.at("Sequence"); + auto& bin_val = v.at("Value").get_binary(); + e.value.assign(bin_val.begin(), bin_val.end()); + return e; + }}; + auto real_validates = ipfs::ValidateIpnsRecord(i::as_bytes(xxd), cid, api); + EXPECT_TRUE(real_validates); + xxd[12]++;//cause a mismatch + il::SetLevel(il::Level::Error); + il::SetHandler(save_log); + auto modified_validates = ipfs::ValidateIpnsRecord(i::as_bytes(xxd), cid, api); + EXPECT_FALSE(modified_validates) << all_log; + il::SetHandler(il::DefaultHandler); + EXPECT_EQ(log_lines.size(),1UL) << all_log; + auto& log_line = log_lines.at(0); + EXPECT_LT(log_line.find("Mismatch on Value"),log_line.size()) << all_log; +} #endif diff --git a/library/src/ipfs_client/opinionated_context.cc b/library/src/ipfs_client/opinionated_context.cc index ce5ef86b..36e560ac 100644 --- a/library/src/ipfs_client/opinionated_context.cc +++ b/library/src/ipfs_client/opinionated_context.cc @@ -14,7 +14,9 @@ auto ipfs::start_default(boost::asio::io_context& io) .with(SKT::RSA, std::make_unique(EVP_PKEY_RSA)) .with(SKT::Ed25519, std::make_unique( - EVP_PKEY_ED25519)); + EVP_PKEY_ED25519)) + .with([](){return true;}) + ; auto rtor = gw::default_requestor({}, api); api->with(rtor); // auto orc = std::make_shared(rtor, api); diff --git a/test_data/blocks/bafybeiazci42it4ldzl37i2i5c5szmjin3mygrsqheb7tms4j3dayt36b4 b/test_data/blocks/bafybeiazci42it4ldzl37i2i5c5szmjin3mygrsqheb7tms4j3dayt36b4 new file mode 100644 index 00000000..a1eae37c Binary files /dev/null and b/test_data/blocks/bafybeiazci42it4ldzl37i2i5c5szmjin3mygrsqheb7tms4j3dayt36b4 differ