Skip to content
This repository has been archived by the owner on Mar 20, 2019. It is now read-only.

Commit

Permalink
Merge branch 'release/66.0.3359.139'
Browse files Browse the repository at this point in the history
  • Loading branch information
gcarq committed May 2, 2018
2 parents 0c55cc9 + 1f62c04 commit 5e715f0
Show file tree
Hide file tree
Showing 22 changed files with 763 additions and 858 deletions.
667 changes: 385 additions & 282 deletions 0001-fix-building-without-safebrowsing.patch

Large diffs are not rendered by default.

57 changes: 6 additions & 51 deletions 0002-fix-building-without-reporting.patch
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,6 @@
# In profile_impl_io_data.h/cc and reporting_service_proxy.cc the devs forgot to check if reporting was enabled before using a reporting feature
# In printer_handler.cc, due to some combination of build flags used in the ungoogled-chromium build, MakeUnique was not pulled in

--- a/chrome/browser/ui/webui/print_preview/printer_handler.cc
+++ b/chrome/browser/ui/webui/print_preview/printer_handler.cc
@@ -8,6 +8,7 @@
#include "chrome/browser/ui/webui/print_preview/extension_printer_handler.h"
#include "chrome/browser/ui/webui/print_preview/pdf_printer_handler.h"
#include "chrome/common/features.h"
+#include "base/memory/ptr_util.h"

#if BUILDFLAG(ENABLE_SERVICE_DISCOVERY)
#include "chrome/browser/ui/webui/print_preview/privet_printer_handler.h"
--- a/content/browser/net/reporting_service_proxy.cc
+++ b/content/browser/net/reporting_service_proxy.cc
@@ -102,6 +102,7 @@ class ReportingServiceProxyImpl : public
Expand All @@ -32,60 +22,25 @@
scoped_refptr<net::URLRequestContextGetter> request_context_getter_;
--- a/chrome/browser/profiles/profile_impl_io_data.h
+++ b/chrome/browser/profiles/profile_impl_io_data.h
@@ -177,6 +177,7 @@ class ProfileImplIOData : public Profile
@@ -179,6 +179,7 @@ class ProfileImplIOData : public Profile
const StoragePartitionDescriptor& partition_descriptor) const override;
chrome_browser_net::Predictor* GetPredictor() override;

+#if BUILDFLAG(ENABLE_REPORTING)
// Returns a net::ReportingService, if reporting should be enabled. Otherwise,
// returns nullptr.
// TODO(mmenke): Remove once URLRequestContextBuilders are always used to
@@ -187,6 +188,7 @@ class ProfileImplIOData : public Profile
@@ -189,6 +190,7 @@ class ProfileImplIOData : public Profile
// Returns a net::ReportingPolicy, if reporting should be enabled. Otherwise,
// returns nullptr.
static std::unique_ptr<net::ReportingPolicy> MaybeCreateReportingPolicy();
+#endif

// Lazy initialization params.
mutable std::unique_ptr<LazyParams> lazy_params_;
--- a/chrome/browser/profiles/profile_impl_io_data.cc
+++ b/chrome/browser/profiles/profile_impl_io_data.cc
@@ -480,7 +480,9 @@ void ProfileImplIOData::InitializeIntern
builder, std::move(request_interceptors),
std::move(profile_params->protocol_handler_interceptor));

+#if BUILDFLAG(ENABLE_REPORTING)
builder->set_reporting_policy(MaybeCreateReportingPolicy());
+#endif
}

void ProfileImplIOData::OnMainRequestContextCreated(
@@ -615,7 +617,9 @@ net::URLRequestContext* ProfileImplIODat
context->host_resolver()));
context->SetJobFactory(std::move(top_job_factory));

+#if BUILDFLAG(ENABLE_REPORTING)
context->SetReportingService(MaybeCreateReportingService(context));
+#endif

return context;
}
@@ -705,6 +709,7 @@ chrome_browser_net::Predictor* ProfileIm
return predictor_.get();
}

+#if BUILDFLAG(ENABLE_REPORTING)
std::unique_ptr<net::ReportingService>
ProfileImplIOData::MaybeCreateReportingService(
net::URLRequestContext* url_request_context) const {
@@ -723,3 +728,4 @@ ProfileImplIOData::MaybeCreateReportingP

return base::MakeUnique<net::ReportingPolicy>();
}
+#endif
--- a/chrome/browser/profiles/profile_io_data.cc
+++ b/chrome/browser/profiles/profile_io_data.cc
@@ -637,7 +637,9 @@ void ProfileIOData::AppRequestContext::S
@@ -630,7 +630,9 @@ void ProfileIOData::AppRequestContext::S
void ProfileIOData::AppRequestContext::SetReportingService(
std::unique_ptr<net::ReportingService> reporting_service) {
reporting_service_ = std::move(reporting_service);
Expand All @@ -94,11 +49,11 @@
+#endif
}

ProfileIOData::AppRequestContext::~AppRequestContext() {
void ProfileIOData::AppRequestContext::SetNetworkErrorLoggingService(
--- a/chrome/browser/browsing_data/chrome_browsing_data_remover_delegate.cc
+++ b/chrome/browser/browsing_data/chrome_browsing_data_remover_delegate.cc
@@ -255,10 +255,12 @@ void ClearReportingCacheOnIOThread(
const base::Callback<bool(const GURL&)>& origin_filter) {
@@ -268,10 +268,12 @@ void ClearReportingCacheOnIOThread(
const base::RepeatingCallback<bool(const GURL&)>& origin_filter) {
DCHECK_CURRENTLY_ON(BrowserThread::IO);

+#if BUILDFLAG(ENABLE_REPORTING)
Expand Down
45 changes: 34 additions & 11 deletions 0003-disable-autofill-download-manager.patch
Original file line number Diff line number Diff line change
Expand Up @@ -10,19 +10,42 @@
}

std::ostream& operator<<(std::ostream& out,
@@ -299,6 +298,7 @@ bool AutofillDownloadManager::StartUploa
@@ -299,38 +298,6 @@ bool AutofillDownloadManager::StartUploa

bool AutofillDownloadManager::StartRequest(
const FormRequestData& request_data) {
+#if 0
net::URLRequestContextGetter* request_context =
driver_->GetURLRequestContext();
DCHECK(request_context);
@@ -330,6 +330,7 @@ bool AutofillDownloadManager::StartReque
variations::SignedIn::kNo, &headers);
fetcher->SetExtraRequestHeaders(headers.ToString());
fetcher->Start();
+#endif

- net::URLRequestContextGetter* request_context =
- driver_->GetURLRequestContext();
- DCHECK(request_context);
- GURL request_url = GetRequestUrl(request_data.request_type);
-
- // Id is ignored for regular chrome, in unit test id's for fake fetcher
- // factory will be 0, 1, 2, ...
- std::unique_ptr<net::URLFetcher> owned_fetcher = net::URLFetcher::Create(
- fetcher_id_for_unittest_++, request_url, net::URLFetcher::POST, this,
- GetNetworkTrafficAnnotation(request_data.request_type));
- net::URLFetcher* fetcher = owned_fetcher.get();
- data_use_measurement::DataUseUserData::AttachToFetcher(
- fetcher, data_use_measurement::DataUseUserData::AUTOFILL);
- url_fetchers_[fetcher] =
- std::make_pair(std::move(owned_fetcher), request_data);
- fetcher->SetAutomaticallyRetryOn5xx(false);
- fetcher->SetRequestContext(request_context);
- fetcher->SetUploadData("text/proto", request_data.payload);
- fetcher->SetLoadFlags(net::LOAD_DO_NOT_SAVE_COOKIES |
- net::LOAD_DO_NOT_SEND_COOKIES);
- // Add Chrome experiment state to the request headers.
- net::HttpRequestHeaders headers;
- // Note: It's OK to pass SignedIn::kNo if it's unknown, as it does not affect
- // transmission of experiments coming from the variations server.
- variations::AppendVariationHeaders(fetcher->GetOriginalURL(),
- driver_->IsIncognito()
- ? variations::InIncognito::kYes
- : variations::InIncognito::kNo,
- variations::SignedIn::kNo, &headers);
- fetcher->SetExtraRequestHeaders(headers.ToString());
- fetcher->Start();
-
return true;
}

66 changes: 46 additions & 20 deletions 0005-disable-default-extensions.patch
Original file line number Diff line number Diff line change
Expand Up @@ -52,35 +52,61 @@
{
--- a/chrome/browser/extensions/webstore_installer.cc
+++ b/chrome/browser/extensions/webstore_installer.cc
@@ -580,6 +580,7 @@ void WebstoreInstaller::DownloadNextPend
@@ -577,28 +577,6 @@ void WebstoreInstaller::DownloadNextPend
void WebstoreInstaller::DownloadCrx(
const std::string& extension_id,
InstallSource source) {
+#if 0
download_url_ = GetWebstoreInstallURL(extension_id, source);
MaybeAppendAuthUserParameter(approval_->authuser, &download_url_);

@@ -602,6 +603,7 @@ void WebstoreInstaller::DownloadCrx(
GetExtensionFileTaskRunner().get(), FROM_HERE,
base::BindOnce(&GetDownloadFilePath, download_directory, extension_id),
base::BindOnce(&WebstoreInstaller::StartDownload, this, extension_id));
+#endif /* 0 */
- download_url_ = GetWebstoreInstallURL(extension_id, source);
- MaybeAppendAuthUserParameter(approval_->authuser, &download_url_);
-
- base::FilePath user_data_dir;
- 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
@@ -750,6 +752,7 @@ void WebstoreInstaller::UpdateDownloadPr
@@ -751,28 +729,6 @@ void WebstoreInstaller::UpdateDownloadPr
}

void WebstoreInstaller::StartCrxInstaller(const DownloadItem& download) {
+#if 0
DCHECK_CURRENTLY_ON(BrowserThread::UI);
DCHECK(!crx_installer_.get());

@@ -772,6 +775,7 @@ void WebstoreInstaller::StartCrxInstalle
crx_installer_->set_allow_silent_install(true);

crx_installer_->InstallCrx(download.GetFullPath());
+#endif /* 0 */
- 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,
Expand Down
30 changes: 15 additions & 15 deletions 0006-modify-default-prefs.patch
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
--- a/chrome/browser/chrome_content_browser_client.cc
+++ b/chrome/browser/chrome_content_browser_client.cc
@@ -859,7 +859,7 @@ void ChromeContentBrowserClient::Registe
@@ -856,7 +856,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
@@ -59,11 +59,11 @@ void RegisterBrowserUserPrefs(user_prefs
@@ -65,11 +65,11 @@ void RegisterBrowserUserPrefs(user_prefs
registry->RegisterBooleanPref(prefs::kWebAppCreateInAppsMenu, true);
registry->RegisterBooleanPref(prefs::kWebAppCreateInQuickLaunchBar, true);
registry->RegisterBooleanPref(
Expand Down Expand Up @@ -60,7 +60,7 @@
void BackgroundModeManager::RegisterProfile(Profile* profile) {
--- a/components/content_settings/core/browser/cookie_settings.cc
+++ b/components/content_settings/core/browser/cookie_settings.cc
@@ -88,7 +88,7 @@ void CookieSettings::GetCookieSettings(
@@ -100,7 +100,7 @@ void CookieSettings::GetCookieSettings(
void CookieSettings::RegisterProfilePrefs(
user_prefs::PrefRegistrySyncable* registry) {
registry->RegisterBooleanPref(
Expand All @@ -82,7 +82,7 @@

--- a/components/autofill/core/browser/autofill_manager.cc
+++ b/components/autofill/core/browser/autofill_manager.cc
@@ -216,7 +216,7 @@ void AutofillManager::RegisterProfilePre
@@ -215,7 +215,7 @@ void AutofillManager::RegisterProfilePre
registry->RegisterIntegerPref(
prefs::kAutofillCreditCardSigninPromoImpressionCount, 0);
registry->RegisterBooleanPref(
Expand All @@ -104,18 +104,18 @@
</dialog>
--- a/chrome/browser/io_thread.cc
+++ b/chrome/browser/io_thread.cc
@@ -620,7 +620,7 @@ void IOThread::RegisterPrefs(PrefRegistr
@@ -629,7 +629,7 @@ void IOThread::RegisterPrefs(PrefRegistr
std::string());
registry->RegisterBooleanPref(prefs::kEnableReferrers, true);
data_reduction_proxy::RegisterPrefs(registry);
- registry->RegisterBooleanPref(prefs::kBuiltInDnsClientEnabled, true);
+ registry->RegisterBooleanPref(prefs::kBuiltInDnsClientEnabled, false);
registry->RegisterListPref(prefs::kDnsOverHttpsServers);
registry->RegisterListPref(prefs::kDnsOverHttpsServerMethods);
registry->RegisterBooleanPref(prefs::kQuickCheckEnabled, true);
registry->RegisterBooleanPref(prefs::kPacHttpsUrlStrippingEnabled, true);
#if defined(OS_POSIX)
--- a/chrome/browser/signin/signin_promo.cc
+++ b/chrome/browser/signin/signin_promo.cc
@@ -390,8 +390,8 @@ void ForceWebBasedSigninFlowForTesting(b
@@ -383,8 +383,8 @@ void ForceWebBasedSigninFlowForTesting(b
void RegisterProfilePrefs(
user_prefs::PrefRegistrySyncable* registry) {
registry->RegisterIntegerPref(prefs::kSignInPromoStartupCount, 0);
Expand All @@ -124,8 +124,8 @@
+ registry->RegisterBooleanPref(prefs::kSignInPromoUserSkipped, 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
@@ -442,12 +442,12 @@ void GetBookmarksMatchingProperties(Book
Expand Down Expand Up @@ -167,7 +167,7 @@
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
@@ -144,10 +144,6 @@ void LocalDiscoveryUI::RegisterProfilePr
@@ -143,10 +143,6 @@ void LocalDiscoveryUI::RegisterProfilePr
user_prefs::PrefRegistrySyncable* registry) {
registry->RegisterBooleanPref(
prefs::kLocalDiscoveryNotificationsEnabled,
Expand All @@ -180,7 +180,7 @@
}
--- a/extensions/common/extension.cc
+++ b/extensions/common/extension.cc
@@ -344,14 +344,6 @@ bool Extension::ShouldDisplayInExtension
@@ -330,14 +330,6 @@ bool Extension::ShouldDisplayInExtension
if (is_theme())
return false;

Expand All @@ -197,7 +197,7 @@
// 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
@@ -334,9 +334,9 @@ void RegisterProfilePrefs(PrefRegistrySi
@@ -370,9 +370,9 @@ void RegisterProfilePrefs(PrefRegistrySi
registry->RegisterBooleanPref(
prefs::kSafeBrowsingSawInterstitialScoutReporting, false);
registry->RegisterBooleanPref(
Expand All @@ -211,7 +211,7 @@
false);
--- a/components/password_manager/core/browser/password_manager.cc
+++ b/components/password_manager/core/browser/password_manager.cc
@@ -236,10 +236,10 @@ PasswordFormManager* FindMatchedManager(
@@ -244,10 +244,10 @@ PasswordFormManager* FindMatchedManager(
void PasswordManager::RegisterProfilePrefs(
user_prefs::PrefRegistrySyncable* registry) {
registry->RegisterBooleanPref(
Expand Down
49 changes: 39 additions & 10 deletions 0007-disable-web-resource-service.patch
Original file line number Diff line number Diff line change
@@ -1,18 +1,47 @@
--- a/components/web_resource/web_resource_service.cc
+++ b/components/web_resource/web_resource_service.cc
@@ -126,6 +126,7 @@ bool WebResourceService::GetFetchSchedul
@@ -128,44 +128,7 @@ bool WebResourceService::GetFetchSchedul
// Initializes the fetching of data from the resource server. Data
// load calls OnURLFetchComplete.
void WebResourceService::StartFetch() {
+#if 0
// Set to false so that next fetch can be scheduled after this fetch or
// if we recieve notification that resource is allowed.
fetch_scheduled_ = false;
@@ -164,6 +165,8 @@ void WebResourceService::StartFetch() {
net::LOAD_DO_NOT_SAVE_COOKIES);
url_fetcher_->SetRequestContext(request_context_.get());
url_fetcher_->Start();
+#endif
- // Set to false so that next fetch can be scheduled after this fetch or
- // if we recieve 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;
- url_fetcher_ = net::URLFetcher::Create(
- web_resource_server, net::URLFetcher::GET, this, traffic_annotation_);
- data_use_measurement::DataUseUserData::AttachToFetcher(
- url_fetcher_.get(),
- data_use_measurement::DataUseUserData::WEB_RESOURCE_SERVICE);
- // Do not let url fetcher affect existing state in system context
- // (by setting cookies, for example).
- url_fetcher_->SetLoadFlags(net::LOAD_DISABLE_CACHE |
- net::LOAD_DO_NOT_SEND_COOKIES |
- net::LOAD_DO_NOT_SAVE_COOKIES);
- url_fetcher_->SetRequestContext(request_context_.get());
- url_fetcher_->Start();
+ in_fetch_ = false;
}

Expand Down
Loading

0 comments on commit 5e715f0

Please sign in to comment.