From 9bda2184700aab2b1fd7cbd30bfc4a3c9a14cb0c Mon Sep 17 00:00:00 2001 From: xsmile <> Date: Thu, 24 May 2018 12:03:04 +0200 Subject: [PATCH 1/7] 67.0.3396.48: Update Inox patches --- 0001-fix-building-without-safebrowsing.patch | 349 ++++++------------- 0002-fix-building-without-reporting.patch | 12 +- 0004-disable-google-url-tracker.patch | 2 +- 0006-modify-default-prefs.patch | 20 +- 0007-disable-web-resource-service.patch | 2 +- 0014-disable-translation-lang-fetch.patch | 14 +- 0017-disable-new-avatar-menu.patch | 2 +- 0021-disable-rlz.patch | 4 +- 9000-disable-metrics.patch | 334 ++++++------------ 9 files changed, 232 insertions(+), 507 deletions(-) diff --git a/0001-fix-building-without-safebrowsing.patch b/0001-fix-building-without-safebrowsing.patch index 52a3a6b..367e11f 100644 --- a/0001-fix-building-without-safebrowsing.patch +++ b/0001-fix-building-without-safebrowsing.patch @@ -1,6 +1,6 @@ --- a/chrome/browser/chrome_content_browser_client.cc +++ b/chrome/browser/chrome_content_browser_client.cc -@@ -653,30 +653,6 @@ void SetApplicationLocaleOnIOThread(cons +@@ -710,30 +710,6 @@ void SetApplicationLocaleOnIOThread(cons g_io_thread_application_locale.Get() = locale; } @@ -31,7 +31,7 @@ #if defined(OS_ANDROID) float GetDeviceScaleAdjustment() { static const float kMinFSM = 1.05f; -@@ -1739,7 +1715,7 @@ void ChromeContentBrowserClient::AppendE +@@ -1890,7 +1866,7 @@ void ChromeContentBrowserClient::AppendE // Disable client-side phishing detection in the renderer if it is // disabled in the Profile preferences or the browser process. if (!prefs->GetBoolean(prefs::kSafeBrowsingEnabled) || @@ -40,7 +40,7 @@ command_line->AppendSwitch( switches::kDisableClientSidePhishingDetection); } -@@ -2331,7 +2307,7 @@ void ChromeContentBrowserClient::AllowCe +@@ -2489,7 +2465,7 @@ void ChromeContentBrowserClient::AllowCe SSLErrorHandler::HandleSSLError( web_contents, cert_error, ssl_info, request_url, expired_previous_decision, @@ -49,7 +49,7 @@ callback, SSLErrorHandler::BlockingPageReadyCallback()); } -@@ -2562,8 +2538,6 @@ bool ChromeContentBrowserClient::CanCrea +@@ -2720,8 +2696,6 @@ bool ChromeContentBrowserClient::CanCrea void ChromeContentBrowserClient::ResourceDispatcherHostCreated() { DCHECK_CURRENTLY_ON(BrowserThread::UI); @@ -58,7 +58,7 @@ for (size_t i = 0; i < extra_parts_.size(); ++i) extra_parts_[i]->ResourceDispatcherHostCreated(); -@@ -3523,7 +3497,7 @@ ChromeContentBrowserClient::CreateThrott +@@ -3677,7 +3651,7 @@ ChromeContentBrowserClient::CreateThrott switches::kCommittedInterstitials)) { throttles.push_back(std::make_unique( handle, @@ -69,7 +69,7 @@ --- a/chrome/browser/profiles/profile_impl.cc +++ b/chrome/browser/profiles/profile_impl.cc -@@ -488,18 +488,6 @@ ProfileImpl::ProfileImpl( +@@ -491,18 +491,6 @@ ProfileImpl::ProfileImpl( create_mode == CREATE_MODE_SYNCHRONOUS); #endif @@ -88,7 +88,7 @@ content::BrowserContext::Initialize(this, path_); { -@@ -508,7 +496,7 @@ ProfileImpl::ProfileImpl( +@@ -511,7 +499,7 @@ ProfileImpl::ProfileImpl( ->CreateDelegate(); delegate->InitPrefRegistry(pref_registry_.get()); prefs_ = chrome_prefs::CreateProfilePrefs( @@ -99,7 +99,7 @@ GetIOTaskRunner(), std::move(delegate)); --- a/chrome/browser/loader/chrome_resource_dispatcher_host_delegate.cc +++ b/chrome/browser/loader/chrome_resource_dispatcher_host_delegate.cc -@@ -440,8 +440,7 @@ void LogCommittedPreviewsDecision( +@@ -347,8 +347,7 @@ void LogCommittedPreviewsDecision( } // namespace ChromeResourceDispatcherHostDelegate::ChromeResourceDispatcherHostDelegate() @@ -109,7 +109,7 @@ #if BUILDFLAG(ENABLE_EXTENSIONS) , user_script_listener_(new extensions::UserScriptListener()) #endif -@@ -491,8 +490,6 @@ void ChromeResourceDispatcherHostDelegat +@@ -398,8 +397,6 @@ void ChromeResourceDispatcherHostDelegat content::AppCacheService* appcache_service, ResourceType resource_type, std::vector>* throttles) { @@ -118,7 +118,7 @@ ProfileIOData* io_data = ProfileIOData::FromResourceContext(resource_context); client_hints::RequestBeginning(request, io_data->GetCookieSettings()); -@@ -659,7 +656,7 @@ void ChromeResourceDispatcherHostDelegat +@@ -533,7 +530,7 @@ void ChromeResourceDispatcherHostDelegat content::ResourceThrottle* first_throttle = NULL; #if defined(OS_ANDROID) first_throttle = DataReductionProxyResourceThrottle::MaybeCreate( @@ -127,7 +127,7 @@ #endif // defined(OS_ANDROID) #if defined(SAFE_BROWSING_DB_LOCAL) || defined(SAFE_BROWSING_DB_REMOTE) -@@ -672,7 +669,7 @@ void ChromeResourceDispatcherHostDelegat +@@ -546,7 +543,7 @@ void ChromeResourceDispatcherHostDelegat if (!url_loader_throttle_used) { first_throttle = MaybeCreateSafeBrowsingResourceThrottle( @@ -272,7 +272,7 @@ } else { --- a/chrome/browser/extensions/blacklist_state_fetcher.cc +++ b/chrome/browser/extensions/blacklist_state_fetcher.cc -@@ -32,10 +32,10 @@ BlacklistStateFetcher::~BlacklistStateFe +@@ -31,10 +31,10 @@ BlacklistStateFetcher::~BlacklistStateFe void BlacklistStateFetcher::Request(const std::string& id, const RequestCallback& callback) { DCHECK_CURRENTLY_ON(BrowserThread::UI); @@ -287,25 +287,23 @@ } else { base::ThreadTaskRunnerHandle::Get()->PostTask( FROM_HERE, base::BindOnce(callback, BLACKLISTED_UNKNOWN)); -@@ -48,11 +48,11 @@ void BlacklistStateFetcher::Request(cons +@@ -47,10 +47,10 @@ void BlacklistStateFetcher::Request(cons if (request_already_sent) return; -- if (!url_request_context_getter_ && g_browser_process && -- g_browser_process->safe_browsing_service()) { -- url_request_context_getter_ = -- g_browser_process->safe_browsing_service()->url_request_context(); +- if (g_browser_process && g_browser_process->safe_browsing_service()) { +- url_loader_factory_ = +- g_browser_process->safe_browsing_service()->GetURLLoaderFactory(); - } -+ //if (!url_request_context_getter_ && g_browser_process && -+ // g_browser_process->safe_browsing_service()) { -+ // url_request_context_getter_ = -+ // g_browser_process->safe_browsing_service()->url_request_context(); ++ //if (g_browser_process && g_browser_process->safe_browsing_service()) { ++ // url_loader_factory_ = ++ // g_browser_process->safe_browsing_service()->GetURLLoaderFactory(); + //} SendRequest(id); } -@@ -108,11 +108,11 @@ void BlacklistStateFetcher::SendRequest( - fetcher->Start(); +@@ -110,13 +110,14 @@ void BlacklistStateFetcher::SendRequest( + base::Unretained(this), fetcher)); } -void BlacklistStateFetcher::SetSafeBrowsingConfig( @@ -319,17 +317,12 @@ +// new safe_browsing::SafeBrowsingProtocolConfig(config)); +//} - void BlacklistStateFetcher::SetURLRequestContextForTest( - net::URLRequestContextGetter* request_context) { -@@ -120,6 +120,7 @@ void BlacklistStateFetcher::SetURLReques - } - GURL BlacklistStateFetcher::RequestUrl() const { + /* std::string url = base::StringPrintf( "%s/%s?client=%s&appver=%s&pver=2.2", safe_browsing_config_->url_prefix.c_str(), -@@ -132,6 +133,8 @@ GURL BlacklistStateFetcher::RequestUrl() +@@ -129,6 +130,8 @@ GURL BlacklistStateFetcher::RequestUrl() net::EscapeQueryParamValue(api_key, true).c_str()); } return GURL(url); @@ -337,10 +330,10 @@ + return GURL(); } - void BlacklistStateFetcher::OnURLFetchComplete(const net::URLFetcher* source) { + void BlacklistStateFetcher::OnURLLoaderComplete( --- a/chrome/browser/extensions/blacklist_state_fetcher.h +++ b/chrome/browser/extensions/blacklist_state_fetcher.h -@@ -34,8 +34,8 @@ class BlacklistStateFetcher : public net +@@ -34,8 +34,8 @@ class BlacklistStateFetcher { virtual void Request(const std::string& id, const RequestCallback& callback); @@ -349,22 +342,22 @@ + //void SetSafeBrowsingConfig( + // const safe_browsing::SafeBrowsingProtocolConfig& config); - void SetURLRequestContextForTest( - net::URLRequestContextGetter* request_context); -@@ -54,8 +54,8 @@ class BlacklistStateFetcher : public net - // ID for URLFetchers for testing. - int url_fetcher_id_; + protected: + void OnURLLoaderComplete(network::SimpleURLLoader* url_loader, +@@ -55,8 +55,8 @@ class BlacklistStateFetcher { + + void SendRequest(const std::string& id); - std::unique_ptr - safe_browsing_config_; + //std::unique_ptr + // safe_browsing_config_; - scoped_refptr url_request_context_getter_; - scoped_refptr parent_request_context_for_test_; + scoped_refptr url_loader_factory_; + // SimpleURLLoader -> (owned loader, extension id). --- a/chrome/browser/download/chrome_download_manager_delegate.cc +++ b/chrome/browser/download/chrome_download_manager_delegate.cc -@@ -284,13 +284,6 @@ ChromeDownloadManagerDelegate::~ChromeDo +@@ -289,13 +289,6 @@ ChromeDownloadManagerDelegate::~ChromeDo void ChromeDownloadManagerDelegate::SetDownloadManager(DownloadManager* dm) { download_manager_ = dm; @@ -377,8 +370,8 @@ - } } - void ChromeDownloadManagerDelegate::Shutdown() { -@@ -567,16 +560,6 @@ download::InProgressCache* ChromeDownloa + #if defined(OS_ANDROID) +@@ -579,16 +572,6 @@ download::InProgressCache* ChromeDownloa void ChromeDownloadManagerDelegate::SanitizeSavePackageResourceName( base::FilePath* filename) { @@ -397,15 +390,15 @@ void ChromeDownloadManagerDelegate::OpenDownloadUsingPlatformHandler( --- a/chrome/browser/browser_process_impl.cc +++ b/chrome/browser/browser_process_impl.cc -@@ -70,7 +70,6 @@ - #include "chrome/browser/printing/print_job_manager.h" +@@ -71,7 +71,6 @@ #include "chrome/browser/printing/print_preview_dialog_controller.h" #include "chrome/browser/profiles/profile_manager.h" + #include "chrome/browser/resource_coordinator/tab_lifecycle_unit_source.h" -#include "chrome/browser/safe_browsing/safe_browsing_service.h" #include "chrome/browser/shell_integration.h" #include "chrome/browser/status_icons/status_tray.h" #include "chrome/browser/ui/browser_dialogs.h" -@@ -333,8 +332,6 @@ void BrowserProcessImpl::StartTearDown() +@@ -349,8 +348,6 @@ void BrowserProcessImpl::StartTearDown() // that URLFetcher operation before going away.) metrics_services_manager_.reset(); intranet_redirect_detector_.reset(); @@ -414,7 +407,7 @@ network_time_tracker_.reset(); #if BUILDFLAG(ENABLE_PLUGINS) plugins_resource_service_.reset(); -@@ -936,22 +933,6 @@ StatusTray* BrowserProcessImpl::status_t +@@ -957,22 +954,6 @@ StatusTray* BrowserProcessImpl::status_t return status_tray_.get(); } @@ -437,7 +430,7 @@ subresource_filter::ContentRulesetService* BrowserProcessImpl::subresource_filter_ruleset_service() { DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_); -@@ -1219,16 +1200,6 @@ void BrowserProcessImpl::CreateBackgroun +@@ -1240,16 +1221,6 @@ void BrowserProcessImpl::CreateBackgroun #endif } @@ -456,7 +449,7 @@ created_subresource_filter_ruleset_service_ = true; --- a/chrome/browser/browser_process_impl.h +++ b/chrome/browser/browser_process_impl.h -@@ -135,9 +135,6 @@ class BrowserProcessImpl : public Browse +@@ -143,9 +143,6 @@ class BrowserProcessImpl : public Browse void set_background_mode_manager_for_test( std::unique_ptr manager) override; StatusTray* status_tray() override; @@ -466,7 +459,7 @@ subresource_filter::ContentRulesetService* subresource_filter_ruleset_service() override; optimization_guide::OptimizationGuideService* optimization_guide_service() -@@ -272,9 +269,6 @@ class BrowserProcessImpl : public Browse +@@ -280,9 +277,6 @@ class BrowserProcessImpl : public Browse std::unique_ptr background_mode_manager_; #endif @@ -525,17 +518,7 @@ #include "chrome/browser/ui/webui/md_downloads/downloads_list_tracker.h" #include "content/public/browser/web_contents_observer.h" #include "content/public/browser/web_ui_message_handler.h" -@@ -107,9 +106,6 @@ class MdDownloadsDOMHandler : public con - // dangerous ones are immediately removed. Protected for testing. - void RemoveDownloads(const DownloadVector& to_remove); - -- // Helper function to handle save download event. -- void SaveDownload(download::DownloadItem* download); -- - private: - using IdSet = std::set; - -@@ -121,19 +117,6 @@ class MdDownloadsDOMHandler : public con +@@ -116,18 +115,6 @@ class MdDownloadsDOMHandler : public con // null-checking |original_notifier_|. content::DownloadManager* GetOriginalNotifierManager() const; @@ -549,8 +532,7 @@ - - // Conveys danger acceptance from the DownloadDangerPrompt to the - // DownloadItem. -- virtual void DangerPromptDone(int download_id, -- DownloadDangerPrompt::Action action); +- void DangerPromptDone(int download_id, DownloadDangerPrompt::Action action); - // Returns true if the records of any downloaded items are allowed (and able) // to be deleted. @@ -565,41 +547,17 @@ #include "chrome/browser/download/download_history.h" #include "chrome/browser/download/download_item_model.h" #include "chrome/browser/download/download_prefs.h" -@@ -195,33 +194,6 @@ void MdDownloadsDOMHandler::HandleDrag(c +@@ -197,9 +196,6 @@ void MdDownloadsDOMHandler::HandleDrag(c void MdDownloadsDOMHandler::HandleSaveDangerous(const base::ListValue* args) { CountDownloadsDOMEvents(DOWNLOADS_DOM_EVENT_SAVE_DANGEROUS); - download::DownloadItem* file = GetDownloadByValue(args); -- SaveDownload(file); --} -- --void MdDownloadsDOMHandler::SaveDownload(download::DownloadItem* download) { -- if (!download) -- return; -- // If danger type is NOT DANGEROUS_FILE, chrome shows users a download danger -- // prompt. -- if (download->GetDangerType() != -- download::DOWNLOAD_DANGER_TYPE_DANGEROUS_FILE) { -- ShowDangerPrompt(download); -- } else { -- // If danger type is DANGEROUS_FILE, chrome proceeds to keep this download -- // without showing download danger prompt. -- if (profile_) { -- PrefService* prefs = profile_->GetPrefs(); -- if (!profile_->IsOffTheRecord() && -- prefs->GetBoolean(prefs::kSafeBrowsingEnabled)) { -- DownloadDangerPrompt::SendSafeBrowsingDownloadReport( -- safe_browsing::ClientSafeBrowsingReportRequest:: -- DANGEROUS_DOWNLOAD_RECOVERY, -- true, *download); -- } -- } -- DangerPromptDone(download->GetId(), DownloadDangerPrompt::ACCEPT); -- } +- if (file) +- ShowDangerPrompt(file); } void MdDownloadsDOMHandler::HandleDiscardDangerous( -@@ -323,12 +295,6 @@ void MdDownloadsDOMHandler::RemoveDownlo +@@ -301,12 +297,6 @@ void MdDownloadsDOMHandler::RemoveDownlo IdSet ids; for (auto* download : to_remove) { @@ -612,7 +570,7 @@ DownloadItemModel item_model(download); if (!item_model.ShouldShowInShelf() || download->GetState() == download::DownloadItem::IN_PROGRESS) { -@@ -381,33 +347,6 @@ void MdDownloadsDOMHandler::FinalizeRemo +@@ -359,33 +349,6 @@ void MdDownloadsDOMHandler::FinalizeRemo } } @@ -656,7 +614,7 @@ #include "chrome/browser/download/download_file_icon_extractor.h" #include "chrome/browser/download/download_prefs.h" #include "chrome/browser/download/download_query.h" -@@ -1300,9 +1299,6 @@ DownloadsAcceptDangerFunction::Downloads +@@ -1301,9 +1300,6 @@ DownloadsAcceptDangerFunction::Downloads DownloadsAcceptDangerFunction::~DownloadsAcceptDangerFunction() {} @@ -666,7 +624,7 @@ bool DownloadsAcceptDangerFunction::RunAsync() { std::unique_ptr params( downloads::AcceptDanger::Params::Create(*args_)); -@@ -1338,40 +1334,7 @@ void DownloadsAcceptDangerFunction::Prom +@@ -1339,40 +1335,7 @@ void DownloadsAcceptDangerFunction::Prom return; } RecordApiFunctions(DOWNLOADS_FUNCTION_ACCEPT_DANGER); @@ -746,7 +704,7 @@ --- a/chrome/browser/download/download_prefs.cc +++ b/chrome/browser/download/download_prefs.cc -@@ -194,14 +194,7 @@ DownloadPrefs::DownloadPrefs(Profile* pr +@@ -195,14 +195,7 @@ DownloadPrefs::DownloadPrefs(Profile* pr base::FilePath::StringType(1, base::FilePath::kExtensionSeparator) + extension); @@ -762,7 +720,7 @@ } } -@@ -359,10 +352,6 @@ bool DownloadPrefs::IsAutoOpenEnabledBas +@@ -360,10 +353,6 @@ bool DownloadPrefs::IsAutoOpenEnabledBas bool DownloadPrefs::EnableAutoOpenBasedOnExtension( const base::FilePath& file_name) { base::FilePath::StringType extension = file_name.Extension(); @@ -798,7 +756,7 @@ } // namespace --- a/chrome/browser/download/download_target_determiner.cc +++ b/chrome/browser/download/download_target_determiner.cc -@@ -954,29 +954,7 @@ DownloadFileType::DangerLevel DownloadTa +@@ -985,29 +985,7 @@ DownloadFileType::DangerLevel DownloadTa download_->HasUserGesture()) return DownloadFileType::NOT_DANGEROUS; @@ -829,20 +787,9 @@ } void DownloadTargetDeterminer::OnDownloadDestroyed( ---- a/chrome/browser/permissions/permission_uma_util.cc -+++ b/chrome/browser/permissions/permission_uma_util.cc -@@ -433,8 +433,6 @@ void PermissionUmaUtil::RecordPermission - PermissionReportInfo report_info(requesting_origin, permission, action, - source_ui, gesture_type, dismiss_count, - ignore_count); -- g_browser_process->safe_browsing_service() -- ->ui_manager()->ReportPermissionAction(report_info); - } - - if (web_contents) { --- a/chrome/browser/download/download_commands.cc +++ b/chrome/browser/download/download_commands.cc -@@ -212,9 +212,6 @@ bool DownloadCommands::IsCommandEnabled( +@@ -213,9 +213,6 @@ bool DownloadCommands::IsCommandEnabled( // filename. Don't base an "Always open" decision based on it. Also // exclude extensions. return download_item_->CanOpenDownload() && @@ -854,7 +801,7 @@ return !download_item_->IsDone(); --- a/chrome/browser/BUILD.gn +++ b/chrome/browser/BUILD.gn -@@ -2393,8 +2393,6 @@ jumbo_split_static_library("browser") { +@@ -2402,8 +2402,6 @@ jumbo_split_static_library("browser") { "download/download_commands.h", "download/download_crx_util.cc", "download/download_crx_util.h", @@ -865,15 +812,15 @@ "download/download_dir_util.cc", --- a/chrome/browser/ui/BUILD.gn +++ b/chrome/browser/ui/BUILD.gn -@@ -2481,7 +2481,6 @@ split_static_library("ui") { - "cocoa/bookmarks/bookmark_editor_controller.h", - "cocoa/bookmarks/bookmark_editor_controller.mm", - "cocoa/constrained_web_dialog_delegate_mac.mm", +@@ -2525,7 +2525,6 @@ split_static_library("ui") { + "cocoa/content_settings/cookie_tree_node.mm", + "cocoa/content_settings/cookies_tree_controller_bridge.h", + "cocoa/content_settings/cookies_tree_controller_bridge.mm", - "cocoa/download/download_danger_prompt_impl.cc", "cocoa/extensions/chooser_dialog_cocoa.h", "cocoa/extensions/chooser_dialog_cocoa.mm", "cocoa/extensions/chooser_dialog_cocoa_controller.h", -@@ -2777,7 +2776,6 @@ split_static_library("ui") { +@@ -2833,7 +2832,6 @@ split_static_library("ui") { "views/cookie_info_view.h", "views/device_chooser_content_view.cc", "views/device_chooser_content_view.h", @@ -883,7 +830,7 @@ "views/exclusive_access_bubble_views.cc", --- a/chrome/browser/ssl/security_state_tab_helper.cc +++ b/chrome/browser/ssl/security_state_tab_helper.cc -@@ -246,61 +246,6 @@ bool SecurityStateTabHelper::UsedPolicyI +@@ -246,62 +246,6 @@ bool SecurityStateTabHelper::UsedPolicyI security_state::MaliciousContentStatus SecurityStateTabHelper::GetMaliciousContentStatus() const { @@ -935,6 +882,7 @@ - case safe_browsing::SB_THREAT_TYPE_SUBRESOURCE_FILTER: - case safe_browsing::SB_THREAT_TYPE_CSD_WHITELIST: - case safe_browsing::SB_THREAT_TYPE_AD_SAMPLE: +- case safe_browsing::SB_THREAT_TYPE_SUSPICIOUS_SITE: - // These threat types are not currently associated with - // interstitials, and thus resources with these threat types are - // not ever whitelisted or pending whitelisting. @@ -947,8 +895,8 @@ --- a/chrome/browser/browsing_data/chrome_browsing_data_remover_delegate.cc +++ b/chrome/browser/browsing_data/chrome_browsing_data_remover_delegate.cc -@@ -715,42 +715,6 @@ void ChromeBrowsingDataRemoverDelegate:: - CONTENT_SETTINGS_TYPE_CLIENT_HINTS, base::Time(), +@@ -706,42 +706,6 @@ void ChromeBrowsingDataRemoverDelegate:: + CONTENT_SETTINGS_TYPE_CLIENT_HINTS, base::Time(), base::Time::Max(), base::BindRepeating(&WebsiteSettingsFilterAdapter, filter)); - // Clear the safebrowsing cookies only if time period is for "all time". It @@ -1001,93 +949,23 @@ #include "chrome/browser/ui/browser.h" #include "chrome/browser/ui/browser_list.h" #include "chrome/browser/ui/browser_window.h" -@@ -83,18 +81,6 @@ namespace { - // permission without having an associated renderer process yet. - const int kInvalidRenderProcessId = -1; - --void ReportNotificationImageOnIOThread( -- scoped_refptr safe_browsing_service, -- Profile* profile, -- const GURL& origin, -- const SkBitmap& image) { -- DCHECK_CURRENTLY_ON(BrowserThread::IO); -- if (!safe_browsing_service || !safe_browsing_service->enabled()) -- return; -- safe_browsing_service->ping_manager()->ReportNotificationImage( -- profile, safe_browsing_service->database_manager(), origin, image); --} -- - // Whether a web notification should be displayed when chrome is in full - // screen mode. - static bool ShouldDisplayWebNotificationOnFullScreen(Profile* profile, -@@ -513,13 +499,6 @@ PlatformNotificationServiceImpl::CreateN +@@ -500,16 +498,6 @@ PlatformNotificationServiceImpl::CreateN notification.set_type(message_center::NOTIFICATION_TYPE_IMAGE); notification.set_image( gfx::Image::CreateFrom1xBitmap(notification_resources.image)); - // n.b. this should only be posted once per notification. -- BrowserThread::PostTask( -- BrowserThread::IO, FROM_HERE, -- base::BindOnce( -- &ReportNotificationImageOnIOThread, -- base::WrapRefCounted(g_browser_process->safe_browsing_service()), -- profile, origin, notification_resources.image)); +- if (g_browser_process->safe_browsing_service() && +- g_browser_process->safe_browsing_service()->enabled_by_prefs()) { +- g_browser_process->safe_browsing_service() +- ->ping_manager() +- ->ReportNotificationImage( +- profile, +- g_browser_process->safe_browsing_service()->database_manager(), +- origin, notification_resources.image); +- } } // Badges are only supported on Android, primarily because it's the only ---- a/chrome/browser/permissions/permission_blacklist_client.cc -+++ b/chrome/browser/permissions/permission_blacklist_client.cc -@@ -56,50 +56,11 @@ PermissionBlacklistClient::~PermissionBl - void PermissionBlacklistClient::StartCheck(const GURL& request_origin) { - DCHECK_CURRENTLY_ON(content::BrowserThread::IO); - -- // Start the timer to interrupt into the client callback method with an -- // empty response if Safe Browsing times out. -- safe_browsing::ThreatMetadata empty_metadata; -- timer_ = std::make_unique(); -- elapsed_timer_.reset(new base::ElapsedTimer()); -- timer_->Start( -- FROM_HERE, base::TimeDelta::FromMilliseconds(timeout_), -- base::Bind(&PermissionBlacklistClient::OnCheckApiBlacklistUrlResult, this, -- request_origin, empty_metadata)); -- // If CheckApiBlacklistUrl returns true, no asynchronous call to |this| will -- // be made, so just directly call through to OnCheckApiBlacklistUrlResult. -- if (db_manager_->CheckApiBlacklistUrl(request_origin, this)) -- OnCheckApiBlacklistUrlResult(request_origin, empty_metadata); --} -- --void PermissionBlacklistClient::OnCheckApiBlacklistUrlResult( -- const GURL& url, -- const safe_browsing::ThreatMetadata& metadata) { -- DCHECK_CURRENTLY_ON(content::BrowserThread::IO); -- -- base::TimeDelta response_time = elapsed_timer_->Elapsed(); -- SafeBrowsingResponse response = SafeBrowsingResponse::NOT_BLACKLISTED; -- -- if (timer_->IsRunning()) { -- timer_->Stop(); -- } else { -- db_manager_->CancelApiCheck(this); -- response = SafeBrowsingResponse::TIMEOUT; -- } -- -- timer_.reset(nullptr); -- bool permission_blocked = -- metadata.api_permissions.find( -- PermissionUtil::ConvertContentSettingsTypeToSafeBrowsingName( -- content_settings_type_)) != metadata.api_permissions.end(); -- if (permission_blocked) -- response = SafeBrowsingResponse::BLACKLISTED; -- -- PermissionUmaUtil::RecordSafeBrowsingResponse(response_time, response); - content::BrowserThread::PostTask( - content::BrowserThread::UI, FROM_HERE, - base::BindOnce( - &PermissionBlacklistClient::EvaluateBlacklistResultOnUiThread, this, -- permission_blocked)); -+ false)); - } - - void PermissionBlacklistClient::EvaluateBlacklistResultOnUiThread( --- a/chrome/browser/metrics/chrome_metrics_service_client.cc +++ b/chrome/browser/metrics/chrome_metrics_service_client.cc @@ -45,7 +45,6 @@ @@ -1098,7 +976,7 @@ #include "chrome/browser/sync/chrome_sync_client.h" #include "chrome/browser/sync/profile_sync_service_factory.h" #include "chrome/browser/translate/translate_ranker_metrics_provider.h" -@@ -675,9 +674,6 @@ void ChromeMetricsServiceClient::Registe +@@ -718,9 +717,6 @@ void ChromeMetricsServiceClient::Registe metrics_service_->RegisterMetricsProvider( std::make_unique()); @@ -1108,23 +986,9 @@ #if !defined(OS_ANDROID) && !defined(OS_CHROMEOS) metrics_service_->RegisterMetricsProvider( std::make_unique()); ---- a/chrome/browser/permissions/permission_blacklist_client.h -+++ b/chrome/browser/permissions/permission_blacklist_client.h -@@ -59,11 +59,6 @@ class PermissionBlacklistClient - - void StartCheck(const GURL& request_origin); - -- // SafeBrowsingDatabaseManager::Client implementation. -- void OnCheckApiBlacklistUrlResult( -- const GURL& url, -- const safe_browsing::ThreatMetadata& metadata) override; -- - void EvaluateBlacklistResultOnUiThread(bool response); - - // WebContentsObserver implementation. Sets a flag so that when the database --- a/chrome/browser/profiles/chrome_browser_main_extra_parts_profiles.cc +++ b/chrome/browser/profiles/chrome_browser_main_extra_parts_profiles.cc -@@ -217,7 +217,6 @@ EnsureBrowserContextKeyedServiceFactorie +@@ -223,7 +223,6 @@ EnsureBrowserContextKeyedServiceFactorie #if BUILDFLAG(ENABLE_CAPTIVE_PORTAL_DETECTION) CaptivePortalServiceFactory::GetInstance(); #endif @@ -1157,7 +1021,7 @@ captive_portal::CaptivePortalMetrics::LogCaptivePortalBlockingPageEvent( --- a/chrome/browser/ssl/cert_report_helper.cc +++ b/chrome/browser/ssl/cert_report_helper.cc -@@ -183,8 +183,6 @@ void CertReportHelper::FinishCertCollect +@@ -182,8 +182,6 @@ void CertReportHelper::FinishCertCollect LOG(ERROR) << "Failed to serialize certificate report."; return; } @@ -1168,7 +1032,7 @@ bool CertReportHelper::ShouldShowCertificateReporterCheckbox() { --- a/chrome/browser/ui/tab_helpers.cc +++ b/chrome/browser/ui/tab_helpers.cc -@@ -239,8 +239,6 @@ void TabHelpers::AttachTabHelpers(WebCon +@@ -237,8 +237,6 @@ void TabHelpers::AttachTabHelpers(WebCon PrefsTabHelper::CreateForWebContents(web_contents); prerender::PrerenderTabHelper::CreateForWebContents(web_contents); PreviewsInfoBarTabHelper::CreateForWebContents(web_contents); @@ -1177,7 +1041,7 @@ SearchEngineTabHelper::CreateForWebContents(web_contents); SecurityStateTabHelper::CreateForWebContents(web_contents); if (SiteEngagementService::IsEnabled()) -@@ -289,9 +287,6 @@ void TabHelpers::AttachTabHelpers(WebCon +@@ -287,9 +285,6 @@ void TabHelpers::AttachTabHelpers(WebCon new ChromePDFWebContentsHelperClient())); PluginObserver::CreateForWebContents(web_contents); SadTabHelper::CreateForWebContents(web_contents); @@ -1187,30 +1051,9 @@ SearchTabHelper::CreateForWebContents(web_contents); TabContentsSyncedTabDelegate::CreateForWebContents(web_contents); TabDialogs::CreateForWebContents(web_contents); ---- a/chrome/browser/permissions/permission_decision_auto_blocker.cc -+++ b/chrome/browser/permissions/permission_decision_auto_blocker.cc -@@ -17,7 +17,6 @@ - #include "chrome/browser/permissions/permission_util.h" - #include "chrome/browser/profiles/incognito_helpers.h" - #include "chrome/browser/profiles/profile.h" --#include "chrome/browser/safe_browsing/safe_browsing_service.h" - #include "chrome/common/chrome_features.h" - #include "components/keyed_service/content/browser_context_dependency_manager.h" - #include "components/safe_browsing/db/database_manager.h" -@@ -424,10 +423,6 @@ PermissionDecisionAutoBlocker::Permissio - db_manager_(nullptr), - safe_browsing_timeout_(kCheckUrlTimeoutMs), - clock_(new base::DefaultClock()) { -- safe_browsing::SafeBrowsingService* sb_service = -- g_browser_process->safe_browsing_service(); -- if (sb_service) -- db_manager_ = sb_service->database_manager(); - } - - PermissionDecisionAutoBlocker::~PermissionDecisionAutoBlocker() {} --- a/chrome/browser/subresource_filter/chrome_subresource_filter_client.cc +++ b/chrome/browser/subresource_filter/chrome_subresource_filter_client.cc -@@ -44,14 +44,7 @@ DEFINE_WEB_CONTENTS_USER_DATA_KEY(Chrome +@@ -43,14 +43,7 @@ DEFINE_WEB_CONTENTS_USER_DATA_KEY(Chrome namespace { scoped_refptr GetDatabaseManager() { @@ -1226,7 +1069,7 @@ } } // namespace -@@ -73,21 +66,6 @@ ChromeSubresourceFilterClient::~ChromeSu +@@ -72,21 +65,6 @@ ChromeSubresourceFilterClient::~ChromeSu void ChromeSubresourceFilterClient::MaybeAppendNavigationThrottles( content::NavigationHandle* navigation_handle, std::vector>* throttles) { @@ -1410,7 +1253,7 @@ void SystemNetworkContextManager::FlushProxyConfigMonitorForTesting() { --- a/chrome/browser/ui/webui/settings/md_settings_localized_strings_provider.cc +++ b/chrome/browser/ui/webui/settings/md_settings_localized_strings_provider.cc -@@ -449,9 +449,8 @@ void AddBluetoothStrings(content::WebUID +@@ -458,9 +458,8 @@ void AddBluetoothStrings(content::WebUID #endif void AddChangePasswordStrings(content::WebUIDataSource* html_source) { @@ -1424,15 +1267,15 @@ ? IDS_SETTINGS_CHANGE_PASSWORD_TITLE_SOFTER --- a/chrome/renderer/chrome_content_renderer_client.cc +++ b/chrome/renderer/chrome_content_renderer_client.cc -@@ -79,7 +79,6 @@ +@@ -77,7 +77,6 @@ #include "components/error_page/common/localized_error.h" #include "components/network_hints/renderer/prescient_networking_dispatcher.h" #include "components/pdf/renderer/pepper_pdf_host.h" -#include "components/safe_browsing/renderer/threat_dom_details.h" #include "components/safe_browsing/renderer/websocket_sb_handshake_throttle.h" - #include "components/spellcheck/spellcheck_build_features.h" - #include "components/startup_metric_utils/common/startup_metric.mojom.h" -@@ -1387,9 +1386,7 @@ void ChromeContentRendererClient::InitSp + #include "components/services/heap_profiling/public/cpp/allocator_shim.h" + #include "components/spellcheck/spellcheck_buildflags.h" +@@ -1393,9 +1392,7 @@ void ChromeContentRendererClient::InitSp std::unique_ptr ChromeContentRendererClient::CreateWebSocketHandshakeThrottle() { @@ -1443,7 +1286,7 @@ } std::unique_ptr -@@ -1680,13 +1677,6 @@ ChromeContentRendererClient::GetTaskSche +@@ -1678,13 +1675,6 @@ ChromeContentRendererClient::GetTaskSche return task_scheduler_util::GetTaskSchedulerInitParamsForRenderer(); } @@ -1464,10 +1307,10 @@ #include "components/nacl/common/buildflags.h" #include "components/rappor/public/interfaces/rappor_recorder.mojom.h" -#include "components/safe_browsing/common/safe_browsing.mojom.h" - #include "components/spellcheck/spellcheck_build_features.h" + #include "components/spellcheck/spellcheck_buildflags.h" #include "content/public/renderer/content_renderer_client.h" #include "content/public/renderer/render_thread.h" -@@ -270,9 +269,6 @@ class ChromeContentRendererClient +@@ -275,9 +274,6 @@ class ChromeContentRendererClient void GetInterface(const std::string& name, mojo::ScopedMessagePipeHandle request_handle) override; @@ -1477,7 +1320,7 @@ void PrepareErrorPageInternal(content::RenderFrame* render_frame, const blink::WebURLRequest& failed_request, const error_page::Error& error, -@@ -305,8 +301,6 @@ class ChromeContentRendererClient +@@ -317,8 +313,6 @@ class ChromeContentRendererClient ChromeKeySystemsProvider key_systems_provider_; @@ -1486,3 +1329,15 @@ #if BUILDFLAG(ENABLE_SPELLCHECK) std::unique_ptr spellcheck_; #endif +--- a/chrome/browser/net/trial_comparison_cert_verifier.cc ++++ b/chrome/browser/net/trial_comparison_cert_verifier.cc +@@ -93,9 +93,6 @@ void SendTrialVerificationReport(void* p + std::string serialized_report; + if (!report.Serialize(&serialized_report)) + return; +- +- CertificateReportingServiceFactory::GetForBrowserContext(profile)->Send( +- serialized_report); + } + + std::unique_ptr TrialVerificationJobResultCallback( diff --git a/0002-fix-building-without-reporting.patch b/0002-fix-building-without-reporting.patch index 47e5221..882ee1a 100644 --- a/0002-fix-building-without-reporting.patch +++ b/0002-fix-building-without-reporting.patch @@ -12,10 +12,10 @@ net::URLRequestContext* request_context = request_context_getter_->GetURLRequestContext(); if (!request_context) { -@@ -117,6 +118,7 @@ class ReportingServiceProxyImpl : public - } - - reporting_service->QueueReport(url, group, type, std::move(body)); +@@ -120,6 +121,7 @@ class ReportingServiceProxyImpl : public + // renderer. + reporting_service->QueueReport(url, group, type, std::move(body), + /* depth= */ 0); +#endif } @@ -40,7 +40,7 @@ mutable std::unique_ptr lazy_params_; --- a/chrome/browser/profiles/profile_io_data.cc +++ b/chrome/browser/profiles/profile_io_data.cc -@@ -630,7 +630,9 @@ void ProfileIOData::AppRequestContext::S +@@ -623,7 +623,9 @@ void ProfileIOData::AppRequestContext::S void ProfileIOData::AppRequestContext::SetReportingService( std::unique_ptr reporting_service) { reporting_service_ = std::move(reporting_service); @@ -52,7 +52,7 @@ 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 -@@ -268,10 +268,12 @@ void ClearReportingCacheOnIOThread( +@@ -271,10 +271,12 @@ void ClearReportingCacheOnIOThread( const base::RepeatingCallback& origin_filter) { DCHECK_CURRENTLY_ON(BrowserThread::IO); diff --git a/0004-disable-google-url-tracker.patch b/0004-disable-google-url-tracker.patch index 0bff06d..8eb012e 100644 --- a/0004-disable-google-url-tracker.patch +++ b/0004-disable-google-url-tracker.patch @@ -12,7 +12,7 @@ GoogleURLTracker::GoogleURLTracker( std::unique_ptr client, -@@ -143,83 +143,4 @@ void GoogleURLTracker::FinishSleep() { +@@ -145,83 +145,4 @@ void GoogleURLTracker::FinishSleep() { } void GoogleURLTracker::StartFetchIfDesirable() { diff --git a/0006-modify-default-prefs.patch b/0006-modify-default-prefs.patch index fae2884..94a22ac 100644 --- a/0006-modify-default-prefs.patch +++ b/0006-modify-default-prefs.patch @@ -1,6 +1,6 @@ --- a/chrome/browser/chrome_content_browser_client.cc +++ b/chrome/browser/chrome_content_browser_client.cc -@@ -856,7 +856,7 @@ void ChromeContentBrowserClient::Registe +@@ -966,7 +966,7 @@ void ChromeContentBrowserClient::Registe void ChromeContentBrowserClient::RegisterProfilePrefs( user_prefs::PrefRegistrySyncable* registry) { registry->RegisterBooleanPref(prefs::kDisable3DAPIs, false); @@ -11,7 +11,7 @@ // 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 -@@ -65,11 +65,11 @@ void RegisterBrowserUserPrefs(user_prefs +@@ -70,11 +70,11 @@ void RegisterBrowserUserPrefs(user_prefs registry->RegisterBooleanPref(prefs::kWebAppCreateInAppsMenu, true); registry->RegisterBooleanPref(prefs::kWebAppCreateInQuickLaunchBar, true); registry->RegisterBooleanPref( @@ -49,7 +49,7 @@ enum class NetworkPredictionStatus { --- a/chrome/browser/background/background_mode_manager.cc +++ b/chrome/browser/background/background_mode_manager.cc -@@ -363,7 +363,7 @@ void BackgroundModeManager::RegisterPref +@@ -362,7 +362,7 @@ void BackgroundModeManager::RegisterPref registry->RegisterBooleanPref(prefs::kChromeCreatedLoginItem, false); registry->RegisterBooleanPref(prefs::kMigratedLoginItemPref, false); #endif @@ -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 -@@ -100,7 +100,7 @@ void CookieSettings::GetCookieSettings( +@@ -111,7 +111,7 @@ void CookieSettings::GetCookieSettings( void CookieSettings::RegisterProfilePrefs( user_prefs::PrefRegistrySyncable* registry) { registry->RegisterBooleanPref( @@ -82,7 +82,7 @@ --- a/components/autofill/core/browser/autofill_manager.cc +++ b/components/autofill/core/browser/autofill_manager.cc -@@ -215,7 +215,7 @@ void AutofillManager::RegisterProfilePre +@@ -227,7 +227,7 @@ void AutofillManager::RegisterProfilePre registry->RegisterIntegerPref( prefs::kAutofillCreditCardSigninPromoImpressionCount, 0); registry->RegisterBooleanPref( @@ -101,10 +101,10 @@ + $i18nRaw{resetPageFeedback} - + --- a/chrome/browser/io_thread.cc +++ b/chrome/browser/io_thread.cc -@@ -629,7 +629,7 @@ void IOThread::RegisterPrefs(PrefRegistr +@@ -615,7 +615,7 @@ void IOThread::RegisterPrefs(PrefRegistr std::string()); registry->RegisterBooleanPref(prefs::kEnableReferrers, true); data_reduction_proxy::RegisterPrefs(registry); @@ -180,7 +180,7 @@ } --- a/extensions/common/extension.cc +++ b/extensions/common/extension.cc -@@ -330,14 +330,6 @@ bool Extension::ShouldDisplayInExtension +@@ -368,14 +368,6 @@ bool Extension::ShouldDisplayInExtension if (is_theme()) return false; @@ -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 -@@ -370,9 +370,9 @@ void RegisterProfilePrefs(PrefRegistrySi +@@ -374,9 +374,9 @@ void RegisterProfilePrefs(PrefRegistrySi registry->RegisterBooleanPref( prefs::kSafeBrowsingSawInterstitialScoutReporting, false); registry->RegisterBooleanPref( @@ -222,5 +222,5 @@ - prefs::kCredentialsEnableAutosignin, true, + prefs::kCredentialsEnableAutosignin, false, user_prefs::PrefRegistrySyncable::SYNCABLE_PRIORITY_PREF); - registry->RegisterBooleanPref(prefs::kWasObsoleteHttpDataCleaned, false); registry->RegisterStringPref(prefs::kSyncPasswordHash, std::string(), + PrefRegistry::NO_REGISTRATION_FLAGS); diff --git a/0007-disable-web-resource-service.patch b/0007-disable-web-resource-service.patch index dae1930..0d37b5c 100644 --- a/0007-disable-web-resource-service.patch +++ b/0007-disable-web-resource-service.patch @@ -1,6 +1,6 @@ --- a/components/web_resource/web_resource_service.cc +++ b/components/web_resource/web_resource_service.cc -@@ -128,44 +128,7 @@ bool WebResourceService::GetFetchSchedul +@@ -127,44 +127,7 @@ bool WebResourceService::GetFetchSchedul // Initializes the fetching of data from the resource server. Data // load calls OnURLFetchComplete. void WebResourceService::StartFetch() { diff --git a/0014-disable-translation-lang-fetch.patch b/0014-disable-translation-lang-fetch.patch index 309452b..45e014a 100644 --- a/0014-disable-translation-lang-fetch.patch +++ b/0014-disable-translation-lang-fetch.patch @@ -11,19 +11,19 @@ request_pending_ = true; --- a/chrome/browser/spellchecker/spellcheck_hunspell_dictionary.cc +++ b/chrome/browser/spellchecker/spellcheck_hunspell_dictionary.cc -@@ -158,7 +158,6 @@ void SpellcheckHunspellDictionary::Retry +@@ -164,7 +164,6 @@ void SpellcheckHunspellDictionary::Retry return; } - request_context_getter_ = request_context_getter; + browser_context_ = browser_context; - DownloadDictionary(GetDictionaryURL()); } bool SpellcheckHunspellDictionary::IsReady() const { -@@ -377,9 +376,6 @@ void SpellcheckHunspellDictionary::Initi +@@ -401,9 +400,6 @@ void SpellcheckHunspellDictionary::Initi } - if (request_context_getter_) { -- // Download from the UI thread to check that |request_context_getter_| is + if (browser_context_) { +- // Download from the UI thread to check that |browser_context_| is - // still valid. - DownloadDictionary(GetDictionaryURL()); return; @@ -31,7 +31,7 @@ } --- a/components/translate/core/browser/translate_ranker_impl.cc +++ b/components/translate/core/browser/translate_ranker_impl.cc -@@ -150,14 +150,10 @@ TranslateRankerImpl::TranslateRankerImpl +@@ -154,14 +154,10 @@ TranslateRankerImpl::TranslateRankerImpl ukm::UkmRecorder* ukm_recorder) : ukm_recorder_(ukm_recorder), is_logging_enabled_(false), @@ -50,7 +50,7 @@ weak_ptr_factory_(this) { if (is_query_enabled_ || is_enforcement_enabled_) { model_loader_ = std::make_unique( -@@ -231,6 +227,8 @@ bool TranslateRankerImpl::ShouldOfferTra +@@ -235,6 +231,8 @@ bool TranslateRankerImpl::ShouldOfferTra // (or become False). const bool kDefaultResponse = true; diff --git a/0017-disable-new-avatar-menu.patch b/0017-disable-new-avatar-menu.patch index fe05949..1c0b2ed 100644 --- a/0017-disable-new-avatar-menu.patch +++ b/0017-disable-new-avatar-menu.patch @@ -1,6 +1,6 @@ --- a/components/signin/core/browser/signin_manager.cc +++ b/components/signin/core/browser/signin_manager.cc -@@ -302,7 +302,7 @@ void SigninManager::OnGoogleServicesUser +@@ -314,7 +314,7 @@ void SigninManager::OnGoogleServicesUser } bool SigninManager::IsSigninAllowed() const { diff --git a/0021-disable-rlz.patch b/0021-disable-rlz.patch index 8f61095..38e5210 100644 --- a/0021-disable-rlz.patch +++ b/0021-disable-rlz.patch @@ -1,7 +1,7 @@ # Disable rlz ---- a/rlz/features/features.gni -+++ b/rlz/features/features.gni +--- 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 diff --git a/9000-disable-metrics.patch b/9000-disable-metrics.patch index db28b77..a0633f3 100644 --- a/9000-disable-metrics.patch +++ b/9000-disable-metrics.patch @@ -1,6 +1,6 @@ --- a/chrome/browser/about_flags.cc +++ b/chrome/browser/about_flags.cc -@@ -1206,6 +1206,11 @@ const FeatureEntry::FeatureVariation kSi +@@ -1225,6 +1225,11 @@ const FeatureEntry::FeatureVariation kSi // // When adding a new choice, add it to the end of the list. const FeatureEntry kFeatureEntries[] = { @@ -12,228 +12,88 @@ {"ignore-gpu-blacklist", flag_descriptions::kIgnoreGpuBlacklistName, flag_descriptions::kIgnoreGpuBlacklistDescription, kOsAll, SINGLE_VALUE_TYPE(switches::kIgnoreGpuBlacklist)}, ---- a/base/metrics/histogram_base.h -+++ b/base/metrics/histogram_base.h -@@ -94,6 +94,12 @@ BASE_EXPORT HistogramBase* DeserializeHi - - class BASE_EXPORT HistogramBase { - public: -+ // Allow histograms to be disabled. -+ static const std::string& kDummyName; -+ static const std::string& kDummySparseName; -+ static bool MetricsEnabled(); -+ bool enabled = false; +--- a/base/BUILD.gn ++++ b/base/BUILD.gn +@@ -575,6 +575,8 @@ jumbo_component("base") { + "message_loop/watchable_io_message_pump_posix.h", + "metrics/bucket_ranges.cc", + "metrics/bucket_ranges.h", ++ "metrics/command_line_handler.cc", ++ "metrics/command_line_handler.h", + "metrics/dummy_histogram.cc", + "metrics/dummy_histogram.h", + "metrics/field_trial.cc", +--- a/tools/gn/bootstrap/bootstrap.py ++++ b/tools/gn/bootstrap/bootstrap.py +@@ -535,6 +535,7 @@ def write_gn_ninja(path, root_gen_dir, o + 'base/message_loop/message_pump_default.cc', + 'base/message_loop/watchable_io_message_pump_posix.cc', + 'base/metrics/bucket_ranges.cc', ++ 'base/metrics/command_line_handler.cc', + 'base/metrics/dummy_histogram.cc', + 'base/metrics/field_trial.cc', + 'base/metrics/field_trial_param_associator.cc', +--- /dev/null ++++ b/base/metrics/command_line_handler.cc +@@ -0,0 +1,11 @@ ++#include "base/metrics/command_line_handler.h" + - typedef int32_t Sample; // Used for samples. - typedef subtle::Atomic32 AtomicCount; // Used to count samples. - typedef int32_t Count; // Used to manipulate counts in temporaries. ---- a/base/metrics/histogram_base.cc -+++ b/base/metrics/histogram_base.cc -@@ -10,6 +10,7 @@ - #include - #include - +#include "base/command_line.h" - #include "base/json/json_string_value_serializer.h" - #include "base/lazy_instance.h" - #include "base/logging.h" -@@ -65,6 +66,12 @@ HistogramBase* DeserializeHistogramInfo( - } - } - -+const std::string& HistogramBase::kDummyName = "Dummy"; -+const std::string& HistogramBase::kDummySparseName = "DummySparse"; -+bool HistogramBase::MetricsEnabled() { -+ return base::CommandLine::ForCurrentProcess()->HasSwitch("enable-metrics"); -+} + - const HistogramBase::Sample HistogramBase::kSampleType_MAX = INT_MAX; - - HistogramBase::HistogramBase(const char* name) ---- a/base/metrics/histogram.cc -+++ b/base/metrics/histogram.cc -@@ -123,7 +123,8 @@ class Histogram::Factory { - minimum_(minimum), - maximum_(maximum), - bucket_count_(bucket_count), -- flags_(flags) {} -+ flags_(flags), -+ enabled_(HistogramBase::MetricsEnabled()) {} - - // Create a BucketRanges structure appropriate for this histogram. - virtual BucketRanges* CreateRanges() { -@@ -153,13 +154,18 @@ class Histogram::Factory { - HistogramBase::Sample maximum_; - uint32_t bucket_count_; - int32_t flags_; -+ const bool enabled_; - - private: - DISALLOW_COPY_AND_ASSIGN(Factory); - }; - - HistogramBase* Histogram::Factory::Build() { -- HistogramBase* histogram = StatisticsRecorder::FindHistogram(name_); -+ std::string overridden_name = HistogramBase::kDummyName; -+ if (enabled_) -+ overridden_name = name_; ++namespace base { + -+ HistogramBase* histogram = StatisticsRecorder::FindHistogram(overridden_name); - if (!histogram) { - // To avoid racy destruction at shutdown, the following will be leaked. - const BucketRanges* created_ranges = CreateRanges(); -@@ -190,7 +196,7 @@ HistogramBase* Histogram::Factory::Build - if (allocator) { - tentative_histogram = allocator->AllocateHistogram( - histogram_type_, -- name_, -+ overridden_name, - minimum_, - maximum_, - registered_ranges, -@@ -225,6 +231,10 @@ HistogramBase* Histogram::Factory::Build - } - } - -+ if (!enabled_) -+ return histogram; -+ -+ histogram->enabled = true; - CHECK_EQ(histogram_type_, histogram->GetHistogramType()) << name_; - if (bucket_count_ != 0 && - !histogram->HasConstructionArguments(minimum_, maximum_, bucket_count_)) { -@@ -461,10 +471,16 @@ bool Histogram::HasConstructionArguments - } - - void Histogram::Add(int value) { -+ if (!enabled) -+ return; ++bool MetricsEnabled() { ++ return base::CommandLine::ForCurrentProcess()->HasSwitch("enable-metrics"); ++} + - AddCount(value, 1); - } - - void Histogram::AddCount(int value, int count) { -+ if (!enabled) -+ return; ++} // namespace base +--- /dev/null ++++ b/base/metrics/command_line_handler.h +@@ -0,0 +1,11 @@ ++#ifndef BASE_METRICS_COMMAND_LINE_HANDLER_H_ ++#define BASE_METRICS_COMMAND_LINE_HANDLER_H_ + - DCHECK_EQ(0, ranges(0)); - DCHECK_EQ(kSampleType_MAX, ranges(bucket_count())); - -@@ -519,10 +535,16 @@ std::unique_ptr Histog - } - - void Histogram::AddSamples(const HistogramSamples& samples) { -+ if (!enabled) -+ return; ++namespace base { + - unlogged_samples_->Add(samples); - } - - bool Histogram::AddSamplesFromPickle(PickleIterator* iter) { -+ if (!enabled) -+ return true; ++// Checks the command-line flag 'enable-metrics'. ++bool MetricsEnabled(); + - return unlogged_samples_->AddFromPickle(iter); - } - ---- a/base/metrics/sparse_histogram.cc -+++ b/base/metrics/sparse_histogram.cc -@@ -24,7 +24,12 @@ typedef HistogramBase::Sample Sample; - // static - HistogramBase* SparseHistogram::FactoryGet(const std::string& name, - int32_t flags) { -- HistogramBase* histogram = StatisticsRecorder::FindHistogram(name); -+ const bool enabled_ = HistogramBase::MetricsEnabled(); -+ std::string overridden_name = HistogramBase::kDummySparseName; -+ if (enabled_) -+ overridden_name = name; ++} // namespace base + -+ HistogramBase* histogram = StatisticsRecorder::FindHistogram(overridden_name); - if (!histogram) { - // Try to create the histogram using a "persistent" allocator. As of - // 2016-02-25, the availability of such is controlled by a base::Feature -@@ -36,7 +41,7 @@ HistogramBase* SparseHistogram::FactoryG - PersistentHistogramAllocator* allocator = GlobalHistogramAllocator::Get(); - if (allocator) { - tentative_histogram = allocator->AllocateHistogram( -- SPARSE_HISTOGRAM, name, 0, 0, nullptr, flags, &histogram_ref); -+ SPARSE_HISTOGRAM, overridden_name, 0, 0, nullptr, flags, &histogram_ref); - } ++#endif // BASE_METRICS_COMMAND_LINE_HANDLER_H_ +--- a/components/metrics/expired_histograms_checker.cc ++++ b/components/metrics/expired_histograms_checker.cc +@@ -2,6 +2,7 @@ + // Use of this source code is governed by a BSD-style license that can be + // found in the LICENSE file. - // Handle the case where no persistent allocator is present or the -@@ -45,7 +50,7 @@ HistogramBase* SparseHistogram::FactoryG - DCHECK(!histogram_ref); // Should never have been set. - DCHECK(!allocator); // Shouldn't have failed. - flags &= ~HistogramBase::kIsPersistent; -- tentative_histogram.reset(new SparseHistogram(GetPermanentName(name))); -+ tentative_histogram.reset(new SparseHistogram(GetPermanentName(overridden_name))); - tentative_histogram->SetFlags(flags); - } ++#include "base/metrics/command_line_handler.h" + #include "components/metrics/expired_histograms_checker.h" -@@ -64,6 +69,10 @@ HistogramBase* SparseHistogram::FactoryG - } - } + #include +@@ -15,6 +16,9 @@ ExpiredHistogramsChecker::ExpiredHistogr + ExpiredHistogramsChecker::~ExpiredHistogramsChecker() {} -+ if (!enabled_) -+ return histogram; + bool ExpiredHistogramsChecker::ShouldRecord(uint64_t histogram_hash) const { ++ if (!base::MetricsEnabled()) ++ return false; + -+ histogram->enabled = true; - CHECK_EQ(SPARSE_HISTOGRAM, histogram->GetHistogramType()); - return histogram; - } -@@ -97,10 +106,16 @@ bool SparseHistogram::HasConstructionArg + return !std::binary_search(array_, array_ + size_, histogram_hash); } - void SparseHistogram::Add(Sample value) { -+ if (!enabled) -+ return; -+ - AddCount(value, 1); - } - - void SparseHistogram::AddCount(Sample value, int count) { -+ if (!enabled) -+ return; -+ - if (count <= 0) { - NOTREACHED(); - return; -@@ -146,11 +161,17 @@ std::unique_ptr Sparse - } - - void SparseHistogram::AddSamples(const HistogramSamples& samples) { -+ if (!enabled) -+ return; -+ - base::AutoLock auto_lock(lock_); - unlogged_samples_->Add(samples); - } - - bool SparseHistogram::AddSamplesFromPickle(PickleIterator* iter) { -+ if (!enabled) -+ return true; -+ - base::AutoLock auto_lock(lock_); - return unlogged_samples_->AddFromPickle(iter); - } --- a/base/metrics/user_metrics.cc +++ b/base/metrics/user_metrics.cc -@@ -9,6 +9,7 @@ - #include +@@ -2,6 +2,7 @@ + // Use of this source code is governed by a BSD-style license that can be + // found in the LICENSE file. - #include "base/bind.h" -+#include "base/command_line.h" - #include "base/lazy_instance.h" - #include "base/location.h" - #include "base/macros.h" -@@ -24,11 +25,21 @@ LazyInstance +@@ -25,10 +26,16 @@ LazyInstanceHasSwitch("enable-metrics"); -+} -+ void RecordAction(const UserMetricsAction& action) { + if (!MetricsEnabled()) + return; @@ -248,7 +108,7 @@ if (!g_task_runner.Get()) { DCHECK(g_callbacks.Get().empty()); return; -@@ -46,6 +57,9 @@ void RecordComputedAction(const std::str +@@ -46,6 +53,9 @@ void RecordComputedAction(const std::str } void AddActionCallback(const ActionCallback& callback) { @@ -258,82 +118,92 @@ // Only allow adding a callback if the task runner is set. DCHECK(g_task_runner.Get()); DCHECK(g_task_runner.Get()->BelongsToCurrentThread()); ---- a/components/metrics/metrics_service.cc -+++ b/components/metrics/metrics_service.cc -@@ -131,6 +131,7 @@ - - #include "base/bind.h" - #include "base/callback.h" -+#include "base/command_line.h" - #include "base/location.h" - #include "base/memory/ptr_util.h" - #include "base/metrics/histogram_base.h" -@@ -815,6 +816,8 @@ bool MetricsService::UmaMetricsProperlyS - void MetricsService::RegisterMetricsProvider( - std::unique_ptr provider) { - DCHECK_EQ(INITIALIZED, state_); -+ if (!base::CommandLine::ForCurrentProcess()->HasSwitch("enable-metrics")) -+ return; - delegating_provider_.RegisterMetricsProvider(std::move(provider)); - } - --- a/chrome/browser/ui/tab_helpers.cc +++ b/chrome/browser/ui/tab_helpers.cc -@@ -206,8 +206,10 @@ void TabHelpers::AttachTabHelpers(WebCon +@@ -8,6 +8,7 @@ + #include + + #include "base/command_line.h" ++#include "base/metrics/command_line_handler.h" + #include "base/feature_list.h" + #include "base/time/default_tick_clock.h" + #include "build/build_config.h" +@@ -204,8 +205,10 @@ void TabHelpers::AttachTabHelpers(WebCon ClientHintsObserver::CreateForWebContents(web_contents); ConnectionHelpTabHelper::CreateForWebContents(web_contents); CoreTabHelper::CreateForWebContents(web_contents); - data_use_measurement::DataUseWebContentsObserver::CreateForWebContents( - web_contents); -+ if (base::CommandLine::ForCurrentProcess()->HasSwitch("enable-metrics")) { ++ if (base::MetricsEnabled()) { + data_use_measurement::DataUseWebContentsObserver::CreateForWebContents( + web_contents); + } ExternalProtocolObserver::CreateForWebContents(web_contents); favicon::CreateContentFaviconDriverForWebContents(web_contents); FindTabHelper::CreateForWebContents(web_contents); -@@ -222,13 +224,19 @@ void TabHelpers::AttachTabHelpers(WebCon +@@ -220,13 +223,19 @@ void TabHelpers::AttachTabHelpers(WebCon HistoryTabHelper::CreateForWebContents(web_contents); InfoBarService::CreateForWebContents(web_contents); InstallableManager::CreateForWebContents(web_contents); - metrics::RendererUptimeWebContentsObserver::CreateForWebContents( - web_contents); -+ if (base::CommandLine::ForCurrentProcess()->HasSwitch("enable-metrics")) { ++ if (base::MetricsEnabled()) { + metrics::RendererUptimeWebContentsObserver::CreateForWebContents( + web_contents); + } MixedContentSettingsTabHelper::CreateForWebContents(web_contents); NavigationCorrectionTabObserver::CreateForWebContents(web_contents); - NavigationMetricsRecorder::CreateForWebContents(web_contents); -+ if (base::CommandLine::ForCurrentProcess()->HasSwitch("enable-metrics")) { ++ if (base::MetricsEnabled()) { + NavigationMetricsRecorder::CreateForWebContents(web_contents); + } OutOfMemoryReporter::CreateForWebContents(web_contents); - chrome::InitializePageLoadMetricsForWebContents(web_contents); -+ if (base::CommandLine::ForCurrentProcess()->HasSwitch("enable-metrics")) { ++ if (base::MetricsEnabled()) { + chrome::InitializePageLoadMetricsForWebContents(web_contents); + } PDFPluginPlaceholderObserver::CreateForWebContents(web_contents); PermissionRequestManager::CreateForWebContents(web_contents); // The PopupBlockerTabHelper has an implicit dependency on -@@ -253,7 +261,9 @@ void TabHelpers::AttachTabHelpers(WebCon +@@ -251,7 +260,9 @@ void TabHelpers::AttachTabHelpers(WebCon // is taken over by ChromeContentSettingsClient. http://crbug.com/387075 TabSpecificContentSettings::CreateForWebContents(web_contents); TabUIHelper::CreateForWebContents(web_contents); - ukm::InitializeSourceUrlRecorderForWebContents(web_contents); -+ if (base::CommandLine::ForCurrentProcess()->HasSwitch("enable-metrics")) { ++ if (base::MetricsEnabled()) { + ukm::InitializeSourceUrlRecorderForWebContents(web_contents); + } vr::VrTabHelper::CreateForWebContents(web_contents); // NO! Do not just add your tab helper here. This is a large alphabetized -@@ -299,7 +309,8 @@ void TabHelpers::AttachTabHelpers(WebCon +@@ -297,7 +308,9 @@ void TabHelpers::AttachTabHelpers(WebCon #if defined(OS_WIN) || defined(OS_MACOSX) || \ (defined(OS_LINUX) && !defined(OS_CHROMEOS)) - metrics::DesktopSessionDurationObserver::CreateForWebContents(web_contents); -+ if (base::CommandLine::ForCurrentProcess()->HasSwitch("enable-metrics")) ++ if (base::MetricsEnabled()) { + metrics::DesktopSessionDurationObserver::CreateForWebContents(web_contents); ++ } #endif // --- Feature tab helpers behind flags --- +--- a/chrome/browser/metrics/chrome_metrics_service_client.cc ++++ b/chrome/browser/metrics/chrome_metrics_service_client.cc +@@ -17,6 +17,7 @@ + #include "base/files/file_util.h" + #include "base/lazy_instance.h" + #include "base/logging.h" ++#include "base/metrics/command_line_handler.h" + #include "base/metrics/field_trial_params.h" + #include "base/metrics/histogram_macros.h" + #include "base/metrics/persistent_histogram_allocator.h" +@@ -599,6 +600,9 @@ void ChromeMetricsServiceClient::Initial + } + + void ChromeMetricsServiceClient::RegisterMetricsServiceProviders() { ++ if (!base::MetricsEnabled()) ++ return; ++ + PrefService* local_state = g_browser_process->local_state(); + + // Gets access to persistent metrics shared by sub-processes. From e5251ba26f283c4f34abf5b6c667b8d9b7f56b0a Mon Sep 17 00:00:00 2001 From: xsmile <> Date: Thu, 24 May 2018 12:05:48 +0200 Subject: [PATCH 2/7] 67.0.3396.48: Update PKGBUILD and build patches --- PKGBUILD | 49 +++++++------- chromium-arflags.patch | 67 +++++++++++++++++++ chromium-clang-compiler-flags.patch | 15 +++++ chromium-enable_widevine.patch | 19 ++++++ chromium-vaapi-r18.patch | 58 ++++++++-------- ...s_cfi-true-builds-with-unbundled-ICU.patch | 53 --------------- ...s-rendering-too-large-when-using-OSX.patch | 60 ----------------- 7 files changed, 155 insertions(+), 166 deletions(-) create mode 100644 chromium-arflags.patch create mode 100644 chromium-clang-compiler-flags.patch create mode 100644 chromium-enable_widevine.patch delete mode 100644 fix-crash-in-is_cfi-true-builds-with-unbundled-ICU.patch delete mode 100644 fix-frame-buttons-rendering-too-large-when-using-OSX.patch diff --git a/PKGBUILD b/PKGBUILD index 33f8418..35f786d 100644 --- a/PKGBUILD +++ b/PKGBUILD @@ -5,7 +5,7 @@ # Contributor: Daniel J Griffiths pkgname=inox -pkgver=66.0.3359.139 +pkgver=67.0.3396.48 pkgrel=1 _launcher_ver=6 pkgdesc="Chromium Spin-off to enhance privacy by disabling data transmission to Google" @@ -30,8 +30,9 @@ source=(https://commondatastorage.googleapis.com/chromium-browser-official/chrom chromium-$pkgver.txt::https://chromium.googlesource.com/chromium/src/+/$pkgver?format=TEXT https://raw.githubusercontent.com/gcarq/inox-patchset/$pkgver/product_logo_{16,22,24,32,48,64,128,256}.png # Patches from Arch Linux - https://raw.githubusercontent.com/gcarq/inox-patchset/$pkgver/fix-crash-in-is_cfi-true-builds-with-unbundled-ICU.patch - https://raw.githubusercontent.com/gcarq/inox-patchset/$pkgver/fix-frame-buttons-rendering-too-large-when-using-OSX.patch + https://raw.githubusercontent.com/gcarq/inox-patchset/$pkgver/chromium-arflags.patch + https://raw.githubusercontent.com/gcarq/inox-patchset/$pkgver/chromium-clang-compiler-flags.patch + https://raw.githubusercontent.com/gcarq/inox-patchset/$pkgver/chromium-enable_widevine.patch https://raw.githubusercontent.com/gcarq/inox-patchset/$pkgver/chromium-skia-harmony.patch https://raw.githubusercontent.com/gcarq/inox-patchset/$pkgver/chromium-widevine.patch # Misc @@ -59,9 +60,9 @@ source=(https://commondatastorage.googleapis.com/chromium-browser-official/chrom https://raw.githubusercontent.com/gcarq/inox-patchset/$pkgver/0020-launcher-branding.patch https://raw.githubusercontent.com/gcarq/inox-patchset/$pkgver/0021-disable-rlz.patch https://raw.githubusercontent.com/gcarq/inox-patchset/$pkgver/9000-disable-metrics.patch) -sha256sums=('be75a5b5f8c5789d359238f374a43bf52ded49425f13ed68b8021c24e2e264b2' +sha256sums=('f6350ea68257309cd99b19b3b686715074ae768c48e4e09d56601209f1c20986' '04917e3cd4307d8e31bfb0027a5dce6d086edb10ff8a716024fbb8bb0c7dccf1' - '34eb82c625b7050021a8d3334ceaa7fa3d042dd816c228c14abb52b29796f7b9' + '2cd032d4811542ea8bb488b94681ed72eb02077b7c10b6dc8853aebb12d114e1' '71471fa4690894420f9e04a2e9a622af620d92ac2714a35f9a4c4e90fa3968dd' '4a533acefbbc1567b0d74a1c0903e9179b8c59c1beabe748850795815366e509' '7b88830c5e0e9819f514ad68aae885d427541a907e25607e47dee1b0f38975fd' @@ -70,33 +71,34 @@ sha256sums=('be75a5b5f8c5789d359238f374a43bf52ded49425f13ed68b8021c24e2e264b2' '53a1e8da18069eb4d6ab3af9c923c22a0f020241a4839c3140e3601052ddf6ff' '896993987d4ef9f0ac7db454f288117316c2c80ed0b6764019afd760db222dad' '3df9b3bbdc07fde63d9e400954dcc6ab6e0e5454f0ef6447570eef0549337354' - 'e3fb73b43bb8c69ff517e66b2cac73d6e759fd240003eb35598df9af442422fe' - 'bd5e0e61df3f89172590801aea7c8ac75162c10c7fe83e262e96a14388d1633a' + 'ebf0054a2f8ad4d7e4da438e143d8674c88a31385f409068c3729c5b222e3973' + '4b7cf89fb16f9f99988b96746bfde4e61cb5c6dcbe61272a638ee2c99810a387' + '85861bfc26eb66280b622669d6a36ece19c555003bbf79e55966c3ac6f7af822' 'feca54ab09ac0fc9d0626770a6b899a6ac5a12173c7d0c1005bc3964ec83e7b3' 'd6fdcb922e5a7fbe15759d39ccc8ea4225821c44d98054ce0f23f9d1f00c9808' - '514f40accb2b4bc439df43f11bb7154a812eeb9fa61777b3d986cfa6bb109ebd' - '6c5f41579c43b192aaa2fd2fa4de06280cb3d4b500621961cb5bfb48d95d471e' - 'aa86ff1fc7b21d9d4523a681eeb46314f00e90558e9069252ab7c4f7b593f5f1' + 'b838eb3168328b35cb6fabad59c9c0882c47472fcc3202ea80acef83602c4fdc' + 'c605713244775e1b834c5bb6e86734800a84527b306b97266c60c5be46fcaa7a' + 'b9fc0089687e67453dba9190a069414f4621143349371fd523eb816e2e46662c' 'f639f11ced3432cb12a19528e4d9a7f1bbcb2f9fd46f2969d8d0b567e27ec407' - 'fb91a7e30e2615e4eb0626b0fdcf97b92d4a727a52023730f408b02fee436c8d' + '372a17710c9ae647ad597284491c5e91ea40cc9ea3750f35531b874dfed3f728' '7193573d2c4c5e9af35c5364ae6b92d714ebdd8224221cd7326a3afde5abc5a1' - 'f93dd17ffd5407cb2384be5e90b5ef00e02762ab456656072ecb67d9e1b61ad4' - 'a28f1428accff9e967c4d0f970fac05c156b96534bc9eefb60f0175116ed7db2' + 'e06d6fb900eadeb57bcbd921e456316e117cddb58c336ba07402c3aefe825dd0' + '50c6e2d299bfce3648d8b58c3479f03b8734fb63e36a3bb59c948c04ea71e3ab' 'f657866cbce253c6854cf30c9564ef59198509ed8274832d4d3e0bad303a89ca' '306b29cdfd2def2353b6c4a582fb6fcc7989a6fe009412d4abf2e2daf84ff9d1' '3a8979ca0cae33a836d27f825ac2e15028c2656efce2ee70c1f8ce7d094f5c1c' '6fdea7a737959b226165dc3b6dd347de1e09e6e237acc444116df007ba0a7c57' '6427fea42b1cc6cf9aaae883c75c2209360344125827e1d6b15666faaf3c10a9' '60ecb418ff8728f67ac9617216f68dcc1ba0fa4d4e47e2da1fc4e63b5c91bfea' - 'c918a2495273f1ae6ab94d3c215b97c00943a5e8cf14c7025c58a955dca71f53' + '9dfb678f76d3429f4fc3014a5de914535a7f7f64a3c185551b3f8bde9d647551' '44db6f3733332167518e947c72c9661b74c757aeed1b4912f94f3f34aeea067a' '7e12969dda184e24eccd6e5bf2b8244ba1336c2dc2dbf0494c153d09923723fd' - 'e407da0596e044971631c0883a83bd75665535f1b913df32ba08ca8cd5d4b16e' + '38583c9e1313e46e7444d990a00e64fb4a07fbb7f3d926737c97b0bfa2e44e33' 'a6d29b8c041e0a367ad68e817c703e03bed63bff26c47d7d94ae280af45b9457' 'e297609b4673e3b35c5843a9c3e49ab1b04bc9a02e9e178d5cee58b6ca8cda01' '80d2974001708c288a54c24e1dc896ef25916552b740765f6066a244c05ffcd5' - 'dbe942b1eaba525ca6b81d398462a70360fc2043cbfe5d4105657c3bd721e592' - 'f53b4d111fc119bd61ca662aab7db530649086ef6af1cd8c779027da088143a9') + '80e6512b928082a0b59465e1dcbab5e6284b545933f42d262194b1a86811a243' + 'd950ffdb1fd573f1e9049293a36025d71a1c08ad772ffe92fe4c7d1761469c4d') # Possible replacements are listed in build/linux/unbundle/replace_gn_files.py # Keys are the names in the above script; values are the dependencies in Arch @@ -153,11 +155,9 @@ prepare() { # https://crbug.com/829916#c16 sed -i 's/"Chromium/"Chrome/' chrome/common/chrome_content_client_constants.cc - # https://crbug.com/822820 - patch -Np1 -i ../fix-crash-in-is_cfi-true-builds-with-unbundled-ICU.patch - - # https://crbug.com/821881 - patch -Np1 -i ../fix-frame-buttons-rendering-too-large-when-using-OSX.patch + patch -Np1 -i ../chromium-arflags.patch + patch -Np1 -i ../chromium-clang-compiler-flags.patch + patch -Np1 -i ../chromium-enable_widevine.patch # https://crbug.com/skia/6663#c10 patch -Np4 -i ../chromium-skia-harmony.patch @@ -206,6 +206,7 @@ prepare() { \! -path "*third_party/$_lib/chromium/*" \ \! -path "*third_party/$_lib/google/*" \ \! -path './base/third_party/icu/*' \ + \! -path './third_party/crashpad/crashpad/third_party/zlib/zlib_crashpad.h' \ \! -path './third_party/pdfium/third_party/freetype/include/pstables.h' \ \! -path './third_party/yasm/run_yasm.py' \ \! -regex '.*\.\(gn\|gni\|isolate\)' \ @@ -284,7 +285,7 @@ build() { --script-executable=/usr/bin/python2 msg2 'Building Chromium' - ninja -C out/Release chrome chrome_sandbox chromedriver widevinecdmadapter + ninja -C out/Release chrome chrome_sandbox chromedriver } package() { @@ -313,7 +314,7 @@ package() { cp \ out/Release/{chrome_{100,200}_percent,resources}.pak \ - out/Release/{*.bin,libwidevinecdmadapter.so} \ + out/Release/{*.bin} \ "$pkgdir/usr/lib/$pkgname/" install -Dm644 -t "$pkgdir/usr/lib/$pkgname/locales" out/Release/locales/*.pak diff --git a/chromium-arflags.patch b/chromium-arflags.patch new file mode 100644 index 0000000..53e2d53 --- /dev/null +++ b/chromium-arflags.patch @@ -0,0 +1,67 @@ +From 2a6309e504376b3f6890df0c1f4d47a1b66866c5 Mon Sep 17 00:00:00 2001 +From: Tom Anderson +Date: Wed, 07 Mar 2018 16:10:40 -0800 +Subject: [PATCH] Format flags for llvm-ar + +We're planning on passing -T to llvm-ar as part of regular builds on Linux. +However, llvm-ar is very particular in its syntax. It requires the operation to +be specified all in one go like "rcsDT", and forbids "-r -c -s -D -T", "rcsD T", +or anything else that has any spaces or dashes. This makes specifying multiple +flags like arflags=['D', 'T'] difficult since gn will add spaces between them. +This CL fixes the issue in our ar wrapper script to correctly format the flags +for llvm-ar. This issue was never seen because arflags is not set anywhere in a +Linux build. + +BUG=801925 +R=thakis + +Change-Id: Idb710052f54487011d6dabc5f30448f78a765515 +--- + +--- a/build/toolchain/gcc_ar_wrapper.py ++++ b/build/toolchain/gcc_ar_wrapper.py +@@ -25,6 +25,9 @@ def main(): + required=True, + help='The ar binary to run', + metavar='PATH') ++ parser.add_argument('--arflags', ++ required=True, ++ help='Flags to pass to ar') + parser.add_argument('--output', + required=True, + help='Output archive file', +@@ -34,8 +37,6 @@ def main(): + parser.add_argument('--resource-whitelist', + help='Merge all resource whitelists into a single file.', + metavar='PATH') +- parser.add_argument('operation', +- help='Operation on the archive') + parser.add_argument('inputs', nargs='+', + help='Input files') + args = parser.parse_args() +@@ -57,7 +58,13 @@ def main(): + wrapper_utils.CombineResourceWhitelists( + whitelist_candidates, args.resource_whitelist) + +- command = [args.ar] + object_mode + args.operation.split() ++ # GNU ar is forgiving with how it handles flags, but llvm-ar is more strict. ++ # Something like "ar -r -c -s -D -T libfoo.a foo.o" would work on GNU, but ++ # llvm requires "llvm-ar rcsDT libfoo.a foo.o". The latter works on GNU too, ++ # so strip spaces and dashes from arflags to handle both cases. ++ operation = args.arflags.replace(' ', '').replace('-', '') ++ ++ command = [args.ar] + object_mode + [operation] + if args.plugin is not None: + command += ['--plugin', args.plugin] + command.append(args.output) +--- a/build/toolchain/gcc_toolchain.gni ++++ b/build/toolchain/gcc_toolchain.gni +@@ -348,7 +348,7 @@ template("gcc_toolchain") { + + # Almost all targets build with //build/config/compiler:thin_archive which + # adds -T to arflags. +- command = "$python_path \"$ar_wrapper\"$whitelist_flag --output={{output}} --ar=\"$ar\" \"{{arflags}} $extra_arflags\" @\"$rspfile\"" ++ command = "$python_path \"$ar_wrapper\"$whitelist_flag --output={{output}} --ar=\"$ar\" --arflags=\"{{arflags}} $extra_arflags\" @\"$rspfile\"" + description = "AR {{output}}" + rspfile_content = "{{inputs}}" + outputs = [ diff --git a/chromium-clang-compiler-flags.patch b/chromium-clang-compiler-flags.patch new file mode 100644 index 0000000..d9b227b --- /dev/null +++ b/chromium-clang-compiler-flags.patch @@ -0,0 +1,15 @@ +# Remove flags not yet implemented in the system compiler's version. + +--- a/build/config/compiler/BUILD.gn ++++ b/build/config/compiler/BUILD.gn +@@ -1387,10 +1387,6 @@ config("default_warnings") { + + # TODO(hans): https://crbug.com/766891 + "-Wno-null-pointer-arithmetic", +- +- # Ignore warnings about MSVC optimization pragmas. +- # TODO(thakis): Only for no_chromium_code? http://crbug.com/505314 +- "-Wno-ignored-pragma-optimize", + ] + if (llvm_force_head_revision) { + cflags += [ diff --git a/chromium-enable_widevine.patch b/chromium-enable_widevine.patch new file mode 100644 index 0000000..6ae4b64 --- /dev/null +++ b/chromium-enable_widevine.patch @@ -0,0 +1,19 @@ +# https://chromium.googlesource.com/chromium/src/+/a5252b20a67b9a6882090d963fbd4dc168dd3436%5E%21/ +# Remove restrictions for enabling Widevine support as the libwidevinecdm.so +# component should be able to be installed separately from the browser. + +--- a/third_party/widevine/cdm/BUILD.gn ++++ b/third_party/widevine/cdm/BUILD.gn +@@ -8,12 +8,6 @@ import("//media/cdm/library_cdm/cdm_path + import("//media/media_options.gni") + import("//third_party/widevine/cdm/widevine.gni") + +-# Internal Cast builds set enable_widevine=true to bring in Widevine support. +-# TODO(xhwang): Support component updated CDM on other platforms and remove this +-# assert. +-assert(!enable_widevine || is_win || is_mac || is_chromecast, +- "Component updated CDM only supported on Windows and Mac for now.") +- + widevine_arch = current_cpu + if (widevine_arch == "x86") { + widevine_arch = "ia32" diff --git a/chromium-vaapi-r18.patch b/chromium-vaapi-r18.patch index 6ae81e1..dd8f2be 100644 --- a/chromium-vaapi-r18.patch +++ b/chromium-vaapi-r18.patch @@ -36,7 +36,7 @@ Signed-off-by: Daniel Charles --- a/chrome/browser/about_flags.cc +++ b/chrome/browser/about_flags.cc -@@ -1234,12 +1234,14 @@ const FeatureEntry kFeatureEntries[] = { +@@ -1285,12 +1285,14 @@ const FeatureEntry kFeatureEntries[] = { flag_descriptions::kUiPartialSwapDescription, kOsAll, SINGLE_DISABLE_VALUE_TYPE(switches::kUIDisablePartialSwap)}, #if BUILDFLAG(ENABLE_WEBRTC) @@ -51,7 +51,7 @@ Signed-off-by: Daniel Charles {"enable-webrtc-hw-h264-encoding", flag_descriptions::kWebrtcHwH264EncodingName, flag_descriptions::kWebrtcHwH264EncodingDescription, kOsAndroid | kOsCrOS, -@@ -1553,6 +1555,13 @@ const FeatureEntry kFeatureEntries[] = { +@@ -1613,6 +1615,13 @@ const FeatureEntry kFeatureEntries[] = { flag_descriptions::kShowTouchHudDescription, kOsCrOS, SINGLE_VALUE_TYPE(ash::switches::kAshTouchHud)}, #endif // OS_CHROMEOS @@ -65,7 +65,7 @@ Signed-off-by: Daniel Charles { "disable-accelerated-video-decode", flag_descriptions::kAcceleratedVideoDecodeName, -@@ -1560,6 +1569,7 @@ const FeatureEntry kFeatureEntries[] = { +@@ -1620,6 +1629,7 @@ const FeatureEntry kFeatureEntries[] = { kOsMac | kOsWin | kOsCrOS | kOsAndroid, SINGLE_DISABLE_VALUE_TYPE(switches::kDisableAcceleratedVideoDecode), }, @@ -73,7 +73,7 @@ Signed-off-by: Daniel Charles #if defined(OS_WIN) {"enable-hdr", flag_descriptions::kEnableHDRName, flag_descriptions::kEnableHDRDescription, kOsWin, -@@ -2283,12 +2293,17 @@ const FeatureEntry kFeatureEntries[] = { +@@ -2310,12 +2320,17 @@ const FeatureEntry kFeatureEntries[] = { FEATURE_VALUE_TYPE(features::kOpenVR)}, #endif // ENABLE_OPENVR #endif // ENABLE_VR @@ -117,8 +117,8 @@ Signed-off-by: Daniel Charles +#endif ::switches::kDisableBlinkFeatures, ::switches::kDisableCastStreamingHWEncoding, - ::switches::kDisableDistanceFieldText, -@@ -163,7 +169,7 @@ void DeriveCommandLine(const GURL& start + ::switches::kDisableGpu, +@@ -162,7 +168,7 @@ void DeriveCommandLine(const GURL& start ::switches::kDisableWebGLImageChromium, ::switches::kEnableWebGLImageChromium, ::switches::kEnableWebVR, @@ -143,7 +143,7 @@ Signed-off-by: Daniel Charles const char kAcceleratedVideoDecodeName[] = "Hardware-accelerated video decode"; const char kAcceleratedVideoDecodeDescription[] = "Hardware-accelerated video decode where available."; -@@ -1730,6 +1737,7 @@ const char kWebrtcEchoCanceller3Name[] = +@@ -1742,6 +1749,7 @@ const char kWebrtcEchoCanceller3Name[] = const char kWebrtcEchoCanceller3Description[] = "Experimental WebRTC echo canceller (AEC3)."; @@ -151,7 +151,7 @@ Signed-off-by: Daniel Charles const char kWebrtcHwDecodingName[] = "WebRTC hardware video decoding"; const char kWebrtcHwDecodingDescription[] = "Support in WebRTC for decoding video streams using platform hardware."; -@@ -1737,6 +1745,7 @@ const char kWebrtcHwDecodingDescription[ +@@ -1749,6 +1757,7 @@ const char kWebrtcHwDecodingDescription[ const char kWebrtcHwEncodingName[] = "WebRTC hardware video encoding"; const char kWebrtcHwEncodingDescription[] = "Support in WebRTC for encoding video streams using platform hardware."; @@ -159,7 +159,7 @@ Signed-off-by: Daniel Charles const char kWebrtcHwH264EncodingName[] = "WebRTC hardware h264 video encoding"; const char kWebrtcHwH264EncodingDescription[] = -@@ -2561,14 +2570,16 @@ const char kTabStripKeyboardFocusDescrip +@@ -2590,14 +2599,16 @@ const char kTabStripKeyboardFocusDescrip // Chrome OS ------------------------------------------------------------------- @@ -190,7 +190,7 @@ Signed-off-by: Daniel Charles extern const char kAcceleratedVideoDecodeName[]; extern const char kAcceleratedVideoDecodeDescription[]; -@@ -1569,13 +1573,17 @@ extern const char kPermissionPromptPersi +@@ -1589,13 +1593,17 @@ extern const char kPermissionPromptPersi #endif // defined(OS_MACOSX) @@ -213,10 +213,10 @@ Signed-off-by: Daniel Charles --- a/content/browser/gpu/compositor_util.cc +++ b/content/browser/gpu/compositor_util.cc -@@ -99,7 +99,11 @@ const GpuFeatureData GetGpuFeatureData(s +@@ -124,7 +124,11 @@ const GpuFeatureData GetGpuFeatureData(s {"video_decode", - manager->GetFeatureStatus( - gpu::GPU_FEATURE_TYPE_ACCELERATED_VIDEO_DECODE), + SafeGetFeatureStatus(manager, + gpu::GPU_FEATURE_TYPE_ACCELERATED_VIDEO_DECODE), +#if defined(OS_LINUX) && !defined(OS_CHROMEOS) && !defined(OS_ANDROID) + !command_line.HasSwitch(switches::kEnableAcceleratedVideo), +#else @@ -227,7 +227,7 @@ Signed-off-by: Daniel Charles true}, --- a/content/browser/gpu/gpu_process_host.cc +++ b/content/browser/gpu/gpu_process_host.cc -@@ -132,7 +132,7 @@ static const char* const kSwitchNames[] +@@ -134,7 +134,7 @@ static const char* const kSwitchNames[] switches::kDisableGLExtensions, switches::kDisableLogging, switches::kDisableShaderNameHashing, @@ -238,7 +238,7 @@ Signed-off-by: Daniel Charles #if defined(OS_WIN) --- a/content/browser/renderer_host/media/video_capture_browsertest.cc +++ b/content/browser/renderer_host/media/video_capture_browsertest.cc -@@ -163,8 +163,13 @@ class VideoCaptureBrowserTest : public C +@@ -164,8 +164,13 @@ class VideoCaptureBrowserTest : public C base::CommandLine::ForCurrentProcess()->AppendSwitch( switches::kUseFakeJpegDecodeAccelerator); } else { @@ -282,7 +282,7 @@ Signed-off-by: Daniel Charles return; --- a/content/browser/renderer_host/render_process_host_impl.cc +++ b/content/browser/renderer_host/render_process_host_impl.cc -@@ -2524,7 +2524,11 @@ void RenderProcessHostImpl::PropagateBro +@@ -2699,7 +2699,11 @@ void RenderProcessHostImpl::PropagateBro switches::kDefaultTileHeight, switches::kDisable2dCanvasImageChromium, switches::kDisableAcceleratedJpegDecoding, @@ -291,10 +291,10 @@ Signed-off-by: Daniel Charles +#else switches::kDisableAcceleratedVideoDecode, +#endif + switches::kDisableBackgroundTasks, switches::kDisableBackgroundTimerThrottling, switches::kDisableBreakpad, - switches::kDisableCompositorUkmForTests, -@@ -2658,8 +2662,10 @@ void RenderProcessHostImpl::PropagateBro +@@ -2837,8 +2841,10 @@ void RenderProcessHostImpl::PropagateBro switches::kDisableMojoRenderer, #endif #if BUILDFLAG(ENABLE_WEBRTC) @@ -307,7 +307,7 @@ Signed-off-by: Daniel Charles switches::kEnableWebRtcStunOrigin, --- a/content/browser/webrtc/webrtc_media_recorder_browsertest.cc +++ b/content/browser/webrtc/webrtc_media_recorder_browsertest.cc -@@ -58,7 +58,12 @@ class WebRtcMediaRecorderTest +@@ -66,7 +66,12 @@ class MAYBE_WebRtcMediaRecorderTest return; // This flag is also used for encoding, https://crbug.com/616640. base::CommandLine::ForCurrentProcess()->AppendSwitch( @@ -405,7 +405,7 @@ Signed-off-by: Daniel Charles // Disables hardware acceleration of video decode, where available. const char kDisableAcceleratedVideoDecode[] = "disable-accelerated-video-decode"; -@@ -859,11 +868,13 @@ const char kZygoteProcess[] +@@ -867,11 +876,13 @@ const char kZygoteProcess[] // ignores this switch on its stable and beta channels. const char kDisableWebRtcEncryption[] = "disable-webrtc-encryption"; @@ -433,7 +433,7 @@ Signed-off-by: Daniel Charles CONTENT_EXPORT extern const char kDisableAcceleratedVideoDecode[]; CONTENT_EXPORT extern const char kDisableAcceleratedVideoEncode[]; CONTENT_EXPORT extern const char kDisableAudioSupportForDesktopShare[]; -@@ -106,6 +110,9 @@ CONTENT_EXPORT extern const char kDisabl +@@ -107,6 +111,9 @@ CONTENT_EXPORT extern const char kDisabl CONTENT_EXPORT extern const char kDomAutomationController[]; extern const char kDisable2dCanvasClipAntialiasing[]; CONTENT_EXPORT extern const char kDumpBlinkRuntimeCallStats[]; @@ -443,7 +443,7 @@ Signed-off-by: Daniel Charles CONTENT_EXPORT extern const char kEnableAggressiveDOMStorageFlushing[]; CONTENT_EXPORT extern const char kEnableAutomation[]; CONTENT_EXPORT extern const char kEnablePreferCompositingToLCDText[]; -@@ -240,8 +247,10 @@ CONTENT_EXPORT extern const char kZygote +@@ -242,8 +249,10 @@ CONTENT_EXPORT extern const char kZygote #if BUILDFLAG(ENABLE_WEBRTC) CONTENT_EXPORT extern const char kDisableWebRtcEncryption[]; @@ -456,7 +456,7 @@ Signed-off-by: Daniel Charles CONTENT_EXPORT extern const char kEnableWebRtcStunOrigin[]; --- a/content/renderer/media/webrtc/peer_connection_dependency_factory.cc +++ b/content/renderer/media/webrtc/peer_connection_dependency_factory.cc -@@ -282,10 +282,18 @@ void PeerConnectionDependencyFactory::In +@@ -276,10 +276,18 @@ void PeerConnectionDependencyFactory::In const base::CommandLine* cmd_line = base::CommandLine::ForCurrentProcess(); if (gpu_factories && gpu_factories->IsGpuVideoAcceleratorEnabled()) { @@ -477,9 +477,9 @@ Signed-off-by: Daniel Charles --- a/content/renderer/render_thread_impl.cc +++ b/content/renderer/render_thread_impl.cc -@@ -1581,7 +1581,11 @@ media::GpuVideoAcceleratorFactories* Ren - scoped_refptr media_task_runner = - GetMediaThreadTaskRunner(); +@@ -1578,7 +1578,11 @@ media::GpuVideoAcceleratorFactories* Ren + kGpuStreamIdMedia, kGpuStreamPriorityMedia); + const bool enable_video_accelerator = +#if defined(OS_LINUX) && !defined(OS_CHROMEOS) + cmd_line->HasSwitch(switches::kEnableAcceleratedVideo) && @@ -491,7 +491,7 @@ Signed-off-by: Daniel Charles gpu::kGpuFeatureStatusEnabled); --- a/gpu/config/software_rendering_list.json +++ b/gpu/config/software_rendering_list.json -@@ -373,17 +373,6 @@ +@@ -377,17 +377,6 @@ ] }, { @@ -511,7 +511,7 @@ Signed-off-by: Daniel Charles "cr_bugs": [145531, 332596, 571899, 629434], --- a/media/gpu/BUILD.gn +++ b/media/gpu/BUILD.gn -@@ -482,6 +482,14 @@ if (use_v4l2_codec || use_vaapi || is_ma +@@ -491,6 +491,14 @@ if (use_v4l2_codec || use_vaapi || is_ma } } @@ -526,7 +526,7 @@ Signed-off-by: Daniel Charles if (use_vaapi) { test("jpeg_encode_accelerator_unittest") { deps = [ -@@ -542,6 +550,10 @@ if (use_v4l2_codec || use_vaapi) { +@@ -551,6 +559,10 @@ if (use_v4l2_codec || use_vaapi) { if (use_ozone) { deps += [ "//ui/ozone" ] } diff --git a/fix-crash-in-is_cfi-true-builds-with-unbundled-ICU.patch b/fix-crash-in-is_cfi-true-builds-with-unbundled-ICU.patch deleted file mode 100644 index ee7339d..0000000 --- a/fix-crash-in-is_cfi-true-builds-with-unbundled-ICU.patch +++ /dev/null @@ -1,53 +0,0 @@ -From f15e8b573ada0fcd643ae393484214b1c7c940f8 Mon Sep 17 00:00:00 2001 -From: Evangelos Foutras -Date: Sat, 24 Mar 2018 00:04:33 +0000 -Subject: [PATCH] Fix crash in is_cfi=true builds with unbundled ICU - -Ensure ICU symbols have public visibility and are thus excluded from CFI -checks and whole-program optimization. The former caused a startup crash -and the latter has the potential to break virtual calls in weird ways. - -BUG=822820 - -Change-Id: Ia809eefcb9e93b3c612f2381d394db83bbc67120 -Reviewed-on: https://chromium-review.googlesource.com/978008 -Reviewed-by: Peter Collingbourne -Reviewed-by: Thomas Anderson -Commit-Queue: Thomas Anderson -Cr-Commit-Position: refs/heads/master@{#545638} ---- - build/linux/unbundle/icu.gn | 18 ++++++++++++++++++ - 1 file changed, 18 insertions(+) - -diff --git a/build/linux/unbundle/icu.gn b/build/linux/unbundle/icu.gn -index 5bdd91555df7..4450e409dba5 100644 ---- a/build/linux/unbundle/icu.gn -+++ b/build/linux/unbundle/icu.gn -@@ -17,6 +17,24 @@ config("icu_config") { - "USING_SYSTEM_ICU=1", - "ICU_UTIL_DATA_IMPL=ICU_UTIL_DATA_STATIC", - "UCHAR_TYPE=uint16_t", -+ -+ # U_EXPORT (defined in unicode/platform.h) is used to set public visibility -+ # on classes through the U_COMMON_API and U_I18N_API macros (among others). -+ # When linking against the system ICU library, we want its symbols to have -+ # public LTO visibility. This disables CFI checks for the ICU classes and -+ # allows whole-program optimization to be applied to the rest of Chromium. -+ # -+ # Both U_COMMON_API and U_I18N_API macros would be defined to U_EXPORT only -+ # when U_COMBINED_IMPLEMENTATION is defined (see unicode/utypes.h). Because -+ # we override the default system UCHAR_TYPE (char16_t), it is not possible -+ # to use U_COMBINED_IMPLEMENTATION at this moment, meaning the U_COMMON_API -+ # and U_I18N_API macros are set to U_IMPORT which is an empty definition. -+ # -+ # Until building with UCHAR_TYPE=char16_t is supported, one way to apply -+ # public visibility (and thus public LTO visibility) to all ICU classes is -+ # to define U_IMPORT to have the same value as U_EXPORT. For more details, -+ # please see: https://crbug.com/822820 -+ "U_IMPORT=U_EXPORT", - ] - } - --- -2.16.3 - diff --git a/fix-frame-buttons-rendering-too-large-when-using-OSX.patch b/fix-frame-buttons-rendering-too-large-when-using-OSX.patch deleted file mode 100644 index c4d0283..0000000 --- a/fix-frame-buttons-rendering-too-large-when-using-OSX.patch +++ /dev/null @@ -1,60 +0,0 @@ -From 7ef426c221d11b53b6de507b398e35e8d7b3cc94 Mon Sep 17 00:00:00 2001 -From: Tom Anderson -Date: Wed, 4 Apr 2018 01:23:26 +0000 -Subject: [PATCH] Fix frame buttons rendering too large when using - OSX-Arc-White GTK theme - -The check for GTK 3.20 was incorrect as the issue it was trying to fix -was still occurring on GTK 3.20+ systems. This CL adds the correct, -but more complex, check. - -Verified on these configurations: -{GTK 3.18, GTK 3.22} X -{Breeze, Adwaita, OSX-Arc-White, Greybird} X -{scale=1, scale=2} X -{fullscreen, restored} - -BUG=821881 -R=thestig - -Change-Id: I05afa35c1452a46a1abf4c39191a13657bfd8e2c -Reviewed-on: https://chromium-review.googlesource.com/990717 -Reviewed-by: Lei Zhang -Commit-Queue: Thomas Anderson -Cr-Commit-Position: refs/heads/master@{#547921} ---- - chrome/browser/ui/libgtkui/nav_button_provider_gtk3.cc | 18 +++++++++++++++++- - 1 file changed, 17 insertions(+), 1 deletion(-) - -diff --git a/chrome/browser/ui/libgtkui/nav_button_provider_gtk3.cc b/chrome/browser/ui/libgtkui/nav_button_provider_gtk3.cc -index 31a8087bca11..6a09faec5dd2 100644 ---- a/chrome/browser/ui/libgtkui/nav_button_provider_gtk3.cc -+++ b/chrome/browser/ui/libgtkui/nav_button_provider_gtk3.cc -@@ -213,7 +213,23 @@ class NavButtonImageSource : public gfx::ImageSkiaSource { - // is not scaled for the (unexpected) smaller button size, and the button's - // edges appear cut off. To fix this, manually set the background to scale - // to the button size when it would have clipped. -- if (GtkVersionCheck(3, 20)) { -+ // -+ // GTK's "contain" is unlike CSS's "contain". In CSS, the image would only -+ // be downsized when it would have clipped. In GTK, the image is always -+ // scaled to fit the drawing region (preserving aspect ratio). Only add -+ // "contain" if clipping would occur. -+ cairo_pattern_t* cr_pattern = nullptr; -+ cairo_surface_t* cr_surface = nullptr; -+ gtk_style_context_get(button_context, button_state, -+ GTK_STYLE_PROPERTY_BACKGROUND_IMAGE, &cr_pattern, -+ nullptr); -+ if (cr_pattern && -+ cairo_pattern_get_surface(cr_pattern, &cr_surface) == -+ CAIRO_STATUS_SUCCESS && -+ cr_surface && -+ cairo_surface_get_type(cr_surface) == CAIRO_SURFACE_TYPE_IMAGE && -+ (cairo_image_surface_get_width(cr_surface) > button_size_.width() || -+ cairo_image_surface_get_height(cr_surface) > button_size_.height())) { - ApplyCssToContext(button_context, - ".titlebutton { background-size: contain; }"); - } --- -2.16.2 - From 04e2f854f2e7962cf5548dc2b0c665028572ba07 Mon Sep 17 00:00:00 2001 From: xsmile <> Date: Wed, 30 May 2018 21:43:55 +0200 Subject: [PATCH 3/7] 67.0.3396.62: Update to stable --- 0001-fix-building-without-safebrowsing.patch | 10 +- PKGBUILD | 76 +++--- chromium-clang-compiler-flags.patch | 15 -- chromium-enable_widevine.patch | 19 -- chromium-ffmpeg-r1.patch | 22 ++ chromium-vaapi-r18.patch | 4 +- chromium-widevine-r2.patch | 39 +++ chromium-widevine.patch | 10 - ...y-on-ffmpeg-internals-for-start-time.patch | 251 ++++++++++++++++++ 9 files changed, 351 insertions(+), 95 deletions(-) delete mode 100644 chromium-clang-compiler-flags.patch delete mode 100644 chromium-enable_widevine.patch create mode 100644 chromium-ffmpeg-r1.patch create mode 100644 chromium-widevine-r2.patch delete mode 100644 chromium-widevine.patch create mode 100644 remove-dependency-on-ffmpeg-internals-for-start-time.patch diff --git a/0001-fix-building-without-safebrowsing.patch b/0001-fix-building-without-safebrowsing.patch index 367e11f..bd3c2f3 100644 --- a/0001-fix-building-without-safebrowsing.patch +++ b/0001-fix-building-without-safebrowsing.patch @@ -58,7 +58,7 @@ for (size_t i = 0; i < extra_parts_.size(); ++i) extra_parts_[i]->ResourceDispatcherHostCreated(); -@@ -3677,7 +3651,7 @@ ChromeContentBrowserClient::CreateThrott +@@ -3681,7 +3655,7 @@ ChromeContentBrowserClient::CreateThrott switches::kCommittedInterstitials)) { throttles.push_back(std::make_unique( handle, @@ -398,7 +398,7 @@ #include "chrome/browser/shell_integration.h" #include "chrome/browser/status_icons/status_tray.h" #include "chrome/browser/ui/browser_dialogs.h" -@@ -349,8 +348,6 @@ void BrowserProcessImpl::StartTearDown() +@@ -350,8 +349,6 @@ void BrowserProcessImpl::StartTearDown() // that URLFetcher operation before going away.) metrics_services_manager_.reset(); intranet_redirect_detector_.reset(); @@ -407,7 +407,7 @@ network_time_tracker_.reset(); #if BUILDFLAG(ENABLE_PLUGINS) plugins_resource_service_.reset(); -@@ -957,22 +954,6 @@ StatusTray* BrowserProcessImpl::status_t +@@ -964,22 +961,6 @@ StatusTray* BrowserProcessImpl::status_t return status_tray_.get(); } @@ -430,7 +430,7 @@ subresource_filter::ContentRulesetService* BrowserProcessImpl::subresource_filter_ruleset_service() { DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_); -@@ -1240,16 +1221,6 @@ void BrowserProcessImpl::CreateBackgroun +@@ -1247,16 +1228,6 @@ void BrowserProcessImpl::CreateBackgroun #endif } @@ -1253,7 +1253,7 @@ void SystemNetworkContextManager::FlushProxyConfigMonitorForTesting() { --- a/chrome/browser/ui/webui/settings/md_settings_localized_strings_provider.cc +++ b/chrome/browser/ui/webui/settings/md_settings_localized_strings_provider.cc -@@ -458,9 +458,8 @@ void AddBluetoothStrings(content::WebUID +@@ -462,9 +462,8 @@ void AddBluetoothStrings(content::WebUID #endif void AddChangePasswordStrings(content::WebUIDataSource* html_source) { diff --git a/PKGBUILD b/PKGBUILD index 35f786d..ff01637 100644 --- a/PKGBUILD +++ b/PKGBUILD @@ -5,7 +5,7 @@ # Contributor: Daniel J Griffiths pkgname=inox -pkgver=67.0.3396.48 +pkgver=67.0.3396.62 pkgrel=1 _launcher_ver=6 pkgdesc="Chromium Spin-off to enhance privacy by disabling data transmission to Google" @@ -31,10 +31,10 @@ source=(https://commondatastorage.googleapis.com/chromium-browser-official/chrom https://raw.githubusercontent.com/gcarq/inox-patchset/$pkgver/product_logo_{16,22,24,32,48,64,128,256}.png # Patches from Arch Linux https://raw.githubusercontent.com/gcarq/inox-patchset/$pkgver/chromium-arflags.patch - https://raw.githubusercontent.com/gcarq/inox-patchset/$pkgver/chromium-clang-compiler-flags.patch - https://raw.githubusercontent.com/gcarq/inox-patchset/$pkgver/chromium-enable_widevine.patch + https://raw.githubusercontent.com/gcarq/inox-patchset/$pkgver/chromium-ffmpeg-r1.patch https://raw.githubusercontent.com/gcarq/inox-patchset/$pkgver/chromium-skia-harmony.patch - https://raw.githubusercontent.com/gcarq/inox-patchset/$pkgver/chromium-widevine.patch + https://raw.githubusercontent.com/gcarq/inox-patchset/$pkgver/chromium-widevine-r2.patch + https://raw.githubusercontent.com/gcarq/inox-patchset/$pkgver/remove-dependency-on-ffmpeg-internals-for-start-time.patch # Misc https://raw.githubusercontent.com/gcarq/inox-patchset/$pkgver/chromium-vaapi-r18.patch # Inox patchset @@ -60,9 +60,9 @@ source=(https://commondatastorage.googleapis.com/chromium-browser-official/chrom https://raw.githubusercontent.com/gcarq/inox-patchset/$pkgver/0020-launcher-branding.patch https://raw.githubusercontent.com/gcarq/inox-patchset/$pkgver/0021-disable-rlz.patch https://raw.githubusercontent.com/gcarq/inox-patchset/$pkgver/9000-disable-metrics.patch) -sha256sums=('f6350ea68257309cd99b19b3b686715074ae768c48e4e09d56601209f1c20986' +sha256sums=('d5ee63932ff1c8c4a5f69c834f6577e7127b416681eddd23bc54886caffd770d' '04917e3cd4307d8e31bfb0027a5dce6d086edb10ff8a716024fbb8bb0c7dccf1' - '2cd032d4811542ea8bb488b94681ed72eb02077b7c10b6dc8853aebb12d114e1' + 'ec97a018339a7037c588e1e5bd3d9b9fa59a21fa03b4f3a80e6c5ad463c2ba28' '71471fa4690894420f9e04a2e9a622af620d92ac2714a35f9a4c4e90fa3968dd' '4a533acefbbc1567b0d74a1c0903e9179b8c59c1beabe748850795815366e509' '7b88830c5e0e9819f514ad68aae885d427541a907e25607e47dee1b0f38975fd' @@ -72,12 +72,12 @@ sha256sums=('f6350ea68257309cd99b19b3b686715074ae768c48e4e09d56601209f1c20986' '896993987d4ef9f0ac7db454f288117316c2c80ed0b6764019afd760db222dad' '3df9b3bbdc07fde63d9e400954dcc6ab6e0e5454f0ef6447570eef0549337354' 'ebf0054a2f8ad4d7e4da438e143d8674c88a31385f409068c3729c5b222e3973' - '4b7cf89fb16f9f99988b96746bfde4e61cb5c6dcbe61272a638ee2c99810a387' - '85861bfc26eb66280b622669d6a36ece19c555003bbf79e55966c3ac6f7af822' - 'feca54ab09ac0fc9d0626770a6b899a6ac5a12173c7d0c1005bc3964ec83e7b3' - 'd6fdcb922e5a7fbe15759d39ccc8ea4225821c44d98054ce0f23f9d1f00c9808' - 'b838eb3168328b35cb6fabad59c9c0882c47472fcc3202ea80acef83602c4fdc' - 'c605713244775e1b834c5bb6e86734800a84527b306b97266c60c5be46fcaa7a' + 'aa885330bc4180b78d915f9dfdfc3210038a0acab7b16735ea9828ab6a633bde' + '04727ad3eadd51206468482025363e0faf816e31a9f28b2f0c540a076cdbb15f' + '068e11a910779d39c5f223018c8f3503734cb3b303471858006cb81ed4886c1b' + 'd6af7a4afcdfce965d9ebcf177ab8189c7006c587c30e940255163db3da4b6c8' + 'a7dbcbfc5ec18606c260df67b98fb2440fe59a4c9ede0823fc43f3bcf439887b' + '46036bdd0ce5be85e61c1f49cd3a13fbe4395e45ae05f46ce6fb15574b60df02' 'b9fc0089687e67453dba9190a069414f4621143349371fd523eb816e2e46662c' 'f639f11ced3432cb12a19528e4d9a7f1bbcb2f9fd46f2969d8d0b567e27ec407' '372a17710c9ae647ad597284491c5e91ea40cc9ea3750f35531b874dfed3f728' @@ -103,7 +103,7 @@ sha256sums=('f6350ea68257309cd99b19b3b686715074ae768c48e4e09d56601209f1c20986' # Possible replacements are listed in build/linux/unbundle/replace_gn_files.py # Keys are the names in the above script; values are the dependencies in Arch declare -gA _system_libs=( - #[ffmpeg]=ffmpeg # https://crbug.com/731766 + [ffmpeg]=ffmpeg [flac]=flac [fontconfig]=fontconfig [freetype]=freetype2 @@ -112,7 +112,7 @@ declare -gA _system_libs=( [libdrm]= [libjpeg]=libjpeg #[libpng]=libpng # https://crbug.com/752403#c10 - #[libvpx]=libvpx + #[libvpx]=libvpx # needs unreleased libvpx [libwebp]=libwebp #[libxml]=libxml2 # https://crbug.com/736026 [libxslt]=libxslt @@ -131,37 +131,28 @@ depends+=(${_system_libs[@]}) prepare() { cd "$srcdir/chromium-$pkgver" - msg2 'Applying build patches' - # https://crbug.com/710701 - local _chrome_build_hash=$(base64 -d ../chromium-$pkgver.txt | - grep -Po '^parent \K[0-9a-f]{40}$') - if [[ -z $_chrome_build_hash ]]; then - error "Unable to find Chrome build hash." - return 1 - fi - echo "LASTCHANGE=$_chrome_build_hash-" >build/util/LASTCHANGE - # Allow building against system libraries in official builds sed -i 's/OFFICIAL_BUILD/GOOGLE_CHROME_BUILD/' \ tools/generate_shim_headers/generate_shim_headers.py - # Enable support for the Widevine CDM plugin - # libwidevinecdm.so is not included, but can be copied over from Chrome - # (Version string doesn't seem to matter so let's go with "Pinkie Pie") - sed "s/@WIDEVINE_VERSION@/Pinkie Pie/" ../chromium-widevine.patch | - patch -Np1 - - # Work around broken screen sharing in Google Meet - # https://crbug.com/829916#c16 - sed -i 's/"Chromium/"Chrome/' chrome/common/chrome_content_client_constants.cc - - patch -Np1 -i ../chromium-arflags.patch - patch -Np1 -i ../chromium-clang-compiler-flags.patch - patch -Np1 -i ../chromium-enable_widevine.patch + # https://crbug.com/731766 + patch -Np1 -i ../remove-dependency-on-ffmpeg-internals-for-start-time.patch # https://crbug.com/skia/6663#c10 patch -Np4 -i ../chromium-skia-harmony.patch + # Fixes from Gentoo + patch -Np1 -i ../chromium-ffmpeg-r1.patch + patch -Np1 -i ../chromium-widevine-r2.patch + + # Remove compiler flags not supported by our system clang + sed -i \ + -e '/"-Wno-ignored-pragma-optimize"/d' \ + build/config/compiler/BUILD.gn + + # Reformat arflags for compatibility with llvm + patch -Np1 -i ../chromium-arflags.patch + msg2 'Applying VA-API patches' patch -Np1 -i ../chromium-vaapi-r18.patch @@ -202,13 +193,10 @@ prepare() { # added benefit of not having to list all the remaining libraries local _lib for _lib in ${_unwanted_bundled_libs[@]}; do - find -type f -path "*third_party/$_lib/*" \ - \! -path "*third_party/$_lib/chromium/*" \ - \! -path "*third_party/$_lib/google/*" \ - \! -path './base/third_party/icu/*' \ - \! -path './third_party/crashpad/crashpad/third_party/zlib/zlib_crashpad.h' \ - \! -path './third_party/pdfium/third_party/freetype/include/pstables.h' \ - \! -path './third_party/yasm/run_yasm.py' \ + find "third_party/$_lib" -type f \ + \! -path "third_party/$_lib/chromium/*" \ + \! -path "third_party/$_lib/google/*" \ + \! -path 'third_party/yasm/run_yasm.py' \ \! -regex '.*\.\(gn\|gni\|isolate\)' \ -delete done diff --git a/chromium-clang-compiler-flags.patch b/chromium-clang-compiler-flags.patch deleted file mode 100644 index d9b227b..0000000 --- a/chromium-clang-compiler-flags.patch +++ /dev/null @@ -1,15 +0,0 @@ -# Remove flags not yet implemented in the system compiler's version. - ---- a/build/config/compiler/BUILD.gn -+++ b/build/config/compiler/BUILD.gn -@@ -1387,10 +1387,6 @@ config("default_warnings") { - - # TODO(hans): https://crbug.com/766891 - "-Wno-null-pointer-arithmetic", -- -- # Ignore warnings about MSVC optimization pragmas. -- # TODO(thakis): Only for no_chromium_code? http://crbug.com/505314 -- "-Wno-ignored-pragma-optimize", - ] - if (llvm_force_head_revision) { - cflags += [ diff --git a/chromium-enable_widevine.patch b/chromium-enable_widevine.patch deleted file mode 100644 index 6ae4b64..0000000 --- a/chromium-enable_widevine.patch +++ /dev/null @@ -1,19 +0,0 @@ -# https://chromium.googlesource.com/chromium/src/+/a5252b20a67b9a6882090d963fbd4dc168dd3436%5E%21/ -# Remove restrictions for enabling Widevine support as the libwidevinecdm.so -# component should be able to be installed separately from the browser. - ---- a/third_party/widevine/cdm/BUILD.gn -+++ b/third_party/widevine/cdm/BUILD.gn -@@ -8,12 +8,6 @@ import("//media/cdm/library_cdm/cdm_path - import("//media/media_options.gni") - import("//third_party/widevine/cdm/widevine.gni") - --# Internal Cast builds set enable_widevine=true to bring in Widevine support. --# TODO(xhwang): Support component updated CDM on other platforms and remove this --# assert. --assert(!enable_widevine || is_win || is_mac || is_chromecast, -- "Component updated CDM only supported on Windows and Mac for now.") -- - widevine_arch = current_cpu - if (widevine_arch == "x86") { - widevine_arch = "ia32" diff --git a/chromium-ffmpeg-r1.patch b/chromium-ffmpeg-r1.patch new file mode 100644 index 0000000..53d61e8 --- /dev/null +++ b/chromium-ffmpeg-r1.patch @@ -0,0 +1,22 @@ +--- a/build/linux/unbundle/ffmpeg.gn ++++ b/build/linux/unbundle/ffmpeg.gn +@@ -14,8 +14,8 @@ pkg_config("system_ffmpeg") { + ] + } + +-buildflag_header("ffmpeg_buildflags") { +- header = "ffmpeg_buildflags.h" ++buildflag_header("ffmpeg_features") { ++ header = "ffmpeg_features.h" + flags = [ "USE_SYSTEM_FFMPEG=true" ] + } + +@@ -30,7 +30,7 @@ shim_headers("ffmpeg_shim") { + + source_set("ffmpeg") { + deps = [ +- ":ffmpeg_buildflags", ++ ":ffmpeg_features", + ":ffmpeg_shim", + ] + public_configs = [ ":system_ffmpeg" ] diff --git a/chromium-vaapi-r18.patch b/chromium-vaapi-r18.patch index dd8f2be..c8f6cd5 100644 --- a/chromium-vaapi-r18.patch +++ b/chromium-vaapi-r18.patch @@ -282,7 +282,7 @@ Signed-off-by: Daniel Charles return; --- a/content/browser/renderer_host/render_process_host_impl.cc +++ b/content/browser/renderer_host/render_process_host_impl.cc -@@ -2699,7 +2699,11 @@ void RenderProcessHostImpl::PropagateBro +@@ -2704,7 +2704,11 @@ void RenderProcessHostImpl::PropagateBro switches::kDefaultTileHeight, switches::kDisable2dCanvasImageChromium, switches::kDisableAcceleratedJpegDecoding, @@ -294,7 +294,7 @@ Signed-off-by: Daniel Charles switches::kDisableBackgroundTasks, switches::kDisableBackgroundTimerThrottling, switches::kDisableBreakpad, -@@ -2837,8 +2841,10 @@ void RenderProcessHostImpl::PropagateBro +@@ -2842,8 +2846,10 @@ void RenderProcessHostImpl::PropagateBro switches::kDisableMojoRenderer, #endif #if BUILDFLAG(ENABLE_WEBRTC) diff --git a/chromium-widevine-r2.patch b/chromium-widevine-r2.patch new file mode 100644 index 0000000..a5d3968 --- /dev/null +++ b/chromium-widevine-r2.patch @@ -0,0 +1,39 @@ +Minimal patch to get chromium to compile with widevine support. + +Exactly the same as -r1, but we now need to patch +ninja to pretty please not terminate our build. + +caveat emptor: it's in no way clear that building chromium this +way is safer, from a security perspective, than whatever Google +Chrome does. + +Upstream appears to be cooking up a code-signing trust-chain +which may protect users against malicious cdm blobs; I doubt +we benefit from these using this kludge. Ideally, someone +would look into this more carefully than I have ... tbh as +soon as I got my "stories" back, I pretty much lost interest :) + +-gmt + +-- +--- a/third_party/widevine/cdm/stub/widevine_cdm_version.h ++++ b/third_party/widevine/cdm/stub/widevine_cdm_version.h +@@ -10,6 +10,7 @@ + + #include "third_party/widevine/cdm/widevine_cdm_common.h" + ++#define WIDEVINE_CDM_VERSION_STRING "unknown" + #define WIDEVINE_CDM_AVAILABLE + + #endif // WIDEVINE_CDM_VERSION_H_ +--- a/third_party/widevine/cdm/BUILD.gn ++++ b/third_party/widevine/cdm/BUILD.gn +@@ -11,7 +11,7 @@ import("//third_party/widevine/cdm/widev + # Internal Cast builds set enable_widevine=true to bring in Widevine support. + # TODO(xhwang): Support component updated CDM on other platforms and remove this + # assert. +-assert(!enable_widevine || is_win || is_mac || is_chromecast, ++assert(!enable_widevine || is_win || is_mac || is_chromecast || is_linux, + "Component updated CDM only supported on Windows and Mac for now.") + + widevine_arch = current_cpu diff --git a/chromium-widevine.patch b/chromium-widevine.patch deleted file mode 100644 index a67ae8b..0000000 --- a/chromium-widevine.patch +++ /dev/null @@ -1,10 +0,0 @@ -diff -upr chromium-48.0.2564.82.orig/third_party/widevine/cdm/stub/widevine_cdm_version.h chromium-48.0.2564.82/third_party/widevine/cdm/stub/widevine_cdm_version.h ---- chromium-48.0.2564.82.orig/third_party/widevine/cdm/stub/widevine_cdm_version.h 2016-01-14 01:05:17.000000000 +0200 -+++ chromium-48.0.2564.82/third_party/widevine/cdm/stub/widevine_cdm_version.h 2016-01-21 19:18:51.287978456 +0200 -@@ -12,4 +12,6 @@ - - #define WIDEVINE_CDM_AVAILABLE - -+#define WIDEVINE_CDM_VERSION_STRING "@WIDEVINE_VERSION@" -+ - #endif // WIDEVINE_CDM_VERSION_H_ diff --git a/remove-dependency-on-ffmpeg-internals-for-start-time.patch b/remove-dependency-on-ffmpeg-internals-for-start-time.patch new file mode 100644 index 0000000..0eb13f2 --- /dev/null +++ b/remove-dependency-on-ffmpeg-internals-for-start-time.patch @@ -0,0 +1,251 @@ +From f9535bd6d61d7e0b2cb452e6976a914d4ee62a2b Mon Sep 17 00:00:00 2001 +From: Dale Curtis +Date: Thu, 17 May 2018 23:44:41 +0000 +Subject: [PATCH] Remove dependency on ffmpeg internals for start time + calculations. + +Some theora clips still have issues, but using first_dts where +we know it's the same as the first pts resolves the lingering +issues. It also looks like we don't need to use pts_buffer now. + +This does the following small fixes: +- MEDIA_LOG(DEBUG) -> MEDIA_LOG(ERROR) for negative ts error. +- Enables previous disabled test in more limited state. +- Adds kNoFFmpegTimestamp so static_cast(AV_NOPTS_VALUE) +is no longer necessary everywhere. A followup patch set will use +this is more places. +- Removes pts_buffer and packet_buffer inspection. + +BUG=731766 +TEST=all tests pass. + +Cq-Include-Trybots: luci.chromium.try:android_optional_gpu_tests_rel;luci.chromium.try:linux_optional_gpu_tests_rel;luci.chromium.try:mac_optional_gpu_tests_rel;luci.chromium.try:win_optional_gpu_tests_rel +Change-Id: I5aadf67a3b5ea2d2a8dd19bbddd7b107208094c5 +Reviewed-on: https://chromium-review.googlesource.com/1064538 +Commit-Queue: Dale Curtis +Reviewed-by: Frank Liberato +Cr-Commit-Position: refs/heads/master@{#559737} +--- + media/ffmpeg/ffmpeg_common.h | 5 +- + media/filters/ffmpeg_demuxer.cc | 88 +++++++----------------- + media/filters/ffmpeg_demuxer_unittest.cc | 24 +++---- + 3 files changed, 37 insertions(+), 80 deletions(-) + +--- a/media/ffmpeg/ffmpeg_common.h ++++ b/media/ffmpeg/ffmpeg_common.h +@@ -28,9 +28,6 @@ extern "C" { + MSVC_PUSH_DISABLE_WARNING(4244); + #include + #include +-#if !BUILDFLAG(USE_SYSTEM_FFMPEG) +-#include +-#endif // !BUILDFLAG(USE_SYSTEM_FFMPEG) + #include + #include + #include +@@ -42,6 +39,8 @@ MSVC_POP_WARNING(); + + namespace media { + ++constexpr int64_t kNoFFmpegTimestamp = static_cast(AV_NOPTS_VALUE); ++ + class AudioDecoderConfig; + class EncryptionScheme; + class VideoDecoderConfig; +--- a/media/filters/ffmpeg_demuxer.cc ++++ b/media/filters/ffmpeg_demuxer.cc +@@ -85,29 +85,26 @@ static base::TimeDelta FramesToTimeDelta + frames * base::Time::kMicrosecondsPerSecond / sample_rate); + } + +-static base::TimeDelta ExtractStartTime(AVStream* stream, +- base::TimeDelta start_time_estimate) { +- DCHECK(start_time_estimate != kNoTimestamp); +- if (stream->start_time == static_cast(AV_NOPTS_VALUE)) { +- return start_time_estimate == kInfiniteDuration ? base::TimeDelta() +- : start_time_estimate; +- } +- +- // First try the lower of the estimate and the |start_time| value. +- base::TimeDelta start_time = +- std::min(ConvertFromTimeBase(stream->time_base, stream->start_time), +- start_time_estimate); +- +- // Next see if the first buffered pts value is usable. +- if (stream->pts_buffer[0] != static_cast(AV_NOPTS_VALUE)) { +- const base::TimeDelta buffered_pts = +- ConvertFromTimeBase(stream->time_base, stream->pts_buffer[0]); +- if (buffered_pts < start_time) +- start_time = buffered_pts; ++static base::TimeDelta ExtractStartTime(AVStream* stream) { ++ // The default start time is zero. ++ base::TimeDelta start_time; ++ ++ // First try to use the |start_time| value as is. ++ if (stream->start_time != kNoFFmpegTimestamp) ++ start_time = ConvertFromTimeBase(stream->time_base, stream->start_time); ++ ++ // Next try to use the first DTS value, for codecs where we know PTS == DTS ++ // (excludes all H26x codecs). The start time must be returned in PTS. ++ if (stream->first_dts != kNoFFmpegTimestamp && ++ stream->codecpar->codec_id != AV_CODEC_ID_HEVC && ++ stream->codecpar->codec_id != AV_CODEC_ID_H264 && ++ stream->codecpar->codec_id != AV_CODEC_ID_MPEG4) { ++ const base::TimeDelta first_pts = ++ ConvertFromTimeBase(stream->time_base, stream->first_dts); ++ if (first_pts < start_time) ++ start_time = first_pts; + } + +- // NOTE: Do not use AVStream->first_dts since |start_time| should be a +- // presentation timestamp. + return start_time; + } + +@@ -514,7 +511,7 @@ void FFmpegDemuxerStream::EnqueuePacket( + buffer->set_duration(kNoTimestamp); + } + +- // Note: If pts is AV_NOPTS_VALUE, stream_timestamp will be kNoTimestamp. ++ // Note: If pts is kNoFFmpegTimestamp, stream_timestamp will be kNoTimestamp. + const base::TimeDelta stream_timestamp = + ConvertStreamTimestamp(stream_->time_base, packet->pts); + +@@ -557,8 +554,8 @@ void FFmpegDemuxerStream::EnqueuePacket( + // code paths below; otherwise they should be treated as a parse error. + if ((!fixup_chained_ogg_ || last_packet_timestamp_ == kNoTimestamp) && + buffer->timestamp() < base::TimeDelta()) { +- MEDIA_LOG(DEBUG, media_log_) +- << "FFmpegDemuxer: unfixable negative timestamp"; ++ MEDIA_LOG(ERROR, media_log_) ++ << "FFmpegDemuxer: unfixable negative timestamp."; + demuxer_->NotifyDemuxerError(DEMUXER_ERROR_COULD_NOT_PARSE); + return; + } +@@ -871,7 +868,7 @@ std::string FFmpegDemuxerStream::GetMeta + base::TimeDelta FFmpegDemuxerStream::ConvertStreamTimestamp( + const AVRational& time_base, + int64_t timestamp) { +- if (timestamp == static_cast(AV_NOPTS_VALUE)) ++ if (timestamp == kNoFFmpegTimestamp) + return kNoTimestamp; + + return ConvertFromTimeBase(time_base, timestamp); +@@ -1271,42 +1268,6 @@ void FFmpegDemuxer::OnFindStreamInfoDone + AVFormatContext* format_context = glue_->format_context(); + streams_.resize(format_context->nb_streams); + +- // Estimate the start time for each stream by looking through the packets +- // buffered during avformat_find_stream_info(). These values will be +- // considered later when determining the actual stream start time. +- // +- // These packets haven't been completely processed yet, so only look through +- // these values if the AVFormatContext has a valid start time. +- // +- // If no estimate is found, the stream entry will be kInfiniteDuration. +- std::vector start_time_estimates(format_context->nb_streams, +- kInfiniteDuration); +-#if !BUILDFLAG(USE_SYSTEM_FFMPEG) +- const AVFormatInternal* internal = format_context->internal; +- if (internal && internal->packet_buffer && +- format_context->start_time != static_cast(AV_NOPTS_VALUE)) { +- struct AVPacketList* packet_buffer = internal->packet_buffer; +- while (packet_buffer != internal->packet_buffer_end) { +- DCHECK_LT(static_cast(packet_buffer->pkt.stream_index), +- start_time_estimates.size()); +- const AVStream* stream = +- format_context->streams[packet_buffer->pkt.stream_index]; +- if (packet_buffer->pkt.pts != static_cast(AV_NOPTS_VALUE)) { +- const base::TimeDelta packet_pts = +- ConvertFromTimeBase(stream->time_base, packet_buffer->pkt.pts); +- // We ignore kNoTimestamp here since -int64_t::min() is possible; see +- // https://crbug.com/700501. Technically this is a valid value, but in +- // practice shouldn't occur, so just ignore it when estimating. +- if (packet_pts != kNoTimestamp && packet_pts != kInfiniteDuration && +- packet_pts < start_time_estimates[stream->index]) { +- start_time_estimates[stream->index] = packet_pts; +- } +- } +- packet_buffer = packet_buffer->next; +- } +- } +-#endif // !BUILDFLAG(USE_SYSTEM_FFMPEG) +- + std::unique_ptr media_tracks(new MediaTracks()); + + DCHECK(track_id_to_demux_stream_map_.empty()); +@@ -1455,8 +1416,7 @@ void FFmpegDemuxer::OnFindStreamInfoDone + + max_duration = std::max(max_duration, streams_[i]->duration()); + +- base::TimeDelta start_time = +- ExtractStartTime(stream, start_time_estimates[i]); ++ base::TimeDelta start_time = ExtractStartTime(stream); + + // Note: This value is used for seeking, so we must take the true value and + // not the one possibly clamped to zero below. +@@ -1494,7 +1454,7 @@ void FFmpegDemuxer::OnFindStreamInfoDone + if (text_enabled_) + AddTextStreams(); + +- if (format_context->duration != static_cast(AV_NOPTS_VALUE)) { ++ if (format_context->duration != kNoFFmpegTimestamp) { + // If there is a duration value in the container use that to find the + // maximum between it and the duration from A/V streams. + const AVRational av_time_base = {1, AV_TIME_BASE}; +--- a/media/filters/ffmpeg_demuxer_unittest.cc ++++ b/media/filters/ffmpeg_demuxer_unittest.cc +@@ -724,12 +724,9 @@ TEST_F(FFmpegDemuxerTest, Read_InvalidNe + ReadUntilEndOfStream(GetStream(DemuxerStream::AUDIO)); + } + +-// TODO(dalecurtis): Test is disabled since FFmpeg does not currently guarantee +-// the order of demuxed packets in OGG containers. Re-enable and fix key frame +-// expectations once we decide to either workaround it or attempt a fix +-// upstream. See http://crbug.com/387996. +-TEST_F(FFmpegDemuxerTest, +- DISABLED_Read_AudioNegativeStartTimeAndOggDiscard_Bear) { ++// Android has no Theora support, so these tests doesn't work. ++#if !defined(OS_ANDROID) ++TEST_F(FFmpegDemuxerTest, Read_AudioNegativeStartTimeAndOggDiscard_Bear) { + // Many ogg files have negative starting timestamps, so ensure demuxing and + // seeking work correctly with a negative start time. + CreateDemuxer("bear.ogv"); +@@ -739,8 +736,12 @@ TEST_F(FFmpegDemuxerTest, + DemuxerStream* video = GetStream(DemuxerStream::VIDEO); + DemuxerStream* audio = GetStream(DemuxerStream::AUDIO); + +- // Run the test twice with a seek in between. +- for (int i = 0; i < 2; ++i) { ++ // Run the test once (should be twice..., see note) with a seek in between. ++ // ++ // TODO(dalecurtis): We only run the test once since FFmpeg does not currently ++ // guarantee the order of demuxed packets in OGG containers. See ++ // http://crbug.com/387996. ++ for (int i = 0; i < 1; ++i) { + audio->Read( + NewReadCBWithCheckedDiscard(FROM_HERE, 40, 0, kInfiniteDuration, true)); + base::RunLoop().Run(); +@@ -759,10 +760,10 @@ TEST_F(FFmpegDemuxerTest, + video->Read(NewReadCB(FROM_HERE, 5751, 0, true)); + base::RunLoop().Run(); + +- video->Read(NewReadCB(FROM_HERE, 846, 33367, true)); ++ video->Read(NewReadCB(FROM_HERE, 846, 33367, false)); + base::RunLoop().Run(); + +- video->Read(NewReadCB(FROM_HERE, 1255, 66733, true)); ++ video->Read(NewReadCB(FROM_HERE, 1255, 66733, false)); + base::RunLoop().Run(); + + // Seek back to the beginning and repeat the test. +@@ -775,9 +776,6 @@ TEST_F(FFmpegDemuxerTest, + // Same test above, but using sync2.ogv which has video stream muxed before the + // audio stream, so seeking based only on start time will fail since ffmpeg is + // essentially just seeking based on file position. +-// +-// Android has no Theora support, so this test doesn't work. +-#if !defined(OS_ANDROID) + TEST_F(FFmpegDemuxerTest, Read_AudioNegativeStartTimeAndOggDiscard_Sync) { + // Many ogg files have negative starting timestamps, so ensure demuxing and + // seeking work correctly with a negative start time. From 4987b721917be563f437ae5ce7af1b649eeeec2d Mon Sep 17 00:00:00 2001 From: xsmile <> Date: Fri, 1 Jun 2018 11:50:03 +0200 Subject: [PATCH 4/7] Update 0012-branding.patch and minor changes --- 0012-branding.patch | 38 ++++++++++-------------------------- 0020-launcher-branding.patch | 2 +- PKGBUILD | 10 +++++----- 3 files changed, 16 insertions(+), 34 deletions(-) diff --git a/0012-branding.patch b/0012-branding.patch index e9559a7..eba3b8d 100644 --- a/0012-branding.patch +++ b/0012-branding.patch @@ -1,6 +1,6 @@ --- a/chrome/common/chrome_paths_linux.cc +++ b/chrome/common/chrome_paths_linux.cc -@@ -87,11 +87,7 @@ bool GetDefaultUserDataDirectory(base::F +@@ -87,11 +87,7 @@ GetXDGDirectory(env.get(), kXdgConfigHomeEnvVar, kDotConfigDir); } @@ -15,7 +15,7 @@ --- a/chrome/app/chromium_strings.grd +++ b/chrome/app/chromium_strings.grd -@@ -130,10 +130,10 @@ If you update this file, be sure also to +@@ -130,10 +130,10 @@ Disconnecting $1someone@example.com will clear your history, bookmarks, settings, and other Chromium data stored on this device. Data stored in your Google Account will not be cleared and can be managed on <a target="_blank" href="$2">Google Dashboard</a>. @@ -28,7 +28,7 @@ -@@ -143,7 +143,7 @@ If you update this file, be sure also to +@@ -143,7 +143,7 @@ @@ -37,7 +37,7 @@ -@@ -166,7 +166,7 @@ If you update this file, be sure also to +@@ -166,7 +166,7 @@ sign in to Chromium @@ -46,25 +46,7 @@ Help make Chromium better by sending crash reports and $1usage statistics to Google -@@ -174,7 +174,7 @@ If you update this file, be sure also to - - - -- $1Google - Chromium -+ $1Google - Inox - - - -@@ -266,7 +266,7 @@ If you update this file, be sure also to - - - -- Please close all Chromium windows and relaunch Chromium for this change to take effect. -+ Please close all Inox windows and relaunch Inox for this change to take effect. - - - -@@ -595,7 +595,7 @@ Chromium is unable to recover your setti +@@ -590,7 +590,7 @@ @@ -73,7 +55,7 @@ Update &Chromium -@@ -603,7 +603,7 @@ Chromium is unable to recover your setti +@@ -598,7 +598,7 @@ @@ -82,7 +64,7 @@ Update &Chromium -@@ -620,7 +620,7 @@ Chromium is unable to recover your setti +@@ -615,7 +615,7 @@ @@ -93,7 +75,7 @@ Chromium Helper --- a/chrome/test/chromedriver/chrome/chrome_finder.cc +++ b/chrome/test/chromedriver/chrome/chrome_finder.cc -@@ -91,15 +91,12 @@ void GetApplicationDirs(std::vector Date: Sun, 3 Jun 2018 17:57:28 +0200 Subject: [PATCH 5/7] PKGBUILD: Fix packaging --- PKGBUILD | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/PKGBUILD b/PKGBUILD index 86bd322..431c42e 100644 --- a/PKGBUILD +++ b/PKGBUILD @@ -302,7 +302,7 @@ package() { cp \ out/Release/{chrome_{100,200}_percent,resources}.pak \ - out/Release/{*.bin} \ + out/Release/*.bin \ "$pkgdir/usr/lib/$pkgname/" install -Dm644 -t "$pkgdir/usr/lib/$pkgname/locales" out/Release/locales/*.pak From 7abce2dd541f87148a883c99abf37b1a2740df74 Mon Sep 17 00:00:00 2001 From: gcarq Date: Thu, 21 Jun 2018 17:28:37 +0200 Subject: [PATCH 6/7] Add patch for upstream issue 707721 (FS#53544) Dialogs were invisible when browser was maximized on second HIDPI screen. --- PKGBUILD | 5 +++ ...-mixup-between-DIP-pixel-coordinates.patch | 40 +++++++++++++++++++ 2 files changed, 45 insertions(+) create mode 100644 x11-fix-mixup-between-DIP-pixel-coordinates.patch diff --git a/PKGBUILD b/PKGBUILD index 431c42e..752e65a 100644 --- a/PKGBUILD +++ b/PKGBUILD @@ -35,6 +35,7 @@ source=(https://commondatastorage.googleapis.com/chromium-browser-official/chrom https://raw.githubusercontent.com/gcarq/inox-patchset/$pkgver/chromium-skia-harmony.patch https://raw.githubusercontent.com/gcarq/inox-patchset/$pkgver/chromium-widevine-r2.patch https://raw.githubusercontent.com/gcarq/inox-patchset/$pkgver/remove-dependency-on-ffmpeg-internals-for-start-time.patch + https://raw.githubusercontent.com/gcarq/inox-patchset/$pkgver/x11-fix-mixup-between-DIP-pixel-coordinates.patch # Misc https://raw.githubusercontent.com/gcarq/inox-patchset/$pkgver/chromium-vaapi-r18.patch # Inox patchset @@ -76,6 +77,7 @@ sha256sums=('d5ee63932ff1c8c4a5f69c834f6577e7127b416681eddd23bc54886caffd770d' 'feca54ab09ac0fc9d0626770a6b899a6ac5a12173c7d0c1005bc3964ec83e7b3' '068e11a910779d39c5f223018c8f3503734cb3b303471858006cb81ed4886c1b' 'd6af7a4afcdfce965d9ebcf177ab8189c7006c587c30e940255163db3da4b6c8' + 'e2c2754536243a60fa70541bbd4121715eccd83caa8f1fb1873bd994cd81f871' 'a7dbcbfc5ec18606c260df67b98fb2440fe59a4c9ede0823fc43f3bcf439887b' '46036bdd0ce5be85e61c1f49cd3a13fbe4395e45ae05f46ce6fb15574b60df02' 'b9fc0089687e67453dba9190a069414f4621143349371fd523eb816e2e46662c' @@ -138,6 +140,9 @@ prepare() { # https://crbug.com/731766 patch -Np1 -i ../remove-dependency-on-ffmpeg-internals-for-start-time.patch + # https://crbug.com/707721 + patch -Np1 -i ../x11-fix-mixup-between-DIP-pixel-coordinates.patch + # https://crbug.com/skia/6663#c10 patch -Np4 -i ../chromium-skia-harmony.patch diff --git a/x11-fix-mixup-between-DIP-pixel-coordinates.patch b/x11-fix-mixup-between-DIP-pixel-coordinates.patch new file mode 100644 index 0000000..34bd51d --- /dev/null +++ b/x11-fix-mixup-between-DIP-pixel-coordinates.patch @@ -0,0 +1,40 @@ +From 2752a03ba6435130848aa620b7ab4246eec2f77a Mon Sep 17 00:00:00 2001 +From: Tom Anderson +Date: Mon, 4 Jun 2018 22:09:08 +0000 +Subject: [PATCH] X11: Fix mixup between DIP/pixel coordinates + +BUG=707721 +R=sky + +Change-Id: Ibbbff9c2c815700324f553a3b66e878f76938534 +Reviewed-on: https://chromium-review.googlesource.com/1083692 +Reviewed-by: Scott Violet +Commit-Queue: Thomas Anderson +Cr-Commit-Position: refs/heads/master@{#564261} +--- + ui/views/widget/desktop_aura/desktop_screen_x11.cc | 9 +++++++-- + 1 file changed, 7 insertions(+), 2 deletions(-) + +diff --git a/ui/views/widget/desktop_aura/desktop_screen_x11.cc b/ui/views/widget/desktop_aura/desktop_screen_x11.cc +index 8fd5d379d344..e90710c2c39c 100644 +--- a/ui/views/widget/desktop_aura/desktop_screen_x11.cc ++++ b/ui/views/widget/desktop_aura/desktop_screen_x11.cc +@@ -216,8 +216,13 @@ display::Display DesktopScreenX11::GetDisplayNearestWindow( + if (host) { + DesktopWindowTreeHostX11* rwh = DesktopWindowTreeHostX11::GetHostForXID( + host->GetAcceleratedWidget()); +- if (rwh) +- return GetDisplayMatching(rwh->GetX11RootWindowBounds()); ++ if (rwh) { ++ const float scale = 1.0f / GetDeviceScaleFactor(); ++ const gfx::Rect pixel_rect = rwh->GetX11RootWindowBounds(); ++ return GetDisplayMatching( ++ gfx::Rect(gfx::ScaleToFlooredPoint(pixel_rect.origin(), scale), ++ gfx::ScaleToCeiledSize(pixel_rect.size(), scale))); ++ } + } + + return GetPrimaryDisplay(); +-- +2.17.1 + From 023a8531592d2625027ee71bd9781e897bac2893 Mon Sep 17 00:00:00 2001 From: gcarq Date: Thu, 21 Jun 2018 19:25:17 +0200 Subject: [PATCH 7/7] update to 67.0.3396.87 --- PKGBUILD | 13 +++--- blink-disable-XML-catalogs-at-runtime.patch | 47 +++++++++++++++++++++ 2 files changed, 55 insertions(+), 5 deletions(-) create mode 100644 blink-disable-XML-catalogs-at-runtime.patch diff --git a/PKGBUILD b/PKGBUILD index 752e65a..50e77dc 100644 --- a/PKGBUILD +++ b/PKGBUILD @@ -5,7 +5,7 @@ # Contributor: Daniel J Griffiths pkgname=inox -pkgver=67.0.3396.62 +pkgver=67.0.3396.87 pkgrel=1 _launcher_ver=6 pkgdesc="Chromium Spin-off to enhance privacy by disabling data transmission to Google" @@ -27,7 +27,6 @@ optdepends=('pepper-flash: support for Flash content' install=inox.install source=(https://commondatastorage.googleapis.com/chromium-browser-official/chromium-$pkgver.tar.xz chromium-launcher-$_launcher_ver.tar.gz::https://github.com/foutrelis/chromium-launcher/archive/v$_launcher_ver.tar.gz - chromium-$pkgver.txt::https://chromium.googlesource.com/chromium/src/+/$pkgver?format=TEXT https://raw.githubusercontent.com/gcarq/inox-patchset/$pkgver/product_logo_{16,22,24,32,48,64,128,256}.png # Patches from Arch Linux https://raw.githubusercontent.com/gcarq/inox-patchset/$pkgver/chromium-arflags.patch @@ -36,6 +35,7 @@ source=(https://commondatastorage.googleapis.com/chromium-browser-official/chrom https://raw.githubusercontent.com/gcarq/inox-patchset/$pkgver/chromium-widevine-r2.patch https://raw.githubusercontent.com/gcarq/inox-patchset/$pkgver/remove-dependency-on-ffmpeg-internals-for-start-time.patch https://raw.githubusercontent.com/gcarq/inox-patchset/$pkgver/x11-fix-mixup-between-DIP-pixel-coordinates.patch + https://raw.githubusercontent.com/gcarq/inox-patchset/$pkgver/blink-disable-XML-catalogs-at-runtime.patch # Misc https://raw.githubusercontent.com/gcarq/inox-patchset/$pkgver/chromium-vaapi-r18.patch # Inox patchset @@ -61,9 +61,8 @@ source=(https://commondatastorage.googleapis.com/chromium-browser-official/chrom https://raw.githubusercontent.com/gcarq/inox-patchset/$pkgver/0020-launcher-branding.patch https://raw.githubusercontent.com/gcarq/inox-patchset/$pkgver/0021-disable-rlz.patch https://raw.githubusercontent.com/gcarq/inox-patchset/$pkgver/9000-disable-metrics.patch) -sha256sums=('d5ee63932ff1c8c4a5f69c834f6577e7127b416681eddd23bc54886caffd770d' +sha256sums=('5d27a72f0cb8247343034f63fdd9747ff388c05b9fceb541668dd04fb372db1d' '04917e3cd4307d8e31bfb0027a5dce6d086edb10ff8a716024fbb8bb0c7dccf1' - 'ec97a018339a7037c588e1e5bd3d9b9fa59a21fa03b4f3a80e6c5ad463c2ba28' '71471fa4690894420f9e04a2e9a622af620d92ac2714a35f9a4c4e90fa3968dd' '4a533acefbbc1567b0d74a1c0903e9179b8c59c1beabe748850795815366e509' '7b88830c5e0e9819f514ad68aae885d427541a907e25607e47dee1b0f38975fd' @@ -78,6 +77,7 @@ sha256sums=('d5ee63932ff1c8c4a5f69c834f6577e7127b416681eddd23bc54886caffd770d' '068e11a910779d39c5f223018c8f3503734cb3b303471858006cb81ed4886c1b' 'd6af7a4afcdfce965d9ebcf177ab8189c7006c587c30e940255163db3da4b6c8' 'e2c2754536243a60fa70541bbd4121715eccd83caa8f1fb1873bd994cd81f871' + '98a5c41cf9687c52ee380d2b683c95387334c76254479c347bdb733646dab815' 'a7dbcbfc5ec18606c260df67b98fb2440fe59a4c9ede0823fc43f3bcf439887b' '46036bdd0ce5be85e61c1f49cd3a13fbe4395e45ae05f46ce6fb15574b60df02' 'b9fc0089687e67453dba9190a069414f4621143349371fd523eb816e2e46662c' @@ -116,7 +116,7 @@ declare -gA _system_libs=( #[libpng]=libpng # https://crbug.com/752403#c10 #[libvpx]=libvpx # needs unreleased libvpx [libwebp]=libwebp - #[libxml]=libxml2 # https://crbug.com/736026 + [libxml]=libxml2 [libxslt]=libxslt [opus]=opus [re2]=re2 @@ -143,6 +143,9 @@ prepare() { # https://crbug.com/707721 patch -Np1 -i ../x11-fix-mixup-between-DIP-pixel-coordinates.patch + # https://crbug.com/736026 + patch -Np1 -i ../blink-disable-XML-catalogs-at-runtime.patch + # https://crbug.com/skia/6663#c10 patch -Np4 -i ../chromium-skia-harmony.patch diff --git a/blink-disable-XML-catalogs-at-runtime.patch b/blink-disable-XML-catalogs-at-runtime.patch new file mode 100644 index 0000000..ec2361e --- /dev/null +++ b/blink-disable-XML-catalogs-at-runtime.patch @@ -0,0 +1,47 @@ +From 8f0c8c8d9bce12c70ce9acb4a7474cd15c9be65b Mon Sep 17 00:00:00 2001 +From: Mike Gilbert +Date: Wed, 20 Jun 2018 20:37:46 +0000 +Subject: [PATCH] blink: disable XML catalogs at runtime + +Chromium may optionally be built against libxml installed on the system. +The system libxml commonly has XML catalog support enabled. Disable it +by calling xmlCatalogSetDefaults(XML_CATA_ALLOW_NONE). + +Bug: https://bugs.gentoo.org/653078 +Change-Id: I069f6dcecf81168f9d31eb0efe2519197ec8e779 +Reviewed-on: https://chromium-review.googlesource.com/1103710 +Reviewed-by: Daniel Cheng +Commit-Queue: Scott Graham +Cr-Commit-Position: refs/heads/master@{#568998} +--- + .../blink/renderer/core/xml/parser/xml_document_parser.cc | 7 +++++++ + 1 file changed, 7 insertions(+) + +diff --git a/third_party/blink/renderer/core/xml/parser/xml_document_parser.cc b/third_party/blink/renderer/core/xml/parser/xml_document_parser.cc +index 9744de383d9a..d0539f61e4b5 100644 +--- a/third_party/blink/renderer/core/xml/parser/xml_document_parser.cc ++++ b/third_party/blink/renderer/core/xml/parser/xml_document_parser.cc +@@ -28,6 +28,10 @@ + + #include + #include ++#include ++#if defined(LIBXML_CATALOG_ENABLED) ++#include ++#endif + #include + + #include +@@ -648,6 +652,9 @@ static void InitializeLibXMLIfNecessary() { + if (did_init) + return; + ++#if defined(LIBXML_CATALOG_ENABLED) ++ xmlCatalogSetDefaults(XML_CATA_ALLOW_NONE); ++#endif + xmlInitParser(); + xmlRegisterInputCallbacks(MatchFunc, OpenFunc, ReadFunc, CloseFunc); + xmlRegisterOutputCallbacks(MatchFunc, OpenFunc, WriteFunc, CloseFunc); +-- +2.17.1 +