add Remove-HashAffiliationFetcher.patch and Add-more-private-google-search-engine.patch

This commit is contained in:
Carmelo Messina 2022-01-27 17:50:19 +01:00
parent c70d9a3a0e
commit 9cf0edcf4b
No known key found for this signature in database
GPG key ID: 968894BE688289FD
3 changed files with 152 additions and 0 deletions

View file

@ -177,3 +177,5 @@ Enable-Certificate-Transparency.patch
Remove-google-fonts-from-gms.patch
Disable-all-predictors-code.patch
Disable-ukm.patch
Remove-HashAffiliationFetcher.patch
Add-more-private-google-search-engine.patch

View file

@ -0,0 +1,102 @@
From: uazo <uazo@users.noreply.github.com>
Date: Thu, 27 Jan 2022 16:39:35 +0000
Subject: Add more private google search engine
---
.../autocomplete_provider_debouncer.cc | 4 +++-
components/omnibox/browser/search_provider.cc | 3 ++-
.../search_engines/prepopulated_engines.json | 21 +++++++++++++++++++
.../search_engines/search_engine_type.h | 1 +
.../template_url_prepopulate_data.cc | 1 +
5 files changed, 28 insertions(+), 2 deletions(-)
diff --git a/components/omnibox/browser/autocomplete_provider_debouncer.cc b/components/omnibox/browser/autocomplete_provider_debouncer.cc
--- a/components/omnibox/browser/autocomplete_provider_debouncer.cc
+++ b/components/omnibox/browser/autocomplete_provider_debouncer.cc
@@ -3,6 +3,7 @@
// found in the LICENSE file.
#include "autocomplete_provider_debouncer.h"
+#include "base/rand_util.h"
AutocompleteProviderDebouncer::AutocompleteProviderDebouncer(bool from_last_run,
int delay_ms)
@@ -14,7 +15,8 @@ void AutocompleteProviderDebouncer::RequestRun(
base::OnceCallback<void()> callback) {
callback_ = std::move(callback);
- base::TimeDelta delay(base::Milliseconds(delay_ms_));
+ double random_delta = (delay_ms_ * base::RandDouble());
+ base::TimeDelta delay(base::Milliseconds(delay_ms_ + random_delta));
if (from_last_run_)
delay -= base::TimeTicks::Now() - time_last_run_;
diff --git a/components/omnibox/browser/search_provider.cc b/components/omnibox/browser/search_provider.cc
--- a/components/omnibox/browser/search_provider.cc
+++ b/components/omnibox/browser/search_provider.cc
@@ -699,7 +699,8 @@ base::TimeDelta SearchProvider::GetSuggestQueryDelay() const {
int polling_delay_ms;
OmniboxFieldTrial::GetSuggestPollingStrategy(&from_last_keystroke,
&polling_delay_ms);
-
+ polling_delay_ms += (OmniboxFieldTrial::kDefaultMinimumTimeBetweenSuggestQueriesMs
+ * base::RandDouble());
base::TimeDelta delay(base::Milliseconds(polling_delay_ms));
if (from_last_keystroke)
return delay;
diff --git a/components/search_engines/prepopulated_engines.json b/components/search_engines/prepopulated_engines.json
--- a/components/search_engines/prepopulated_engines.json
+++ b/components/search_engines/prepopulated_engines.json
@@ -164,6 +164,27 @@
"id": 13
},
+ "googlesimple": {
+ "name": "Google Simple",
+ "keyword": "googlesimple",
+ "favicon_url": "https://www.google.com/favicon.ico",
+ "search_url": "{google:baseURL}search?q={searchTerms}&ie={inputEncoding}&hl=en",
+ "suggest_url": "{google:baseSuggestURL}search?client={google:suggestClient}&q={searchTerms}&hl=en",
+ "image_url": "{google:baseURL}searchbyimage/upload?hl=en",
+ "new_tab_url": "{google:baseURL}_/chrome/newtab?hl=en&ie={inputEncoding}",
+ "contextual_search_url": "{google:baseURL}_/contextualsearch?{google:contextualSearchVersion}{google:contextualSearchContextData}&hl=en",
+ "image_url_post_params": "encoded_image={google:imageThumbnail},image_url={google:imageURL},sbisrc={google:imageSearchSource},original_width={google:imageOriginalWidth},original_height={google:imageOriginalHeight}",
+ "alternate_urls": [
+ "{google:baseURL}?hl=en#q={searchTerms}",
+ "{google:baseURL}search?hl=en#q={searchTerms}",
+ "{google:baseURL}webhp?hl=en#q={searchTerms}",
+ "{google:baseURL}s?hl=en#q={searchTerms}",
+ "{google:baseURL}s?hl=en&q={searchTerms}"
+ ],
+ "type": "SEARCH_ENGINE_GOOGLE_EN",
+ "id": 14
+ },
+
"mail_ru": {
"name": "@MAIL.RU",
"keyword": "mail.ru",
diff --git a/components/search_engines/search_engine_type.h b/components/search_engines/search_engine_type.h
--- a/components/search_engines/search_engine_type.h
+++ b/components/search_engines/search_engine_type.h
@@ -76,6 +76,7 @@ enum SearchEngineType {
SEARCH_ENGINE_PRIVACYWALL = 58,
SEARCH_ENGINE_ECOSIA = 59,
SEARCH_ENGINE_GOOGLE_EN,
+ SEARCH_ENGINE_GOOGLE_SIMPLE,
SEARCH_ENGINE_MAX // Bounding value needed for UMA histogram macro.
};
diff --git a/components/search_engines/template_url_prepopulate_data.cc b/components/search_engines/template_url_prepopulate_data.cc
--- a/components/search_engines/template_url_prepopulate_data.cc
+++ b/components/search_engines/template_url_prepopulate_data.cc
@@ -1325,6 +1325,7 @@ std::vector<std::unique_ptr<TemplateURLData>> GetPrepopulationSetFromCountryID(
std::vector<std::unique_ptr<TemplateURLData>> t_urls;
for (size_t i = 0; i < num_engines; ++i)
t_urls.push_back(TemplateURLDataFromPrepopulatedEngine(*engines[i]));
+ t_urls.push_back(TemplateURLDataFromPrepopulatedEngine(googlesimple));
return t_urls;
}
--
2.20.1

View file

@ -0,0 +1,48 @@
From: uazo <uazo@users.noreply.github.com>
Date: Thu, 27 Jan 2022 16:04:42 +0000
Subject: Remove HashAffiliationFetcher
and fix crash with cct in incognito
---
.../well_known_change_password_navigation_throttle.cc | 7 ++++++-
.../browser/site_affiliation/hash_affiliation_fetcher.cc | 1 +
2 files changed, 7 insertions(+), 1 deletion(-)
diff --git a/chrome/browser/ui/passwords/well_known_change_password_navigation_throttle.cc b/chrome/browser/ui/passwords/well_known_change_password_navigation_throttle.cc
--- a/chrome/browser/ui/passwords/well_known_change_password_navigation_throttle.cc
+++ b/chrome/browser/ui/passwords/well_known_change_password_navigation_throttle.cc
@@ -112,7 +112,7 @@ WellKnownChangePasswordNavigationThrottle::
affiliation_service_ =
AffiliationServiceFactory::GetForProfile(Profile::FromBrowserContext(
handle->GetWebContents()->GetBrowserContext()));
- if (affiliation_service_->GetChangePasswordURL(request_url_).is_empty()) {
+ if (affiliation_service_ && affiliation_service_->GetChangePasswordURL(request_url_).is_empty()) {
well_known_change_password_state_.PrefetchChangePasswordURLs(
affiliation_service_, {request_url_});
}
@@ -183,6 +183,11 @@ void WellKnownChangePasswordNavigationThrottle::OnProcessingFinished(
Resume();
return;
}
+ if (!affiliation_service_) {
+ Redirect(request_url_.DeprecatedGetOriginAsURL());
+ CancelDeferredNavigation(NavigationThrottle::CANCEL);
+ return;
+ };
GURL redirect_url = affiliation_service_->GetChangePasswordURL(request_url_);
if (redirect_url.is_valid()) {
diff --git a/components/password_manager/core/browser/site_affiliation/hash_affiliation_fetcher.cc b/components/password_manager/core/browser/site_affiliation/hash_affiliation_fetcher.cc
--- a/components/password_manager/core/browser/site_affiliation/hash_affiliation_fetcher.cc
+++ b/components/password_manager/core/browser/site_affiliation/hash_affiliation_fetcher.cc
@@ -55,6 +55,7 @@ void HashAffiliationFetcher::StartRequest(
const std::vector<FacetURI>& facet_uris,
RequestInfo request_info) {
requested_facet_uris_ = facet_uris;
+ if ((true)) return;
net::NetworkTrafficAnnotationTag traffic_annotation =
net::DefineNetworkTrafficAnnotation("affiliation_lookup_by_hash", R"(
--
2.20.1