2
0
mirror of https://codeberg.org/kiss-community/repo synced 2024-07-04 23:12:28 +00:00

chromium: Cherrypick patches from ungoogled-chromium and friends.

This commit is contained in:
Dylan Araps 2019-07-30 17:29:13 +03:00
parent 79762dce7a
commit c81b17388b
37 changed files with 3575 additions and 3 deletions

View File

@ -1,5 +1,48 @@
#!/bin/sh -e
pkg_dir=$1
set -- \
blink_symbol_level=0 \
clang_use_chrome_plugins=false \
closure_compile=false \
custom_toolchain=\"//build/toolchain/linux/unbundle:default\" \
enable_mds=false \
enable_nacl=false \
enable_nacl_nonsfi=false \
enable_reading_list=false \
enable_remoting=false \
enable_reporting=false \
enable_service_discovery=false \
enable_swiftshader=false \
fatal_linker_warnings=false \
host_toolchain=\"//build/toolchain/linux/unbundle:default\" \
is_clang=false \
is_debug=false \
linux_use_bundled_binutils=false \
rtc_use_x11=true \
safe_browsing_mode=0 \
symbol_level=0 \
treat_warnings_as_errors=false \
use_allocator=\"none\" \
use_allocator_shim=false \
use_atk=false \
use_cups=false \
use_custom_libcxx=false \
use_dbus=false \
use_gio=false \
use_gnome_keyring=false \
use_gold=false \
use_jumbo_build=true \
jumbo_file_merge_limit=8 \
use_kerberos=false \
use_lld=false \
use_pulseaudio=false \
use_sysroot=false \
use_system_harfbuzz=true \
use_official_google_api_keys=false \
use_unofficial_version_number=false
for patch in *.patch; do
patch -p1 < "$patch"
done
@ -40,8 +83,7 @@ done
python2 build/linux/unbundle/replace_gn_files.py \
--system-libraries ffmpeg fontconfig harfbuzz-ng libdrm libevent libjpeg libpng libwebp libxml libxslt opus re2 snappy yasm
python2 tools/gn/bootstrap/bootstrap.py -s -v \
--gn-gen-args 'is_debug=false use_jumbo_build=true enable_nacl=false symbol_level=0 blink_symbol_level=0 enable_nacl_nonsfi=false use_gold=false treat_warnings_as_errors=false fatal_linker_warnings=false use_sysroot=false use_cups=false rtc_use_x11=true is_clang=false use_atk=false use_dbus=false safe_browsing_mode=0 use_pulseaudio=false use_gio=false use_gnome_keyring=false use_kerberos=false use_allocator="none" use_allocator_shim=false use_system_harfbuzz=true clang_use_chrome_plugins=false custom_toolchain="//build/toolchain/linux/unbundle:default" host_toolchain="//build/toolchain/linux/unbundle:default" linux_use_bundled_binutils=false use_custom_libcxx=false use_lld=false closure_compile=false'
python2 tools/gn/bootstrap/bootstrap.py -s -v --gn-gen-args "$*"
out/Release/gn gen out/Release \
--script-executable=/usr/bin/python2
@ -51,5 +93,9 @@ ninja -C out/Release chrome chromedriver
cd out/Release
for bin in chrome chromedriver *.bin; do
install -Dm755 "$bin" "$1/usr/lib/chromium/$bin"
install -Dm755 "$bin" "$pkg_dir/usr/lib/chromium/$bin"
done
mkdir -p "$pkg_dir/usr/bin"
ln -s /usr/lib/chromium/chrome "$pkg_dir/usr/bin/chrome"
ln -s /usr/lib/chromium/chromedriver "$pkg_dir/usr/bin/chromedriver"

View File

@ -1,4 +1,17 @@
510e6ca7ccc218b401b375c13656f6aecab196b03142026dc3602b9d1804a5ac chromium-75.0.3770.142.tar.xz
bc2a44c2f3574f5997e54e4088e1644bcffaa6f541cd729a32bf94ea05dd10bb 0003-disable-autofill-download-manager.patch
4a27dea88e61e1ba607cc9868ecba60882759ea608299c42ce59b821f0e17d8a 0004-disable-google-url-tracker.patch
1dc7e3f22cd81ca85ea9f3240cc6adb90f111477c9cc05efcfe4943a2dcf9f6e 0005-disable-default-extensions.patch
a15de5b30ad7d77358116faf1e40a82dec2f43da25f51a44e8e265b161ab8da0 0006-modify-default-prefs.patch
22cc3b5e1032a170c958213f546a1dc48fd9433823767b0159d40f930a0b3029 0007-disable-web-resource-service.patch
a7728ea22805f69ce9a16a35ae067fe570825e8154bdb66b18bb072289c5589e 0008-restore-classic-ntp.patch
e7d182028feb9d6790e7a849671c4c79a833909fdb2c48f3b11272ea53c127cc 0009-disable-google-ipv6-probes.patch
3f40d4f1a0f7a03945c80e6ffd417ca93e4f7f22ee09faaa71a058e6e246786f 0010-disable-gcm-status-check.patch
52dc08f76953323413eefded936b7fa3e3bc69ba75e2a74b80455d3da5e708a8 0014-disable-translation-lang-fetch.patch
b5e0f354ebf44075899d3161f808e2e070194377c7f801935e49200ca4bae9c0 0015-disable-update-pings.patch
ed7c8ebaa0ee44d4775c0bfb097a22340e30d2d78546f223fbc8e8da4e457686 0019-disable-battery-status-service.patch
80e6512b928082a0b59465e1dcbab5e6284b545933f42d262194b1a86811a243 0021-disable-rlz.patch
45e970e285ceb599c15aa7184f6f86061abd4de6c58a985678bfb6cc68464c77 android.patch
ece2d462169429541a7fa1cc7f3f72698e883292500dde6f1c64ce165dd6abd9 chromium-75-fix-gn-gen.patch
b386cb54d0229c640cc44012a9dbb0b822c979810a62be92dc44e1a3c8a457d3 chromium-75-gcc-angle-fix.patch
1830b37534e2adf7fd22569c1bbe10eb29bcf85bd9437dc5039c91e7097dc627 chromium-75-llvm8.patch
@ -12,6 +25,22 @@ daa26bab3a3a9f8b8539dffefa7a07f6d7ac07476d7ae762e3f0169985e429ff chromium-fix-c
6592a17ac557d4cdd5dbb9cd2445c95c1668f17d8c95a7f5ebf42ebbde35430e chromium-optional-dbus-r5.patch
f0e59aee57bffc87ab8d51f1f893ec8ed561769328352a9124f717e886b8054f chromium-url-formatter.patch
8c6ecc26aab9f4acc911350d9bb1e40f32cad144b6a08c9d7b188e9598d0f2de chromium-widevine-r4.patch
85f819beee54b6a87d63d59dd0094885dccf0b7cbed7efe6b90b9f6b5cbb78e9 device-notifications.patch
2907556a180098f02e945ee4f8dce1f0ff6f84362328700a4a23fb195b324266 disable-crash-reporter.patch
13ee937555d20af557a18029a7cfde0f387c542f2bfe75bdb9b9b85187cec9ee disable-domain-reliability.patch
a1422d23da46e2dc39974dbe25787e5040e0dd1104806a796d5776af80cf0bb4 disable-download-quarantine.patch
cba503f5d3d776c951c5ee20eaa0a17d48fb5981823dd8118f9d48e61b42d411 disable-fetching-field-trials.patch
3ab3ef00886f89da2802b16ad8cebde881b26dbcbb0f1b1b6563dcede0a627d3 disable-fonts-googleapis-references.patch
39ea6f6e39f91249f5a89324f083863b934171eeb67667e26a2863e91af2b578 disable-gaia.patch
64d6c33f565c6fc1702fcc97af56ecbc3564fa8b5591d73f554ec48d97fc73fd disable-gcm.patch
ef924778ebfc2462b8b12f49e32dff00adc2883af344c3895e5026b11d36c4f1 disable-google-host-detection.patch
ce6a00f2c31dfc6b06154ca9db9ccda5b42bc9965f861d9978bc202ee2549c01 disable-mei-preload.patch
599ba1f2bb26b6afd81fc207181dfd95368ad10992b40a6752999fe12f7ea837 disable-network-time-tracker.patch
a4d5cc75a9979d13a368d22c8281c80a2c025629b6145ee0aacafef56da4c5d9 disable-webrtc-log-uploader.patch
d0059ab268e3d2030f9e2d2b36b16f3e68bdb3353a98b07f974d3c353fa7238f fix-building-without-mdns-and-service-discovery.patch
5b698ada72c4afe56271d6397c49367ec8614c664fd294cc7d43705eb4306ac6 fix-building-without-safebrowsing.patch
760a9fd65492138fa9ccf57aa5579f8f66d0e593582ac930dcc0cbe54076b166 fuzzers.patch
9248bae6df77f701afc9ecd36a6e2901649a4a5edf106475e4f26f623cd31892 google-api-warning.patch
6d921355eaef7101a0713e0e7a88b7a7c4e8aa28391325399fdd0a59f2358d13 musl-cdefs-r2.patch
fec5590225bf3d0238ee45f8f67fcb032946abe351383653c3026ce4e706d48f musl-dlopen.patch
f1375a3acd205ee46dd5d7c729e09d19982833f71e5eb1fb9c3ec5d3de5ffe90 musl-dns-r2.patch
@ -33,3 +62,8 @@ ebde3be74f0db9486cf99cd7faafb29f1472f432046b8801c494cff5713c8d94 musl-sandbox-r
a4b0374c536128483cdaeb706f2b1a7144168ae6e44d9ca2df7445d1be780afc musl-ucontext-r1.patch
72d806af57a729d36b1eb482419245fba4c58d035fc20e58dbbcf88c35d50e97 musl-v8-monotonic-pthread-cont_timedwait.patch
e191334207865e43b831492913d58cae4c89449d32b362b9f9aa7e1d196837a9 musl-wordsize-r1.patch
b07a4903f150da643320012880622b6d52c0ccf1e85d3425240188277ee546ef perfetto.patch
77ece26615320e5ffbda4ba2dcfc3a184cba923a1be19fc031fa5edb56e59632 safe_browsing-disable-incident-reporting.patch
5f8d6876420bd9a5c208d432a82a4faa78f43d24fe5b425a8f6a0a475bc4e8dd safe_browsing-disable-reporting-of-safebrowsing-over.patch
3f55f3ed81f4d967b8eb45655ddbdd3a59da3d69dbf1999a9335b199c84d1c9d unrar.patch
815a2a41003747bb6b44df192af4650e9ea0fe2dc87bb689a9bbb6e7a2c3eddd welcome-page.patch

View File

@ -0,0 +1,73 @@
--- a/components/autofill/core/browser/autofill_download_manager.cc
+++ b/components/autofill/core/browser/autofill_download_manager.cc
@@ -703,70 +703,6 @@ AutofillDownloadManager::GetRequestURLAn
}
bool AutofillDownloadManager::StartRequest(FormRequestData request_data) {
- scoped_refptr<network::SharedURLLoaderFactory> url_loader_factory =
- driver_->GetURLLoaderFactory();
- DCHECK(url_loader_factory);
-
- // Get the URL and method to use for this request.
- std::string method;
- GURL request_url;
- std::tie(request_url, method) =
- UseApi() ? GetRequestURLAndMethodForApi(request_data)
- : GetRequestURLAndMethod(request_data);
-
- auto resource_request = std::make_unique<network::ResourceRequest>();
- resource_request->url = request_url;
- resource_request->load_flags =
- net::LOAD_DO_NOT_SEND_COOKIES | net::LOAD_DO_NOT_SAVE_COOKIES;
- resource_request->method = method;
-
- // Add Chrome experiment state to the request headers.
- variations::AppendVariationsHeaderUnknownSignedIn(
- request_url,
- driver_->IsIncognito() ? variations::InIncognito::kYes
- : variations::InIncognito::kNo,
- resource_request.get());
-
- // Set headers specific to the API if using it.
- if (UseApi())
- // Encode response serialized proto in base64 for safety.
- resource_request->headers.SetHeader(kGoogEncodeResponseIfExecutable,
- "base64");
-
- // Put API key in request's header if a key exists, and the endpoint is
- // trusted by Google.
- if (!api_key_.empty() && request_url.SchemeIs(url::kHttpsScheme) &&
- google_util::IsGoogleAssociatedDomainUrl(request_url)) {
- resource_request->headers.SetHeader(kGoogApiKey, api_key_);
- }
-
- auto simple_loader = network::SimpleURLLoader::Create(
- std::move(resource_request),
- GetNetworkTrafficAnnotation(request_data.request_type));
-
- // This allows reading the error message within the API response when status
- // is not 200 (e.g., 400). Otherwise, URL loader will not give any content in
- // the response when there is a failure, which makes debugging hard.
- simple_loader->SetAllowHttpErrorResults(true);
-
- if (method == "POST") {
- const std::string content_type =
- UseApi() ? "application/x-protobuf" : "text/proto";
- // Attach payload data and add data format header.
- simple_loader->AttachStringForUpload(request_data.payload, content_type);
- }
-
- // Transfer ownership of the loader into url_loaders_. Temporarily hang
- // onto the raw pointer to use it as a key and to kick off the request;
- // transferring ownership (std::move) invalidates the |simple_loader|
- // variable.
- auto* raw_simple_loader = simple_loader.get();
- url_loaders_.push_back(std::move(simple_loader));
- raw_simple_loader->DownloadToStringOfUnboundedSizeUntilCrashAndDie(
- url_loader_factory.get(),
- base::BindOnce(&AutofillDownloadManager::OnSimpleLoaderComplete,
- base::Unretained(this), std::move(--url_loaders_.end()),
- std::move(request_data), base::TimeTicks::Now()));
return true;
}

View File

@ -0,0 +1,98 @@
--- a/components/google/core/browser/google_url_tracker.cc
+++ b/components/google/core/browser/google_url_tracker.cc
@@ -25,9 +25,9 @@
#include "services/network/public/cpp/simple_url_loader.h"
const char GoogleURLTracker::kDefaultGoogleHomepage[] =
- "https://www.google.com/";
+ "";
const char GoogleURLTracker::kSearchDomainCheckURL[] =
- "https://www.google.com/searchdomaincheck?format=domain&type=chrome";
+ "";
const base::Feature GoogleURLTracker::kNoSearchDomainCheck{
"NoSearchDomainCheck", base::FEATURE_DISABLED_BY_DEFAULT};
@@ -148,83 +148,4 @@ void GoogleURLTracker::FinishSleep() {
}
void GoogleURLTracker::StartLoadIfDesirable() {
- // Bail if a load isn't appropriate right now. This function will be called
- // again each time one of the preconditions changes, so we'll load
- // immediately once all of them are met.
- //
- // See comments in header on the class, on RequestServerCheck(), and on the
- // various members here for more detail on exactly what the conditions are.
- if (in_startup_sleep_ || already_loaded_ || !need_to_load_)
- return;
-
- // Some switches should disable the Google URL tracker entirely. If we can't
- // do background networking, we can't do the necessary load, and if the user
- // specified a Google base URL manually, we shouldn't bother to look up any
- // alternatives or offer to switch to them.
- if (!client_->IsBackgroundNetworkingEnabled() ||
- base::CommandLine::ForCurrentProcess()->HasSwitch(
- switches::kGoogleBaseURL))
- return;
-
- already_loaded_ = true;
- net::NetworkTrafficAnnotationTag traffic_annotation =
- net::DefineNetworkTrafficAnnotation("google_url_tracker", R"(
- semantics {
- sender: "Google URL Tracker"
- description:
- "When the user's default search engine is Google, or Google "
- "services are used to resolve navigation errors, the browser needs "
- "to know the ideal origin for requests to Google services. In "
- "these cases the browser makes a request to a global Google "
- "service that returns this origin, potentially taking into account "
- "the user's cookies or IP address."
- trigger: "Browser startup or network change."
- data: "None."
- destination: GOOGLE_OWNED_SERVICE
- }
- policy {
- cookies_allowed: YES
- cookies_store: "user"
- setting:
- "To disable this check, users can change the default search engine "
- "to something other than Google, and disable 'Use a web service to "
- "help resolve navigation errors' in Chromium's settings under "
- "Privacy.\nAlternately, running Chromium with "
- "--google-base-url=\"https://www.google.com/\" will disable this, "
- "and force Chromium to use the specified URL for Google service "
- "requests.\nFinally, running Chromium with "
- "--disable-background-networking will disable this, as well as "
- "various other features that make network requests automatically."
- policy_exception_justification:
- "Setting DefaultSearchProviderEnabled Chrome settings policy to "
- "false suffices as a way of setting the default search engine to "
- "not be Google. But there is no policy that controls navigation "
- "error resolution."
- })");
- auto resource_request = std::make_unique<network::ResourceRequest>();
- resource_request->url = GURL(kSearchDomainCheckURL);
- // We don't want this load to set new entries in the cache or cookies, lest
- // we alarm the user.
- resource_request->load_flags =
- (net::LOAD_DISABLE_CACHE | net::LOAD_DO_NOT_SAVE_COOKIES);
- simple_loader_ = network::SimpleURLLoader::Create(std::move(resource_request),
- traffic_annotation);
- // Configure to retry at most kMaxRetries times for 5xx errors and network
- // changes.
- // A network change can propagate through Chrome in various stages, so it's
- // possible for this code to be reached via OnNetworkChanged(), and then have
- // the load we kick off be canceled due to e.g. the DNS server changing at a
- // later time. In general it's not possible to ensure that by the time we
- // reach here any requests we start won't be canceled in this fashion, so
- // retrying is the best we can do.
- static const int kMaxRetries = 5;
- simple_loader_->SetRetryOptions(
- kMaxRetries,
- network::SimpleURLLoader::RetryMode::RETRY_ON_5XX |
- network::SimpleURLLoader::RetryMode::RETRY_ON_NETWORK_CHANGE);
- simple_loader_->DownloadToString(
- client_->GetURLLoaderFactory(),
- base::BindOnce(&GoogleURLTracker::OnURLLoaderComplete,
- base::Unretained(this)),
- 2 * 1024 /* max_body_size */);
}

View File

@ -0,0 +1,121 @@
--- a/chrome/browser/extensions/component_loader.cc
+++ b/chrome/browser/extensions/component_loader.cc
@@ -345,11 +345,6 @@ void ComponentLoader::AddWebStoreApp() {
if (!IsNormalSession())
return;
#endif
-
- AddWithNameAndDescription(
- IDR_WEBSTORE_MANIFEST, base::FilePath(FILE_PATH_LITERAL("web_store")),
- l10n_util::GetStringUTF8(IDS_WEBSTORE_NAME_STORE),
- l10n_util::GetStringUTF8(IDS_WEBSTORE_APP_DESCRIPTION));
}
#if defined(OS_CHROMEOS)
@@ -447,11 +442,6 @@ void ComponentLoader::AddDefaultComponen
AddKeyboardApp();
#else // defined(OS_CHROMEOS)
DCHECK(!skip_session_components);
-#if BUILDFLAG(ENABLE_PRINTING)
- // Cloud Print component app. Not required on Chrome OS.
- Add(IDR_CLOUDPRINT_MANIFEST,
- base::FilePath(FILE_PATH_LITERAL("cloud_print")));
-#endif // BUILDFLAG(ENABLE_PRINTING)
#endif // defined(OS_CHROMEOS)
if (!skip_session_components) {
@@ -536,12 +526,6 @@ void ComponentLoader::AddDefaultComponen
#if BUILDFLAG(ENABLE_HANGOUT_SERVICES_EXTENSION)
AddHangoutServicesExtension();
#endif // BUILDFLAG(ENABLE_HANGOUT_SERVICES_EXTENSION)
- bool install_feedback = enable_background_extensions_during_testing;
-#if defined(GOOGLE_CHROME_BUILD)
- install_feedback = true;
-#endif // defined(GOOGLE_CHROME_BUILD)
- if (install_feedback)
- Add(IDR_FEEDBACK_MANIFEST, base::FilePath(FILE_PATH_LITERAL("feedback")));
}
#if defined(OS_CHROMEOS)
--- a/chrome/browser/extensions/external_component_loader.cc
+++ b/chrome/browser/extensions/external_component_loader.cc
@@ -29,9 +29,6 @@ ExternalComponentLoader::~ExternalCompon
void ExternalComponentLoader::StartLoading() {
auto prefs = std::make_unique<base::DictionaryValue>();
-#if defined(GOOGLE_CHROME_BUILD)
- AddExternalExtension(extension_misc::kInAppPaymentsSupportAppId, prefs.get());
-#endif // defined(GOOGLE_CHROME_BUILD)
#if defined(OS_CHROMEOS)
{
--- a/chrome/browser/extensions/webstore_installer.cc
+++ b/chrome/browser/extensions/webstore_installer.cc
@@ -568,28 +568,6 @@ void WebstoreInstaller::DownloadNextPend
void WebstoreInstaller::DownloadCrx(
const std::string& extension_id,
InstallSource source) {
- download_url_ = GetWebstoreInstallURL(extension_id, source);
- MaybeAppendAuthUserParameter(approval_->authuser, &download_url_);
-
- base::FilePath user_data_dir;
- base::PathService::Get(chrome::DIR_USER_DATA, &user_data_dir);
- base::FilePath download_path = user_data_dir.Append(kWebstoreDownloadFolder);
-
- base::FilePath download_directory(g_download_directory_for_tests ?
- *g_download_directory_for_tests : download_path);
-
-#if defined(OS_CHROMEOS)
- // Do not use drive for extension downloads.
- if (drive::util::IsUnderDriveMountPoint(download_directory)) {
- download_directory = DownloadPrefs::FromBrowserContext(
- profile_)->GetDefaultDownloadDirectoryForProfile();
- }
-#endif
-
- base::PostTaskAndReplyWithResult(
- GetExtensionFileTaskRunner().get(), FROM_HERE,
- base::BindOnce(&GetDownloadFilePath, download_directory, extension_id),
- base::BindOnce(&WebstoreInstaller::StartDownload, this, extension_id));
}
// http://crbug.com/165634
@@ -735,28 +713,6 @@ void WebstoreInstaller::UpdateDownloadPr
}
void WebstoreInstaller::StartCrxInstaller(const DownloadItem& download) {
- DCHECK_CURRENTLY_ON(BrowserThread::UI);
- DCHECK(!crx_installer_.get());
-
- // The clock may be backward, e.g. daylight savings time just happenned.
- if (download.GetEndTime() >= download.GetStartTime()) {
- UMA_HISTOGRAM_TIMES("Extensions.WebstoreDownload.FileDownload",
- download.GetEndTime() - download.GetStartTime());
- }
- ExtensionService* service = ExtensionSystem::Get(profile_)->
- extension_service();
- CHECK(service);
-
- const Approval* approval = GetAssociatedApproval(download);
- DCHECK(approval);
-
- crx_installer_ = download_crx_util::CreateCrxInstaller(profile_, download);
-
- crx_installer_->set_expected_id(approval->extension_id);
- crx_installer_->set_is_gallery_install(true);
- crx_installer_->set_allow_silent_install(true);
-
- crx_installer_->InstallCrx(download.GetFullPath());
}
void WebstoreInstaller::ReportFailure(const std::string& error,
--- a/chrome/browser/extensions/component_extensions_whitelist/whitelist.cc
+++ b/chrome/browser/extensions/component_extensions_whitelist/whitelist.cc
@@ -25,7 +25,6 @@ namespace extensions {
bool IsComponentExtensionWhitelisted(const std::string& extension_id) {
const char* const kAllowed[] = {
- extension_misc::kInAppPaymentsSupportAppId,
extension_misc::kMediaRouterStableExtensionId,
extension_misc::kPdfExtensionId,
#if defined(OS_CHROMEOS)

View File

@ -0,0 +1,248 @@
--- a/chrome/browser/chrome_content_browser_client.cc
+++ b/chrome/browser/chrome_content_browser_client.cc
@@ -1125,7 +1125,7 @@ void ChromeContentBrowserClient::Registe
void ChromeContentBrowserClient::RegisterProfilePrefs(
user_prefs::PrefRegistrySyncable* registry) {
registry->RegisterBooleanPref(prefs::kDisable3DAPIs, false);
- registry->RegisterBooleanPref(prefs::kEnableHyperlinkAuditing, true);
+ registry->RegisterBooleanPref(prefs::kEnableHyperlinkAuditing, false);
registry->RegisterListPref(prefs::kEnableDeprecatedWebPlatformFeatures);
// Register user prefs for mapping SitePerProcess and IsolateOrigins in
// user policy in addition to the same named ones in Local State (which are
--- a/chrome/browser/ui/browser_ui_prefs.cc
+++ b/chrome/browser/ui/browser_ui_prefs.cc
@@ -66,11 +66,11 @@ void RegisterBrowserUserPrefs(user_prefs
registry->RegisterBooleanPref(prefs::kWebAppCreateInAppsMenu, true);
registry->RegisterBooleanPref(prefs::kWebAppCreateInQuickLaunchBar, true);
registry->RegisterBooleanPref(
- prefs::kOfferTranslateEnabled, true,
+ prefs::kOfferTranslateEnabled, false,
user_prefs::PrefRegistrySyncable::SYNCABLE_PREF);
registry->RegisterStringPref(prefs::kCloudPrintEmail, std::string());
registry->RegisterBooleanPref(prefs::kCloudPrintProxyEnabled, true);
- registry->RegisterBooleanPref(prefs::kCloudPrintSubmitEnabled, true);
+ registry->RegisterBooleanPref(prefs::kCloudPrintSubmitEnabled, false);
registry->RegisterDictionaryPref(prefs::kBrowserWindowPlacement);
registry->RegisterDictionaryPref(prefs::kBrowserWindowPlacementPopup);
registry->RegisterDictionaryPref(prefs::kAppWindowPlacement);
--- a/chrome/browser/net/prediction_options.cc
+++ b/chrome/browser/net/prediction_options.cc
@@ -32,7 +32,7 @@ NetworkPredictionStatus CanPrefetchAndPr
}
return NetworkPredictionStatus::DISABLED_DUE_TO_NETWORK;
default:
- DCHECK_EQ(NETWORK_PREDICTION_NEVER, network_prediction_options);
+ //DCHECK_EQ(NETWORK_PREDICTION_NEVER, network_prediction_options);
return NetworkPredictionStatus::DISABLED_ALWAYS;
}
}
--- a/chrome/browser/net/prediction_options.h
+++ b/chrome/browser/net/prediction_options.h
@@ -23,7 +23,7 @@ enum NetworkPredictionOptions {
NETWORK_PREDICTION_ALWAYS,
NETWORK_PREDICTION_WIFI_ONLY,
NETWORK_PREDICTION_NEVER,
- NETWORK_PREDICTION_DEFAULT = NETWORK_PREDICTION_WIFI_ONLY,
+ NETWORK_PREDICTION_DEFAULT = NETWORK_PREDICTION_NEVER,
};
enum class NetworkPredictionStatus {
--- a/chrome/browser/background/background_mode_manager.cc
+++ b/chrome/browser/background/background_mode_manager.cc
@@ -352,7 +352,7 @@ void BackgroundModeManager::RegisterPref
registry->RegisterBooleanPref(prefs::kChromeCreatedLoginItem, false);
registry->RegisterBooleanPref(prefs::kMigratedLoginItemPref, false);
#endif
- registry->RegisterBooleanPref(prefs::kBackgroundModeEnabled, true);
+ registry->RegisterBooleanPref(prefs::kBackgroundModeEnabled, false);
}
void BackgroundModeManager::RegisterProfile(Profile* profile) {
--- a/components/content_settings/core/browser/cookie_settings.cc
+++ b/components/content_settings/core/browser/cookie_settings.cc
@@ -50,7 +50,7 @@ void CookieSettings::GetCookieSettings(
void CookieSettings::RegisterProfilePrefs(
user_prefs::PrefRegistrySyncable* registry) {
registry->RegisterBooleanPref(
- prefs::kBlockThirdPartyCookies, false,
+ prefs::kBlockThirdPartyCookies, true,
user_prefs::PrefRegistrySyncable::SYNCABLE_PREF);
}
--- a/chrome/browser/ui/navigation_correction_tab_observer.cc
+++ b/chrome/browser/ui/navigation_correction_tab_observer.cc
@@ -55,7 +55,7 @@ NavigationCorrectionTabObserver::~Naviga
// static
void NavigationCorrectionTabObserver::RegisterProfilePrefs(
user_prefs::PrefRegistrySyncable* prefs) {
- prefs->RegisterBooleanPref(prefs::kAlternateErrorPagesEnabled, true,
+ prefs->RegisterBooleanPref(prefs::kAlternateErrorPagesEnabled, false,
user_prefs::PrefRegistrySyncable::SYNCABLE_PREF);
}
--- a/components/autofill/core/common/autofill_prefs.cc
+++ b/components/autofill/core/common/autofill_prefs.cc
@@ -130,10 +130,10 @@ const char kAutocompleteLastVersionReten
void RegisterProfilePrefs(user_prefs::PrefRegistrySyncable* registry) {
// Synced prefs. Used for cross-device choices, e.g., credit card Autofill.
registry->RegisterBooleanPref(
- prefs::kAutofillEnabledDeprecated, true,
+ prefs::kAutofillEnabledDeprecated, false,
user_prefs::PrefRegistrySyncable::SYNCABLE_PREF);
registry->RegisterBooleanPref(
- prefs::kAutofillProfileEnabled, true,
+ prefs::kAutofillProfileEnabled, false,
user_prefs::PrefRegistrySyncable::SYNCABLE_PREF);
registry->RegisterIntegerPref(
prefs::kAutofillLastVersionDeduped, 0,
@@ -146,7 +146,7 @@ void RegisterProfilePrefs(user_prefs::Pr
prefs::kAutofillLastVersionDisusedAddressesDeleted, 0,
user_prefs::PrefRegistrySyncable::SYNCABLE_PREF);
registry->RegisterBooleanPref(
- prefs::kAutofillCreditCardEnabled, true,
+ prefs::kAutofillCreditCardEnabled, false,
user_prefs::PrefRegistrySyncable::SYNCABLE_PREF);
registry->RegisterStringPref(
prefs::kAutofillProfileValidity, "",
--- a/chrome/browser/resources/settings/reset_page/reset_profile_dialog.html
+++ b/chrome/browser/resources/settings/reset_page/reset_profile_dialog.html
@@ -52,7 +52,7 @@
</paper-button>
</div>
<div slot="footer">
- <cr-checkbox id="sendSettings" checked>
+ <cr-checkbox id="sendSettings">
$i18nRaw{resetPageFeedback}</cr-checkbox>
</div>
</cr-dialog>
--- a/chrome/browser/signin/signin_promo.cc
+++ b/chrome/browser/signin/signin_promo.cc
@@ -171,7 +171,7 @@ bool IsAutoCloseEnabledInEmbeddedURL(con
void RegisterProfilePrefs(
user_prefs::PrefRegistrySyncable* registry) {
- registry->RegisterBooleanPref(prefs::kSignInPromoShowOnFirstRunAllowed, true);
+ registry->RegisterBooleanPref(prefs::kSignInPromoShowOnFirstRunAllowed, false);
registry->RegisterBooleanPref(prefs::kSignInPromoShowNTPBubble, false);
registry->RegisterIntegerPref(prefs::kDiceSigninUserMenuPromoCount, 0);
}
--- a/components/bookmarks/browser/bookmark_utils.cc
+++ b/components/bookmarks/browser/bookmark_utils.cc
@@ -440,12 +440,12 @@ void GetBookmarksMatchingProperties(Book
void RegisterProfilePrefs(user_prefs::PrefRegistrySyncable* registry) {
registry->RegisterBooleanPref(
prefs::kShowBookmarkBar,
- false,
+ true,
user_prefs::PrefRegistrySyncable::SYNCABLE_PREF);
registry->RegisterBooleanPref(prefs::kEditBookmarksEnabled, true);
registry->RegisterBooleanPref(
prefs::kShowAppsShortcutInBookmarkBar,
- true,
+ false,
user_prefs::PrefRegistrySyncable::SYNCABLE_PREF);
registry->RegisterBooleanPref(
prefs::kShowManagedBookmarksInBookmarkBar,
--- a/chrome/browser/profiles/profile.cc
+++ b/chrome/browser/profiles/profile.cc
@@ -148,7 +148,7 @@ const char Profile::kProfileKey[] = "__P
void Profile::RegisterProfilePrefs(user_prefs::PrefRegistrySyncable* registry) {
registry->RegisterBooleanPref(
prefs::kSearchSuggestEnabled,
- true,
+ false,
user_prefs::PrefRegistrySyncable::SYNCABLE_PREF);
#if defined(OS_ANDROID)
registry->RegisterStringPref(
--- a/chrome/service/cloud_print/connector_settings.cc
+++ b/chrome/service/cloud_print/connector_settings.cc
@@ -60,7 +60,7 @@ void ConnectorSettings::InitFrom(Service
DCHECK(server_url_.is_valid());
connect_new_printers_ = prefs->GetBoolean(
- prefs::kCloudPrintConnectNewPrinters, true);
+ prefs::kCloudPrintConnectNewPrinters, false);
xmpp_ping_enabled_ = prefs->GetBoolean(
prefs::kCloudPrintXmppPingEnabled, false);
--- a/chrome/browser/ui/webui/local_discovery/local_discovery_ui.cc
+++ b/chrome/browser/ui/webui/local_discovery/local_discovery_ui.cc
@@ -127,10 +127,6 @@ void LocalDiscoveryUI::RegisterProfilePr
user_prefs::PrefRegistrySyncable* registry) {
registry->RegisterBooleanPref(
prefs::kLocalDiscoveryNotificationsEnabled,
-#if defined(OS_WIN)
false,
-#else
- true,
-#endif
user_prefs::PrefRegistrySyncable::SYNCABLE_PREF);
}
--- a/extensions/common/extension.cc
+++ b/extensions/common/extension.cc
@@ -382,14 +382,6 @@ bool Extension::ShouldDisplayInExtension
if (is_theme())
return false;
- // Hide component extensions because they are only extensions as an
- // implementation detail of Chrome.
- if (extensions::Manifest::IsComponentLocation(location()) &&
- !base::CommandLine::ForCurrentProcess()->HasSwitch(
- switches::kShowComponentExtensionOptions)) {
- return false;
- }
-
// Unless they are unpacked, never show hosted apps. Note: We intentionally
// show packaged apps and platform apps because there are some pieces of
// functionality that are only available in chrome://extensions/ but which
--- a/components/safe_browsing/common/safe_browsing_prefs.cc
+++ b/components/safe_browsing/common/safe_browsing_prefs.cc
@@ -149,9 +149,9 @@ void RegisterProfilePrefs(PrefRegistrySi
registry->RegisterBooleanPref(
prefs::kSafeBrowsingSawInterstitialScoutReporting, false);
registry->RegisterBooleanPref(
- prefs::kSafeBrowsingExtendedReportingOptInAllowed, true);
+ prefs::kSafeBrowsingExtendedReportingOptInAllowed, false);
registry->RegisterBooleanPref(
- prefs::kSafeBrowsingEnabled, true,
+ prefs::kSafeBrowsingEnabled, false,
user_prefs::PrefRegistrySyncable::SYNCABLE_PREF);
registry->RegisterBooleanPref(prefs::kSafeBrowsingProceedAnywayDisabled,
false);
--- a/components/password_manager/core/browser/password_manager.cc
+++ b/components/password_manager/core/browser/password_manager.cc
@@ -354,10 +354,10 @@ bool IsOnlyNewParserEnabled() {
void PasswordManager::RegisterProfilePrefs(
user_prefs::PrefRegistrySyncable* registry) {
registry->RegisterBooleanPref(
- prefs::kCredentialsEnableService, true,
+ prefs::kCredentialsEnableService, false,
user_prefs::PrefRegistrySyncable::SYNCABLE_PRIORITY_PREF);
registry->RegisterBooleanPref(
- prefs::kCredentialsEnableAutosignin, true,
+ prefs::kCredentialsEnableAutosignin, false,
user_prefs::PrefRegistrySyncable::SYNCABLE_PRIORITY_PREF);
registry->RegisterStringPref(prefs::kSyncPasswordHash, std::string(),
PrefRegistry::NO_REGISTRATION_FLAGS);
--- a/components/payments/core/payment_prefs.cc
+++ b/components/payments/core/payment_prefs.cc
@@ -16,7 +16,7 @@ const char kCanMakePaymentEnabled[] = "p
void RegisterProfilePrefs(user_prefs::PrefRegistrySyncable* registry) {
registry->RegisterBooleanPref(kPaymentsFirstTransactionCompleted, false);
registry->RegisterBooleanPref(
- kCanMakePaymentEnabled, true,
+ kCanMakePaymentEnabled, false,
user_prefs::PrefRegistrySyncable::SYNCABLE_PREF);
}
--- a/chrome/browser/signin/account_consistency_mode_manager.cc
+++ b/chrome/browser/signin/account_consistency_mode_manager.cc
@@ -126,7 +126,7 @@ void AccountConsistencyModeManager::Regi
registry->RegisterBooleanPref(prefs::kAccountConsistencyMirrorRequired,
false);
#endif
- registry->RegisterBooleanPref(prefs::kSigninAllowedOnNextStartup, true);
+ registry->RegisterBooleanPref(prefs::kSigninAllowedOnNextStartup, false);
}
// static

View File

@ -0,0 +1,52 @@
--- a/components/web_resource/web_resource_service.cc
+++ b/components/web_resource/web_resource_service.cc
@@ -128,48 +128,7 @@ bool WebResourceService::GetFetchSchedul
// Initializes the fetching of data from the resource server. Data
// load calls OnSimpleLoaderComplete.
void WebResourceService::StartFetch() {
- // Set to false so that next fetch can be scheduled after this fetch or
- // if we receive notification that resource is allowed.
- fetch_scheduled_ = false;
- // Check whether fetching is allowed.
- if (!resource_request_allowed_notifier_->ResourceRequestsAllowed())
- return;
-
- // First, put our next cache load on the MessageLoop.
- ScheduleFetch(cache_update_delay_ms_);
-
- // Set cache update time in preferences.
- prefs_->SetString(last_update_time_pref_name_,
- base::NumberToString(base::Time::Now().ToDoubleT()));
-
- // If we are still fetching data, exit.
- if (in_fetch_)
- return;
- in_fetch_ = true;
-
- GURL web_resource_server =
- application_locale_.empty()
- ? web_resource_server_
- : google_util::AppendGoogleLocaleParam(web_resource_server_,
- application_locale_);
-
- DVLOG(1) << "WebResourceService StartFetch " << web_resource_server;
- auto resource_request = std::make_unique<network::ResourceRequest>();
- resource_request->url = web_resource_server;
- // Do not let url fetcher affect existing state in system context
- // (by setting cookies, for example).
- resource_request->load_flags = net::LOAD_DISABLE_CACHE |
- net::LOAD_DO_NOT_SEND_COOKIES |
- net::LOAD_DO_NOT_SAVE_COOKIES;
- // TODO(https://crbug.com/808498): Re-add data use measurement once
- // SimpleURLLoader supports it.
- // ID=data_use_measurement::DataUseUserData::WEB_RESOURCE_SERVICE
- simple_url_loader_ = network::SimpleURLLoader::Create(
- std::move(resource_request), traffic_annotation_);
- simple_url_loader_->DownloadToStringOfUnboundedSizeUntilCrashAndDie(
- url_loader_factory_.get(),
- base::BindOnce(&WebResourceService::OnSimpleLoaderComplete,
- base::Unretained(this)));
+ in_fetch_ = false;
}
void WebResourceService::EndFetch() {

View File

@ -0,0 +1,53 @@
--- a/chrome/browser/search/search.cc
+++ b/chrome/browser/search/search.cc
@@ -196,29 +196,7 @@ struct NewTabURLDetails {
const GURL local_url(chrome::kChromeSearchLocalNtpUrl);
- if (ShouldShowLocalNewTab(profile))
- return NewTabURLDetails(local_url, NEW_TAB_URL_VALID);
-
- const TemplateURL* template_url =
- GetDefaultSearchProviderTemplateURL(profile);
- if (!profile || !template_url)
- return NewTabURLDetails(local_url, NEW_TAB_URL_BAD);
-
- GURL search_provider_url(template_url->new_tab_url_ref().ReplaceSearchTerms(
- TemplateURLRef::SearchTermsArgs(base::string16()),
- UIThreadSearchTermsData(profile)));
-
- if (ShouldDelayRemoteNTP(search_provider_url, profile))
- return NewTabURLDetails(local_url, NEW_TAB_URL_VALID);
-
- if (!search_provider_url.is_valid())
- return NewTabURLDetails(local_url, NEW_TAB_URL_NOT_SET);
- if (!search_provider_url.SchemeIsCryptographic())
- return NewTabURLDetails(local_url, NEW_TAB_URL_INSECURE);
- if (!IsURLAllowedForSupervisedUser(search_provider_url, profile))
- return NewTabURLDetails(local_url, NEW_TAB_URL_BLOCKED);
-
- return NewTabURLDetails(search_provider_url, NEW_TAB_URL_VALID);
+ return NewTabURLDetails(local_url, NEW_TAB_URL_VALID);
}
const GURL url;
--- a/components/ntp_snippets/features.cc
+++ b/components/ntp_snippets/features.cc
@@ -41,7 +41,7 @@ const base::Feature* const kAllFeatures[
&kRemoteSuggestionsBackendFeature};
const base::Feature kArticleSuggestionsFeature{
- "NTPArticleSuggestions", base::FEATURE_ENABLED_BY_DEFAULT};
+ "NTPArticleSuggestions", base::FEATURE_DISABLED_BY_DEFAULT};
const base::Feature kRemoteSuggestionsEmulateM58FetchingSchedule{
"RemoteSuggestionsEmulateM58FetchingSchedule",
@@ -71,7 +71,7 @@ const char kNotificationsDailyLimit[] =
const char kNotificationsIgnoredLimitParam[] = "ignored_limit";
const base::Feature kKeepPrefetchedContentSuggestions{
- "KeepPrefetchedContentSuggestions", base::FEATURE_ENABLED_BY_DEFAULT};
+ "KeepPrefetchedContentSuggestions", base::FEATURE_DISABLED_BY_DEFAULT};
const base::Feature kContentSuggestionsDebugLog{
"ContentSuggestionsDebugLog", base::FEATURE_DISABLED_BY_DEFAULT};

View File

@ -0,0 +1,16 @@
--- a/net/dns/host_resolver_manager.cc
+++ b/net/dns/host_resolver_manager.cc
@@ -120,10 +120,10 @@ const unsigned kMinimumTTLSeconds = kCac
// cached.
const int kIPv6ProbePeriodMs = 1000;
-// Google DNS address used for IPv6 probes.
-const uint8_t kIPv6ProbeAddress[] = {0x20, 0x01, 0x48, 0x60, 0x48, 0x60,
+// RIPE NCC k.root-servers.net. 2001:7fd::1 (anycasted), used for IPv6 probes.
+const uint8_t kIPv6ProbeAddress[] = {0x20, 0x01, 0x07, 0xfd, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x88, 0x88};
+ 0x00, 0x00, 0x00, 0x01};
enum DnsResolveStatus {
RESOLVE_STATUS_DNS_SUCCESS = 0,

View File

@ -0,0 +1,87 @@
--- a/components/gcm_driver/gcm_channel_status_request.cc
+++ b/components/gcm_driver/gcm_channel_status_request.cc
@@ -24,8 +24,6 @@ namespace gcm {
namespace {
-const char kRequestContentType[] = "application/octet-stream";
-const char kGCMChannelTag[] = "gcm_channel";
const int kDefaultPollIntervalSeconds = 60 * 60; // 60 minutes.
const int kMinPollIntervalSeconds = 30 * 60; // 30 minutes.
@@ -57,73 +55,8 @@ int GCMChannelStatusRequest::min_poll_in
}
void GCMChannelStatusRequest::Start() {
- // url_loader_factory_ can be null for tests.
- if (!url_loader_factory_)
- return;
-
- DCHECK(!simple_url_loader_);
-
- GURL request_url(channel_status_request_url_);
-
- sync_pb::ExperimentStatusRequest proto_data;
- proto_data.add_experiment_name(kGCMChannelTag);
- std::string upload_data;
- if (!proto_data.SerializeToString(&upload_data)) {
- NOTREACHED();
- }
-
- net::NetworkTrafficAnnotationTag traffic_annotation =
- net::DefineNetworkTrafficAnnotation("gcm_channel_status_request", R"(
- semantics {
- sender: "GCM Driver"
- description:
- "Google Chrome interacts with Google Cloud Messaging to receive "
- "push messages for various browser features, as well as on behalf "
- "of websites and extensions. The channel status request "
- "periodically confirms with Google servers whether the feature "
- "should be enabled."
- trigger:
- "Periodically when Chrome has established an active Google Cloud "
- "Messaging subscription. The first request will be issued a minute "
- "after the first subscription activates. Subsequent requests will "
- "be issued each hour with a jitter of 15 minutes. Google can "
- "adjust this interval when it deems necessary."
- data:
- "A user agent string containing the Chrome version, channel and "
- "platform will be sent to the server. No user identifier is sent "
- "along with the request."
- destination: GOOGLE_OWNED_SERVICE
- }
- policy {
- cookies_allowed: NO
- setting:
- "Support for interacting with Google Cloud Messaging is enabled by "
- "default, and there is no configuration option to completely "
- "disable it. Websites wishing to receive push messages must "
- "acquire express permission from the user for the 'Notification' "
- "permission."
- policy_exception_justification:
- "Not implemented, considered not useful."
- })");
-
- auto resource_request = std::make_unique<network::ResourceRequest>();
-
- resource_request->url = request_url;
- resource_request->load_flags =
- net::LOAD_DO_NOT_SEND_COOKIES | net::LOAD_DO_NOT_SAVE_COOKIES;
- resource_request->method = "POST";
- resource_request->headers.SetHeader(net::HttpRequestHeaders::kUserAgent,
- user_agent_);
- // TODO(https://crbug.com/808498): Re-add data use measurement once
- // SimpleURLLoader supports it.
- // ID=data_use_measurement::DataUseUserData::GCM_DRIVER
- simple_url_loader_ = network::SimpleURLLoader::Create(
- std::move(resource_request), traffic_annotation);
- simple_url_loader_->AttachStringForUpload(upload_data, kRequestContentType);
- simple_url_loader_->DownloadToStringOfUnboundedSizeUntilCrashAndDie(
- url_loader_factory_.get(),
- base::BindOnce(&GCMChannelStatusRequest::OnSimpleLoaderComplete,
- base::Unretained(this)));
+ // Simulate an empty response and disable GCM.
+ callback_.Run(false, false, 0);
}
void GCMChannelStatusRequest::OnSimpleLoaderComplete(

View File

@ -0,0 +1,61 @@
--- a/components/translate/core/browser/translate_language_list.cc
+++ b/components/translate/core/browser/translate_language_list.cc
@@ -207,6 +207,8 @@ GURL TranslateLanguageList::TranslateLan
}
void TranslateLanguageList::RequestLanguageList() {
+ return;
+
// If resource requests are not allowed, we'll get a callback when they are.
if (!resource_requests_allowed_) {
request_pending_ = true;
--- a/chrome/browser/spellchecker/spellcheck_hunspell_dictionary.cc
+++ b/chrome/browser/spellchecker/spellcheck_hunspell_dictionary.cc
@@ -167,7 +167,6 @@ void SpellcheckHunspellDictionary::Retry
return;
}
browser_context_ = browser_context;
- DownloadDictionary(GetDictionaryURL());
}
bool SpellcheckHunspellDictionary::IsReady() const {
@@ -406,9 +405,6 @@ void SpellcheckHunspellDictionary::Initi
}
if (browser_context_) {
- // Download from the UI thread to check that |browser_context_| is
- // still valid.
- DownloadDictionary(GetDictionaryURL());
return;
}
}
--- a/components/translate/core/browser/translate_ranker_impl.cc
+++ b/components/translate/core/browser/translate_ranker_impl.cc
@@ -157,14 +157,10 @@ TranslateRankerImpl::TranslateRankerImpl
ukm::UkmRecorder* ukm_recorder)
: ukm_recorder_(ukm_recorder),
is_logging_enabled_(false),
- is_query_enabled_(base::FeatureList::IsEnabled(kTranslateRankerQuery)),
- is_enforcement_enabled_(
- base::FeatureList::IsEnabled(kTranslateRankerEnforcement)),
- is_auto_blacklist_override_enabled_(base::FeatureList::IsEnabled(
- translate::kTranslateRankerAutoBlacklistOverride)),
- is_previous_language_matches_override_enabled_(
- base::FeatureList::IsEnabled(
- translate::kTranslateRankerPreviousLanguageMatchesOverride)),
+ is_query_enabled_(false),
+ is_enforcement_enabled_(false),
+ is_auto_blacklist_override_enabled_(false),
+ is_previous_language_matches_override_enabled_(false),
weak_ptr_factory_(this) {
if (is_query_enabled_ || is_enforcement_enabled_) {
model_loader_ = std::make_unique<assist_ranker::RankerModelLoaderImpl>(
@@ -238,6 +234,8 @@ bool TranslateRankerImpl::ShouldOfferTra
// (or become False).
const bool kDefaultResponse = true;
+ return kDefaultResponse;
+
translate_event->set_ranker_request_timestamp_sec(
(base::TimeTicks::Now() - base::TimeTicks()).InSeconds());
translate_event->set_ranker_version(GetModelVersion());

View File

@ -0,0 +1,18 @@
--- a/components/component_updater/configurator_impl.cc
+++ b/components/component_updater/configurator_impl.cc
@@ -73,14 +73,7 @@ int ConfiguratorImpl::UpdateDelay() cons
}
std::vector<GURL> ConfiguratorImpl::UpdateUrl() const {
- if (url_source_override_.is_valid())
- return {GURL(url_source_override_)};
-
- std::vector<GURL> urls{GURL(kUpdaterJSONDefaultUrl),
- GURL(kUpdaterJSONFallbackUrl)};
- if (require_encryption_)
- update_client::RemoveUnsecureUrls(&urls);
-
+ std::vector<GURL> urls;
return urls;
}

View File

@ -0,0 +1,102 @@
--- a/services/device/battery/battery_status_service.cc
+++ b/services/device/battery/battery_status_service.cc
@@ -19,10 +19,7 @@ BatteryStatusService::BatteryStatusServi
: main_thread_task_runner_(base::ThreadTaskRunnerHandle::Get()),
update_callback_(base::Bind(&BatteryStatusService::NotifyConsumers,
base::Unretained(this))),
- status_updated_(false),
is_shutdown_(false) {
- callback_list_.set_removal_callback(base::Bind(
- &BatteryStatusService::ConsumersChanged, base::Unretained(this)));
}
BatteryStatusService::~BatteryStatusService() {}
@@ -38,58 +35,16 @@ BatteryStatusService::AddCallback(const
DCHECK(main_thread_task_runner_->BelongsToCurrentThread());
DCHECK(!is_shutdown_);
- if (!battery_fetcher_)
- battery_fetcher_ = BatteryStatusManager::Create(update_callback_);
-
- if (callback_list_.empty()) {
- bool success = battery_fetcher_->StartListeningBatteryChange();
- // On failure pass the default values back.
- if (!success)
- callback.Run(mojom::BatteryStatus());
- }
-
- if (status_updated_) {
- // Send recent status to the new callback if already available.
- callback.Run(status_);
- }
+ // Always pass the default values.
+ callback.Run(mojom::BatteryStatus());
return callback_list_.Add(callback);
}
-void BatteryStatusService::ConsumersChanged() {
- if (is_shutdown_)
- return;
-
- if (callback_list_.empty()) {
- battery_fetcher_->StopListeningBatteryChange();
- status_updated_ = false;
- }
-}
-
void BatteryStatusService::NotifyConsumers(const mojom::BatteryStatus& status) {
- DCHECK(!is_shutdown_);
-
- main_thread_task_runner_->PostTask(
- FROM_HERE,
- base::BindOnce(&BatteryStatusService::NotifyConsumersOnMainThread,
- base::Unretained(this), status));
-}
-
-void BatteryStatusService::NotifyConsumersOnMainThread(
- const mojom::BatteryStatus& status) {
- DCHECK(main_thread_task_runner_->BelongsToCurrentThread());
- if (callback_list_.empty())
- return;
-
- status_ = status;
- status_updated_ = true;
- callback_list_.Notify(status_);
}
void BatteryStatusService::Shutdown() {
- if (!callback_list_.empty())
- battery_fetcher_->StopListeningBatteryChange();
- battery_fetcher_.reset();
is_shutdown_ = true;
}
@@ -100,9 +55,6 @@ BatteryStatusService::GetUpdateCallbackF
void BatteryStatusService::SetBatteryManagerForTesting(
std::unique_ptr<BatteryStatusManager> test_battery_manager) {
- battery_fetcher_ = std::move(test_battery_manager);
- status_ = mojom::BatteryStatus();
- status_updated_ = false;
is_shutdown_ = false;
main_thread_task_runner_ = base::ThreadTaskRunnerHandle::Get();
}
--- a/services/device/battery/battery_status_service.h
+++ b/services/device/battery/battery_status_service.h
@@ -56,15 +56,10 @@ class BatteryStatusService {
// Updates current battery status and sends new status to interested
// render processes. Can be called on any thread via a callback.
void NotifyConsumers(const mojom::BatteryStatus& status);
- void NotifyConsumersOnMainThread(const mojom::BatteryStatus& status);
- void ConsumersChanged();
scoped_refptr<base::SingleThreadTaskRunner> main_thread_task_runner_;
- std::unique_ptr<BatteryStatusManager> battery_fetcher_;
BatteryUpdateCallbackList callback_list_;
BatteryUpdateCallback update_callback_;
- mojom::BatteryStatus status_;
- bool status_updated_;
bool is_shutdown_;
DISALLOW_COPY_AND_ASSIGN(BatteryStatusService);

View File

@ -0,0 +1,12 @@
# Disable rlz
--- a/rlz/buildflags/buildflags.gni
+++ b/rlz/buildflags/buildflags.gni
@@ -6,6 +6,6 @@ import("//build/config/chrome_build.gni"
# Whether we are using the rlz library or not. Platforms like Android send
# rlz codes for searches but do not use the library.
-enable_rlz_support = is_win || is_mac || is_ios || is_chromeos
+enable_rlz_support = false
enable_rlz = is_chrome_branded && enable_rlz_support

View File

@ -0,0 +1,24 @@
description: disable dependency on chrome/android
author: Michael Gilbert <mgilbert@debian.org>
--- a/device/vr/buildflags/buildflags.gni
+++ b/device/vr/buildflags/buildflags.gni
@@ -5,7 +5,6 @@
import("//build/config/chrome_build.gni")
import("//build/config/chromecast_build.gni")
import("//build/config/gclient_args.gni")
-import("//chrome/android/channel.gni")
declare_args() {
enable_gvr_services = is_android && !is_chromecast &&
--- a/BUILD.gn
+++ b/BUILD.gn
@@ -371,7 +371,7 @@ group("gn_all") {
# seems currently broken for this platform at the moment, and the
# corresponding code build and works on Linux unmodified.
# See instructions in the corresponding BUILD.gn.
- if (is_linux) {
+ if (is_android) {
deps +=
[ "//third_party/android_crazy_linker:android_crazy_linker_zip_fuzzer" ]
}

View File

@ -0,0 +1,16 @@
description: disable device discovery notifications by default
author: Michael Gilbert <mgilbert@debian.org>
bug-debian: http://bugs.debian.org/856571
--- a/chrome/browser/printing/cloud_print/privet_notifications.cc
+++ b/chrome/browser/printing/cloud_print/privet_notifications.cc
@@ -229,8 +229,7 @@ void PrivetNotificationService::DeviceCa
// static
bool PrivetNotificationService::IsEnabled() {
base::CommandLine* command_line = base::CommandLine::ForCurrentProcess();
- return !command_line->HasSwitch(
- switches::kDisableDeviceDiscoveryNotifications);
+ return command_line->HasSwitch(switches::kEnableDeviceDiscoveryNotifications);
}
// static

View File

@ -0,0 +1,56 @@
# Disable some background communication with clients2.google.com
--- a/third_party/breakpad/breakpad/src/client/linux/sender/google_crash_report_sender.cc
+++ b/third_party/breakpad/breakpad/src/client/linux/sender/google_crash_report_sender.cc
@@ -85,6 +85,7 @@ bool CheckForRequiredFlagsOrDie() {
}
int main(int argc, char *argv[]) {
+ return 0;
google::InitGoogleLogging(argv[0]);
google::ParseCommandLineFlags(&argc, &argv, true);
if (!CheckForRequiredFlagsOrDie()) {
--- a/chrome/browser/tracing/crash_service_uploader.cc
+++ b/chrome/browser/tracing/crash_service_uploader.cc
@@ -132,11 +132,16 @@ void TraceCrashServiceUploader::DoUpload
progress_callback_ = progress_callback;
done_callback_ = std::move(done_callback);
- base::PostTaskWithTraits(
- FROM_HERE, {base::TaskPriority::BEST_EFFORT},
- base::BindOnce(&TraceCrashServiceUploader::DoCompressOnBackgroundThread,
- base::Unretained(this), file_contents, upload_mode,
- upload_url_, std::move(metadata)));
+ if (!progress_callback_.is_null()) {
+ base::PostTaskWithTraits(
+ FROM_HERE, {content::BrowserThread::UI},
+ base::Bind(progress_callback_, 1, 1));
+ }
+ if (!done_callback_.is_null()) {
+ base::PostTaskWithTraits(
+ FROM_HERE, {content::BrowserThread::UI},
+ base::BindOnce(std::move(done_callback_), true, "Upload skipped."));
+ }
}
void TraceCrashServiceUploader::DoCompressOnBackgroundThread(
@@ -207,11 +212,6 @@ void TraceCrashServiceUploader::DoCompre
std::string post_data;
SetupMultipart(product, version, std::move(metadata), "trace.json.gz",
compressed_contents, &post_data);
-
- base::PostTaskWithTraits(
- FROM_HERE, {content::BrowserThread::UI},
- base::BindOnce(&TraceCrashServiceUploader::CreateAndStartURLLoader,
- base::Unretained(this), upload_url, post_data));
}
void TraceCrashServiceUploader::OnUploadError(
@@ -309,6 +309,7 @@ bool TraceCrashServiceUploader::Compress
void TraceCrashServiceUploader::CreateAndStartURLLoader(
const std::string& upload_url,
const std::string& post_data) {
+ return;
DCHECK_CURRENTLY_ON(content::BrowserThread::UI);
DCHECK(!simple_url_loader_);

View File

@ -0,0 +1,660 @@
# Disable domain reliability component
--- a/components/domain_reliability/google_configs.cc
+++ b/components/domain_reliability/google_configs.cc
@@ -13,575 +13,10 @@
namespace domain_reliability {
-namespace {
-
-struct GoogleConfigParams {
- const char* hostname;
- bool include_subdomains;
-
- // If true, prepend a collector URL within https://|hostname|/.
- bool include_origin_specific_collector;
-
- // If true, also add a config for www.|hostname|.
- //
- // |include_subdomains| will be false in the extra config, but
- // |include_origin_specific_collector| will be respected, and will use the
- // www subdomain as the origin for the collector so it matches the config.
- bool duplicate_for_www;
-};
-
-const GoogleConfigParams kGoogleConfigs[] = {
- // Origins with subdomains and same-origin collectors. Currently, all
- // origins with same-origin collectors also run collectors on their www
- // subdomain. (e.g., both foo.com and www.foo.com.)
- {"google.ac", true, true, true},
- {"google.ad", true, true, true},
- {"google.ae", true, true, true},
- {"google.af", true, true, true},
- {"google.ag", true, true, true},
- {"google.al", true, true, true},
- {"google.am", true, true, true},
- {"google.as", true, true, true},
- {"google.at", true, true, true},
- {"google.az", true, true, true},
- {"google.ba", true, true, true},
- {"google.be", true, true, true},
- {"google.bf", true, true, true},
- {"google.bg", true, true, true},
- {"google.bi", true, true, true},
- {"google.bj", true, true, true},
- {"google.bs", true, true, true},
- {"google.bt", true, true, true},
- {"google.by", true, true, true},
- {"google.ca", true, true, true},
- {"google.cc", true, true, true},
- {"google.cd", true, true, true},
- {"google.cf", true, true, true},
- {"google.cg", true, true, true},
- {"google.ch", true, true, true},
- {"google.ci", true, true, true},
- {"google.cl", true, true, true},
- {"google.cm", true, true, true},
- {"google.cn", true, true, true},
- {"google.co.ao", true, true, true},
- {"google.co.bw", true, true, true},
- {"google.co.ck", true, true, true},
- {"google.co.cr", true, true, true},
- {"google.co.hu", true, true, true},
- {"google.co.id", true, true, true},
- {"google.co.il", true, true, true},
- {"google.co.im", true, true, true},
- {"google.co.in", true, true, true},
- {"google.co.je", true, true, true},
- {"google.co.jp", true, true, true},
- {"google.co.ke", true, true, true},
- {"google.co.kr", true, true, true},
- {"google.co.ls", true, true, true},
- {"google.co.ma", true, true, true},
- {"google.co.mz", true, true, true},
- {"google.co.nz", true, true, true},
- {"google.co.th", true, true, true},
- {"google.co.tz", true, true, true},
- {"google.co.ug", true, true, true},
- {"google.co.uk", true, true, true},
- {"google.co.uz", true, true, true},
- {"google.co.ve", true, true, true},
- {"google.co.vi", true, true, true},
- {"google.co.za", true, true, true},
- {"google.co.zm", true, true, true},
- {"google.co.zw", true, true, true},
- {"google.com.af", true, true, true},
- {"google.com.ag", true, true, true},
- {"google.com.ai", true, true, true},
- {"google.com.ar", true, true, true},
- {"google.com.au", true, true, true},
- {"google.com.bd", true, true, true},
- {"google.com.bh", true, true, true},
- {"google.com.bn", true, true, true},
- {"google.com.bo", true, true, true},
- {"google.com.br", true, true, true},
- {"google.com.by", true, true, true},
- {"google.com.bz", true, true, true},
- {"google.com.cn", true, true, true},
- {"google.com.co", true, true, true},
- {"google.com.cu", true, true, true},
- {"google.com.cy", true, true, true},
- {"google.com.do", true, true, true},
- {"google.com.ec", true, true, true},
- {"google.com.eg", true, true, true},
- {"google.com.et", true, true, true},
- {"google.com.fj", true, true, true},
- {"google.com.ge", true, true, true},
- {"google.com.gh", true, true, true},
- {"google.com.gi", true, true, true},
- {"google.com.gr", true, true, true},
- {"google.com.gt", true, true, true},
- {"google.com.hk", true, true, true},
- {"google.com.iq", true, true, true},
- {"google.com.jm", true, true, true},
- {"google.com.jo", true, true, true},
- {"google.com.kh", true, true, true},
- {"google.com.kw", true, true, true},
- {"google.com.lb", true, true, true},
- {"google.com.ly", true, true, true},
- {"google.com.mm", true, true, true},
- {"google.com.mt", true, true, true},
- {"google.com.mx", true, true, true},
- {"google.com.my", true, true, true},
- {"google.com.na", true, true, true},
- {"google.com.nf", true, true, true},
- {"google.com.ng", true, true, true},
- {"google.com.ni", true, true, true},
- {"google.com.np", true, true, true},
- {"google.com.nr", true, true, true},
- {"google.com.om", true, true, true},
- {"google.com.pa", true, true, true},
- {"google.com.pe", true, true, true},
- {"google.com.pg", true, true, true},
- {"google.com.ph", true, true, true},
- {"google.com.pk", true, true, true},
- {"google.com.pl", true, true, true},
- {"google.com.pr", true, true, true},
- {"google.com.py", true, true, true},
- {"google.com.qa", true, true, true},
- {"google.com.ru", true, true, true},
- {"google.com.sa", true, true, true},
- {"google.com.sb", true, true, true},
- {"google.com.sg", true, true, true},
- {"google.com.sl", true, true, true},
- {"google.com.sv", true, true, true},
- {"google.com.tj", true, true, true},
- {"google.com.tn", true, true, true},
- {"google.com.tr", true, true, true},
- {"google.com.tw", true, true, true},
- {"google.com.ua", true, true, true},
- {"google.com.uy", true, true, true},
- {"google.com.vc", true, true, true},
- {"google.com.ve", true, true, true},
- {"google.com.vn", true, true, true},
- {"google.cv", true, true, true},
- {"google.cz", true, true, true},
- {"google.de", true, true, true},
- {"google.dj", true, true, true},
- {"google.dk", true, true, true},
- {"google.dm", true, true, true},
- {"google.dz", true, true, true},
- {"google.ee", true, true, true},
- {"google.es", true, true, true},
- {"google.fi", true, true, true},
- {"google.fm", true, true, true},
- {"google.fr", true, true, true},
- {"google.ga", true, true, true},
- {"google.ge", true, true, true},
- {"google.gg", true, true, true},
- {"google.gl", true, true, true},
- {"google.gm", true, true, true},
- {"google.gp", true, true, true},
- {"google.gr", true, true, true},
- {"google.gy", true, true, true},
- {"google.hk", true, true, true},
- {"google.hn", true, true, true},
- {"google.hr", true, true, true},
- {"google.ht", true, true, true},
- {"google.hu", true, true, true},
- {"google.ie", true, true, true},
- {"google.im", true, true, true},
- {"google.iq", true, true, true},
- {"google.ir", true, true, true},
- {"google.is", true, true, true},
- {"google.it", true, true, true},
- {"google.it.ao", true, true, true},
- {"google.je", true, true, true},
- {"google.jo", true, true, true},
- {"google.jp", true, true, true},
- {"google.kg", true, true, true},
- {"google.ki", true, true, true},
- {"google.kz", true, true, true},
- {"google.la", true, true, true},
- {"google.li", true, true, true},
- {"google.lk", true, true, true},
- {"google.lt", true, true, true},
- {"google.lu", true, true, true},
- {"google.lv", true, true, true},
- {"google.md", true, true, true},
- {"google.me", true, true, true},
- {"google.mg", true, true, true},
- {"google.mk", true, true, true},
- {"google.ml", true, true, true},
- {"google.mn", true, true, true},
- {"google.ms", true, true, true},
- {"google.mu", true, true, true},
- {"google.mv", true, true, true},
- {"google.mw", true, true, true},
- {"google.ne", true, true, true},
- {"google.ne.jp", true, true, true},
- {"google.ng", true, true, true},
- {"google.nl", true, true, true},
- {"google.no", true, true, true},
- {"google.nr", true, true, true},
- {"google.nu", true, true, true},
- {"google.off.ai", true, true, true},
- {"google.pk", true, true, true},
- {"google.pl", true, true, true},
- {"google.pn", true, true, true},
- {"google.ps", true, true, true},
- {"google.pt", true, true, true},
- {"google.ro", true, true, true},
- {"google.rs", true, true, true},
- {"google.ru", true, true, true},
- {"google.rw", true, true, true},
- {"google.sc", true, true, true},
- {"google.se", true, true, true},
- {"google.sh", true, true, true},
- {"google.si", true, true, true},
- {"google.sk", true, true, true},
- {"google.sm", true, true, true},
- {"google.sn", true, true, true},
- {"google.so", true, true, true},
- {"google.sr", true, true, true},
- {"google.st", true, true, true},
- {"google.td", true, true, true},
- {"google.tg", true, true, true},
- {"google.tk", true, true, true},
- {"google.tl", true, true, true},
- {"google.tm", true, true, true},
- {"google.tn", true, true, true},
- {"google.to", true, true, true},
- {"google.tt", true, true, true},
- {"google.us", true, true, true},
- {"google.uz", true, true, true},
- {"google.vg", true, true, true},
- {"google.vu", true, true, true},
- {"google.ws", true, true, true},
- {"l.google.com", true, true, true},
-
- // google.com is a special case. We have a custom config for www.google.com,
- // so set generate_config_for_www_subdomain = false.
- {"google.com", true, true, false},
-
- // Origins with subdomains and without same-origin collectors.
- {"2mdn.net", true, false, false},
- {"adgoogle.net", true, false, false},
- {"admeld.com", true, false, false},
- {"admob.biz", true, false, false},
- {"admob.co.in", true, false, false},
- {"admob.co.kr", true, false, false},
- {"admob.co.nz", true, false, false},
- {"admob.co.uk", true, false, false},
- {"admob.co.za", true, false, false},
- {"admob.com", true, false, false},
- {"admob.com.br", true, false, false},
- {"admob.com.es", true, false, false},
- {"admob.com.fr", true, false, false},
- {"admob.com.mx", true, false, false},
- {"admob.com.pt", true, false, false},
- {"admob.de", true, false, false},
- {"admob.dk", true, false, false},
- {"admob.es", true, false, false},
- {"admob.fi", true, false, false},
- {"admob.fr", true, false, false},
- {"admob.gr", true, false, false},
- {"admob.hk", true, false, false},
- {"admob.ie", true, false, false},
- {"admob.in", true, false, false},
- {"admob.it", true, false, false},
- {"admob.jp", true, false, false},
- {"admob.kr", true, false, false},
- {"admob.mobi", true, false, false},
- {"admob.no", true, false, false},
- {"admob.ph", true, false, false},
- {"admob.pt", true, false, false},
- {"admob.sg", true, false, false},
- {"admob.tw", true, false, false},
- {"admob.us", true, false, false},
- {"admob.vn", true, false, false},
- {"adwhirl.com", true, false, false},
- {"ampproject.com", true, false, false},
- {"ampproject.net", true, false, false},
- {"ampproject.org", true, false, false},
- {"android.com", true, false, false},
- {"anycast-edge.metric.gstatic.com", true, false, false},
- {"anycast-stb.metric.gstatic.com", true, false, false},
- {"anycast.metric.gstatic.com", true, false, false},
- {"cdn.ampproject.org", true, false, false},
- {"chromecast.com", true, false, false},
- {"chromeexperiments.com", true, false, false},
- {"chromestatus.com", true, false, false},
- {"chromium.org", true, false, false},
- {"clients6.google.com", true, false, false},
- {"cloudendpointsapis.com", true, false, false},
- {"dartmotif.com", true, false, false},
- {"dartsearch.net", true, false, false},
- {"doubleclick.com", true, false, false},
- {"doubleclick.ne.jp", true, false, false},
- {"doubleclick.net", true, false, false},
- {"doubleclickusercontent.com", true, false, false},
- {"fls.doubleclick.net", true, false, false},
- {"g.co", true, false, false},
- {"g.doubleclick.net", true, false, false},
- {"ggpht.com", true, false, false},
- {"gmodules.com", true, false, false},
- {"goo.gl", true, false, false},
- {"google-syndication.com", true, false, false},
- {"google.cat", true, false, false},
- {"google.info", true, false, false},
- {"google.jobs", true, false, false},
- {"google.net", true, false, false},
- {"google.org", true, false, false},
- {"google.stackdriver.com", true, false, false},
- {"googleadapis.com", true, false, false},
- {"googleadservices.com", true, false, false},
- {"googleadsserving.cn", true, false, false},
- {"googlealumni.com", true, false, false},
- {"googleapis.cn", true, false, false},
- {"googleapis.com", true, false, false},
- {"googleapps.com", true, false, false},
- {"googlecbs.com", true, false, false},
- {"googlecode.com", true, false, false},
- {"googlecommerce.com", true, false, false},
- {"googledrive.com", true, false, false},
- {"googleenterprise.com", true, false, false},
- {"googlefiber.com", true, false, false},
- {"googlefiber.net", true, false, false},
- {"googlegoro.com", true, false, false},
- {"googlehosted.com", true, false, false},
- {"googlepayments.com", true, false, false},
- {"googlesource.com", true, false, false},
- {"googlesyndication.com", true, false, false},
- {"googletagmanager.com", true, false, false},
- {"googletagservices.com", true, false, false},
- {"googleusercontent.com", true, false, false},
- {"googlezip.net", true, false, false},
- {"gstatic.cn", true, false, false},
- {"gstatic.com", true, false, false},
- {"gvt3.com", true, false, false},
- {"gvt9.com", true, false, false},
- {"picasa.com", true, false, false},
- {"recaptcha.net", true, false, false},
- {"stackdriver.com", true, false, false},
- {"stbcast-stb.metric.gstatic.com", true, false, false},
- {"stbcast.metric.gstatic.com", true, false, false},
- {"stbcast2-stb.metric.gstatic.com", true, false, false},
- {"stbcast2.metric.gstatic.com", true, false, false},
- {"stbcast3-stb.metric.gstatic.com", true, false, false},
- {"stbcast3.metric.gstatic.com", true, false, false},
- {"stbcast4-stb.metric.gstatic.com", true, false, false},
- {"stbcast4.metric.gstatic.com", true, false, false},
- {"unicast-edge.metric.gstatic.com", true, false, false},
- {"unicast-stb.metric.gstatic.com", true, false, false},
- {"unicast.metric.gstatic.com", true, false, false},
- {"unicast2-stb.metric.gstatic.com", true, false, false},
- {"unicast2.metric.gstatic.com", true, false, false},
- {"waze.com", true, false, false},
- {"withgoogle.com", true, false, false},
- {"youtu.be", true, false, false},
- {"youtube-3rd-party.com", true, false, false},
- {"youtube-nocookie.com", true, false, false},
- {"youtube.ae", true, false, false},
- {"youtube.al", true, false, false},
- {"youtube.am", true, false, false},
- {"youtube.at", true, false, false},
- {"youtube.az", true, false, false},
- {"youtube.ba", true, false, false},
- {"youtube.be", true, false, false},
- {"youtube.bg", true, false, false},
- {"youtube.bh", true, false, false},
- {"youtube.bo", true, false, false},
- {"youtube.ca", true, false, false},
- {"youtube.cat", true, false, false},
- {"youtube.ch", true, false, false},
- {"youtube.cl", true, false, false},
- {"youtube.co", true, false, false},
- {"youtube.co.ae", true, false, false},
- {"youtube.co.at", true, false, false},
- {"youtube.co.hu", true, false, false},
- {"youtube.co.id", true, false, false},
- {"youtube.co.il", true, false, false},
- {"youtube.co.in", true, false, false},
- {"youtube.co.jp", true, false, false},
- {"youtube.co.ke", true, false, false},
- {"youtube.co.kr", true, false, false},
- {"youtube.co.ma", true, false, false},
- {"youtube.co.nz", true, false, false},
- {"youtube.co.th", true, false, false},
- {"youtube.co.ug", true, false, false},
- {"youtube.co.uk", true, false, false},
- {"youtube.co.ve", true, false, false},
- {"youtube.co.za", true, false, false},
- {"youtube.com", true, false, false},
- {"youtube.com.ar", true, false, false},
- {"youtube.com.au", true, false, false},
- {"youtube.com.az", true, false, false},
- {"youtube.com.bh", true, false, false},
- {"youtube.com.bo", true, false, false},
- {"youtube.com.br", true, false, false},
- {"youtube.com.by", true, false, false},
- {"youtube.com.co", true, false, false},
- {"youtube.com.do", true, false, false},
- {"youtube.com.ee", true, false, false},
- {"youtube.com.eg", true, false, false},
- {"youtube.com.es", true, false, false},
- {"youtube.com.gh", true, false, false},
- {"youtube.com.gr", true, false, false},
- {"youtube.com.gt", true, false, false},
- {"youtube.com.hk", true, false, false},
- {"youtube.com.hr", true, false, false},
- {"youtube.com.jm", true, false, false},
- {"youtube.com.jo", true, false, false},
- {"youtube.com.kw", true, false, false},
- {"youtube.com.lb", true, false, false},
- {"youtube.com.lv", true, false, false},
- {"youtube.com.mk", true, false, false},
- {"youtube.com.mt", true, false, false},
- {"youtube.com.mx", true, false, false},
- {"youtube.com.my", true, false, false},
- {"youtube.com.ng", true, false, false},
- {"youtube.com.om", true, false, false},
- {"youtube.com.pe", true, false, false},
- {"youtube.com.ph", true, false, false},
- {"youtube.com.pk", true, false, false},
- {"youtube.com.pt", true, false, false},
- {"youtube.com.qa", true, false, false},
- {"youtube.com.ro", true, false, false},
- {"youtube.com.sa", true, false, false},
- {"youtube.com.sg", true, false, false},
- {"youtube.com.tn", true, false, false},
- {"youtube.com.tr", true, false, false},
- {"youtube.com.tw", true, false, false},
- {"youtube.com.ua", true, false, false},
- {"youtube.com.uy", true, false, false},
- {"youtube.com.ve", true, false, false},
- {"youtube.cz", true, false, false},
- {"youtube.de", true, false, false},
- {"youtube.dk", true, false, false},
- {"youtube.ee", true, false, false},
- {"youtube.es", true, false, false},
- {"youtube.fi", true, false, false},
- {"youtube.fr", true, false, false},
- {"youtube.ge", true, false, false},
- {"youtube.gr", true, false, false},
- {"youtube.gt", true, false, false},
- {"youtube.hk", true, false, false},
- {"youtube.hr", true, false, false},
- {"youtube.hu", true, false, false},
- {"youtube.ie", true, false, false},
- {"youtube.in", true, false, false},
- {"youtube.is", true, false, false},
- {"youtube.it", true, false, false},
- {"youtube.jo", true, false, false},
- {"youtube.jp", true, false, false},
- {"youtube.kr", true, false, false},
- {"youtube.lk", true, false, false},
- {"youtube.lt", true, false, false},
- {"youtube.lv", true, false, false},
- {"youtube.ma", true, false, false},
- {"youtube.md", true, false, false},
- {"youtube.me", true, false, false},
- {"youtube.mk", true, false, false},
- {"youtube.mx", true, false, false},
- {"youtube.my", true, false, false},
- {"youtube.ng", true, false, false},
- {"youtube.nl", true, false, false},
- {"youtube.no", true, false, false},
- {"youtube.pe", true, false, false},
- {"youtube.ph", true, false, false},
- {"youtube.pk", true, false, false},
- {"youtube.pl", true, false, false},
- {"youtube.pr", true, false, false},
- {"youtube.pt", true, false, false},
- {"youtube.qa", true, false, false},
- {"youtube.ro", true, false, false},
- {"youtube.rs", true, false, false},
- {"youtube.ru", true, false, false},
- {"youtube.sa", true, false, false},
- {"youtube.se", true, false, false},
- {"youtube.sg", true, false, false},
- {"youtube.si", true, false, false},
- {"youtube.sk", true, false, false},
- {"youtube.sn", true, false, false},
- {"youtube.tn", true, false, false},
- {"youtube.ua", true, false, false},
- {"youtube.ug", true, false, false},
- {"youtube.uy", true, false, false},
- {"youtube.vn", true, false, false},
- {"youtubeeducation.com", true, false, false},
- {"youtubemobilesupport.com", true, false, false},
- {"ytimg.com", true, false, false},
-
- // Origins without subdomains and with same-origin collectors.
- {"accounts.google.com", false, true, false},
- {"apis.google.com", false, true, false},
- {"app.google.stackdriver.com", false, true, false},
- {"b.mail.google.com", false, true, false},
- {"chatenabled.mail.google.com", false, true, false},
- {"ddm.google.com", false, true, false},
- {"gmail.com", false, true, false},
- {"gmail.google.com", false, true, false},
- {"mail-attachment.googleusercontent.com", false, true, false},
- {"mail.google.com", false, true, false},
- {"www.gmail.com", false, true, false},
-
- // Origins without subdomains or same-origin collectors.
- {"ad.doubleclick.net", false, false, false},
- {"drive.google.com", false, false, false},
- {"redirector.googlevideo.com", false, false, false},
-};
-
-const char* const kGoogleStandardCollectors[] = {
- "https://beacons.gcp.gvt2.com/domainreliability/upload",
- "https://beacons.gvt2.com/domainreliability/upload",
- "https://beacons2.gvt2.com/domainreliability/upload",
- "https://beacons3.gvt2.com/domainreliability/upload",
- "https://beacons4.gvt2.com/domainreliability/upload",
- "https://beacons5.gvt2.com/domainreliability/upload",
- "https://beacons5.gvt3.com/domainreliability/upload",
- "https://clients2.google.com/domainreliability/upload",
-};
-
-const char* const kGoogleOriginSpecificCollectorPathString =
- "/domainreliability/upload";
-
-static std::unique_ptr<DomainReliabilityConfig> CreateGoogleConfig(
- const GoogleConfigParams& params,
- bool is_www) {
- if (is_www)
- DCHECK(params.duplicate_for_www);
-
- std::string hostname = (is_www ? "www." : "") + std::string(params.hostname);
- bool include_subdomains = params.include_subdomains && !is_www;
-
- std::unique_ptr<DomainReliabilityConfig> config(
- new DomainReliabilityConfig());
- config->origin = GURL("https://" + hostname + "/");
- config->include_subdomains = include_subdomains;
- config->collectors.clear();
- if (params.include_origin_specific_collector) {
- GURL::Replacements replacements;
- replacements.SetPathStr(kGoogleOriginSpecificCollectorPathString);
- config->collectors.push_back(
- std::make_unique<GURL>(config->origin.ReplaceComponents(replacements)));
- }
- for (size_t i = 0; i < base::size(kGoogleStandardCollectors); i++)
- config->collectors.push_back(
- std::make_unique<GURL>(kGoogleStandardCollectors[i]));
- config->success_sample_rate = 0.05;
- config->failure_sample_rate = 1.00;
- config->path_prefixes.clear();
- return config;
-}
-
-} // namespace
-
// static
void GetAllGoogleConfigs(
std::vector<std::unique_ptr<DomainReliabilityConfig>>* configs_out) {
configs_out->clear();
-
- for (auto& params : kGoogleConfigs) {
- configs_out->push_back(CreateGoogleConfig(params, false));
- if (params.duplicate_for_www)
- configs_out->push_back(CreateGoogleConfig(params, true));
- }
}
} // namespace domain_reliability
--- a/components/domain_reliability/uploader.cc
+++ b/components/domain_reliability/uploader.cc
@@ -82,7 +82,7 @@ class DomainReliabilityUploaderImpl
if (discard_uploads_)
discarded_upload_count_++;
- if (discard_uploads_ || shutdown_) {
+ if (true) {
DVLOG(1) << "Discarding report instead of uploading.";
UploadResult result;
result.status = UploadResult::SUCCESS;
--- a/components/domain_reliability/bake_in_configs.py
+++ b/components/domain_reliability/bake_in_configs.py
@@ -490,7 +490,7 @@ def origin_is_whitelisted(origin):
domain = origin[8:-1]
else:
return False
- return any(domain == e or domain.endswith('.' + e) for e in DOMAIN_WHITELIST)
+ return False
def quote_and_wrap_text(text, width=79, prefix=' "', suffix='"'):
--- a/components/domain_reliability/BUILD.gn
+++ b/components/domain_reliability/BUILD.gn
@@ -9,26 +9,6 @@ action("bake_in_configs") {
script = "bake_in_configs.py"
inputs = [
- "baked_in_configs/c_android_clients_google_com.json",
- "baked_in_configs/c_bigcache_googleapis_com.json",
- "baked_in_configs/c_doc-0-0-sj_sj_googleusercontent_com.json",
- "baked_in_configs/c_docs_google_com.json",
- "baked_in_configs/c_drive_google_com.json",
- "baked_in_configs/c_googlesyndication_com.json",
- "baked_in_configs/c_pack_google_com.json",
- "baked_in_configs/c_play_google_com.json",
- "baked_in_configs/c_youtube_com.json",
- "baked_in_configs/clients2_google_com.json",
- "baked_in_configs/docs_google_com.json",
- "baked_in_configs/gcp_gvt2_com.json",
- "baked_in_configs/gcp_gvt6_com.json",
- "baked_in_configs/google-analytics_com.json",
- "baked_in_configs/googlevideo_com.json",
- "baked_in_configs/gvt1_com.json",
- "baked_in_configs/gvt2_com.json",
- "baked_in_configs/gvt6_com.json",
- "baked_in_configs/ssl_gstatic_com.json",
- "baked_in_configs/www_google_com.json",
]
output_file = "$target_gen_dir/baked_in_configs.cc"
@@ -38,13 +18,21 @@ action("bake_in_configs") {
# The JSON file list is too long for the command line on Windows, so put
# them in a response file.
- response_file_contents = rebase_path(inputs, root_build_dir)
- args = [
- "--file-list",
- "{{response_file_name}}",
- "--output",
- rebase_path(output_file, root_build_dir),
- ]
+ if (is_win) {
+ args = [
+ "--file-list",
+ "nul",
+ "--output",
+ rebase_path(output_file, root_build_dir),
+ ]
+ } else {
+ args = [
+ "--file-list",
+ "/dev/null",
+ "--output",
+ rebase_path(output_file, root_build_dir),
+ ]
+ }
}
jumbo_component("domain_reliability") {

View File

@ -0,0 +1,98 @@
# Disables file download quarantining
--- a/content/browser/renderer_host/pepper/pepper_file_io_host.cc
+++ b/content/browser/renderer_host/pepper/pepper_file_io_host.cc
@@ -432,7 +432,7 @@ void PepperFileIOHost::OnLocalFileOpened
ppapi::host::ReplyMessageContext reply_context,
const base::FilePath& path,
base::File::Error error_code) {
-#if defined(OS_WIN) || defined(OS_LINUX)
+#if 0
// Quarantining a file before its contents are available is only supported on
// Windows and Linux.
if (!FileOpenForWrite(open_flags_) || error_code != base::File::FILE_OK) {
@@ -452,7 +452,7 @@ void PepperFileIOHost::OnLocalFileOpened
#endif
}
-#if defined(OS_WIN) || defined(OS_LINUX)
+#if 0
void PepperFileIOHost::OnLocalFileQuarantined(
ppapi::host::ReplyMessageContext reply_context,
const base::FilePath& path,
--- a/content/browser/renderer_host/pepper/pepper_file_io_host.h
+++ b/content/browser/renderer_host/pepper/pepper_file_io_host.h
@@ -15,7 +15,6 @@
#include "base/macros.h"
#include "base/memory/ref_counted.h"
#include "base/memory/weak_ptr.h"
-#include "components/download/quarantine/quarantine.h"
#include "content/browser/renderer_host/pepper/browser_ppapi_host_impl.h"
#include "ipc/ipc_listener.h"
#include "ipc/ipc_platform_file.h"
@@ -92,10 +91,6 @@ class PepperFileIOHost : public ppapi::h
const base::FilePath& path,
base::File::Error error_code);
- void OnLocalFileQuarantined(ppapi::host::ReplyMessageContext reply_context,
- const base::FilePath& path,
- download::QuarantineFileResult quarantine_result);
-
void SendFileOpenReply(ppapi::host::ReplyMessageContext reply_context,
base::File::Error error_code);
--- a/components/download/internal/common/base_file.cc
+++ b/components/download/internal/common/base_file.cc
@@ -22,7 +22,6 @@
#include "components/download/public/common/download_interrupt_reasons_utils.h"
#include "components/download/public/common/download_item.h"
#include "components/download/public/common/download_stats.h"
-#include "components/download/quarantine/quarantine.h"
#include "crypto/secure_hash.h"
#if defined(OS_ANDROID)
@@ -494,7 +493,7 @@ DownloadInterruptReason BaseFile::Publis
}
#endif // defined(OS_ANDROID)
-#if defined(OS_WIN) || defined(OS_MACOSX) || defined(OS_LINUX)
+#if 0
namespace {
@@ -578,7 +577,7 @@ DownloadInterruptReason BaseFile::Annota
}
return DOWNLOAD_INTERRUPT_REASON_FILE_FAILED;
}
-#else // !OS_WIN && !OS_MACOSX && !OS_LINUX
+#else // 1
DownloadInterruptReason BaseFile::AnnotateWithSourceInformation(
const std::string& client_guid,
const GURL& source_url,
--- a/components/download/quarantine/quarantine.cc
+++ b/components/download/quarantine/quarantine.cc
@@ -6,8 +6,6 @@
#include "build/build_config.h"
-#if !defined(OS_WIN) && !defined(OS_MACOSX)
-
namespace download {
QuarantineFileResult QuarantineFile(const base::FilePath& file,
@@ -18,5 +16,3 @@ QuarantineFileResult QuarantineFile(cons
}
} // namespace download
-
-#endif // !WIN && !MAC
--- a/content/browser/BUILD.gn
+++ b/content/browser/BUILD.gn
@@ -51,7 +51,6 @@ jumbo_source_set("browser") {
"//components/discardable_memory/service",
"//components/download/database",
"//components/download/public/common:public",
- "//components/download/quarantine",
"//components/filename_generation",
"//components/link_header_util",
"//components/metrics",

View File

@ -0,0 +1,66 @@
# NOTE: Modified to remove usage of compiler #if macros
From: csagan5 <32685696+csagan5@users.noreply.github.com>
Date: Sun, 8 Jul 2018 18:16:34 +0200
Subject: Disable fetching of all field trials
---
.../src/org/chromium/chrome/browser/ChromeFeatureList.java | 12 +++---------
components/variations/service/variations_service.cc | 4 ++++
2 files changed, 7 insertions(+), 9 deletions(-)
--- a/chrome/android/java/src/org/chromium/chrome/browser/ChromeFeatureList.java
+++ b/chrome/android/java/src/org/chromium/chrome/browser/ChromeFeatureList.java
@@ -106,9 +106,7 @@ public abstract class ChromeFeatureList
*/
public static int getFieldTrialParamByFeatureAsInt(
String featureName, String paramName, int defaultValue) {
- if (sTestFeatures != null) return defaultValue;
- assert isInitialized();
- return nativeGetFieldTrialParamByFeatureAsInt(featureName, paramName, defaultValue);
+ return defaultValue;
}
/**
@@ -125,9 +123,7 @@ public abstract class ChromeFeatureList
*/
public static double getFieldTrialParamByFeatureAsDouble(
String featureName, String paramName, double defaultValue) {
- if (sTestFeatures != null) return defaultValue;
- assert isInitialized();
- return nativeGetFieldTrialParamByFeatureAsDouble(featureName, paramName, defaultValue);
+ return defaultValue;
}
/**
@@ -144,9 +140,7 @@ public abstract class ChromeFeatureList
*/
public static boolean getFieldTrialParamByFeatureAsBoolean(
String featureName, String paramName, boolean defaultValue) {
- if (sTestFeatures != null) return defaultValue;
- assert isInitialized();
- return nativeGetFieldTrialParamByFeatureAsBoolean(featureName, paramName, defaultValue);
+ return defaultValue;
}
// Alphabetical:
--- a/components/variations/service/variations_service.cc
+++ b/components/variations/service/variations_service.cc
@@ -240,17 +240,7 @@ bool GetInstanceManipulations(const net:
// Variations seed fetching is only enabled in official Chrome builds, if a URL
// is specified on the command line, and for testing.
bool IsFetchingEnabled() {
-#if !defined(GOOGLE_CHROME_BUILD)
- if (!base::CommandLine::ForCurrentProcess()->HasSwitch(
- switches::kVariationsServerURL) &&
- !g_should_fetch_for_testing) {
- DVLOG(1)
- << "Not performing repeated fetching in unofficial build without --"
- << switches::kVariationsServerURL << " specified.";
- return false;
- }
-#endif
- return true;
+ return false;
}
std::unique_ptr<SeedResponse> MaybeImportFirstRunSeed(

View File

@ -0,0 +1,107 @@
# Disables references to fonts.googleapis.com
--- a/components/dom_distiller/content/browser/dom_distiller_viewer_source.cc
+++ b/components/dom_distiller/content/browser/dom_distiller_viewer_source.cc
@@ -309,7 +309,7 @@ bool DomDistillerViewerSource::ShouldSer
}
std::string DomDistillerViewerSource::GetContentSecurityPolicyStyleSrc() const {
- return "style-src 'self' https://fonts.googleapis.com;";
+ return "style-src 'self';";
}
std::string DomDistillerViewerSource::GetContentSecurityPolicyChildSrc() const {
--- a/components/dom_distiller/core/html/preview.html
+++ b/components/dom_distiller/core/html/preview.html
@@ -11,7 +11,7 @@ found in the LICENSE file.
<meta name="theme-color" id="theme-color">
<title>Title goes here and it could be kind of lengthy - Publisher name</title>
<link href="../css/distilledpage.css" rel="stylesheet" type="text/css">
- <link href='https://fonts.googleapis.com/css?family=Roboto' rel='stylesheet' type='text/css'>
+ <link href='chrome://resources/css/roboto.css' rel='stylesheet' type='text/css'>
<style>
.english :lang(th) {display: none}
.english :lang(zh) {display: none}
--- a/third_party/catapult/third_party/polymer/components/font-roboto/roboto.html
+++ b/third_party/catapult/third_party/polymer/components/font-roboto/roboto.html
@@ -7,4 +7,4 @@ The complete set of contributors may be
Code distributed by Google as part of the polymer project is also
subject to an additional IP rights grant found at http://polymer.github.io/PATENTS.txt
-->
-<link rel="stylesheet" type="text/css" href="https://fonts.googleapis.com/css?family=Roboto+Mono:400,700|Roboto:400,300,300italic,400italic,500,500italic,700,700italic" crossorigin="anonymous">
+<link rel="stylesheet" href="chrome://resources/css/roboto.css">
--- a/third_party/catapult/tracing/third_party/gl-matrix/jsdoc-template/static/default.css
+++ b/third_party/catapult/tracing/third_party/gl-matrix/jsdoc-template/static/default.css
@@ -168,7 +168,7 @@ ul.inheritsList
/* Copied from styles.css generated by Github Pages */
-@import url(https://fonts.googleapis.com/css?family=Lato:300italic,700italic,300,700);
+@import url(chrome://resources/css/roboto.css);
body {
padding:50px;
--- a/third_party/crashpad/crashpad/doc/support/crashpad_doxygen.css
+++ b/third_party/crashpad/crashpad/doc/support/crashpad_doxygen.css
@@ -12,8 +12,7 @@
* See the License for the specific language governing permissions and
* limitations under the License. */
-@import "https://fonts.googleapis.com/css?family=Open+Sans:300,400,700&subset=latin,cyrillic-ext,greek-ext,cyrillic,greek,vietnamese,latin-ext";
-@import "https://fonts.googleapis.com/css?family=Source+Code+Pro";
+@import "chrome://resources/css/roboto.css";
body,
table,
--- a/third_party/flatbuffers/src/docs/header.html
+++ b/third_party/flatbuffers/src/docs/header.html
@@ -14,7 +14,7 @@ $treeview
$search
$mathjax
<link href="$relpath^$stylesheet" rel="stylesheet" type="text/css" />
-<link href="https://fonts.googleapis.com/css?family=Roboto:300,400,400italic,500,500italic,700,700italic|Roboto+Mono:400,700" rel="stylesheet">
+<link href="chrome://resources/css/roboto.css" rel="stylesheet">
$extrastylesheet
</head>
<body>
--- a/components/dom_distiller/core/javascript/dom_distiller_viewer.js
+++ b/components/dom_distiller/core/javascript/dom_distiller_viewer.js
@@ -123,7 +123,7 @@ function maybeSetWebFont() {
return;
var e = document.createElement('link');
- e.href = 'https://fonts.googleapis.com/css?family=Roboto';
+ e.href = 'chrome://resources/css/roboto.css';
e.rel = 'stylesheet';
e.type = 'text/css';
document.head.appendChild(e);
--- a/tools/md_browser/base.css
+++ b/tools/md_browser/base.css
@@ -16,8 +16,7 @@
/* Common styles and definitions. */
-@import "//fonts.googleapis.com/css?family=Open+Sans:300,400,700&subset=latin,cyrillic-ext,greek-ext,cyrillic,greek,vietnamese,latin-ext";
-@import "//fonts.googleapis.com/css?family=Source+Code+Pro";
+@import "chrome://resources/css/roboto.css";
*,
*::after,
*::before {
@@ -72,7 +71,7 @@ ul, ol {
user-select: none;
}
.u-monospace {
- font-family: 'Source Code Pro', monospace;
+ font-family: monospace;
}
/* Common.soy */
@@ -82,7 +81,7 @@ ul, ol {
color: #000;
display: -ms-flexbox;
display: flex;
- font: 14px/1.54 'Open Sans', sans-serif;
+ font: 14px/1.54 'Roboto', sans-serif;
min-height: 100vh;
-ms-flex-direction: column;
flex-direction: column;

View File

@ -0,0 +1,138 @@
# Disables Gaia code
# Somehow it is still activated even without being signed-in: https://github.com/Eloston/ungoogled-chromium/issues/104
--- a/google_apis/gaia/gaia_auth_fetcher.cc
+++ b/google_apis/gaia/gaia_auth_fetcher.cc
@@ -262,61 +262,6 @@ void GaiaAuthFetcher::CreateAndStartGaia
int load_flags,
const net::NetworkTrafficAnnotationTag& traffic_annotation) {
DCHECK(!fetch_pending_) << "Tried to fetch two things at once!";
-
- auto resource_request = std::make_unique<network::ResourceRequest>();
- resource_request->url = gaia_gurl;
- original_url_ = gaia_gurl;
-
- if (!(load_flags & net::LOAD_DO_NOT_SEND_COOKIES)) {
- DCHECK_EQ(GaiaUrls::GetInstance()->gaia_url(), gaia_gurl.GetOrigin())
- << gaia_gurl;
- resource_request->site_for_cookies = GaiaUrls::GetInstance()->gaia_url();
- }
-
- if (!body.empty())
- resource_request->method = "POST";
-
- if (!headers.empty())
- resource_request->headers.AddHeadersFromString(headers);
-
- // The Gaia token exchange requests do not require any cookie-based
- // identification as part of requests. We suppress sending any cookies to
- // maintain a separation between the user's browsing and Chrome's internal
- // services. Where such mixing is desired (MergeSession or OAuthLogin), it
- // will be done explicitly.
- resource_request->load_flags = load_flags;
-
- // Use raw headers as the cookies are filtered-out of the response when
- // serialized at the IPC layer.
- resource_request->report_raw_headers = true;
-
- url_loader_ = network::SimpleURLLoader::Create(std::move(resource_request),
- traffic_annotation);
- if (!body.empty())
- url_loader_->AttachStringForUpload(body,
- "application/x-www-form-urlencoded");
-
- url_loader_->SetAllowHttpErrorResults(true);
-
- VLOG(2) << "Gaia fetcher URL: " << gaia_gurl.spec();
- VLOG(2) << "Gaia fetcher headers: " << headers;
- VLOG(2) << "Gaia fetcher body: " << body;
-
- // Fetchers are sometimes cancelled because a network change was detected,
- // especially at startup and after sign-in on ChromeOS. Retrying once should
- // be enough in those cases; let the fetcher retry up to 3 times just in case.
- // http://crbug.com/163710
- url_loader_->SetRetryOptions(
- 3, network::SimpleURLLoader::RETRY_ON_NETWORK_CHANGE);
-
- fetch_pending_ = true;
-
- // Unretained is OK below as |url_loader_| is owned by this.
- url_loader_->DownloadToString(
- url_loader_factory_.get(),
- base::BindOnce(&GaiaAuthFetcher::OnURLLoadComplete,
- base::Unretained(this)),
- kMaxMessageSize);
}
// static
--- a/chrome/browser/resources/component_extension_resources.grd
+++ b/chrome/browser/resources/component_extension_resources.grd
@@ -32,8 +32,6 @@
<!-- Bookmarks -->
<include name="IDR_COMPONENT_BOOKMARKS_BOOKMARKS_HTML" file="bookmarks/bookmarks.html" type="BINDATA" />
- <!-- Gaia auth extension -->
- <include name="IDR_GAIA_AUTH_SUCCESS" file="gaia_auth/success.html" allowexternalscript="true" type="BINDATA" />
<!-- Hangout Services extension, included in Google Chrome builds only. -->
<if expr="_google_chrome or enable_hangout_services_extension">
<include name="IDR_HANGOUT_SERVICES_BACKGROUND_HTML" file="hangout_services/background.html" type="BINDATA" />
--- a/chrome/browser/extensions/signin/gaia_auth_extension_loader.cc
+++ b/chrome/browser/extensions/signin/gaia_auth_extension_loader.cc
@@ -43,19 +43,6 @@ ComponentLoader* GetComponentLoader(Brow
void LoadGaiaAuthExtension(BrowserContext* context) {
DCHECK_CURRENTLY_ON(BrowserThread::UI);
-
- ComponentLoader* component_loader = GetComponentLoader(context);
- const base::CommandLine* command_line =
- base::CommandLine::ForCurrentProcess();
- if (command_line->HasSwitch(::switches::kAuthExtensionPath)) {
- base::FilePath auth_extension_path =
- command_line->GetSwitchValuePath(::switches::kAuthExtensionPath);
- component_loader->Add(IDR_GAIA_AUTH_MANIFEST, auth_extension_path);
- return;
- }
-
- component_loader->Add(IDR_GAIA_AUTH_MANIFEST,
- base::FilePath(FILE_PATH_LITERAL("gaia_auth")));
}
void UnloadGaiaAuthExtension(BrowserContext* context) {
--- a/chrome/browser/extensions/component_extensions_whitelist/whitelist.cc
+++ b/chrome/browser/extensions/component_extensions_whitelist/whitelist.cc
@@ -67,7 +67,6 @@ bool IsComponentExtensionWhitelisted(int
#endif
case IDR_CRYPTOTOKEN_MANIFEST:
case IDR_FEEDBACK_MANIFEST:
- case IDR_GAIA_AUTH_MANIFEST:
#if BUILDFLAG(ENABLE_HANGOUT_SERVICES_EXTENSION)
case IDR_HANGOUT_SERVICES_MANIFEST:
#endif
--- a/chrome/browser/ui/webui/signin/inline_login_ui.cc
+++ b/chrome/browser/ui/webui/signin/inline_login_ui.cc
@@ -53,7 +53,6 @@ content::WebUIDataSource* CreateWebUIDat
source->AddResourcePath("inline_login.css", IDR_INLINE_LOGIN_CSS);
source->AddResourcePath("inline_login.js", IDR_INLINE_LOGIN_JS);
- source->AddResourcePath("gaia_auth_host.js", IDR_GAIA_AUTH_AUTHENTICATOR_JS);
source->AddLocalizedString("title", IDS_CHROME_SIGNIN_TITLE);
source->AddLocalizedString(
--- a/chrome/browser/browser_resources.grd
+++ b/chrome/browser/browser_resources.grd
@@ -392,7 +392,6 @@
<include name="IDR_INLINE_LOGIN_HTML" file="resources\inline_login\inline_login.html" flattenhtml="true" allowexternalscript="true" type="BINDATA" />
<include name="IDR_INLINE_LOGIN_CSS" file="resources\inline_login\inline_login.css" flattenhtml="true" type="BINDATA" />
<include name="IDR_INLINE_LOGIN_JS" file="resources\inline_login\inline_login.js" flattenhtml="true" type="BINDATA" />
- <include name="IDR_GAIA_AUTH_AUTHENTICATOR_JS" file="resources\gaia_auth_host\authenticator.js" flattenhtml="true" type="BINDATA" />
<include name="IDR_INSPECT_CSS" file="resources\inspect\inspect.css" flattenhtml="true" type="BINDATA" />
<include name="IDR_INSPECT_HTML" file="resources\inspect\inspect.html" flattenhtml="true" allowexternalscript="true" type="BINDATA" />
<include name="IDR_INSPECT_JS" file="resources\inspect\inspect.js" flattenhtml="true" type="BINDATA" />
@@ -492,7 +491,6 @@
<include name="IDR_WEBRTC_LOGS_JS" file="resources\media\webrtc_logs.js" type="BINDATA" />
<include name="IDR_WEBSTORE_MANIFEST" file="resources\webstore_app\manifest.json" type="BINDATA" />
<include name="IDR_CRYPTOTOKEN_MANIFEST" file="resources\cryptotoken\manifest.json" type="BINDATA" />
- <include name="IDR_GAIA_AUTH_MANIFEST" file="resources\gaia_auth\manifest.json" type="BINDATA" />
<if expr="chromeos">
<if expr="optimize_webui">
<then>

View File

@ -0,0 +1,28 @@
# Disable Google Cloud Messaging (GCM) client
--- a/components/gcm_driver/gcm_client_impl.cc
+++ b/components/gcm_driver/gcm_client_impl.cc
@@ -496,6 +496,7 @@ void GCMClientImpl::StartGCM() {
void GCMClientImpl::InitializeMCSClient() {
DCHECK(network_connection_tracker_);
+ return;
std::vector<GURL> endpoints;
endpoints.push_back(gservices_settings_.GetMCSMainEndpoint());
GURL fallback_endpoint = gservices_settings_.GetMCSFallbackEndpoint();
@@ -685,6 +686,7 @@ void GCMClientImpl::RemoveHeartbeatInter
}
void GCMClientImpl::StartCheckin() {
+ return;
// Make sure no checkin is in progress.
if (checkin_request_)
return;
@@ -760,6 +762,7 @@ void GCMClientImpl::SetGServicesSettings
}
void GCMClientImpl::SchedulePeriodicCheckin() {
+ return;
// Make sure no checkin is in progress.
if (checkin_request_.get() || !device_checkin_info_.accounts_set)
return;

View File

@ -0,0 +1,588 @@
# Disables various detections of Google hosts and functionality specific to them
--- a/net/base/url_util.cc
+++ b/net/base/url_util.cc
@@ -392,28 +392,6 @@ void GetIdentityFromURL(const GURL& url,
}
bool HasGoogleHost(const GURL& url) {
- static const char* kGoogleHostSuffixes[] = {
- ".google.com",
- ".youtube.com",
- ".gmail.com",
- ".doubleclick.net",
- ".gstatic.com",
- ".googlevideo.com",
- ".googleusercontent.com",
- ".googlesyndication.com",
- ".google-analytics.com",
- ".googleadservices.com",
- ".googleapis.com",
- ".ytimg.com",
- };
- base::StringPiece host = url.host_piece();
- for (const char* suffix : kGoogleHostSuffixes) {
- // Here it's possible to get away with faster case-sensitive comparisons
- // because the list above is all lowercase, and a GURL's host name will
- // always be canonicalized to lowercase as well.
- if (base::EndsWith(host, suffix, base::CompareCase::SENSITIVE))
- return true;
- }
return false;
}
--- a/components/variations/net/variations_http_headers.cc
+++ b/components/variations/net/variations_http_headers.cc
@@ -29,10 +29,6 @@ namespace variations {
namespace {
-// The name string for the header for variations information.
-// Note that prior to M33 this header was named X-Chrome-Variations.
-const char kClientDataHeader[] = "X-Client-Data";
-
// The result of checking if a URL should have variations headers appended.
// This enum is used to record UMA histogram values, and should not be
// reordered.
@@ -96,34 +92,7 @@ class VariationsHeaderHelper {
: VariationsHeaderHelper(request, null_url_request, variations_header) {}
bool AppendHeaderIfNeeded(const GURL& url, InIncognito incognito) {
- // Note the criteria for attaching client experiment headers:
- // 1. We only transmit to Google owned domains which can evaluate
- // experiments.
- // 1a. These include hosts which have a standard postfix such as:
- // *.doubleclick.net or *.googlesyndication.com or
- // exactly www.googleadservices.com or
- // international TLD domains *.google.<TLD> or *.youtube.<TLD>.
- // 2. Only transmit for non-Incognito profiles.
- // 3. For the X-Client-Data header, only include non-empty variation IDs.
- if ((incognito == InIncognito::kYes) || !ShouldAppendVariationsHeader(url))
- return false;
-
- if (variations_header_.empty())
- return false;
-
- if (resource_request_) {
- // Set the variations header to cors_exempt_headers rather than headers
- // to be exempted from CORS checks.
- resource_request_->cors_exempt_headers.SetHeaderIfMissing(
- kClientDataHeader, variations_header_);
- } else if (url_request_) {
- url_request_->SetExtraRequestHeaderByName(kClientDataHeader,
- variations_header_, false);
- } else {
- NOTREACHED();
- return false;
- }
- return true;
+ return false;
}
private:
@@ -189,14 +158,10 @@ void RemoveVariationsHeaderIfNeeded(
const net::RedirectInfo& redirect_info,
const network::ResourceResponseHead& response_head,
std::vector<std::string>* to_be_removed_headers) {
- if (!ShouldAppendVariationsHeader(redirect_info.new_url))
- to_be_removed_headers->push_back(kClientDataHeader);
}
void StripVariationsHeaderIfNeeded(const GURL& new_location,
net::URLRequest* request) {
- if (!ShouldAppendVariationsHeader(new_location))
- request->RemoveRequestHeaderByName(kClientDataHeader);
}
std::unique_ptr<network::SimpleURLLoader>
@@ -226,11 +191,11 @@ CreateSimpleURLLoaderWithVariationsHeade
}
bool IsVariationsHeader(const std::string& header_name) {
- return header_name == kClientDataHeader;
+ return false;
}
bool HasVariationsHeader(const network::ResourceRequest& request) {
- return request.cors_exempt_headers.HasHeader(kClientDataHeader);
+ return false;
}
bool ShouldAppendVariationsHeaderForTesting(const GURL& url) {
@@ -239,7 +204,6 @@ bool ShouldAppendVariationsHeaderForTest
void UpdateCorsExemptHeaderForVariations(
network::mojom::NetworkContextParams* params) {
- params->cors_exempt_header_list.push_back(kClientDataHeader);
}
} // namespace variations
--- a/chrome/browser/page_load_metrics/page_load_metrics_util.cc
+++ b/chrome/browser/page_load_metrics/page_load_metrics_util.cc
@@ -169,9 +169,7 @@ bool DidObserveLoadingBehaviorInAnyFrame
}
bool IsGoogleSearchHostname(const GURL& url) {
- base::Optional<std::string> result =
- page_load_metrics::GetGoogleHostnamePrefix(url);
- return result && result.value() == "www";
+ return false;
}
bool IsGoogleSearchResultUrl(const GURL& url) {
--- a/components/search_engines/template_url.cc
+++ b/components/search_engines/template_url.cc
@@ -505,11 +505,7 @@ base::string16 TemplateURLRef::SearchTer
bool TemplateURLRef::HasGoogleBaseURLs(
const SearchTermsData& search_terms_data) const {
ParseIfNecessary(search_terms_data);
- return std::any_of(replacements_.begin(), replacements_.end(),
- [](const Replacement& replacement) {
- return replacement.type == GOOGLE_BASE_URL ||
- replacement.type == GOOGLE_BASE_SUGGEST_URL;
- });
+ return false;
}
bool TemplateURLRef::ExtractSearchTermsFromURL(
--- a/components/google/core/common/google_util.cc
+++ b/components/google/core/common/google_util.cc
@@ -45,120 +45,16 @@ bool gUseMockLinkDoctorBaseURLForTesting
bool g_ignore_port_numbers = false;
-bool IsPathHomePageBase(base::StringPiece path) {
- return (path == "/") || (path == "/webhp");
-}
-
-// Removes a single trailing dot if present in |host|.
-void StripTrailingDot(base::StringPiece* host) {
- if (host->ends_with("."))
- host->remove_suffix(1);
-}
-
-// True if the given canonical |host| is "[www.]<domain_in_lower_case>.<TLD>"
-// with a valid TLD. If |subdomain_permission| is ALLOW_SUBDOMAIN, we check
-// against host "*.<domain_in_lower_case>.<TLD>" instead. Will return the TLD
-// string in |tld|, if specified and the |host| can be parsed.
-bool IsValidHostName(base::StringPiece host,
- base::StringPiece domain_in_lower_case,
- SubdomainPermission subdomain_permission,
- base::StringPiece* tld) {
- // Fast path to avoid searching the registry set.
- if (host.find(domain_in_lower_case) == base::StringPiece::npos)
- return false;
-
- size_t tld_length =
- net::registry_controlled_domains::GetCanonicalHostRegistryLength(
- host, net::registry_controlled_domains::EXCLUDE_UNKNOWN_REGISTRIES,
- net::registry_controlled_domains::EXCLUDE_PRIVATE_REGISTRIES);
- if ((tld_length == 0) || (tld_length == std::string::npos))
- return false;
-
- // Removes the tld and the preceding dot.
- base::StringPiece host_minus_tld =
- host.substr(0, host.length() - tld_length - 1);
-
- if (tld)
- *tld = host.substr(host.length() - tld_length);
-
- if (base::LowerCaseEqualsASCII(host_minus_tld, domain_in_lower_case))
- return true;
-
- if (subdomain_permission == ALLOW_SUBDOMAIN) {
- std::string dot_domain(".");
- domain_in_lower_case.AppendToString(&dot_domain);
- return base::EndsWith(host_minus_tld, dot_domain,
- base::CompareCase::INSENSITIVE_ASCII);
- }
-
- std::string www_domain("www.");
- domain_in_lower_case.AppendToString(&www_domain);
- return base::LowerCaseEqualsASCII(host_minus_tld, www_domain);
-}
-
-// True if |url| is a valid URL with HTTP or HTTPS scheme. If |port_permission|
-// is DISALLOW_NON_STANDARD_PORTS, this also requires |url| to use the standard
-// port for its scheme (80 for HTTP, 443 for HTTPS).
-bool IsValidURL(const GURL& url, PortPermission port_permission) {
- return url.is_valid() && url.SchemeIsHTTPOrHTTPS() &&
- (url.port().empty() || g_ignore_port_numbers ||
- (port_permission == ALLOW_NON_STANDARD_PORTS));
-}
-
-bool IsCanonicalHostGoogleHostname(base::StringPiece canonical_host,
- SubdomainPermission subdomain_permission) {
- const GURL& base_url(CommandLineGoogleBaseURL());
- if (base_url.is_valid() && (canonical_host == base_url.host_piece()))
- return true;
-
- base::StringPiece tld;
- if (!IsValidHostName(canonical_host, "google", subdomain_permission, &tld))
- return false;
-
- // Remove the trailing dot from tld if present, as for google domain it's the
- // same page.
- StripTrailingDot(&tld);
-
- static const base::NoDestructor<base::flat_set<base::StringPiece>>
- google_tlds(std::initializer_list<base::StringPiece>({GOOGLE_TLD_LIST}));
- return google_tlds->contains(tld);
-}
-
-// True if |url| is a valid URL with a host that is in the static list of
-// Google subdomains for google search, and an HTTP or HTTPS scheme. Requires
-// |url| to use the standard port for its scheme (80 for HTTP, 443 for HTTPS).
-bool IsGoogleSearchSubdomainUrl(const GURL& url) {
- if (!IsValidURL(url, PortPermission::DISALLOW_NON_STANDARD_PORTS))
- return false;
-
- base::StringPiece host(url.host_piece());
- StripTrailingDot(&host);
-
- static const base::NoDestructor<base::flat_set<base::StringPiece>>
- google_subdomains(std::initializer_list<base::StringPiece>(
- {"ipv4.google.com", "ipv6.google.com"}));
-
- return google_subdomains->contains(host);
-}
-
} // namespace
// Global functions -----------------------------------------------------------
bool HasGoogleSearchQueryParam(base::StringPiece str) {
- url::Component query(0, static_cast<int>(str.length())), key, value;
- while (url::ExtractQueryKeyValue(str.data(), &query, &key, &value)) {
- base::StringPiece key_str = str.substr(key.begin, key.len);
- if (key_str == "q" || key_str == "as_q")
- return true;
- }
return false;
}
GURL LinkDoctorBaseURL() {
- if (gUseMockLinkDoctorBaseURLForTesting)
- return GURL("http://mock.linkdoctor.url/for?testing");
- return GURL(LINKDOCTOR_SERVER_REQUEST_URL);
+ return GURL();
}
void SetMockLinkDoctorBaseURLForTesting() {
@@ -172,162 +68,53 @@ std::string GetGoogleLocale(const std::s
GURL AppendGoogleLocaleParam(const GURL& url,
const std::string& application_locale) {
- return net::AppendQueryParameter(url, "hl",
- GetGoogleLocale(application_locale));
+ return url;
}
std::string GetGoogleCountryCode(const GURL& google_homepage_url) {
- base::StringPiece google_hostname = google_homepage_url.host_piece();
- // TODO(igorcov): This needs a fix for case when the host has a trailing dot,
- // like "google.com./". https://crbug.com/720295.
- const size_t last_dot = google_hostname.find_last_of('.');
- if (last_dot == std::string::npos)
- return std::string();
- base::StringPiece country_code = google_hostname.substr(last_dot + 1);
- // Assume the com TLD implies the US.
- if (country_code == "com")
- return "us";
- // Google uses the Unicode Common Locale Data Repository (CLDR), and the CLDR
- // code for the UK is "gb".
- if (country_code == "uk")
- return "gb";
- // Catalonia does not have a CLDR country code, since it's a region in Spain,
- // so use Spain instead.
- if (country_code == "cat")
- return "es";
- return country_code.as_string();
+ return "nolocale";
}
GURL GetGoogleSearchURL(const GURL& google_homepage_url) {
- // To transform the homepage URL into the corresponding search URL, add the
- // "search" and the "q=" query string.
- GURL::Replacements replacements;
- replacements.SetPathStr("search");
- replacements.SetQueryStr("q=");
- return google_homepage_url.ReplaceComponents(replacements);
+ return google_homepage_url;
}
const GURL& CommandLineGoogleBaseURL() {
- // Unit tests may add command-line flags after the first call to this
- // function, so we don't simply initialize a static |base_url| directly and
- // then unconditionally return it.
- static base::NoDestructor<std::string> switch_value;
static base::NoDestructor<GURL> base_url;
- std::string current_switch_value(
- base::CommandLine::ForCurrentProcess()->GetSwitchValueASCII(
- switches::kGoogleBaseURL));
- if (current_switch_value != *switch_value) {
- *switch_value = current_switch_value;
- *base_url = url_formatter::FixupURL(*switch_value, std::string());
- if (!base_url->is_valid() || base_url->has_query() || base_url->has_ref())
- *base_url = GURL();
- }
+ *base_url = GURL();
return *base_url;
}
bool StartsWithCommandLineGoogleBaseURL(const GURL& url) {
- const GURL& base_url(CommandLineGoogleBaseURL());
- return base_url.is_valid() &&
- base::StartsWith(url.possibly_invalid_spec(), base_url.spec(),
- base::CompareCase::SENSITIVE);
+ return false;
}
bool IsGoogleHostname(base::StringPiece host,
SubdomainPermission subdomain_permission) {
- url::CanonHostInfo host_info;
- return IsCanonicalHostGoogleHostname(net::CanonicalizeHost(host, &host_info),
- subdomain_permission);
+ return false;
}
bool IsGoogleDomainUrl(const GURL& url,
SubdomainPermission subdomain_permission,
PortPermission port_permission) {
- return IsValidURL(url, port_permission) &&
- IsCanonicalHostGoogleHostname(url.host_piece(), subdomain_permission);
+ return false;
}
bool IsGoogleHomePageUrl(const GURL& url) {
- // First check to see if this has a Google domain.
- if (!IsGoogleDomainUrl(url, DISALLOW_SUBDOMAIN,
- DISALLOW_NON_STANDARD_PORTS) &&
- !IsGoogleSearchSubdomainUrl(url)) {
- return false;
- }
-
- // Make sure the path is a known home page path.
- base::StringPiece path(url.path_piece());
- return IsPathHomePageBase(path) ||
- base::StartsWith(path, "/ig", base::CompareCase::INSENSITIVE_ASCII);
+ return false;
}
bool IsGoogleSearchUrl(const GURL& url) {
- // First check to see if this has a Google domain.
- if (!IsGoogleDomainUrl(url, DISALLOW_SUBDOMAIN,
- DISALLOW_NON_STANDARD_PORTS) &&
- !IsGoogleSearchSubdomainUrl(url)) {
- return false;
- }
-
- // Make sure the path is a known search path.
- base::StringPiece path(url.path_piece());
- bool is_home_page_base = IsPathHomePageBase(path);
- if (!is_home_page_base && (path != "/search"))
- return false;
-
- // Check for query parameter in URL parameter and hash fragment, depending on
- // the path type.
- return HasGoogleSearchQueryParam(url.ref_piece()) ||
- (!is_home_page_base && HasGoogleSearchQueryParam(url.query_piece()));
+ return false;
}
bool IsYoutubeDomainUrl(const GURL& url,
SubdomainPermission subdomain_permission,
PortPermission port_permission) {
- return IsValidURL(url, port_permission) &&
- IsValidHostName(url.host_piece(), "youtube", subdomain_permission,
- nullptr);
+ return false;
}
bool IsGoogleAssociatedDomainUrl(const GURL& url) {
- if (IsGoogleDomainUrl(url, ALLOW_SUBDOMAIN, ALLOW_NON_STANDARD_PORTS))
- return true;
-
- if (IsYoutubeDomainUrl(url, ALLOW_SUBDOMAIN, ALLOW_NON_STANDARD_PORTS))
- return true;
-
- // Some domains don't have international TLD extensions, so testing for them
- // is very straightforward.
- static const char* kSuffixesToSetHeadersFor[] = {
- ".android.com",
- ".doubleclick.com",
- ".doubleclick.net",
- ".ggpht.com",
- ".googleadservices.com",
- ".googleapis.com",
- ".googlesyndication.com",
- ".googleusercontent.com",
- ".googlevideo.com",
- ".gstatic.com",
- ".litepages.googlezip.net",
- ".ytimg.com",
- };
- const std::string host = url.host();
- for (size_t i = 0; i < base::size(kSuffixesToSetHeadersFor); ++i) {
- if (base::EndsWith(host, kSuffixesToSetHeadersFor[i],
- base::CompareCase::INSENSITIVE_ASCII)) {
- return true;
- }
- }
-
- // Exact hostnames in lowercase to set headers for.
- static const char* kHostsToSetHeadersFor[] = {
- "googleweblight.com",
- };
- for (size_t i = 0; i < base::size(kHostsToSetHeadersFor); ++i) {
- if (base::LowerCaseEqualsASCII(host, kHostsToSetHeadersFor[i]))
- return true;
- }
-
return false;
}
--- a/chrome/common/page_load_metrics/page_load_metrics_util.cc
+++ b/chrome/common/page_load_metrics/page_load_metrics_util.cc
@@ -12,38 +12,7 @@
namespace page_load_metrics {
base::Optional<std::string> GetGoogleHostnamePrefix(const GURL& url) {
- const size_t registry_length =
- net::registry_controlled_domains::GetRegistryLength(
- url,
-
- // Do not include unknown registries (registries that don't have any
- // matches in effective TLD names).
- net::registry_controlled_domains::EXCLUDE_UNKNOWN_REGISTRIES,
-
- // Do not include private registries, such as appspot.com. We don't
- // want to match URLs like www.google.appspot.com.
- net::registry_controlled_domains::EXCLUDE_PRIVATE_REGISTRIES);
-
- const base::StringPiece hostname = url.host_piece();
- if (registry_length == 0 || registry_length == std::string::npos ||
- registry_length >= hostname.length()) {
- return base::Optional<std::string>();
- }
-
- // Removes the tld and the preceding dot.
- const base::StringPiece hostname_minus_registry =
- hostname.substr(0, hostname.length() - (registry_length + 1));
-
- if (hostname_minus_registry == "google")
- return std::string("");
-
- if (!base::EndsWith(hostname_minus_registry, ".google",
- base::CompareCase::INSENSITIVE_ASCII)) {
- return base::Optional<std::string>();
- }
-
- return std::string(hostname_minus_registry.substr(
- 0, hostname_minus_registry.length() - strlen(".google")));
+ return base::Optional<std::string>();
}
bool IsGoogleHostname(const GURL& url) {
--- a/chrome/common/google_url_loader_throttle.cc
+++ b/chrome/common/google_url_loader_throttle.cc
@@ -8,10 +8,6 @@
#include "components/variations/net/variations_http_headers.h"
#include "services/network/public/cpp/features.h"
-#if BUILDFLAG(ENABLE_EXTENSIONS)
-#include "extensions/common/extension_urls.h"
-#endif
-
GoogleURLLoaderThrottle::GoogleURLLoaderThrottle(
bool is_off_the_record,
chrome::mojom::DynamicParams dynamic_params)
@@ -25,36 +21,6 @@ void GoogleURLLoaderThrottle::DetachFrom
void GoogleURLLoaderThrottle::WillStartRequest(
network::ResourceRequest* request,
bool* defer) {
- variations::AppendVariationsHeaderWithCustomValue(
- request->url,
- is_off_the_record_ ? variations::InIncognito::kYes
- : variations::InIncognito::kNo,
- dynamic_params_.variation_ids_header, request);
-
- if (dynamic_params_.force_safe_search) {
- GURL new_url;
- safe_search_util::ForceGoogleSafeSearch(request->url, &new_url);
- if (!new_url.is_empty())
- request->url = new_url;
- }
-
- static_assert(safe_search_util::YOUTUBE_RESTRICT_OFF == 0,
- "OFF must be first");
- if (dynamic_params_.youtube_restrict >
- safe_search_util::YOUTUBE_RESTRICT_OFF &&
- dynamic_params_.youtube_restrict <
- safe_search_util::YOUTUBE_RESTRICT_COUNT) {
- safe_search_util::ForceYouTubeRestrict(
- request->url, &request->headers,
- static_cast<safe_search_util::YouTubeRestrictMode>(
- dynamic_params_.youtube_restrict));
- }
-
- if (!dynamic_params_.allowed_domains_for_apps.empty() &&
- request->url.DomainIs("google.com")) {
- request->headers.SetHeader(safe_search_util::kGoogleAppsAllowedDomains,
- dynamic_params_.allowed_domains_for_apps);
- }
}
void GoogleURLLoaderThrottle::WillRedirectRequest(
@@ -63,33 +29,6 @@ void GoogleURLLoaderThrottle::WillRedire
bool* /* defer */,
std::vector<std::string>* to_be_removed_headers,
net::HttpRequestHeaders* modified_headers) {
- variations::RemoveVariationsHeaderIfNeeded(*redirect_info, response_head,
- to_be_removed_headers);
-
- // URLLoaderThrottles can only change the redirect URL when the network
- // service is enabled. The non-network service path handles this in
- // ChromeNetworkDelegate.
- if (dynamic_params_.force_safe_search &&
- base::FeatureList::IsEnabled(network::features::kNetworkService)) {
- safe_search_util::ForceGoogleSafeSearch(redirect_info->new_url,
- &redirect_info->new_url);
- }
-
- if (dynamic_params_.youtube_restrict >
- safe_search_util::YOUTUBE_RESTRICT_OFF &&
- dynamic_params_.youtube_restrict <
- safe_search_util::YOUTUBE_RESTRICT_COUNT) {
- safe_search_util::ForceYouTubeRestrict(
- redirect_info->new_url, modified_headers,
- static_cast<safe_search_util::YouTubeRestrictMode>(
- dynamic_params_.youtube_restrict));
- }
-
- if (!dynamic_params_.allowed_domains_for_apps.empty() &&
- redirect_info->new_url.DomainIs("google.com")) {
- modified_headers->SetHeader(safe_search_util::kGoogleAppsAllowedDomains,
- dynamic_params_.allowed_domains_for_apps);
- }
}
#if BUILDFLAG(ENABLE_EXTENSIONS)
@@ -97,17 +36,5 @@ void GoogleURLLoaderThrottle::WillProces
const GURL& response_url,
network::ResourceResponseHead* response_head,
bool* defer) {
- // Built-in additional protection for the chrome web store origin.
- GURL webstore_url(extension_urls::GetWebstoreLaunchURL());
- if (response_url.SchemeIsHTTPOrHTTPS() &&
- response_url.DomainIs(webstore_url.host_piece())) {
- if (response_head && response_head->headers &&
- !response_head->headers->HasHeaderValue("x-frame-options", "deny") &&
- !response_head->headers->HasHeaderValue("x-frame-options",
- "sameorigin")) {
- response_head->headers->RemoveHeader("x-frame-options");
- response_head->headers->AddHeader("x-frame-options: sameorigin");
- }
- }
}
#endif

View File

@ -0,0 +1,25 @@
# Disables use of a binary for preloading the Media Engagement index
# Said binary is: chrome/browser/resources/media/mei_preload/preloaded_data.pb
# According to media/base/media_switches (for PreloadMediaEngagementData), it
# "enables a list of origins to be considered as having a high MEI until there
# is enough local data to determine the user's preferred behavior." This feature
# does not seem to outweigh the benefit of removing the binary, thus this patch.
--- a/chrome/BUILD.gn
+++ b/chrome/BUILD.gn
@@ -330,7 +330,6 @@ if (!is_android && !is_mac) {
}
data_deps += [
- "//chrome/browser/resources/media/mei_preload:component",
"//third_party/widevine/cdm",
]
@@ -1330,7 +1329,6 @@ if (is_win) {
":packed_resources",
":swiftshader_library",
":widevine_cdm_library",
- "//chrome/browser/resources/media/mei_preload:component_bundle",
]
if (is_chrome_branded) {

View File

@ -0,0 +1,16 @@
# Disable Network Time Tracker
# This connects to Google to check if the system time is correct when a website certificate
# date seems incorrect, according to https://bugs.chromium.org/p/chromium/issues/detail?id=725232,
# Fixes https://github.com/Eloston/ungoogled-chromium/issues/302
--- a/components/network_time/network_time_tracker.cc
+++ b/components/network_time/network_time_tracker.cc
@@ -277,7 +277,7 @@ void NetworkTimeTracker::UpdateNetworkTi
}
bool NetworkTimeTracker::AreTimeFetchesEnabled() const {
- return base::FeatureList::IsEnabled(kNetworkTimeServiceQuerying);
+ return false;
}
NetworkTimeTracker::FetchBehavior NetworkTimeTracker::GetFetchBehavior() const {

View File

@ -0,0 +1,112 @@
# Disables WebRTC log uploading to Google
--- a/chrome/browser/media/webrtc/webrtc_log_uploader.cc
+++ b/chrome/browser/media/webrtc/webrtc_log_uploader.cc
@@ -131,29 +131,11 @@ void WebRtcLogUploader::LoggingStoppedDo
DCHECK(meta_data.get());
DCHECK(!upload_done_data.log_path.empty());
- std::string compressed_log = CompressLog(log_buffer.get());
-
- std::string local_log_id;
-
if (base::PathExists(upload_done_data.log_path)) {
webrtc_logging::DeleteOldWebRtcLogFiles(upload_done_data.log_path);
-
- local_log_id = base::NumberToString(base::Time::Now().ToDoubleT());
- base::FilePath log_file_path =
- upload_done_data.log_path.AppendASCII(local_log_id)
- .AddExtension(FILE_PATH_LITERAL(".gz"));
- WriteCompressedLogToFile(compressed_log, log_file_path);
-
- base::FilePath log_list_path =
- webrtc_logging::TextLogList::GetWebRtcLogListFileForDirectory(
- upload_done_data.log_path);
- AddLocallyStoredLogInfoToUploadListFile(log_list_path, local_log_id);
}
- WebRtcLogUploadDoneData upload_done_data_with_log_id = upload_done_data;
- upload_done_data_with_log_id.local_log_id = local_log_id;
- PrepareMultipartPostData(compressed_log, std::move(meta_data),
- upload_done_data_with_log_id);
+ NotifyUploadDoneAndLogStats(net::HTTP_OK, net::OK, "", upload_done_data);
}
void WebRtcLogUploader::PrepareMultipartPostData(
@@ -164,27 +146,7 @@ void WebRtcLogUploader::PrepareMultipart
DCHECK(!compressed_log.empty());
DCHECK(meta_data.get());
- std::unique_ptr<std::string> post_data(new std::string());
- SetupMultipart(post_data.get(), compressed_log,
- upload_done_data.incoming_rtp_dump,
- upload_done_data.outgoing_rtp_dump, *meta_data.get());
-
- // If a test has set the test string pointer, write to it and skip uploading.
- // Still fire the upload callback so that we can run an extension API test
- // using the test framework for that without hanging.
- // TODO(grunell): Remove this when the api test for this feature is fully
- // implemented according to the test plan. http://crbug.com/257329.
- if (post_data_) {
- *post_data_ = *post_data;
- NotifyUploadDoneAndLogStats(net::HTTP_OK, net::OK, "", upload_done_data);
- return;
- }
-
- base::PostTaskWithTraits(
- FROM_HERE, {BrowserThread::IO},
- base::BindOnce(&WebRtcLogUploader::UploadCompressedLog,
- base::Unretained(this), upload_done_data,
- std::move(post_data)));
+ NotifyUploadDoneAndLogStats(net::HTTP_OK, net::OK, "", upload_done_data);
}
void WebRtcLogUploader::UploadStoredLog(
@@ -255,47 +217,6 @@ void WebRtcLogUploader::LoggingStoppedDo
webrtc_logging::DeleteOldWebRtcLogFiles(log_paths.log_path);
- base::FilePath log_list_path =
- webrtc_logging::TextLogList::GetWebRtcLogListFileForDirectory(
- log_paths.log_path);
-
- // Store the native log with a ".gz" extension.
- std::string compressed_log = CompressLog(log_buffer.get());
- base::FilePath native_log_path =
- log_paths.log_path.AppendASCII(log_id).AddExtension(
- FILE_PATH_LITERAL(".gz"));
- WriteCompressedLogToFile(compressed_log, native_log_path);
- AddLocallyStoredLogInfoToUploadListFile(log_list_path, log_id);
-
- // Move the rtp dump files to the log directory with a name of
- // <log id>.rtp_[in|out].
- if (!log_paths.incoming_rtp_dump.empty()) {
- base::FilePath rtp_path =
- log_paths.log_path.AppendASCII(log_id).AddExtension(
- FILE_PATH_LITERAL(".rtp_in"));
- base::Move(log_paths.incoming_rtp_dump, rtp_path);
- }
-
- if (!log_paths.outgoing_rtp_dump.empty()) {
- base::FilePath rtp_path =
- log_paths.log_path.AppendASCII(log_id).AddExtension(
- FILE_PATH_LITERAL(".rtp_out"));
- base::Move(log_paths.outgoing_rtp_dump, rtp_path);
- }
-
- if (meta_data.get() && !meta_data->empty()) {
- base::Pickle pickle;
- for (const auto& it : *meta_data.get()) {
- pickle.WriteString(it.first);
- pickle.WriteString(it.second);
- }
- base::FilePath meta_path =
- log_paths.log_path.AppendASCII(log_id).AddExtension(
- FILE_PATH_LITERAL(".meta"));
- base::WriteFile(meta_path, static_cast<const char*>(pickle.data()),
- pickle.size());
- }
-
base::PostTaskWithTraits(FROM_HERE, {BrowserThread::UI},
base::BindOnce(done_callback, true, ""));

View File

@ -0,0 +1,53 @@
# Fix building with enable_service_discovery=false and enable_mds=false
--- a/chrome/browser/media/router/discovery/mdns/dns_sd_device_lister.cc
+++ b/chrome/browser/media/router/discovery/mdns/dns_sd_device_lister.cc
@@ -37,48 +37,22 @@ DnsSdDeviceLister::DnsSdDeviceLister(
DnsSdDeviceLister::~DnsSdDeviceLister() {}
void DnsSdDeviceLister::Discover() {
- if (!device_lister_) {
- device_lister_ = local_discovery::ServiceDiscoveryDeviceLister::Create(
- this, service_discovery_client_, service_type_);
- device_lister_->Start();
- VLOG(1) << "Started device lister for service type "
- << device_lister_->service_type();
- }
- device_lister_->DiscoverNewDevices();
- VLOG(1) << "Discovery new devices for service type "
- << device_lister_->service_type();
}
void DnsSdDeviceLister::Reset() {
- device_lister_.reset();
}
void DnsSdDeviceLister::OnDeviceChanged(
const std::string& service_type,
bool added,
const ServiceDescription& service_description) {
- DnsSdService service;
- FillServiceInfo(service_description, &service);
- VLOG(1) << "OnDeviceChanged: "
- << "service_name: " << service.service_name << ", "
- << "added: " << added << ", "
- << "service_type: " << device_lister_->service_type();
- delegate_->ServiceChanged(device_lister_->service_type(), added, service);
}
void DnsSdDeviceLister::OnDeviceRemoved(const std::string& service_type,
const std::string& service_name) {
- VLOG(1) << "OnDeviceRemoved: "
- << "service_name: " << service_name << ", "
- << "service_type: " << service_type;
- delegate_->ServiceRemoved(service_type, service_name);
}
void DnsSdDeviceLister::OnDeviceCacheFlushed(const std::string& service_type) {
- VLOG(1) << "OnDeviceCacheFlushed: "
- << "service_type: " << device_lister_->service_type();
- delegate_->ServicesFlushed(device_lister_->service_type());
- device_lister_->DiscoverNewDevices();
}
} // namespace media_router

View File

@ -0,0 +1,74 @@
# Additional changes to Inox's fix-building-without-safebrowsing.patch
--- a/chrome/browser/chrome_content_browser_client.cc
+++ b/chrome/browser/chrome_content_browser_client.cc
@@ -5307,20 +5307,7 @@ safe_browsing::UrlCheckerDelegate*
ChromeContentBrowserClient::GetSafeBrowsingUrlCheckerDelegate(
content::ResourceContext* resource_context) {
DCHECK_CURRENTLY_ON(BrowserThread::IO);
-
- ProfileIOData* io_data = ProfileIOData::FromResourceContext(resource_context);
- if (!io_data->safe_browsing_enabled()->GetValue())
- return nullptr;
-
- // |safe_browsing_service_| may be unavailable in tests.
- if (safe_browsing_service_ && !safe_browsing_url_checker_delegate_) {
- safe_browsing_url_checker_delegate_ =
- base::MakeRefCounted<safe_browsing::UrlCheckerDelegateImpl>(
- safe_browsing_service_->database_manager(),
- safe_browsing_service_->ui_manager());
- }
-
- return safe_browsing_url_checker_delegate_.get();
+ return nullptr;
}
base::Optional<std::string>
--- a/chrome/browser/download/download_item_model.cc
+++ b/chrome/browser/download/download_item_model.cc
@@ -22,9 +22,6 @@
#include "chrome/browser/download/download_stats.h"
#include "chrome/browser/download/offline_item_utils.h"
#include "chrome/browser/profiles/profile.h"
-#include "chrome/browser/safe_browsing/download_protection/download_feedback_service.h"
-#include "chrome/common/safe_browsing/download_file_types.pb.h"
-#include "chrome/common/safe_browsing/file_type_policies.h"
#include "chrome/grit/chromium_strings.h"
#include "chrome/grit/generated_resources.h"
#include "components/download/public/common/download_danger_type.h"
@@ -37,7 +34,6 @@
using base::TimeDelta;
using download::DownloadItem;
-using safe_browsing::DownloadFileType;
namespace {
@@ -264,14 +260,7 @@ bool DownloadItemModel::IsMalicious() co
}
bool DownloadItemModel::ShouldAllowDownloadFeedback() const {
-#if defined(FULL_SAFE_BROWSING)
- if (!IsDangerous())
- return false;
- return safe_browsing::DownloadFeedbackService::IsEnabledForDownload(
- *download_);
-#else
return false;
-#endif
}
bool DownloadItemModel::ShouldRemoveFromShelfWhenComplete() const {
--- a/chrome/browser/ui/views/safe_browsing/password_reuse_modal_warning_dialog.cc
+++ b/chrome/browser/ui/views/safe_browsing/password_reuse_modal_warning_dialog.cc
@@ -58,9 +58,7 @@ PasswordReuseModalWarningDialog::Passwor
SetLayoutManager(std::make_unique<views::FillLayout>());
views::Label* message_body_label = new views::Label(
- service_
- ? service_->GetWarningDetailText(password_type)
- : l10n_util::GetStringUTF16(IDS_PAGE_INFO_CHANGE_PASSWORD_DETAILS));
+ l10n_util::GetStringUTF16(IDS_PAGE_INFO_CHANGE_PASSWORD_DETAILS));
message_body_label->SetMultiLine(true);
message_body_label->SetHorizontalAlignment(gfx::ALIGN_LEFT);
message_body_label->SetHandlesTooltips(false);

View File

@ -0,0 +1,40 @@
description: fuzzers aren't built, so don't depend on them
author: Michael Gilbert <mgilbert@debian.org>
--- a/BUILD.gn
+++ b/BUILD.gn
@@ -722,8 +722,7 @@ group("gn_all") {
}
}
- if ((is_linux && !is_chromecast) || (is_win && use_libfuzzer) ||
- (use_libfuzzer && is_mac)) {
+ if (false) {
deps += [
"//chrome/services/cups_ipp_parser/public/cpp:fuzzers",
"//testing/libfuzzer/fuzzers",
--- a/content/test/BUILD.gn
+++ b/content/test/BUILD.gn
@@ -2320,12 +2320,6 @@ test("content_perftests") {
}
}
-group("fuzzers") {
- deps = [
- "//content/test/fuzzer",
- ]
-}
-
# This group defines the isolate files needed to run
# test_buildbucket_api_gpu_cases.py on bots. This also tells the build system
# when the tests should be re-run - when one of the dependent files changes.
--- a/v8/tools/BUILD.gn
+++ b/v8/tools/BUILD.gn
@@ -11,7 +11,6 @@ group("gn_all") {
data_deps = [
":v8_check_static_initializers",
"gcmole:v8_run_gcmole",
- "jsfunfuzz:v8_jsfunfuzz",
]
}

View File

@ -0,0 +1,16 @@
description: disable the google api key warning when those aren't found
author: Michael Gilbert <mgilbert@debian.org>
--- a/chrome/browser/ui/startup/startup_browser_creator_impl.cc
+++ b/chrome/browser/ui/startup/startup_browser_creator_impl.cc
@@ -810,10 +810,6 @@ void StartupBrowserCreatorImpl::AddInfoB
chrome::ShowBadFlagsPrompt(web_contents);
InfoBarService* infobar_service =
InfoBarService::FromWebContents(web_contents);
- if (!google_apis::HasAPIKeyConfigured() ||
- !google_apis::HasOAuthClientConfigured()) {
- GoogleApiKeysInfoBarDelegate::Create(infobar_service);
- }
if (ObsoleteSystem::IsObsoleteNowOrSoon()) {
PrefService* local_state = g_browser_process->local_state();
if (!local_state ||

View File

@ -0,0 +1,14 @@
description: disable dependencies on third_party/perfetto
author: Michael Gilbert <mgilbert@debian.org>
--- a/BUILD.gn
+++ b/BUILD.gn
@@ -666,7 +666,7 @@ group("gn_all") {
}
}
- if (is_mac || is_linux || is_android || is_fuchsia) {
+ if (false) {
deps += [ "//third_party/perfetto:all" ]
}

View File

@ -0,0 +1,75 @@
From fe92c640c7e02841dcf5dbc20a5eddbd07fd7edf Mon Sep 17 00:00:00 2001
From: Joachim Bauch <jojo@struktur.de>
Date: Tue, 7 Jul 2015 17:02:09 +0200
Subject: [PATCH 47/66] safe_browsing: disable incident reporting
Disables the safebrowsing incident reporting where you could upload
information about a blocked URL to Google (also added a trk prefix to
the URL so we get notified if this happens again in the future).
---
.../safe_browsing/incident_reporting/incident_report_uploader_impl.cc | 2 +-
.../safe_browsing/incident_reporting/incident_reporting_service.cc | 3 +++
chrome/browser/safe_browsing/safe_browsing_blocking_page.cc | 3 +--
chrome/browser/safe_browsing/safe_browsing_service.cc | 2 ++
components/security_interstitials/core/safe_browsing_loud_error_ui.cc | 2 ++
5 files changed, 9 insertions(+), 3 deletions(-)
--- a/chrome/browser/safe_browsing/incident_reporting/incident_report_uploader_impl.cc
+++ b/chrome/browser/safe_browsing/incident_reporting/incident_report_uploader_impl.cc
@@ -23,7 +23,7 @@ namespace safe_browsing {
namespace {
const char kSbIncidentReportUrl[] =
- "https://sb-ssl.google.com/safebrowsing/clientreport/incident";
+ "trk:268:https://sb-ssl.google.com/safebrowsing/clientreport/incident";
constexpr net::NetworkTrafficAnnotationTag
kSafeBrowsingIncidentTrafficAnnotation =
--- a/chrome/browser/safe_browsing/incident_reporting/incident_reporting_service.cc
+++ b/chrome/browser/safe_browsing/incident_reporting/incident_reporting_service.cc
@@ -311,11 +311,7 @@ IncidentReportingService::UploadContext:
// static
bool IncidentReportingService::IsEnabledForProfile(Profile* profile) {
- if (profile->IsOffTheRecord())
- return false;
- if (!profile->GetPrefs()->GetBoolean(prefs::kSafeBrowsingEnabled))
- return false;
- return IsExtendedReportingEnabled(*profile->GetPrefs());
+ return false;
}
IncidentReportingService::IncidentReportingService(
--- a/chrome/browser/safe_browsing/safe_browsing_blocking_page.cc
+++ b/chrome/browser/safe_browsing/safe_browsing_blocking_page.cc
@@ -62,8 +62,7 @@ class SafeBrowsingBlockingPageFactoryImp
PrefService* prefs =
Profile::FromBrowserContext(web_contents->GetBrowserContext())
->GetPrefs();
- bool is_extended_reporting_opt_in_allowed =
- IsExtendedReportingOptInAllowed(*prefs);
+ bool is_extended_reporting_opt_in_allowed = false;
bool is_proceed_anyway_disabled =
prefs->GetBoolean(prefs::kSafeBrowsingProceedAnywayDisabled);
--- a/chrome/browser/safe_browsing/safe_browsing_service.cc
+++ b/chrome/browser/safe_browsing/safe_browsing_service.cc
@@ -358,7 +358,7 @@ SafeBrowsingUIManager* SafeBrowsingServi
}
void SafeBrowsingService::RegisterAllDelayedAnalysis() {
-#if defined(FULL_SAFE_BROWSING)
+#if 0
RegisterBinaryIntegrityAnalysis();
#endif
}
--- a/components/security_interstitials/core/safe_browsing_loud_error_ui.cc
+++ b/components/security_interstitials/core/safe_browsing_loud_error_ui.cc
@@ -22,6 +22,7 @@ namespace {
// For malware interstitial pages, we link the problematic URL to Google's
// diagnostic page.
+// trk:228
const char kSbDiagnosticUrl[] =
"https://transparencyreport.google.com/safe-browsing/search?url=%s";

View File

@ -0,0 +1,209 @@
From 8f348bf2c249701de2f6049ac57fe346bd6b665f Mon Sep 17 00:00:00 2001
From: Joachim Bauch <jojo@struktur.de>
Date: Tue, 7 Jul 2015 18:28:46 +0200
Subject: [PATCH 48/66] safe_browsing: disable reporting of safebrowsing
override
Disables reporting of the safebrowsing override, i.e. the report sent
if a user decides to visit a page that was flagged as "insecure".
This prevents trk:148 (phishing) and trk:149 (malware).
---
.../browser/safe_browsing/client_side_detection_service.cc | 12 ++++++++++++
1 file changed, 12 insertions(+)
--- a/chrome/browser/safe_browsing/client_side_detection_service.cc
+++ b/chrome/browser/safe_browsing/client_side_detection_service.cc
@@ -64,12 +64,6 @@ enum MalwareReportTypes {
REPORT_RESULT_MAX
};
-void UpdateEnumUMAHistogram(MalwareReportTypes report_type) {
- DCHECK(report_type >= 0 && report_type < REPORT_RESULT_MAX);
- UMA_HISTOGRAM_ENUMERATION("SBClientMalware.SentReports", report_type,
- REPORT_RESULT_MAX);
-}
-
} // namespace
const int ClientSideDetectionService::kInitialClientModelFetchDelayMs = 10000;
@@ -284,94 +278,8 @@ void ClientSideDetectionService::StartCl
DCHECK_CURRENTLY_ON(BrowserThread::UI);
std::unique_ptr<ClientPhishingRequest> request(verdict);
- if (!enabled_) {
- if (!callback.is_null())
- callback.Run(GURL(request->url()), false);
- return;
- }
-
- // Fill in metadata about which model we used.
- if (is_extended_reporting) {
- request->set_model_filename(model_loader_extended_->name());
- request->mutable_population()->set_user_population(
- ChromeUserPopulation::EXTENDED_REPORTING);
- } else {
- request->set_model_filename(model_loader_standard_->name());
- request->mutable_population()->set_user_population(
- ChromeUserPopulation::SAFE_BROWSING);
- }
- DVLOG(2) << "Starting report for hit on model " << request->model_filename();
-
- request->mutable_population()->set_profile_management_status(
- GetProfileManagementStatus(
- g_browser_process->browser_policy_connector()));
-
- std::string request_data;
- if (!request->SerializeToString(&request_data)) {
- UMA_HISTOGRAM_COUNTS_1M("SBClientPhishing.RequestNotSerialized", 1);
- DVLOG(1) << "Unable to serialize the CSD request. Proto file changed?";
- if (!callback.is_null())
- callback.Run(GURL(request->url()), false);
- return;
- }
-
- net::NetworkTrafficAnnotationTag traffic_annotation =
- net::DefineNetworkTrafficAnnotation(
- "safe_browsing_client_side_phishing_detector", R"(
- semantics {
- sender: "Safe Browsing Client-Side Phishing Detector"
- description:
- "If the client-side phishing detector determines that the "
- "current page contents are similar to phishing pages, it will "
- "send a request to Safe Browsing to ask for a final verdict. If "
- "Safe Browsing agrees the page is dangerous, Chrome will show a "
- "full-page interstitial warning."
- trigger:
- "Whenever the clinet-side detector machine learning model "
- "computes a phishy-ness score above a threshold, after page-load."
- data:
- "Top-level page URL without CGI parameters, boolean and double "
- "features extracted from DOM, such as the number of resources "
- "loaded in the page, if certain likely phishing and social "
- "engineering terms found on the page, etc."
- destination: GOOGLE_OWNED_SERVICE
- }
- policy {
- cookies_allowed: YES
- cookies_store: "Safe browsing cookie store"
- setting:
- "Users can enable or disable this feature by toggling 'Protect "
- "you and your device from dangerous sites' in Chrome settings "
- "under Privacy. This feature is enabled by default."
- chrome_policy {
- SafeBrowsingEnabled {
- policy_options {mode: MANDATORY}
- SafeBrowsingEnabled: false
- }
- }
- })");
- auto resource_request = std::make_unique<network::ResourceRequest>();
- resource_request->url = GetClientReportUrl(kClientReportPhishingUrl);
- resource_request->method = "POST";
- resource_request->load_flags = net::LOAD_DISABLE_CACHE;
- auto loader = network::SimpleURLLoader::Create(std::move(resource_request),
- traffic_annotation);
- loader->AttachStringForUpload(request_data, "application/octet-stream");
- loader->DownloadToStringOfUnboundedSizeUntilCrashAndDie(
- url_loader_factory_.get(),
- base::BindOnce(&ClientSideDetectionService::OnURLLoaderComplete,
- base::Unretained(this), loader.get()));
-
- // Remember which callback and URL correspond to the current fetcher object.
- std::unique_ptr<ClientPhishingReportInfo> info(new ClientPhishingReportInfo);
- auto* loader_ptr = loader.get();
- info->loader = std::move(loader);
- info->callback = callback;
- info->phishing_url = GURL(request->url());
- client_phishing_reports_[loader_ptr] = std::move(info);
-
- // Record that we made a request
- phishing_report_times_.push(base::Time::Now());
+ if (!callback.is_null())
+ callback.Run(GURL(request->url()), false);
}
void ClientSideDetectionService::StartClientReportMalwareRequest(
@@ -380,81 +288,8 @@ void ClientSideDetectionService::StartCl
DCHECK_CURRENTLY_ON(BrowserThread::UI);
std::unique_ptr<ClientMalwareRequest> request(verdict);
- if (!enabled_) {
- if (!callback.is_null())
- callback.Run(GURL(request->url()), GURL(request->url()), false);
- return;
- }
-
- std::string request_data;
- if (!request->SerializeToString(&request_data)) {
- UpdateEnumUMAHistogram(REPORT_FAILED_SERIALIZATION);
- DVLOG(1) << "Unable to serialize the CSD request. Proto file changed?";
- if (!callback.is_null())
- callback.Run(GURL(request->url()), GURL(request->url()), false);
- return;
- }
-
- net::NetworkTrafficAnnotationTag traffic_annotation =
- net::DefineNetworkTrafficAnnotation(
- "safe_browsing_client_side_malware_detector", R"(
- semantics {
- sender: "Safe Browsing Client-Side Malware Detector"
- description:
- "If the client-side malware detector determines that a requested "
- "page's IP is in the blacklisted malware IPs, it will send a "
- "request to Safe Browsing to ask for a final verdict. If Safe "
- "Browsing agrees the page is dangerous, Chrome will show a "
- "full-page interstitial warning."
- trigger:
- "Whenever the IP of the page is in malware blacklist."
- data:
- "Top-level page URL without CGI parameters, its non-https "
- "referrer, URLs of resources that match IP blacklist."
- destination: GOOGLE_OWNED_SERVICE
- }
- policy {
- cookies_allowed: YES
- cookies_store: "Safe browsing cookie store"
- setting:
- "Users can enable or disable this feature by toggling 'Protect "
- "you and your device from dangerous sites' in Chrome settings "
- "under Privacy. This feature is enabled by default."
- chrome_policy {
- SafeBrowsingEnabled {
- policy_options {mode: MANDATORY}
- SafeBrowsingEnabled: false
- }
- }
- })");
- auto resource_request = std::make_unique<network::ResourceRequest>();
- resource_request->url = GetClientReportUrl(kClientReportMalwareUrl);
- resource_request->method = "POST";
- resource_request->load_flags = net::LOAD_DISABLE_CACHE;
- auto loader = network::SimpleURLLoader::Create(std::move(resource_request),
- traffic_annotation);
- loader->AttachStringForUpload(request_data, "application/octet-stream");
- loader->DownloadToStringOfUnboundedSizeUntilCrashAndDie(
- url_loader_factory_.get(),
- base::BindOnce(&ClientSideDetectionService::OnURLLoaderComplete,
- base::Unretained(this), loader.get()));
-
- // Remember which callback and URL correspond to the current fetcher object.
- std::unique_ptr<ClientMalwareReportInfo> info(new ClientMalwareReportInfo);
- auto* loader_ptr = loader.get();
- info->loader = std::move(loader);
- info->callback = callback;
- info->original_url = GURL(request->url());
- client_malware_reports_[loader_ptr] = std::move(info);
-
- UMA_HISTOGRAM_ENUMERATION("SBClientMalware.SentReports", REPORT_SENT,
- REPORT_RESULT_MAX);
-
- UMA_HISTOGRAM_COUNTS_1M("SBClientMalware.IPBlacklistRequestPayloadSize",
- request_data.size());
-
- // Record that we made a malware request
- malware_report_times_.push(base::Time::Now());
+ if (!callback.is_null())
+ callback.Run(GURL(request->url()), GURL(request->url()), false);
}
void ClientSideDetectionService::HandlePhishingVerdict(

View File

@ -0,0 +1,87 @@
description: disable support for safe browsing inspection of rar files
author: Michael Gilbert <mgilbert@debian.org>
bug: http://bugs.debian.org/914487
--- a/chrome/common/safe_browsing/BUILD.gn
+++ b/chrome/common/safe_browsing/BUILD.gn
@@ -64,41 +64,6 @@ if (safe_browsing_mode == 1) {
]
}
- source_set("rar_analyzer") {
- sources = [
- "rar_analyzer.cc",
- "rar_analyzer.h",
- ]
-
- deps = [
- ":archive_analyzer_results",
- ":download_type_util",
- ":file_type_policies",
- "//base",
- "//base:i18n",
- "//components/safe_browsing:features",
- "//third_party/unrar:unrar",
- ]
-
- defines = [
- "_FILE_OFFSET_BITS=64",
- "LARGEFILE_SOURCE",
- "RAR_SMP",
- "SILENT",
-
- # The following is set to disable certain macro definitions in the unrar
- # source code.
- "CHROMIUM_UNRAR",
-
- # Disables exceptions in unrar, replaces them with process termination.
- "UNRAR_NO_EXCEPTIONS",
- ]
-
- public_deps = [
- "//components/safe_browsing:csd_proto",
- ]
- }
-
source_set("disk_image_type_sniffer_mac") {
sources = [
"disk_image_type_sniffer_mac.cc",
@@ -167,7 +132,6 @@ source_set("safe_browsing") {
":archive_analyzer_results",
":binary_feature_extractor",
":download_type_util",
- ":rar_analyzer",
"//components/safe_browsing:features",
]
--- a/chrome/services/file_util/safe_archive_analyzer.cc
+++ b/chrome/services/file_util/safe_archive_analyzer.cc
@@ -7,7 +7,6 @@
#include "base/macros.h"
#include "build/build_config.h"
#include "chrome/common/safe_browsing/archive_analyzer_results.h"
-#include "chrome/common/safe_browsing/rar_analyzer.h"
#include "chrome/common/safe_browsing/zip_analyzer.h"
#include "mojo/public/cpp/bindings/strong_binding.h"
@@ -50,8 +49,7 @@ void SafeArchiveAnalyzer::AnalyzeRarFile
AnalyzeRarFileCallback callback) {
DCHECK(rar_file.IsValid());
+ LOG(FATAL) << "AnalyzeRarFile is disabled in this build";
safe_browsing::ArchiveAnalyzerResults results;
- safe_browsing::rar_analyzer::AnalyzeRarFile(
- std::move(rar_file), std::move(temporary_file), &results);
std::move(callback).Run(results);
}
--- a/chrome/browser/safe_browsing/download_protection/file_analyzer.cc
+++ b/chrome/browser/safe_browsing/download_protection/file_analyzer.cc
@@ -101,7 +101,7 @@ void FileAnalyzer::Start(const base::Fil
if (inspection_type == DownloadFileType::ZIP) {
StartExtractZipFeatures();
} else if (inspection_type == DownloadFileType::RAR) {
- StartExtractRarFeatures();
+ LOG(WARNING) << "Safebrowser inspection of rar files is disabled in this build";
#if defined(OS_MACOSX)
} else if (inspection_type == DownloadFileType::DMG) {
StartExtractDmgFeatures();

View File

@ -0,0 +1,15 @@
description: do not override the welcome page setting set in master_preferences
author: Michael Gilbert <mgilbert@debian.org>
bug-debian: http://bugs.debian.org/857767
--- a/chrome/browser/profiles/profile_manager.cc
+++ b/chrome/browser/profiles/profile_manager.cc
@@ -1072,7 +1072,7 @@ void ProfileManager::InitProfileUserPref
profile->GetPrefs()->SetString(prefs::kSupervisedUserId,
supervised_user_id);
}
-#if !defined(OS_ANDROID)
+#if 0
// TODO(pmonette): Fix IsNewProfile() to handle the case where the profile is
// new even if the "Preferences" file already existed. (For example: The
// master_preferences file is dumped into the default profile on first run,

View File

@ -1,4 +1,17 @@
https://commondatastorage.googleapis.com/chromium-browser-official/chromium-75.0.3770.142.tar.xz
patches/0003-disable-autofill-download-manager.patch
patches/0004-disable-google-url-tracker.patch
patches/0005-disable-default-extensions.patch
patches/0006-modify-default-prefs.patch
patches/0007-disable-web-resource-service.patch
patches/0008-restore-classic-ntp.patch
patches/0009-disable-google-ipv6-probes.patch
patches/0010-disable-gcm-status-check.patch
patches/0014-disable-translation-lang-fetch.patch
patches/0015-disable-update-pings.patch
patches/0019-disable-battery-status-service.patch
patches/0021-disable-rlz.patch
patches/android.patch
patches/chromium-75-fix-gn-gen.patch
patches/chromium-75-gcc-angle-fix.patch
patches/chromium-75-llvm8.patch
@ -12,6 +25,22 @@ patches/chromium-optional-atk-r1.patch
patches/chromium-optional-dbus-r5.patch
patches/chromium-url-formatter.patch
patches/chromium-widevine-r4.patch
patches/device-notifications.patch
patches/disable-crash-reporter.patch
patches/disable-domain-reliability.patch
patches/disable-download-quarantine.patch
patches/disable-fetching-field-trials.patch
patches/disable-fonts-googleapis-references.patch
patches/disable-gaia.patch
patches/disable-gcm.patch
patches/disable-google-host-detection.patch
patches/disable-mei-preload.patch
patches/disable-network-time-tracker.patch
patches/disable-webrtc-log-uploader.patch
patches/fix-building-without-mdns-and-service-discovery.patch
patches/fix-building-without-safebrowsing.patch
patches/fuzzers.patch
patches/google-api-warning.patch
patches/musl-cdefs-r2.patch
patches/musl-dlopen.patch
patches/musl-dns-r2.patch
@ -33,3 +62,8 @@ patches/musl-syscall.patch
patches/musl-ucontext-r1.patch
patches/musl-v8-monotonic-pthread-cont_timedwait.patch
patches/musl-wordsize-r1.patch
patches/perfetto.patch
patches/safe_browsing-disable-incident-reporting.patch
patches/safe_browsing-disable-reporting-of-safebrowsing-over.patch
patches/unrar.patch
patches/welcome-page.patch