From 0da84072bc0bf6f8736874dcc61f0f81cd2d1fc6 Mon Sep 17 00:00:00 2001 From: Henrique Ferreiro Date: Wed, 4 Jul 2018 13:42:32 +0200 Subject: [PATCH 001/138] Update patches to 69.0.3472.3 --- patches/master_patch.patch | 328 +++++++----------- .../third_party/boringssl/src/boringssl.patch | 22 +- patches/v8/filter.patch | 12 +- 3 files changed, 143 insertions(+), 219 deletions(-) diff --git a/patches/master_patch.patch b/patches/master_patch.patch index fe864a0f8a..f941afc6cd 100644 --- a/patches/master_patch.patch +++ b/patches/master_patch.patch @@ -1,5 +1,5 @@ diff --git a/base/threading/thread_restrictions.h b/base/threading/thread_restrictions.h -index 57f2f21e9ee03079d84965ba48256380a75b0180..d5c093d041f5908d1f0800efd4b2895e7e4ec6fc 100644 +index aaf226b5bf5b0e452cfbb1c0945decc40b288bbe..0a4cb9c31563bd6f78e4ea9596782c2d7fbc1202 100644 --- a/base/threading/thread_restrictions.h +++ b/base/threading/thread_restrictions.h @@ -34,6 +34,13 @@ class StatisticsProviderImpl; @@ -16,7 +16,7 @@ index 57f2f21e9ee03079d84965ba48256380a75b0180..d5c093d041f5908d1f0800efd4b2895e namespace content { class BrowserGpuChannelHostFactory; class BrowserGpuMemoryBufferManager; -@@ -447,6 +454,9 @@ class BASE_EXPORT ThreadRestrictions { +@@ -449,6 +456,9 @@ class BASE_EXPORT ThreadRestrictions { friend class ui::CommandBufferLocal; friend class ui::GpuState; @@ -27,7 +27,7 @@ index 57f2f21e9ee03079d84965ba48256380a75b0180..d5c093d041f5908d1f0800efd4b2895e // BEGIN USAGE THAT NEEDS TO BE FIXED. friend class ::chromeos::BlockingMethodCaller; // http://crbug.com/125360 diff --git a/build/config/BUILDCONFIG.gn b/build/config/BUILDCONFIG.gn -index 93a97ff2803fe335be4537bc2d21a493468a2a23..bb84112e3babe3e4e974dbd2d11e580501ddf152 100644 +index 848d3cf68b3df2ec0c11c09cc3aa9fc59b9c1b10..5ad466d6404008bb3c3cddc42bb5a1a92b17ca75 100644 --- a/build/config/BUILDCONFIG.gn +++ b/build/config/BUILDCONFIG.gn @@ -148,6 +148,8 @@ declare_args() { @@ -78,7 +78,7 @@ index 4bb4a043cbbcb562aed8926867660547cd7f018c..769bc73607b600d549b6185a37d6b0cc } +} diff --git a/build/toolchain/win/BUILD.gn b/build/toolchain/win/BUILD.gn -index 4d9d1f45f8702395716bd7be30c7a9b21ffb2f7d..c668f93a50f3e46ee441eedf34f6c09e82003a68 100644 +index eb3e2b2b377dde31e062be46837bf509ecab0325..a4bee6058da2366f8b5358072a845828bd080b97 100644 --- a/build/toolchain/win/BUILD.gn +++ b/build/toolchain/win/BUILD.gn @@ -6,6 +6,7 @@ import("//build/config/clang/clang.gni") @@ -99,10 +99,10 @@ index 4d9d1f45f8702395716bd7be30c7a9b21ffb2f7d..c668f93a50f3e46ee441eedf34f6c09e goma_prefix = "" } diff --git a/chrome/BUILD.gn b/chrome/BUILD.gn -index 395d16c7cef21407a233cdb79aaa88a5c5b6e72b..2fbac7de0bce3c1bdb634f8e16afed59d3add639 100644 +index eb55999a8aa354e403505947e8b126d90b64dff8..ad71409160fb1b82359dfc6325d03516c9f9305e 100644 --- a/chrome/BUILD.gn +++ b/chrome/BUILD.gn -@@ -40,6 +40,11 @@ if (is_android) { +@@ -41,6 +41,11 @@ if (is_android) { import("//build/util/version.gni") import("//media/cdm/library_cdm/cdm_paths.gni") import("//third_party/icu/config.gni") @@ -115,20 +115,20 @@ index 395d16c7cef21407a233cdb79aaa88a5c5b6e72b..2fbac7de0bce3c1bdb634f8e16afed59 assert(!is_ios, "Chromium/iOS shouldn't use anything in //chrome") diff --git a/chrome/app/BUILD.gn b/chrome/app/BUILD.gn -index 4f74e74cfda63e4a9e9cb64c32a490c85a9a42d1..babd5dc7594d3b8a7529938469a9ea7a640f14a1 100644 +index 22e10d6c2fcf926ce090c25e102883eda8893dad..9fbd92a9e441488f4f4b2cde2b5e77eebeac5296 100644 --- a/chrome/app/BUILD.gn +++ b/chrome/app/BUILD.gn -@@ -431,6 +431,8 @@ if (!is_android) { - chrome_packaged_services += [ "//chrome/utility:profile_import_manifest" ] - } - -+chrome_packaged_services += [ "//electron/app:tor_launcher_manifest" ] +@@ -442,6 +442,8 @@ service_manifest("chrome_content_packaged_services_manifest_overlay") { + "//components/services/font:manifest", + ] + } + - service_manifest("chrome_manifest") { - source = "chrome_manifest.json" ++ packaged_services += [ "//electron/app:tor_launcher_manifest" ] } + + # Per-profile services. diff --git a/chrome/browser/chrome_content_browser_manifest_overlay.json b/chrome/browser/chrome_content_browser_manifest_overlay.json -index 3805676f7b81e20087b2cc34197733ac0e43edc4..cf11d90db95ed4d59180837d8bff2d4a5180ba79 100644 +index 4bebe8192e2e6fd36aa49aed6e53172edb58e739..e72d31fb327921940fc6c388b5c625496a07c98e 100644 --- a/chrome/browser/chrome_content_browser_manifest_overlay.json +++ b/chrome/browser/chrome_content_browser_manifest_overlay.json @@ -12,7 +12,7 @@ @@ -140,10 +140,10 @@ index 3805676f7b81e20087b2cc34197733ac0e43edc4..cf11d90db95ed4d59180837d8bff2d4a "safe_browsing.mojom.SafeBrowsing", "translate.mojom.ContentTranslateDriver" ], -@@ -55,6 +55,7 @@ - "proxy_resolver": [ "factory" ], - "preferences": [ "pref_client", "pref_control" ], +@@ -58,6 +58,7 @@ "removable_storage_writer": [ "removable_storage_writer" ], + "secure_channel": [ "secure_channel" ], + "shortcut_viewer_app": [ "shortcut_viewer" ], + "tor_launcher": [ "tor_launcher" ], "ui": [ "display_dev", @@ -451,7 +451,7 @@ index 9f0003bc2d80d7c76ab9dd17393d0188fe1ac6fd..88d75d4091fb3dc282998a5d44e63cbf // content::NotificationObserver implementation. void Observe(int type, diff --git a/chrome/browser/resource_coordinator/tab_lifecycle_unit.cc b/chrome/browser/resource_coordinator/tab_lifecycle_unit.cc -index 01d3ee8917c2d05943e42556a4221161606c451d..f801248b1017abaf706533ff0889295c13cfb653 100644 +index 8075180fd7b00a9dc1ad3860e3e49f15b41eec29..0c001515ff56d7539e78ae88db3c1e6ab2c56fc3 100644 --- a/chrome/browser/resource_coordinator/tab_lifecycle_unit.cc +++ b/chrome/browser/resource_coordinator/tab_lifecycle_unit.cc @@ -12,6 +12,7 @@ @@ -462,24 +462,24 @@ index 01d3ee8917c2d05943e42556a4221161606c451d..f801248b1017abaf706533ff0889295c #include "chrome/browser/media/webrtc/media_capture_devices_dispatcher.h" #include "chrome/browser/media/webrtc/media_stream_capture_indicator.h" #include "chrome/browser/profiles/profile.h" -@@ -19,6 +20,7 @@ - #include "chrome/browser/resource_coordinator/tab_activity_watcher.h" +@@ -20,6 +21,7 @@ + #include "chrome/browser/resource_coordinator/tab_helper.h" #include "chrome/browser/resource_coordinator/tab_lifecycle_observer.h" #include "chrome/browser/resource_coordinator/tab_load_tracker.h" +#include "chrome/browser/resource_coordinator/tab_manager.h" #include "chrome/browser/resource_coordinator/tab_manager_features.h" #include "chrome/browser/resource_coordinator/time.h" #include "chrome/browser/ui/tabs/tab_strip_model.h" -@@ -375,7 +377,7 @@ void TabLifecycleUnitSource::TabLifecycleUnit::FinishDiscard( - create_params.desired_renderer_state = +@@ -573,7 +575,7 @@ void TabLifecycleUnitSource::TabLifecycleUnit::FinishDiscard( content::WebContents::CreateParams::kNoRendererProcess; + create_params.last_active_time = old_contents->GetLastActiveTime(); std::unique_ptr null_contents = - content::WebContents::Create(create_params); + g_browser_process->GetTabManager()->CreateNullContents(create_params, old_contents); content::WebContents* raw_null_contents = null_contents.get(); - // Copy over the state from the navigation controller to preserve the - // back/forward history and to continue to display the correct title/favicon. -@@ -428,7 +430,9 @@ void TabLifecycleUnitSource::TabLifecycleUnit::FinishDiscard( + + // Attach the ResourceCoordinatorTabHelper. In production code this has +@@ -630,7 +632,9 @@ void TabLifecycleUnitSource::TabLifecycleUnit::FinishDiscard( // TODO(jamescook): This breaks script connections with other tabs. Find a // different approach that doesn't do that, perhaps based on // RenderFrameProxyHosts. @@ -488,13 +488,13 @@ index 01d3ee8917c2d05943e42556a4221161606c451d..f801248b1017abaf706533ff0889295c + g_browser_process->GetTabManager()->DestroyOldContents( + std::move(old_contents_deleter)); - LifecycleState previous_state = GetState(); - SetState(LifecycleState::DISCARDED); + SetState(LifecycleUnitState::DISCARDED, + DiscardReasonToStateChangeReason(discard_reason)); diff --git a/chrome/browser/resource_coordinator/tab_manager.cc b/chrome/browser/resource_coordinator/tab_manager.cc -index e111e54ebef9951556284671ca43b468e8c767d6..7525ca235ec9a3f2209be4d2aff5bd80206c4d22 100644 +index a3fdc6ab26be4871294035e3ef1b788b1cb488ca..5b9b3a46e04fbc04d974cb57cdfaf5b2c2866024 100644 --- a/chrome/browser/resource_coordinator/tab_manager.cc +++ b/chrome/browser/resource_coordinator/tab_manager.cc -@@ -488,6 +488,19 @@ void TabManager::PurgeBackgroundedTabsIfNeeded() { +@@ -490,6 +490,19 @@ void TabManager::PurgeBackgroundedTabsIfNeeded() { } } @@ -515,7 +515,7 @@ index e111e54ebef9951556284671ca43b468e8c767d6..7525ca235ec9a3f2209be4d2aff5bd80 TRACE_EVENT_INSTANT0("navigation", "TabManager::PauseBackgroundTabOpeningIfNeeded", diff --git a/chrome/browser/resource_coordinator/tab_manager.h b/chrome/browser/resource_coordinator/tab_manager.h -index 3aacb7cde1e7b1bf5d97ccbab5d94f5bb25f1ec2..8d2e998578735187290f708e3d6dc60f34a396ce 100644 +index 103fec465a1d84eb4841fd2d9a6da8c804ee1b24..72f28aeec3a9ca61c398bac663fa0a4df76759e3 100644 --- a/chrome/browser/resource_coordinator/tab_manager.h +++ b/chrome/browser/resource_coordinator/tab_manager.h @@ -31,6 +31,7 @@ @@ -568,7 +568,7 @@ index de9e4280f1984afd3198b5c8132774cc26ff7e95..54be9a23739ddb16322c0067c7e4da51 rev_checking_required_local_anchors_.GetValue(); config->sha1_local_anchors_enabled = sha1_local_anchors_enabled_.GetValue(); diff --git a/chrome/browser/ui/libgtkui/BUILD.gn b/chrome/browser/ui/libgtkui/BUILD.gn -index ccbed52a0a3fca220eab8becadd3b68163418694..0b70ef9b3dd00ad99cb88e2e7ed00c2d9bf8d3e8 100644 +index 8af376e16e327f97577b0f2bc0487e30751201d2..fc7a2d23ea2ae3db8709036dff062bc5aa31cd10 100644 --- a/chrome/browser/ui/libgtkui/BUILD.gn +++ b/chrome/browser/ui/libgtkui/BUILD.gn @@ -65,6 +65,9 @@ template("libgtkui") { @@ -582,10 +582,10 @@ index ccbed52a0a3fca220eab8becadd3b68163418694..0b70ef9b3dd00ad99cb88e2e7ed00c2d "//build/config/linux/pangocairo", "//build/config/linux:x11", diff --git a/chrome/common/BUILD.gn b/chrome/common/BUILD.gn -index b45794f858d4f8eabceab39166f2103dbdf87361..69d2674f11800d3b906b60f840c9b4e5351d8ab6 100644 +index c36abac4f582b934758001124755536164dbe357..ee3c0e29fd01ba38119b8ae28a9d6e4356041372 100644 --- a/chrome/common/BUILD.gn +++ b/chrome/common/BUILD.gn -@@ -495,6 +495,12 @@ static_library("common") { +@@ -496,6 +496,12 @@ static_library("common") { ] public_deps += [ "//chrome/common:version_header" ] } @@ -711,10 +711,10 @@ index d4e0823a55994118bacfe4fd7f8ec1881640e8ac..3644624a60bc75b5d6308c30343a2579 FPL("Chrome_StatusTrayWindow"); #endif // defined(OS_WIN) diff --git a/chrome/common/chrome_paths_mac.mm b/chrome/common/chrome_paths_mac.mm -index 406298ba2b3352b072ed500c42e46e26d1043f8c..dd9e3b25926d7d7d79d6f02c6265febf37696053 100644 +index 40a4d69c5bb3096be8241a7d2b07509ba2a21603..37a0ece79d26635f7e6d5f7bcfb55839cb6c44ac 100644 --- a/chrome/common/chrome_paths_mac.mm +++ b/chrome/common/chrome_paths_mac.mm -@@ -40,7 +40,9 @@ NSBundle* OuterAppBundleInternal() { +@@ -38,7 +38,9 @@ NSBundle* OuterAppBundleInternal() { // From C.app/Contents/Versions/1.2.3.4, go up three steps to get to C.app. base::FilePath versioned_dir = chrome::GetVersionedDirectory(); @@ -987,10 +987,10 @@ index 0b312fc03b93ec515fdc50ecd6fc4ed2e55dd2c8..ce621207b4da425873d8c3286eb3ab30 static_library("test_support") { diff --git a/chrome/renderer/chrome_content_renderer_client.cc b/chrome/renderer/chrome_content_renderer_client.cc -index 64a3c7982c9f23dbef8cd3061b3bface7cd65997..68aea089616a0b19483bed771d4d9f6ce3d79189 100644 +index 6a15716bb62fe24544b62c3168ad7db8747e48a8..fe993b166e736930d8eec42c8f1ef2719f973ddc 100644 --- a/chrome/renderer/chrome_content_renderer_client.cc +++ b/chrome/renderer/chrome_content_renderer_client.cc -@@ -1512,6 +1512,7 @@ ChromeContentRendererClient::CreateBrowserPluginDelegate( +@@ -1504,6 +1504,7 @@ ChromeContentRendererClient::CreateBrowserPluginDelegate( #endif } @@ -998,7 +998,7 @@ index 64a3c7982c9f23dbef8cd3061b3bface7cd65997..68aea089616a0b19483bed771d4d9f6c void ChromeContentRendererClient::RecordRappor(const std::string& metric, const std::string& sample) { if (!rappor_recorder_) { -@@ -1529,6 +1530,7 @@ void ChromeContentRendererClient::RecordRapporURL(const std::string& metric, +@@ -1521,6 +1522,7 @@ void ChromeContentRendererClient::RecordRapporURL(const std::string& metric, } rappor_recorder_->RecordRapporURL(metric, url); } @@ -1007,10 +1007,10 @@ index 64a3c7982c9f23dbef8cd3061b3bface7cd65997..68aea089616a0b19483bed771d4d9f6c void ChromeContentRendererClient::AddImageContextMenuProperties( const WebURLResponse& response, diff --git a/chrome/renderer/chrome_content_renderer_client.h b/chrome/renderer/chrome_content_renderer_client.h -index 8427fc4c5669c30f2c54181ab5b684266a357cfc..265de15051ea410e4b1712a45a208ce2ad717ff7 100644 +index 5b8b73068b814e4d341722ee1e8688e85edc4e01..2b1ce902796db26cb79ef6d38b3b857fd4df9d57 100644 --- a/chrome/renderer/chrome_content_renderer_client.h +++ b/chrome/renderer/chrome_content_renderer_client.h -@@ -198,9 +198,9 @@ class ChromeContentRendererClient +@@ -197,9 +197,9 @@ class ChromeContentRendererClient const content::WebPluginInfo& info, const std::string& mime_type, const GURL& original_url) override; @@ -1129,10 +1129,10 @@ index c4c5f83886574956b3abdfa77a07500a2ee6de9e..edbfde3c41a1e38bcdedd09aaa41d8a1 std::unique_ptr ref_factory_; service_manager::BinderRegistry registry_; diff --git a/components/autofill/core/browser/credit_card_save_manager.cc b/components/autofill/core/browser/credit_card_save_manager.cc -index 5eac76c70943bef6691581cb5d92afae25c1239a..5f688cd9f8e2bd6134ce5783302c62ca55430ced 100644 +index 359c92bf2df0c436b1b7cb67bfde3677df2a1fac..fdf8cd6760d014eece1d137930433024df810b7b 100644 --- a/components/autofill/core/browser/credit_card_save_manager.cc +++ b/components/autofill/core/browser/credit_card_save_manager.cc -@@ -190,12 +190,17 @@ void CreditCardSaveManager::AttemptToOfferCardUploadSave( +@@ -202,12 +202,17 @@ void CreditCardSaveManager::AttemptToOfferCardUploadSave( } bool CreditCardSaveManager::IsCreditCardUploadEnabled() { @@ -1225,10 +1225,10 @@ index dbd2ae8df59756c61d28091cff70098c897db8f4..84fbc695c817c87deb902d8b6f69d3f1 link.href = href; link.target = '_blank'; diff --git a/components/guest_view/browser/guest_view_base.cc b/components/guest_view/browser/guest_view_base.cc -index 8f31866db03f908536dce6ca8e41b24ef40c21c7..3df51bf2e70929f065bda77d5dcd84fa354092a8 100644 +index 7b1a30f6189d1c45ac89288d22b61f07d2360f77..e851b27d2dd78d31db8b0c6587fb78067fe75dec 100644 --- a/components/guest_view/browser/guest_view_base.cc +++ b/components/guest_view/browser/guest_view_base.cc -@@ -419,8 +419,10 @@ void GuestViewBase::DidAttach(int guest_proxy_routing_id) { +@@ -418,8 +418,10 @@ void GuestViewBase::DidAttach(int guest_proxy_routing_id) { SetUpSizing(*attach_params()); @@ -1239,7 +1239,7 @@ index 8f31866db03f908536dce6ca8e41b24ef40c21c7..3df51bf2e70929f065bda77d5dcd84fa // Give the derived class an opportunity to perform some actions. DidAttachToEmbedder(); -@@ -440,8 +442,12 @@ void GuestViewBase::DidDetach() { +@@ -439,8 +441,12 @@ void GuestViewBase::DidDetach() { owner_web_contents()->GetRenderViewHost()->Send( new GuestViewMsg_GuestDetached(element_instance_id_)); element_instance_id_ = kInstanceIDNone; @@ -1254,10 +1254,10 @@ index 8f31866db03f908536dce6ca8e41b24ef40c21c7..3df51bf2e70929f065bda77d5dcd84fa WebContents* GuestViewBase::GetOwnerWebContents() const { diff --git a/components/guest_view/browser/guest_view_base.h b/components/guest_view/browser/guest_view_base.h -index 32341e9197a71fe2215c67e5b2e936b171043d76..25f6b04bafc86c44a243d933a55444a5eb0d4eb7 100644 +index fc5b48c0f9a9f28da8fd68c684f0652b7e1352a7..bca49df25c4d852cbcf83ebc5ff59dbb20870062 100644 --- a/components/guest_view/browser/guest_view_base.h +++ b/components/guest_view/browser/guest_view_base.h -@@ -244,6 +244,9 @@ class GuestViewBase : public content::BrowserPluginGuestDelegate, +@@ -243,6 +243,9 @@ class GuestViewBase : public content::BrowserPluginGuestDelegate, // an opportunity to perform setup actions after attachment. virtual void DidAttachToEmbedder() {} @@ -1268,7 +1268,7 @@ index 32341e9197a71fe2215c67e5b2e936b171043d76..25f6b04bafc86c44a243d933a55444a5 // // This gives the derived class an opportunity to perform additional diff --git a/components/guest_view/browser/guest_view_manager.cc b/components/guest_view/browser/guest_view_manager.cc -index a18eacb3b74c7bdfba63394cc123a8b748728fd1..8da758ea5a68e9773e8f6c23acb0c781c91cf279 100644 +index 0671c3cd7d7880a79efa3a3bba0d977f24049c3c..1cdb522b62f83f06bf5be8839c7eb53f22d4e044 100644 --- a/components/guest_view/browser/guest_view_manager.cc +++ b/components/guest_view/browser/guest_view_manager.cc @@ -67,6 +67,9 @@ class GuestViewManager::EmbedderRenderProcessHostObserver @@ -1331,7 +1331,7 @@ index a1b5b975bc89c4891643adab17ce0b00ba2a8032..229928f2381eaecf6d3180109dd9aaa7 LibsecretLoader::SearchHelper helper; diff --git a/components/os_crypt/keychain_password_mac.mm b/components/os_crypt/keychain_password_mac.mm -index 2b38db266f9aa1f4141c8649c021042ede4e5589..ea0387b11f4b00f87596d738c152aa4cc43b2beb 100644 +index 7c110c7b14e559cd73dfb0ca6f72c14b671d52b8..dc3e79afa4f9b80f27b1a6026c06543f0d974367 100644 --- a/components/os_crypt/keychain_password_mac.mm +++ b/components/os_crypt/keychain_password_mac.mm @@ -7,6 +7,7 @@ @@ -1342,7 +1342,7 @@ index 2b38db266f9aa1f4141c8649c021042ede4e5589..ea0387b11f4b00f87596d738c152aa4c #include "base/mac/mac_logging.h" #include "base/rand_util.h" #include "crypto/apple_keychain.h" -@@ -61,6 +62,14 @@ const char KeychainPassword::account_name[] = "Chromium"; +@@ -56,6 +57,14 @@ const char KeychainPassword::account_name[] = "Chromium"; std::string KeychainPassword::GetPassword() const { UInt32 password_length = 0; void* password_data = NULL; @@ -1355,8 +1355,8 @@ index 2b38db266f9aa1f4141c8649c021042ede4e5589..ea0387b11f4b00f87596d738c152aa4c + account_name = ::KeychainPassword::account_name; + } OSStatus error = keychain_.FindGenericPassword( - nullptr, strlen(service_name), service_name, strlen(account_name), - account_name, &password_length, &password_data, NULL); + strlen(service_name), service_name, strlen(account_name), account_name, + &password_length, &password_data, NULL); diff --git a/components/password_manager/core/browser/new_password_form_manager.cc b/components/password_manager/core/browser/new_password_form_manager.cc index 150b7ab410b698c1622383842bb6f529ad83e1fd..264f5f6671b59875118a06010f11ebecac245ca7 100644 --- a/components/password_manager/core/browser/new_password_form_manager.cc @@ -1450,10 +1450,10 @@ index ac7a6eb8c3298bbf6a25bf3eb623a8875383bc1e..e5383acaae9965d602ce3a46671026ea } // namespace password_manager diff --git a/content/app/content_main_runner_impl.cc b/content/app/content_main_runner_impl.cc -index 83e8990edf17e2cd26687eeec13ef99e25dd4f44..5b3d06b71bab28c001e82828c91ab8ae16909cf0 100644 +index 4787f14958265ffe6b2d505996175aaf2571f6b8..e3c6739233355ceb4123a42b77fc9e298f68b7e1 100644 --- a/content/app/content_main_runner_impl.cc +++ b/content/app/content_main_runner_impl.cc -@@ -871,7 +871,7 @@ int ContentMainRunnerImpl::Initialize(const ContentMainParams& params) { +@@ -847,7 +847,7 @@ int ContentMainRunnerImpl::Initialize(const ContentMainParams& params) { return nullptr; })); @@ -1462,20 +1462,20 @@ index 83e8990edf17e2cd26687eeec13ef99e25dd4f44..5b3d06b71bab28c001e82828c91ab8ae #if defined(OS_WIN) bool should_enable_stack_dump = !process_type.empty(); #else -@@ -887,7 +887,7 @@ int ContentMainRunnerImpl::Initialize(const ContentMainParams& params) { +@@ -863,7 +863,7 @@ int ContentMainRunnerImpl::Initialize(const ContentMainParams& params) { service_manager::switches::kDisableInProcessStackTraces)) { base::debug::EnableInProcessStackDumping(); } -#endif // !defined(OFFICIAL_BUILD) +#endif // 0 - if (delegate_) - delegate_->PreSandboxStartup(); + delegate_->PreSandboxStartup(); + diff --git a/content/browser/browser_plugin/browser_plugin_guest.cc b/content/browser/browser_plugin/browser_plugin_guest.cc -index a0bc9305e62dceaa1179dce3166711d33e3ea254..3d5cf1f526cf928e1e658c9e525d9dc98709334d 100644 +index 5b9fca0cf04f4d928090632e6483eefa2e35456d..8ee9662335415d8cad6292b42a681438b9fc08ca 100644 --- a/content/browser/browser_plugin/browser_plugin_guest.cc +++ b/content/browser/browser_plugin/browser_plugin_guest.cc -@@ -833,6 +833,8 @@ void BrowserPluginGuest::OnDetach(int browser_plugin_instance_id) { +@@ -830,6 +830,8 @@ void BrowserPluginGuest::OnDetach(int browser_plugin_instance_id) { } delegate_->DidDetach(); @@ -1540,10 +1540,10 @@ index 91bf248a67a5a82eab9c5942be54465599bf397a..b2dbd9a97dce6c402f0d3f87b452613d // In this loop, copy the WebPluginInfo (and do not use a reference) because // the filter might mutate it. diff --git a/content/browser/frame_host/render_widget_host_view_guest.cc b/content/browser/frame_host/render_widget_host_view_guest.cc -index a0bc38e7f059d5066ef0147ac9b83cbc958d7209..de59d17171b79266bc25c47ea581989a625ae3c1 100644 +index 6a47f48f920fbb6266e4041d42903e76478fd3ab..f4134fa198e1adb6bdae70c8a6fc677d92c8326d 100644 --- a/content/browser/frame_host/render_widget_host_view_guest.cc +++ b/content/browser/frame_host/render_widget_host_view_guest.cc -@@ -594,7 +594,14 @@ void RenderWidgetHostViewGuest::ShowDefinitionForSelection() { +@@ -591,7 +591,14 @@ void RenderWidgetHostViewGuest::ShowDefinitionForSelection() { // overlay (it will open Dictionary.app), so the target NSView need not be // specified. // https://crbug.com/152438 @@ -1621,78 +1621,11 @@ index 3761be5f730dd73662acdd016ee098d64556b09c..e3066953627059ec96ebd6b159db7251 private: DISALLOW_COPY_AND_ASSIGN(RenderWidgetHostNSViewBridge); }; -diff --git a/content/browser/renderer_host/render_widget_host_ns_view_bridge.mm b/content/browser/renderer_host/render_widget_host_ns_view_bridge.mm -index 54b1c71bb4c6d2d792eb449cfe9d2cbd94881ffa..9b8249025e94fe3ee18f3562ab1d923266de3ff2 100644 ---- a/content/browser/renderer_host/render_widget_host_ns_view_bridge.mm -+++ b/content/browser/renderer_host/render_widget_host_ns_view_bridge.mm -@@ -11,6 +11,9 @@ - #include "base/strings/sys_string_conversions.h" - #import "content/browser/renderer_host/popup_window_mac.h" - #import "content/browser/renderer_host/render_widget_host_view_cocoa.h" -+#if !defined(MUON_CHROMIUM_BUILD) -+#include "content/browser/renderer_host/render_widget_host_view_mac.h" -+#endif - #include "content/common/cursors/webcursor.h" - #import "skia/ext/skia_utils_mac.h" - #include "ui/accelerated_widget_mac/display_ca_layer_tree.h" -@@ -55,6 +58,11 @@ class RenderWidgetHostViewNSViewBridgeLocal - void DisplayCursor(const WebCursor& cursor) override; - void SetCursorLocked(bool locked) override; - void ShowDictionaryOverlayForSelection() override; -+#if !defined(MUON_CHROMIUM_BUILD) -+ void ShowDictionaryOverlayForSelection(RenderWidgetHostView* target_view); -+ void SetTargetView(RenderWidgetHostView* target_view) override { -+ target_view_ = static_cast(target_view); }; -+#endif - void ShowDictionaryOverlay( - const mac::AttributedStringCoder::EncodedString& encoded_string, - gfx::Point baseline_point) override; -@@ -91,6 +99,10 @@ class RenderWidgetHostViewNSViewBridgeLocal - // Cached copy of the tooltip text, to avoid redundant calls. - base::string16 tooltip_text_; - -+#if !defined(MUON_CHROMIUM_BUILD) -+ RenderWidgetHostViewMac* target_view_; -+#endif -+ - DISALLOW_COPY_AND_ASSIGN(RenderWidgetHostViewNSViewBridgeLocal); - }; - -@@ -105,6 +117,9 @@ RenderWidgetHostViewNSViewBridgeLocal::RenderWidgetHostViewNSViewBridgeLocal( - std::make_unique(background_layer_.get()); - [cocoa_view_ setLayer:background_layer_]; - [cocoa_view_ setWantsLayer:YES]; -+#if !defined(MUON_CHROMIUM_BUILD) -+ target_view_ = NULL; -+#endif - } - - RenderWidgetHostViewNSViewBridgeLocal:: -@@ -305,10 +320,17 @@ void RenderWidgetHostViewNSViewBridgeLocal::ShowDictionaryOverlay( - mac::AttributedStringCoder::Decode(&encoded_string); - if ([string length] == 0) - return; -+ NSView* view = cocoa_view_; -+#if !defined(MUON_CHROMIUM_BUILD) -+ if (target_view_) { -+ view = target_view_->cocoa_view(); -+ } -+#endif -+ - NSPoint flipped_baseline_point = { -- baseline_point.x(), [cocoa_view_ frame].size.height - baseline_point.y(), -+ baseline_point.x(), [view frame].size.height - baseline_point.y(), - }; -- [cocoa_view_ showDefinitionForAttributedString:string -+ [view showDefinitionForAttributedString:string - atPoint:flipped_baseline_point]; - } - diff --git a/content/browser/renderer_host/render_widget_host_view_aura.cc b/content/browser/renderer_host/render_widget_host_view_aura.cc -index aefe1196095598567cef2e883b52e23a95a45737..121f3ba116bdac7b058ba78228c3a1a114dc9ac2 100644 +index 50fb4ac83df4440dec8ec85413e40b2c163fc34f..6d7c275596d540fd59cc8bac1e7b4dff337020e7 100644 --- a/content/browser/renderer_host/render_widget_host_view_aura.cc +++ b/content/browser/renderer_host/render_widget_host_view_aura.cc -@@ -1640,8 +1640,23 @@ bool RenderWidgetHostViewAura::TransformPointToLocalCoordSpaceLegacy( +@@ -1634,8 +1634,23 @@ bool RenderWidgetHostViewAura::TransformPointToLocalCoordSpaceLegacy( !delegated_frame_host_->TransformPointToLocalCoordSpaceLegacy( point_in_pixels, original_surface, transformed_point)) return false; @@ -1719,10 +1652,10 @@ index aefe1196095598567cef2e883b52e23a95a45737..121f3ba116bdac7b058ba78228c3a1a1 } diff --git a/content/browser/renderer_host/render_widget_host_view_cocoa.mm b/content/browser/renderer_host/render_widget_host_view_cocoa.mm -index d86576cc36ac0fe922623618b0d84346ccc5ec8e..3733a3074b9bbb1139574b9e7f6435fb205bf0f5 100644 +index acd073c5a1647fac743f10399440068c004f9b65..d4fd2534f4ce314a2e9bd53c08ce190c205d60ed 100644 --- a/content/browser/renderer_host/render_widget_host_view_cocoa.mm +++ b/content/browser/renderer_host/render_widget_host_view_cocoa.mm -@@ -179,6 +179,12 @@ void ExtractUnderlines(NSAttributedString* string, +@@ -180,6 +180,12 @@ void ExtractUnderlines(NSAttributedString* string, } // namespace @@ -1735,7 +1668,7 @@ index d86576cc36ac0fe922623618b0d84346ccc5ec8e..3733a3074b9bbb1139574b9e7f6435fb // These are not documented, so use only after checking -respondsToSelector:. @interface NSApplication (UndocumentedSpeechMethods) - (void)speakString:(NSString*)string; -@@ -363,7 +369,14 @@ void ExtractUnderlines(NSAttributedString* string, +@@ -354,7 +360,14 @@ void ExtractUnderlines(NSAttributedString* string, } - (BOOL)acceptsFirstMouse:(NSEvent*)theEvent { @@ -1750,7 +1683,7 @@ index d86576cc36ac0fe922623618b0d84346ccc5ec8e..3733a3074b9bbb1139574b9e7f6435fb } - (void)setCloseOnDeactivate:(BOOL)b { -@@ -650,8 +663,10 @@ void ExtractUnderlines(NSAttributedString* string, +@@ -643,8 +656,10 @@ void ExtractUnderlines(NSAttributedString* string, if (EventIsReservedBySystem(theEvent)) return; @@ -1761,7 +1694,7 @@ index d86576cc36ac0fe922623618b0d84346ccc5ec8e..3733a3074b9bbb1139574b9e7f6435fb if (eventType == NSFlagsChanged) { // Ignore NSFlagsChanged events from the NumLock and Fn keys as -@@ -698,6 +713,12 @@ void ExtractUnderlines(NSAttributedString* string, +@@ -691,6 +706,12 @@ void ExtractUnderlines(NSAttributedString* string, bool shouldAutohideCursor = textInputType_ != ui::TEXT_INPUT_TYPE_NONE && eventType == NSKeyDown && !(modifierFlags & NSCommandKeyMask); @@ -1775,10 +1708,10 @@ index d86576cc36ac0fe922623618b0d84346ccc5ec8e..3733a3074b9bbb1139574b9e7f6435fb // We only handle key down events and just simply forward other events. if (eventType != NSKeyDown) { diff --git a/content/browser/renderer_host/render_widget_host_view_mac.h b/content/browser/renderer_host/render_widget_host_view_mac.h -index 656807e405af36dc7d34ab0b6a0cff265cf0c55a..ce4dadb867841e6cb4817e99536e62342a208a50 100644 +index 8dffe1b810ebb8494be3a41fe2ed2daa034a85ad..07ca961edc65ded67a8b595d5e1106717fecbf89 100644 --- a/content/browser/renderer_host/render_widget_host_view_mac.h +++ b/content/browser/renderer_host/render_widget_host_view_mac.h -@@ -106,6 +106,9 @@ class CONTENT_EXPORT RenderWidgetHostViewMac +@@ -108,6 +108,9 @@ class CONTENT_EXPORT RenderWidgetHostViewMac gfx::Rect GetViewBounds() const override; void SetActive(bool active) override; void ShowDefinitionForSelection() override; @@ -1789,10 +1722,10 @@ index 656807e405af36dc7d34ab0b6a0cff265cf0c55a..ce4dadb867841e6cb4817e99536e6234 void SetNeedsBeginFrames(bool needs_begin_frames) override; void GetScreenInfo(ScreenInfo* screen_info) const override; diff --git a/content/browser/renderer_host/render_widget_host_view_mac.mm b/content/browser/renderer_host/render_widget_host_view_mac.mm -index c8bfdb794cd399b8da72c2cd07876460cd2f2516..938c8a3a7a9ff36f1ea59faabea3011cb5d6aa9f 100644 +index 1e06f2c9934cd99c43c411ace9d4309a959e832f..3102a8322149dc86276bb3d8e7ba79585973ba81 100644 --- a/content/browser/renderer_host/render_widget_host_view_mac.mm +++ b/content/browser/renderer_host/render_widget_host_view_mac.mm -@@ -1204,6 +1204,10 @@ void RenderWidgetHostViewMac::SetActive(bool active) { +@@ -1216,6 +1216,10 @@ void RenderWidgetHostViewMac::SetActive(bool active) { if (host()) { host()->SetActive(active); if (active) { @@ -1803,7 +1736,7 @@ index c8bfdb794cd399b8da72c2cd07876460cd2f2516..938c8a3a7a9ff36f1ea59faabea3011c if (HasFocus()) host()->Focus(); } else { -@@ -1221,6 +1225,14 @@ void RenderWidgetHostViewMac::ShowDefinitionForSelection() { +@@ -1233,6 +1237,14 @@ void RenderWidgetHostViewMac::ShowDefinitionForSelection() { ns_view_bridge_->ShowDictionaryOverlayForSelection(); } @@ -1893,10 +1826,10 @@ index 39b89cd36c327f27da7f687c3179ace964fc6d63..9140ff961245e4e4e222986e48297906 process_->Launch(std::make_unique( diff --git a/content/browser/web_contents/web_contents_impl.cc b/content/browser/web_contents/web_contents_impl.cc -index ec663126dca2247cd9c04a13b06ba530febe52d2..6da03ddce2930dc0a06bbd310b01dc79ab80e147 100644 +index 70c8438e18516985ec7fa6c2c5245a5f7ac63a50..66e8cf16d398aab8c67c6097981d918b94ac09c7 100644 --- a/content/browser/web_contents/web_contents_impl.cc +++ b/content/browser/web_contents/web_contents_impl.cc -@@ -1780,8 +1780,9 @@ void WebContentsImpl::Init(const WebContents::CreateParams& params) { +@@ -1872,8 +1872,9 @@ void WebContentsImpl::Init(const WebContents::CreateParams& params) { // This is set before initializing the render manager since // RenderFrameHostManager::Init calls back into us via its delegate to ask if // it should be hidden. @@ -1906,9 +1839,9 @@ index ec663126dca2247cd9c04a13b06ba530febe52d2..6da03ddce2930dc0a06bbd310b01dc79 + // params.initially_hidden ? Visibility::HIDDEN : Visibility::VISIBLE; + visibility_ = Visibility::VISIBLE; - // The routing ids must either all be set or all be unset. - DCHECK((params.routing_id == MSG_ROUTING_NONE && -@@ -2387,7 +2388,8 @@ void WebContentsImpl::CreateNewWindow( + if (!params.last_active_time.is_null()) + last_active_time_ = params.last_active_time; +@@ -2554,7 +2555,8 @@ void WebContentsImpl::CreateNewWindow( DCHECK(!params.opener_suppressed || render_view_route_id == MSG_ROUTING_NONE); scoped_refptr site_instance = @@ -1987,10 +1920,10 @@ index 27c25d3d25e18d9591b6ffd770fcd11875b231f7..01d2b4c88bf1c6f25441f7cd219e56df title += " "; title += label; // makes attaching to process easier diff --git a/content/common/dom_storage/dom_storage_map.cc b/content/common/dom_storage/dom_storage_map.cc -index 0a6b0176a982782fd1472f607f811dd6c183c3fe..052ca73677cad3b10b494bf2ab823a046dd0b080 100644 +index fd088fb170bead6452ded14016f21f0c29659e03..2d51cbc6c9b58263a345b7d641f8d89e7e292523 100644 --- a/content/common/dom_storage/dom_storage_map.cc +++ b/content/common/dom_storage/dom_storage_map.cc -@@ -184,8 +184,8 @@ bool DOMStorageMap::SetItemInternal(MapType* map_type, +@@ -187,8 +187,8 @@ bool DOMStorageMap::SetItemInternal(MapType* map_type, // Only check quota if the size is increasing, this allows // shrinking changes to pre-existing files that are over budget. @@ -2028,7 +1961,7 @@ index 0f2bbdcf4b2b25f938fde6c8433390f6adc1d384..45fc9e5353dcdaa2b368e62981f0597f // Tells the view to speak the currently selected text. virtual void SpeakSelection() = 0; diff --git a/content/renderer/browser_plugin/browser_plugin.cc b/content/renderer/browser_plugin/browser_plugin.cc -index d64895137a73fe0bccc29e8081e0a16c4657a86f..58befaf094e95827a5126e0abfa55d30a9e13340 100644 +index 1651db088d0c510313c8f569c56fc236d2cc635e..c68b252a58de26d920c912497fa0ffe04d9fb274 100644 --- a/content/renderer/browser_plugin/browser_plugin.cc +++ b/content/renderer/browser_plugin/browser_plugin.cc @@ -105,6 +105,7 @@ BrowserPlugin::BrowserPlugin( @@ -2053,7 +1986,7 @@ index d64895137a73fe0bccc29e8081e0a16c4657a86f..58befaf094e95827a5126e0abfa55d30 BrowserPluginManager::Get()->Send( new BrowserPluginHostMsg_Detach(browser_plugin_instance_id_)); -@@ -654,8 +660,6 @@ blink::WebInputEventResult BrowserPlugin::HandleInputEvent( +@@ -659,8 +665,6 @@ blink::WebInputEventResult BrowserPlugin::HandleInputEvent( if (blink::WebInputEvent::IsGestureEventType(event.GetType())) { auto gesture_event = static_cast(event); @@ -2063,17 +1996,18 @@ index d64895137a73fe0bccc29e8081e0a16c4657a86f..58befaf094e95827a5126e0abfa55d30 // We shouldn't be forwarding GestureEvents to the Guest anymore. Indicate // we handled this only if it's a non-resent event. diff --git a/device/geolocation/BUILD.gn b/device/geolocation/BUILD.gn -index a69729c616a6359bfaa41a9bb97069578bbd8702..49a80e4fe931c772a80bddebe823a3f364e9152a 100644 +index 924390705c3f95b55183e3fde5bc40a2c48cd60a..093a9c379177bf347f17134da3162a340fc4665a 100644 --- a/device/geolocation/BUILD.gn +++ b/device/geolocation/BUILD.gn -@@ -11,6 +11,7 @@ if (is_android) { +@@ -10,6 +10,8 @@ if (is_android) { + } - component("geolocation") { - defines = [ "DEVICE_GEOLOCATION_IMPLEMENTATION" ] + source_set("geolocation") { + configs += [ "//electron/build/geolocation" ] - ++ sources = [ "empty_wifi_data_provider.cc", + "empty_wifi_data_provider.h", diff --git a/device/geolocation/network_location_request.cc b/device/geolocation/network_location_request.cc index a9a739e4f9a707faaf195f0747b560197b97a1be..2c34b71205886e239151ba56e5c8f7f878c9d611 100644 --- a/device/geolocation/network_location_request.cc @@ -2092,7 +2026,7 @@ index a9a739e4f9a707faaf195f0747b560197b97a1be..2c34b71205886e239151ba56e5c8f7f8 const char kLocationString[] = "location"; const char kLatitudeString[] = "lat"; diff --git a/extensions/browser/BUILD.gn b/extensions/browser/BUILD.gn -index 40b145b62c4ec608197883e4b9a215dcf1a578ee..7d7dfc7166b57a0f60f40c53517e12c611e2a138 100644 +index f293adbf7c3b5b70815f67df89b8813c75430c30..a4ca01157a9235cca2f72d40fd454023af8b4848 100644 --- a/extensions/browser/BUILD.gn +++ b/extensions/browser/BUILD.gn @@ -329,8 +329,8 @@ jumbo_source_set("browser_sources") { @@ -2138,7 +2072,7 @@ index ffa79cf2918bc0c651448cb27bebcb780f9c4e6c..5f78f790bccf27fc2349d95324cf1a4f content::WebContents* owner = guest->owner_web_contents(); if (!owner) diff --git a/extensions/browser/guest_view/web_view/web_view_guest.cc b/extensions/browser/guest_view/web_view/web_view_guest.cc -index 8611c34be99326fa50f7cc0469dd02051399231b..67f768723be251820f6680feb243e8c8289d3450 100644 +index 716f3f074a4e38958368649a1e51afde6a352c42..ce200abedc23bba890193dd09235252f4b1a1f62 100644 --- a/extensions/browser/guest_view/web_view/web_view_guest.cc +++ b/extensions/browser/guest_view/web_view/web_view_guest.cc @@ -306,7 +306,7 @@ std::string WebViewGuest::GetPartitionID( @@ -2151,10 +2085,10 @@ index 8611c34be99326fa50f7cc0469dd02051399231b..67f768723be251820f6680feb243e8c8 // static int WebViewGuest::GetOrGenerateRulesRegistryID( diff --git a/extensions/common/BUILD.gn b/extensions/common/BUILD.gn -index cb4a7414da8542af079dff51be69c5a837f0f4d4..2371bab4b987edfa682fed920aebd25ffab8dcdb 100644 +index 942eba27819370a546abb83e1ff10139b5e3228d..5747158eea01b3e3824b6a14f6d8e79752fb4676 100644 --- a/extensions/common/BUILD.gn +++ b/extensions/common/BUILD.gn -@@ -313,6 +313,7 @@ if (enable_extensions) { +@@ -317,6 +317,7 @@ if (enable_extensions) { "//components/url_formatter", "//components/url_matcher", "//components/version_info", @@ -2163,7 +2097,7 @@ index cb4a7414da8542af079dff51be69c5a837f0f4d4..2371bab4b987edfa682fed920aebd25f "//device/bluetooth", "//device/usb", diff --git a/extensions/common/api/_api_features.json b/extensions/common/api/_api_features.json -index 702788438797608165c3ee7c5f8ac1d5574d2698..718445ad38a6d74d20ca5ef50da693c9ff8cbb32 100644 +index 245e68cca9cf1434aa732fef10bf6b1e3b9f79a3..a4da9e48a596f7645601c6d7e05617b1dfba1813 100644 --- a/extensions/common/api/_api_features.json +++ b/extensions/common/api/_api_features.json @@ -193,7 +193,10 @@ @@ -2178,7 +2112,7 @@ index 702788438797608165c3ee7c5f8ac1d5574d2698..718445ad38a6d74d20ca5ef50da693c9 }, { "internal": true, "channel": "stable", -@@ -561,6 +564,7 @@ +@@ -565,6 +568,7 @@ "internal": true, "contexts": ["webui"], "matches": [ @@ -2186,7 +2120,7 @@ index 702788438797608165c3ee7c5f8ac1d5574d2698..718445ad38a6d74d20ca5ef50da693c9 "chrome://chrome-signin/*", "chrome://home/*", "chrome://media-router/*", -@@ -585,6 +589,14 @@ +@@ -589,6 +593,14 @@ "chrome://oobe/*", "chrome://assistant-optin/*" ] @@ -2201,7 +2135,7 @@ index 702788438797608165c3ee7c5f8ac1d5574d2698..718445ad38a6d74d20ca5ef50da693c9 }], "webViewRequest": [{ "dependencies": ["permission:webview"], -@@ -593,6 +605,7 @@ +@@ -597,6 +609,7 @@ "channel": "stable", "contexts": ["webui"], "matches": [ @@ -2253,10 +2187,10 @@ index d985c0df7a9cb9543003ac32751f3fc80633248a..02bd6daf7e48de8345ce3be506e02110 proto.attachedCallback = function() { diff --git a/media/base/media_switches.cc b/media/base/media_switches.cc -index 8fda8274d5dfe61e8d7e6bec9eb24719adb69e3a..a17609ac5f5dcc175d0abb758ac9729a2cb33f6a 100644 +index d8505dbe1427ce17bf02640ea39e4dbf9c3387a0..82ae6153c02f5cd6ba0bf905111b87330fd1974d 100644 --- a/media/base/media_switches.cc +++ b/media/base/media_switches.cc -@@ -378,7 +378,7 @@ std::string GetEffectiveAutoplayPolicy(const base::CommandLine& command_line) { +@@ -405,7 +405,7 @@ std::string GetEffectiveAutoplayPolicy(const base::CommandLine& command_line) { return switches::autoplay::kDocumentUserActivationRequiredPolicy; // The default value is platform dependent. @@ -2265,23 +2199,11 @@ index 8fda8274d5dfe61e8d7e6bec9eb24719adb69e3a..a17609ac5f5dcc175d0abb758ac9729a return switches::autoplay::kUserGestureRequiredPolicy; #else return switches::autoplay::kNoUserGestureRequiredPolicy; -diff --git a/mojo/public/cpp/platform/named_platform_channel_win.cc b/mojo/public/cpp/platform/named_platform_channel_win.cc -index 0507efe5abb5193f653a7631b5025cb9358c23f0..9c329bd6d81baa962f16f32e226f0221f712e7c1 100644 ---- a/mojo/public/cpp/platform/named_platform_channel_win.cc -+++ b/mojo/public/cpp/platform/named_platform_channel_win.cc -@@ -5,6 +5,7 @@ - #include "mojo/public/cpp/platform/named_platform_channel.h" - - #include -+#include - - // NOTE: This needs to be included *after* windows.h. - #include diff --git a/net/BUILD.gn b/net/BUILD.gn -index 9d59189d80aea8f99b73020f36a578a96667af37..30b01577e5f01ba1d6f33a14c811363d3b0eea2c 100644 +index 80ba467c4f8cb7a3442de92a307285a94b10c694..270379a30a01dffdf2ed0882389abb927bab4ac3 100644 --- a/net/BUILD.gn +++ b/net/BUILD.gn -@@ -355,6 +355,10 @@ component("net") { +@@ -367,6 +367,10 @@ component("net") { "ssl/token_binding.h", "third_party/quic/core/quic_error_codes.cc", "third_party/quic/core/quic_error_codes.h", @@ -2423,10 +2345,10 @@ index e26c7d78b7d379dd010ba6ac6afdf494ecd5c563..3e827a41f18577b1f1f4f9744cfab83f } diff --git a/net/http/transport_security_state.cc b/net/http/transport_security_state.cc -index 5177ef21fdfe0ca4e01bc7551f081380bcaa98ee..82fa14fbd64344dcaf1952b22ac3f558e2e6f613 100644 +index cd6128c229248675c2b22224f306d0d8df5740dd..cf90a3f065eb57fb4c85724a656afb4eeacdff6f 100644 --- a/net/http/transport_security_state.cc +++ b/net/http/transport_security_state.cc -@@ -761,6 +761,10 @@ TransportSecurityState::TransportSecurityState() +@@ -508,6 +508,10 @@ TransportSecurityState::TransportSecurityState() enable_static_pins_ = false; enable_static_expect_ct_ = false; #endif @@ -2438,10 +2360,10 @@ index 5177ef21fdfe0ca4e01bc7551f081380bcaa98ee..82fa14fbd64344dcaf1952b22ac3f558 } diff --git a/net/log/net_log_event_type_list.h b/net/log/net_log_event_type_list.h -index 79f3590df116ba98f0778a5a3f523d311952d86c..d700eb8572eba2361dee83fe0d097d0df2043a3e 100644 +index 949de470e2919a25a5a53a963cd61052847e2329..3853d5904b7c561e0d0aee7f9ff0fcfc29afb77c 100644 --- a/net/log/net_log_event_type_list.h +++ b/net/log/net_log_event_type_list.h -@@ -2113,6 +2113,12 @@ EVENT_TYPE(SOCKS5_GREET_WRITE) +@@ -2121,6 +2121,12 @@ EVENT_TYPE(SOCKS5_GREET_WRITE) // The time spent waiting for the "greeting" response from the SOCKS server. EVENT_TYPE(SOCKS5_GREET_READ) @@ -2598,31 +2520,31 @@ index 2dad2733466a194da7898919604ebf4dcb463d74..30cb9d1955a034d2a6bcec97a2a28658 socket_.reset(new SOCKSClientSocket( std::move(transport_socket_handle_), socks_params_->destination(), diff --git a/net/url_request/url_request_job.h b/net/url_request/url_request_job.h -index 389315a25d7da30d71b59e3803ab795bc4c18e1c..79797fe7e674f9f6d2a65de542f262a945454f16 100644 +index cad145dad56c3d2512b2d03d78a12a9e3a35c9d0..8239098264ff4dee5b8b031def94c492028b4f31 100644 --- a/net/url_request/url_request_job.h +++ b/net/url_request/url_request_job.h -@@ -285,6 +285,7 @@ class NET_EXPORT URLRequestJob : public base::PowerObserver { - void OnCallToDelegate(); +@@ -291,6 +291,7 @@ class NET_EXPORT URLRequestJob : public base::PowerObserver { + void OnCallToDelegate(NetLogEventType type); void OnCallToDelegateComplete(); -+public: ++ public: // Called to read raw (pre-filtered) data from this Job. Reads at most // |buf_size| bytes into |buf|. // Possible return values: diff --git a/services/service_manager/sandbox/win/sandbox_win.cc b/services/service_manager/sandbox/win/sandbox_win.cc -index 197090f0f5001a23798ce08a6cba6332f100c720..08695457c8b4dc074d1e964a99e2447929b2a05e 100644 +index 31edb20931f11bcff578eede005b8c44b3fa5700..7c0877140c2712fad4fc2ca359f790ad4233afaf 100644 --- a/services/service_manager/sandbox/win/sandbox_win.cc +++ b/services/service_manager/sandbox/win/sandbox_win.cc -@@ -827,6 +827,9 @@ sandbox::ResultCode SandboxWin::StartSandboxedProcess( +@@ -830,6 +830,9 @@ sandbox::ResultCode SandboxWin::StartSandboxedProcess( service_manager::switches::kNoSandbox)) { base::LaunchOptions options; options.handles_to_inherit = handles_to_inherit; +#if !defined(MUON_CHROMIUM_BUILD) + options.start_hidden = true; +#endif - *process = base::LaunchProcess(*cmd_line, options); - return sandbox::SBOX_ALL_OK; - } + if (sandbox_type == SANDBOX_TYPE_NETWORK) { + // Launch the process in a job to ensure that the network process doesn't + // outlive the browser. This could happen if there is a lot of I/O on diff --git a/third_party/blink/renderer/core/editing/editing_behavior.h b/third_party/blink/renderer/core/editing/editing_behavior.h index 90f13baf5daa216c0832b39137ba87f60aa2ccd2..643caf4e6825e3da6678af6a1a981c42d2bb782b 100644 --- a/third_party/blink/renderer/core/editing/editing_behavior.h @@ -2637,10 +2559,10 @@ index 90f13baf5daa216c0832b39137ba87f60aa2ccd2..643caf4e6825e3da6678af6a1a981c42 bool ShouldSelectReplacement() const { diff --git a/third_party/blink/renderer/core/exported/web_view_impl.cc b/third_party/blink/renderer/core/exported/web_view_impl.cc -index 80ba4c18ebc9811a8f6ac6dc706ceef6404ebb5f..86625911824f3b40c300f18db7d9bf1928981183 100644 +index b5c2685603c6db968436d8c8399325dd9495ba36..69d3aaac0cee0bff4649546aacc054a2eaa6a552 100644 --- a/third_party/blink/renderer/core/exported/web_view_impl.cc +++ b/third_party/blink/renderer/core/exported/web_view_impl.cc -@@ -3196,6 +3196,7 @@ void WebViewImpl::DidCloseContextMenu() { +@@ -3116,6 +3116,7 @@ void WebViewImpl::DidCloseContextMenu() { LocalFrame* frame = page_->GetFocusController().FocusedFrame(); if (frame) frame->Selection().SetCaretBlinkingSuspended(false); @@ -2649,10 +2571,10 @@ index 80ba4c18ebc9811a8f6ac6dc706ceef6404ebb5f..86625911824f3b40c300f18db7d9bf19 void WebViewImpl::HidePopups() { diff --git a/third_party/blink/renderer/core/html/media/autoplay_policy.cc b/third_party/blink/renderer/core/html/media/autoplay_policy.cc -index 2b382dc0094ab2a21c3f46f4ecabbb9acb6e89b8..47c995d35672a69168712b05204d75633af4789d 100644 +index b6d8c82aa42a39cfab90fd8814906413761396c6..fa75d18084e01a86c02521727807dd117f903deb 100644 --- a/third_party/blink/renderer/core/html/media/autoplay_policy.cc +++ b/third_party/blink/renderer/core/html/media/autoplay_policy.cc -@@ -341,6 +341,12 @@ bool AutoplayPolicy::IsGestureNeededForPlaybackIfPendingUserGestureIsLocked() +@@ -343,6 +343,12 @@ bool AutoplayPolicy::IsGestureNeededForPlaybackIfPendingUserGestureIsLocked() if (element_->GetLoadType() == WebMediaPlayer::kLoadTypeMediaStream) return false; @@ -2665,7 +2587,7 @@ index 2b382dc0094ab2a21c3f46f4ecabbb9acb6e89b8..47c995d35672a69168712b05204d7563 // We want to allow muted video to autoplay if: // - the flag is enabled; // - Data Saver is not enabled; -@@ -360,6 +366,12 @@ bool AutoplayPolicy::IsGestureNeededForPlaybackIfPendingUserGestureIsLocked() +@@ -362,6 +368,12 @@ bool AutoplayPolicy::IsGestureNeededForPlaybackIfPendingUserGestureIsLocked() IsAutoplayAllowedPerSettings()) { return false; } @@ -2724,10 +2646,10 @@ index 5d115f0cc12f124d57df088b6b1add05e47e7b68..af49abf95e2268fdcc49cc60d988772b MHTMLArchive* Archive() const override; diff --git a/third_party/blink/renderer/platform/bindings/v8_per_isolate_data.cc b/third_party/blink/renderer/platform/bindings/v8_per_isolate_data.cc -index 108efb6d07e77b43494788d0dbe2647cb8038f1c..62b5fbca4822328343ef1c14b040ec1af7baf8b8 100644 +index 4096a64a8683cf759092ca44c4e1ce84b3e1535c..e65c46f609c96228d943e5cb93de6863cebc651a 100644 --- a/third_party/blink/renderer/platform/bindings/v8_per_isolate_data.cc +++ b/third_party/blink/renderer/platform/bindings/v8_per_isolate_data.cc -@@ -49,7 +49,8 @@ v8::Isolate* MainThreadIsolate() { +@@ -50,7 +50,8 @@ v8::Isolate* MainThreadIsolate() { static V8PerIsolateData* g_main_thread_per_isolate_data = nullptr; static void BeforeCallEnteredCallback(v8::Isolate* isolate) { @@ -2780,7 +2702,7 @@ index d31a9f29fa9c12e753708b2a1e75c33b70924300..4977f3268d04c2d3fd23c93e361a7f29 # Windows' assembly is built with Yasm. The other platforms use the platform diff --git a/third_party/crashpad/crashpad/handler/crash_report_upload_thread.cc b/third_party/crashpad/crashpad/handler/crash_report_upload_thread.cc -index 715c533a2756506cc3151739fe458efd2dc5323d..30608c6852d0845566f2a05d620f6c86a5560161 100644 +index 4783ecb252b11a56550d4a6f684bd15c89fc4eb7..9ffdb7c00af09accc1883c525332271faebd5241 100644 --- a/third_party/crashpad/crashpad/handler/crash_report_upload_thread.cc +++ b/third_party/crashpad/crashpad/handler/crash_report_upload_thread.cc @@ -170,7 +170,11 @@ void CrashReportUploadThread::ProcessPendingReport( @@ -2796,10 +2718,10 @@ index 715c533a2756506cc3151739fe458efd2dc5323d..30608c6852d0845566f2a05d620f6c86 database_->SkipReportUpload( report.uuid, Metrics::CrashSkippedReason::kUploadThrottled); diff --git a/ui/views/controls/menu/menu_controller.cc b/ui/views/controls/menu/menu_controller.cc -index 00590f09d91f0f2b5226ba5e59d866cc47fb347e..fe3790e6cd3329c8eab8651592188eccc77dec98 100644 +index 7db3c69b1a3b7d57eb12f13f96dda38a5a635fee..3ae5151eaabc7522f70f0887b6b2825b944258ba 100644 --- a/ui/views/controls/menu/menu_controller.cc +++ b/ui/views/controls/menu/menu_controller.cc -@@ -619,6 +619,7 @@ bool MenuController::OnMouseDragged(SubmenuView* source, +@@ -620,6 +620,7 @@ bool MenuController::OnMouseDragged(SubmenuView* source, return true; } MenuItemView* mouse_menu = NULL; @@ -2807,7 +2729,7 @@ index 00590f09d91f0f2b5226ba5e59d866cc47fb347e..fe3790e6cd3329c8eab8651592188ecc if (part.type == MenuPart::MENU_ITEM) { // If there is no menu target, but a submenu target, then we are interacting // with an empty menu item within a submenu. These cannot become selection -@@ -643,7 +644,10 @@ bool MenuController::OnMouseDragged(SubmenuView* source, +@@ -644,7 +645,10 @@ bool MenuController::OnMouseDragged(SubmenuView* source, } } } diff --git a/patches/third_party/boringssl/src/boringssl.patch b/patches/third_party/boringssl/src/boringssl.patch index cbc9347bf5..1267f4354e 100644 --- a/patches/third_party/boringssl/src/boringssl.patch +++ b/patches/third_party/boringssl/src/boringssl.patch @@ -1,5 +1,5 @@ diff --git a/crypto/cipher_extra/cipher_extra.c b/crypto/cipher_extra/cipher_extra.c -index e770489e947ecbf3154bb680cf043c9b8dc6159d..04c2c57d412eda4cfa82db8323c188d364761528 100644 +index 2b88fb6c10644b6932b8ebb76a4e53132d49fad6..0ceb2c5aecc48d293f0203bf72fc99ce7ae5d2f2 100644 --- a/crypto/cipher_extra/cipher_extra.c +++ b/crypto/cipher_extra/cipher_extra.c @@ -83,6 +83,8 @@ const EVP_CIPHER *EVP_get_cipherbynid(int nid) { @@ -136,7 +136,7 @@ index 275d439768b7d75219fce86392ac28c3fa3747fd..60bbeb998809212a43a65ea0bbe2a537 if (!RIPEMD160_Init(&ctx)) { diff --git a/include/openssl/digest.h b/include/openssl/digest.h -index 81f58925e22502b0279b497a53b6a0c6bd47d13c..86c92441aaf32e9fe99508240ff86c5d505b1f07 100644 +index 4077d902a07c215659ed61b54a468231536d70ee..6a2d78b6b8da43958c80068527756b55b8928882 100644 --- a/include/openssl/digest.h +++ b/include/openssl/digest.h @@ -83,6 +83,7 @@ OPENSSL_EXPORT const EVP_MD *EVP_sha224(void); @@ -165,10 +165,10 @@ index afeb2dea4e0464082fa72fd1404f9321eb656dec..2c3c842cb4a21e937993132f7a7cfbae #define LN_ripemd160WithRSA "ripemd160WithRSA" #define NID_ripemd160WithRSA 119 diff --git a/include/openssl/ssl.h b/include/openssl/ssl.h -index 9544bbebe846abb1efe9bea4aaabd4d301b38bea..e3d9133f6dfb5ad3236284f7edfcefafde1a7ee8 100644 +index 2558732c5d8ec7b873dd2a82ca869bcfad1a4f8c..2fe9b19e5c4738ac0c00d3c651d65ede78b9f717 100644 --- a/include/openssl/ssl.h +++ b/include/openssl/ssl.h -@@ -4266,6 +4266,15 @@ OPENSSL_EXPORT int SSL_CTX_set_tlsext_status_cb(SSL_CTX *ctx, +@@ -4290,6 +4290,15 @@ OPENSSL_EXPORT int SSL_CTX_set_tlsext_status_cb(SSL_CTX *ctx, // |SSL_CTX_set_tlsext_status_cb|'s callback and returns one. OPENSSL_EXPORT int SSL_CTX_set_tlsext_status_arg(SSL_CTX *ctx, void *arg); @@ -182,13 +182,13 @@ index 9544bbebe846abb1efe9bea4aaabd4d301b38bea..e3d9133f6dfb5ad3236284f7edfcefaf + int id_len, int *out_copy)); +#endif - // Private structures. + // Nodejs compatibility section (hidden). // diff --git a/ssl/internal.h b/ssl/internal.h -index 28ea87b7261ce8d679b84520678d39f7b47c29b4..a84926a7f62e2e22cc76f18c83ddccaa9840c5eb 100644 +index 412c1fe71286b7df0ec66912f7dfd0945c623f09..e860499831ba91ae80ea6ea308fde12eb2eb1562 100644 --- a/ssl/internal.h +++ b/ssl/internal.h -@@ -2049,6 +2049,8 @@ struct SSLContext { +@@ -2080,6 +2080,8 @@ struct SSLContext { void (*remove_session_cb)(SSL_CTX *ctx, SSL_SESSION *sess); SSL_SESSION *(*get_session_cb)(SSL *ssl, const uint8_t *data, int len, int *copy); @@ -198,7 +198,7 @@ index 28ea87b7261ce8d679b84520678d39f7b47c29b4..a84926a7f62e2e22cc76f18c83ddccaa CRYPTO_refcount_t references; diff --git a/ssl/ssl_session.cc b/ssl/ssl_session.cc -index e31df68869c313770fb56a5e15fafd4b5839117d..332107d2b878d3df04350699383a7493baba3f36 100644 +index 5e8ffe0b5608c94b0cf09c441b2392c3334619d6..ddc176b703b51df3c3795c4c6c3d3b239c22778c 100644 --- a/ssl/ssl_session.cc +++ b/ssl/ssl_session.cc @@ -686,10 +686,17 @@ static enum ssl_hs_wait_t ssl_lookup_session( @@ -222,7 +222,7 @@ index e31df68869c313770fb56a5e15fafd4b5839117d..332107d2b878d3df04350699383a7493 if (!session) { return ssl_hs_ok; } -@@ -1244,6 +1251,12 @@ void SSL_CTX_sess_set_get_cb(SSL_CTX *ctx, +@@ -1265,6 +1272,12 @@ void SSL_CTX_sess_set_get_cb(SSL_CTX *ctx, ctx->get_session_cb = cb; } @@ -236,7 +236,7 @@ index e31df68869c313770fb56a5e15fafd4b5839117d..332107d2b878d3df04350699383a7493 const uint8_t *id, int id_len, diff --git a/util/BUILD.toplevel b/util/BUILD.toplevel -index 6e569ec82db970ba8f1004f811ff08cc59794005..905a293ad046e5653352ec59a278df3aa1cf2355 100644 +index 6691f7178c54dba334e014ff7e7ff4dc793f512f..18c53f79a9d2cbab67f80a99ed54c6c2d2a4486e 100644 --- a/util/BUILD.toplevel +++ b/util/BUILD.toplevel @@ -29,6 +29,7 @@ load( @@ -247,7 +247,7 @@ index 6e569ec82db970ba8f1004f811ff08cc59794005..905a293ad046e5653352ec59a278df3a ) config_setting( -@@ -145,6 +146,15 @@ cc_library( +@@ -146,6 +147,15 @@ cc_library( ], ) diff --git a/patches/v8/filter.patch b/patches/v8/filter.patch index 7fe66b1c9c..41703fe09c 100644 --- a/patches/v8/filter.patch +++ b/patches/v8/filter.patch @@ -1,24 +1,26 @@ diff --git a/BUILD.gn b/BUILD.gn -index 456a318c1c60527ae264cc3b8326cbd860dc5d2f..27291944c55c2b8ac343344419f759f8dbe2e55f 100644 +index 92277c2e52fccd844f0eca42515f1a27f58f7893..9ebfd30d4faddd1bda60cad3e0bd690c3b291ad5 100644 --- a/BUILD.gn +++ b/BUILD.gn -@@ -195,7 +195,13 @@ config("internal_config") { +@@ -208,9 +208,15 @@ config("internal_config") { "$target_gen_dir", ] -- if (is_component_build) { + if (is_win) { + cflags = [ + "/wd4275", # dll export + ] + } + + defines = [] + +- if (is_component_build) { + if (true) { - defines = [ "BUILDING_V8_SHARED" ] + defines += [ "BUILDING_V8_SHARED" ] } } diff --git a/src/profiler/profiler-listener.cc b/src/profiler/profiler-listener.cc -index 70d907b21659702e2543c6a18f7b855d112d786f..8a1d417e1eaa7a7d831a86403ceb37792a10dde6 100644 +index 51327685059037f2b0614feaafc75aef81512bca..67f6f30275ee8bfd7ca463830b0c13b5c75bb2d7 100644 --- a/src/profiler/profiler-listener.cc +++ b/src/profiler/profiler-listener.cc @@ -98,7 +98,7 @@ void ProfilerListener::CodeCreateEvent(CodeEventListener::LogEventsAndTags tag, From 9828071ef5add11ea565f9c0e8d4967f94c3c076 Mon Sep 17 00:00:00 2001 From: Henrique Ferreiro Date: Wed, 4 Jul 2018 14:17:04 +0200 Subject: [PATCH 002/138] Rename //net:net_browser_services to //net/dns:mojo_service https://crrev.com/24feb5bfd766 --- chromium_src/BUILD.gn | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/chromium_src/BUILD.gn b/chromium_src/BUILD.gn index d06145394f..d10b5e2afe 100644 --- a/chromium_src/BUILD.gn +++ b/chromium_src/BUILD.gn @@ -445,7 +445,7 @@ source_set("browser") { deps += [ "//base", "//net:extras", - "//net:net_browser_services", + "//net/dns:mojo_service", "//skia", "//ui/base", "//ui/events", From c5188ecf8530b11b7ebea1594dd6ccd875b312c7 Mon Sep 17 00:00:00 2001 From: Henrique Ferreiro Date: Thu, 5 Jul 2018 10:59:38 +0200 Subject: [PATCH 003/138] TODO: Use net::CompletionOnceCallback in place of net::CompletionCallback http://crbug.com/807724 --- atom/browser/api/atom_api_session.cc | 22 ++++--- atom/browser/atom_browser_context.cc | 3 +- .../atom_extensions_browser_client.cc | 4 +- .../atom_extensions_network_delegate.cc | 65 +++++++++---------- .../atom_extensions_network_delegate.h | 11 ++-- atom/browser/net/atom_cert_verifier.cc | 21 +++--- atom/browser/net/atom_cert_verifier.h | 11 ++-- atom/browser/net/atom_network_delegate.cc | 27 ++++---- atom/browser/net/atom_network_delegate.h | 11 ++-- atom/browser/net/url_request_fetch_job.h | 1 + .../browser/net/tor_proxy_network_delegate.cc | 17 +++-- .../browser/net/tor_proxy_network_delegate.h | 5 +- vendor/brightray/browser/network_delegate.cc | 8 +-- vendor/brightray/browser/network_delegate.h | 9 +-- 14 files changed, 112 insertions(+), 103 deletions(-) diff --git a/atom/browser/api/atom_api_session.cc b/atom/browser/api/atom_api_session.cc index 9711c7489c..54e9207600 100644 --- a/atom/browser/api/atom_api_session.cc +++ b/atom/browser/api/atom_api_session.cc @@ -309,10 +309,10 @@ void DoCacheActionInIO( void SetCertVerifyProcInIO( const scoped_refptr& context_getter, - const AtomCertVerifier::VerifyProc& proc) { + AtomCertVerifier::VerifyProc proc) { auto request_context = context_getter->GetURLRequestContext(); static_cast(request_context->cert_verifier())-> - SetVerifyProc(proc); + SetVerifyProc(std::move(proc)); } void ClearHostResolverCacheInIO( @@ -492,15 +492,17 @@ void Session::SetDownloadPath(const base::FilePath& path) { void Session::SetCertVerifyProc(v8::Local val, mate::Arguments* args) { AtomCertVerifier::VerifyProc proc; - if (!(val->IsNull() || mate::ConvertFromV8(args->isolate(), val, &proc))) { - args->ThrowError("Must pass null or function"); - return; - } + // TODO(hferreiro) + // if (!(val->IsNull() || + // mate::ConvertFromV8(args->isolate(), val, std::move(proc)))) { + // args->ThrowError("Must pass null or function"); + // return; + //} - BrowserThread::PostTask(BrowserThread::IO, FROM_HERE, - base::Bind(&SetCertVerifyProcInIO, - request_context_getter_, - proc)); + BrowserThread::PostTask( + BrowserThread::IO, FROM_HERE, + base::BindOnce(&SetCertVerifyProcInIO, request_context_getter_, + std::move(proc))); } void Session::SetPermissionRequestHandler(v8::Local val, diff --git a/atom/browser/atom_browser_context.cc b/atom/browser/atom_browser_context.cc index 5ac4240846..02851d4cff 100644 --- a/atom/browser/atom_browser_context.cc +++ b/atom/browser/atom_browser_context.cc @@ -30,6 +30,7 @@ #include "components/prefs/pref_registry_simple.h" #include "content/public/browser/browser_thread.h" #include "content/public/common/url_constants.h" +#include "net/base/completion_once_callback.h" #include "net/ftp/ftp_network_layer.h" #include "net/net_buildflags.h" #include "net/url_request/data_protocol_handler.h" @@ -50,7 +51,7 @@ namespace { class NoCacheBackend : public net::HttpCache::BackendFactory { int CreateBackend(net::NetLog* net_log, std::unique_ptr* backend, - const net::CompletionCallback& callback) override { + net::CompletionOnceCallback callback) override { return net::ERR_FAILED; } }; diff --git a/atom/browser/extensions/atom_extensions_browser_client.cc b/atom/browser/extensions/atom_extensions_browser_client.cc index a1d3b91077..867bb13a04 100644 --- a/atom/browser/extensions/atom_extensions_browser_client.cc +++ b/atom/browser/extensions/atom_extensions_browser_client.cc @@ -178,7 +178,7 @@ class URLRequestResourceBundleJob : public net::URLRequestSimpleJob { std::string* charset, scoped_refptr data, std::string* read_mime_type, - const net::CompletionCallback& callback, + net::CompletionOnceCallback callback, bool read_result) { *out_mime_type = *read_mime_type; if (base::StartsWith(*read_mime_type, "text/", @@ -190,7 +190,7 @@ class URLRequestResourceBundleJob : public net::URLRequestSimpleJob { *charset = "utf-8"; } int result = read_result ? net::OK : net::ERR_INVALID_URL; - callback.Run(result); + std::move(callback).Run(result); } // We need the filename of the resource to determine the mime type. diff --git a/atom/browser/extensions/atom_extensions_network_delegate.cc b/atom/browser/extensions/atom_extensions_network_delegate.cc index 49edb15df8..c298599771 100644 --- a/atom/browser/extensions/atom_extensions_network_delegate.cc +++ b/atom/browser/extensions/atom_extensions_network_delegate.cc @@ -4,6 +4,8 @@ #include "atom/browser/extensions/atom_extensions_network_delegate.h" +#include + #include "base/stl_util.h" #include "chrome/browser/extensions/event_router_forwarder.h" #include "chrome/browser/net/chrome_extensions_network_delegate.h" @@ -48,11 +50,11 @@ void AtomExtensionsNetworkDelegate::RunCallback( if (result != net::ERR_IO_PENDING) { // nothing ran the original callback - callbacks_[request_id].Run(net::OK); + std::move(callbacks_[request_id]).Run(net::OK); } } else { // nothing ran the original callback - callbacks_[request_id].Run(previous_result); + std::move(callbacks_[request_id]).Run(previous_result); } // make sure this don't run again @@ -63,16 +65,16 @@ int AtomExtensionsNetworkDelegate::OnBeforeURLRequestInternal( net::URLRequest* request, GURL* new_url) { return atom::AtomNetworkDelegate::OnBeforeURLRequest( - request, callbacks_[request->identifier()], new_url); + request, std::move(callbacks_[request->identifier()]), new_url); } int AtomExtensionsNetworkDelegate::OnBeforeURLRequest( net::URLRequest* request, - const net::CompletionCallback& callback, + net::CompletionOnceCallback callback, GURL* new_url) { extensions_delegate_->ForwardStartRequestStatus(request); - callbacks_[request->identifier()] = callback; + callbacks_[request->identifier()] = std::move(callback); base::Callback internal_callback = base::Bind( &AtomExtensionsNetworkDelegate::OnBeforeURLRequestInternal, @@ -85,8 +87,8 @@ int AtomExtensionsNetworkDelegate::OnBeforeURLRequest( internal_callback, request->identifier()); - int result = extensions_delegate_->OnBeforeURLRequest( - request, wrapped_cb, new_url); + int result = extensions_delegate_->NotifyBeforeURLRequest( + request, std::move(wrapped_cb), new_url); if (result == net::OK) return internal_callback.Run(); @@ -99,16 +101,16 @@ int AtomExtensionsNetworkDelegate::OnBeforeStartTransactionInternal( net::HttpRequestHeaders* headers) { return atom::AtomNetworkDelegate::OnBeforeStartTransaction( request, - callbacks_[request->identifier()], + std::move(callbacks_[request->identifier()]), headers); } int AtomExtensionsNetworkDelegate::OnBeforeStartTransaction( net::URLRequest* request, - const net::CompletionCallback& callback, + net::CompletionOnceCallback callback, net::HttpRequestHeaders* headers) { - callbacks_[request->identifier()] = callback; + callbacks_[request->identifier()] = std::move(callback); base::Callback internal_callback = base::Bind( &AtomExtensionsNetworkDelegate::OnBeforeStartTransactionInternal, @@ -121,8 +123,8 @@ int AtomExtensionsNetworkDelegate::OnBeforeStartTransaction( internal_callback, request->identifier()); - int result = extensions_delegate_->OnBeforeStartTransaction( - request, wrapped_cb, headers); + int result = extensions_delegate_->NotifyBeforeStartTransaction( + request, std::move(callback), headers); if (result == net::ERR_IO_PENDING) return result; @@ -134,7 +136,7 @@ void AtomExtensionsNetworkDelegate::OnStartTransaction( net::URLRequest* request, const net::HttpRequestHeaders& headers) { atom::AtomNetworkDelegate::OnStartTransaction(request, headers); - extensions_delegate_->OnStartTransaction(request, headers); + extensions_delegate_->NotifyStartTransaction(request, headers); } int AtomExtensionsNetworkDelegate::OnHeadersReceivedInternal( @@ -143,21 +145,19 @@ int AtomExtensionsNetworkDelegate::OnHeadersReceivedInternal( scoped_refptr* override_response_headers, GURL* allowed_unsafe_redirect_url) { return atom::AtomNetworkDelegate::OnHeadersReceived( - request, - callbacks_[request->identifier()], - original_response_headers, - override_response_headers, - allowed_unsafe_redirect_url); + request, std::move(callbacks_[request->identifier()]), + original_response_headers, override_response_headers, + allowed_unsafe_redirect_url); } int AtomExtensionsNetworkDelegate::OnHeadersReceived( net::URLRequest* request, - const net::CompletionCallback& callback, + net::CompletionOnceCallback callback, const net::HttpResponseHeaders* original_response_headers, scoped_refptr* override_response_headers, GURL* allowed_unsafe_redirect_url) { - callbacks_[request->identifier()] = callback; + callbacks_[request->identifier()] = std::move(callback); base::Callback internal_callback = base::Bind(&AtomExtensionsNetworkDelegate::OnHeadersReceivedInternal, @@ -172,12 +172,9 @@ int AtomExtensionsNetworkDelegate::OnHeadersReceived( internal_callback, request->identifier()); - int result = extensions_delegate_->OnHeadersReceived( - request, - wrapped_cb, - original_response_headers, - override_response_headers, - allowed_unsafe_redirect_url); + int result = extensions_delegate_->NotifyHeadersReceived( + request, std::move(wrapped_cb), original_response_headers, + override_response_headers, allowed_unsafe_redirect_url); if (result == net::OK) return internal_callback.Run(); @@ -189,14 +186,14 @@ void AtomExtensionsNetworkDelegate::OnBeforeRedirect( net::URLRequest* request, const GURL& new_location) { atom::AtomNetworkDelegate::OnBeforeRedirect(request, new_location); - extensions_delegate_->OnBeforeRedirect(request, new_location); + extensions_delegate_->NotifyBeforeRedirect(request, new_location); } void AtomExtensionsNetworkDelegate::OnResponseStarted( net::URLRequest* request, int net_error) { atom::AtomNetworkDelegate::OnResponseStarted(request, net_error); - extensions_delegate_->OnResponseStarted(request, net_error); + extensions_delegate_->NotifyResponseStarted(request, net_error); } void AtomExtensionsNetworkDelegate::OnCompleted( @@ -206,7 +203,7 @@ void AtomExtensionsNetworkDelegate::OnCompleted( callbacks_.erase(request->identifier()); atom::AtomNetworkDelegate::OnCompleted(request, started, net_error); - extensions_delegate_->OnCompleted(request, started, net_error); + extensions_delegate_->NotifyCompleted(request, started, net_error); extensions_delegate_->ForwardProxyErrors(request, net_error); extensions_delegate_->ForwardDoneRequestStatus(request); } @@ -215,23 +212,23 @@ void AtomExtensionsNetworkDelegate::OnURLRequestDestroyed( net::URLRequest* request) { callbacks_.erase(request->identifier()); atom::AtomNetworkDelegate::OnURLRequestDestroyed(request); - extensions_delegate_->OnURLRequestDestroyed(request); + extensions_delegate_->NotifyURLRequestDestroyed(request); } void AtomExtensionsNetworkDelegate::OnPACScriptError( int line_number, const base::string16& error) { - extensions_delegate_->OnPACScriptError(line_number, error); + extensions_delegate_->NotifyPACScriptError(line_number, error); } net::NetworkDelegate::AuthRequiredResponse AtomExtensionsNetworkDelegate::OnAuthRequired( net::URLRequest* request, const net::AuthChallengeInfo& auth_info, - const AuthCallback& callback, + AuthCallback callback, net::AuthCredentials* credentials) { - return extensions_delegate_->OnAuthRequired( - request, auth_info, callback, credentials); + return extensions_delegate_->NotifyAuthRequired( + request, auth_info, std::move(callback), credentials); } } // namespace extensions diff --git a/atom/browser/extensions/atom_extensions_network_delegate.h b/atom/browser/extensions/atom_extensions_network_delegate.h index e9b10d0952..02b3558c97 100644 --- a/atom/browser/extensions/atom_extensions_network_delegate.h +++ b/atom/browser/extensions/atom_extensions_network_delegate.h @@ -11,6 +11,7 @@ #include "atom/browser/extensions/atom_extension_system.h" #include "atom/browser/extensions/atom_extension_system_factory.h" #include "atom/browser/net/atom_network_delegate.h" +#include "net/base/completion_once_callback.h" class ChromeExtensionsNetworkDelegate; class Profile; @@ -32,10 +33,10 @@ class AtomExtensionsNetworkDelegate : public atom::AtomNetworkDelegate { protected: int OnBeforeURLRequest(net::URLRequest* request, - const net::CompletionCallback& callback, + net::CompletionOnceCallback callback, GURL* new_url) override; int OnBeforeStartTransaction(net::URLRequest* request, - const net::CompletionCallback& callback, + net::CompletionOnceCallback callback, net::HttpRequestHeaders* headers) override; void OnBeforeRedirect(net::URLRequest* request, const GURL& new_location) override; @@ -57,7 +58,7 @@ class AtomExtensionsNetworkDelegate : public atom::AtomNetworkDelegate { GURL* allowed_unsafe_redirect_url); int OnHeadersReceived( net::URLRequest* request, - const net::CompletionCallback& callback, + net::CompletionOnceCallback callback, const net::HttpResponseHeaders* original_response_headers, scoped_refptr* override_response_headers, GURL* allowed_unsafe_redirect_url) override; @@ -70,14 +71,14 @@ class AtomExtensionsNetworkDelegate : public atom::AtomNetworkDelegate { net::NetworkDelegate::AuthRequiredResponse OnAuthRequired( net::URLRequest* request, const net::AuthChallengeInfo& auth_info, - const AuthCallback& callback, + AuthCallback callback, net::AuthCredentials* credentials) override; void RunCallback(base::Callback internal_callback, const uint64_t request_id, int previous_result); Profile* profile_; - std::map callbacks_; + std::map callbacks_; std::unique_ptr extensions_delegate_; extensions::EventRouterForwarder* extension_event_router_forwarder_; diff --git a/atom/browser/net/atom_cert_verifier.cc b/atom/browser/net/atom_cert_verifier.cc index 62ace401c9..d8659bc337 100644 --- a/atom/browser/net/atom_cert_verifier.cc +++ b/atom/browser/net/atom_cert_verifier.cc @@ -4,6 +4,8 @@ #include "atom/browser/net/atom_cert_verifier.h" +#include + #include "atom/browser/browser.h" #include "atom/common/native_mate_converters/net_converter.h" #include "content/public/browser/browser_thread.h" @@ -19,11 +21,11 @@ namespace { void OnResult( net::CertVerifyResult* verify_result, - const net::CompletionCallback& callback, + net::CompletionOnceCallback callback, bool result) { BrowserThread::PostTask( BrowserThread::IO, FROM_HERE, - base::Bind(callback, result ? net::OK : net::ERR_FAILED)); + base::BindOnce(std::move(callback), result ? net::OK : net::ERR_FAILED)); } } // namespace @@ -35,27 +37,28 @@ AtomCertVerifier::AtomCertVerifier() AtomCertVerifier::~AtomCertVerifier() { } -void AtomCertVerifier::SetVerifyProc(const VerifyProc& proc) { - verify_proc_ = proc; +void AtomCertVerifier::SetVerifyProc(VerifyProc proc) { + verify_proc_ = std::move(proc); } int AtomCertVerifier::Verify( const RequestParams& params, net::CRLSet* crl_set, net::CertVerifyResult* verify_result, - const net::CompletionCallback& callback, + net::CompletionOnceCallback callback, std::unique_ptr* out_req, const net::NetLogWithSource& net_log) { DCHECK_CURRENTLY_ON(BrowserThread::IO); - if (verify_proc_.is_null()) + if (!verify_proc_) return default_cert_verifier_->Verify( - params, crl_set, verify_result, callback, out_req, net_log); + params, crl_set, verify_result, std::move(callback), out_req, net_log); BrowserThread::PostTask( BrowserThread::UI, FROM_HERE, - base::Bind(verify_proc_, params.hostname(), params.certificate(), - base::Bind(OnResult, verify_result, callback))); + base::BindOnce( + std::move(verify_proc_), params.hostname(), params.certificate(), + base::BindOnce(OnResult, verify_result, std::move(callback)))); return net::ERR_IO_PENDING; } diff --git a/atom/browser/net/atom_cert_verifier.h b/atom/browser/net/atom_cert_verifier.h index 8073e151b1..7ef450f383 100644 --- a/atom/browser/net/atom_cert_verifier.h +++ b/atom/browser/net/atom_cert_verifier.h @@ -8,6 +8,7 @@ #include #include +#include "net/base/completion_once_callback.h" #include "net/cert/cert_verifier.h" namespace atom { @@ -18,18 +19,18 @@ class AtomCertVerifier : public net::CertVerifier { virtual ~AtomCertVerifier(); using VerifyProc = - base::Callback, - const base::Callback&)>; + base::OnceCallback, + const base::OnceCallback&)>; - void SetVerifyProc(const VerifyProc& proc); + void SetVerifyProc(VerifyProc proc); protected: // net::CertVerifier: int Verify(const RequestParams& params, net::CRLSet* crl_set, net::CertVerifyResult* verify_result, - const net::CompletionCallback& callback, + net::CompletionOnceCallback callback, std::unique_ptr* out_req, const net::NetLogWithSource& net_log) override; bool SupportsOCSPStapling() override; diff --git a/atom/browser/net/atom_network_delegate.cc b/atom/browser/net/atom_network_delegate.cc index 6dc2689a6d..47a6faaa1c 100644 --- a/atom/browser/net/atom_network_delegate.cc +++ b/atom/browser/net/atom_network_delegate.cc @@ -307,18 +307,19 @@ void AtomNetworkDelegate::SetDevToolsNetworkEmulationClientId( int AtomNetworkDelegate::OnBeforeURLRequest( net::URLRequest* request, - const net::CompletionCallback& callback, + net::CompletionOnceCallback callback, GURL* new_url) { if (!base::ContainsKey(response_listeners_, kOnBeforeRequest)) return brightray::NetworkDelegate::OnBeforeURLRequest( - request, callback, new_url); + request, std::move(callback), new_url); - return HandleResponseEvent(kOnBeforeRequest, request, callback, new_url); + return HandleResponseEvent(kOnBeforeRequest, request, std::move(callback), + new_url); } int AtomNetworkDelegate::OnBeforeStartTransaction( net::URLRequest* request, - const net::CompletionCallback& callback, + net::CompletionOnceCallback callback, net::HttpRequestHeaders* headers) { std::string client_id; { @@ -332,10 +333,10 @@ int AtomNetworkDelegate::OnBeforeStartTransaction( client_id); if (!base::ContainsKey(response_listeners_, kOnBeforeSendHeaders)) return brightray::NetworkDelegate::OnBeforeStartTransaction( - request, callback, headers); + request, std::move(callback), headers); - return HandleResponseEvent( - kOnBeforeSendHeaders, request, callback, headers, *headers); + return HandleResponseEvent(kOnBeforeSendHeaders, request, std::move(callback), + headers, *headers); } void AtomNetworkDelegate::OnStartTransaction( @@ -351,16 +352,16 @@ void AtomNetworkDelegate::OnStartTransaction( int AtomNetworkDelegate::OnHeadersReceived( net::URLRequest* request, - const net::CompletionCallback& callback, + net::CompletionOnceCallback callback, const net::HttpResponseHeaders* original, scoped_refptr* override, GURL* new_url) { if (!base::ContainsKey(response_listeners_, kOnHeadersReceived)) return brightray::NetworkDelegate::OnHeadersReceived( - request, callback, original, override, new_url); + request, std::move(callback), original, override, new_url); return HandleResponseEvent( - kOnHeadersReceived, request, callback, + kOnHeadersReceived, request, std::move(callback), ResponseHeadersContainer(override, original->GetStatusLine(), new_url), original); } @@ -436,7 +437,7 @@ template int AtomNetworkDelegate::HandleResponseEvent( ResponseEvent type, net::URLRequest* request, - const net::CompletionCallback& callback, + net::CompletionOnceCallback callback, Out out, Args... args) { const auto& info = response_listeners_[type]; @@ -447,7 +448,7 @@ int AtomNetworkDelegate::HandleResponseEvent( FillDetailsObject(details.get(), request, args...); // The |request| could be destroyed before the |callback| is called. - callbacks_[request->identifier()] = callback; + callbacks_[request->identifier()] = std::move(callback); int frame_tree_node_id = -1; GetFrameTreeNodeId(request, &frame_tree_node_id); @@ -501,7 +502,7 @@ void AtomNetworkDelegate::OnListenerResultInIO( bool cancel = false; response->GetBoolean("cancel", &cancel); - callbacks_[id].Run(cancel ? net::ERR_ABORTED : net::OK); + std::move(callbacks_[id]).Run(cancel ? net::ERR_ABORTED : net::OK); } template diff --git a/atom/browser/net/atom_network_delegate.h b/atom/browser/net/atom_network_delegate.h index b97cdf00bc..1c040f7162 100644 --- a/atom/browser/net/atom_network_delegate.h +++ b/atom/browser/net/atom_network_delegate.h @@ -17,6 +17,7 @@ #include "brightray/browser/network_delegate.h" #include "content/public/browser/resource_request_info.h" #include "extensions/common/url_pattern.h" +#include "net/base/completion_once_callback.h" #include "net/base/net_errors.h" #include "net/http/http_request_headers.h" #include "net/http/http_response_headers.h" @@ -73,16 +74,16 @@ class AtomNetworkDelegate : public brightray::NetworkDelegate { protected: // net::NetworkDelegate: int OnBeforeURLRequest(net::URLRequest* request, - const net::CompletionCallback& callback, + const net::CompletionOnceCallback callback, GURL* new_url) override; int OnBeforeStartTransaction(net::URLRequest* request, - const net::CompletionCallback& callback, + net::CompletionOnceCallback callback, net::HttpRequestHeaders* headers) override; void OnStartTransaction(net::URLRequest* request, const net::HttpRequestHeaders& headers) override; int OnHeadersReceived( net::URLRequest* request, - const net::CompletionCallback& callback, + net::CompletionOnceCallback callback, const net::HttpResponseHeaders* original_response_headers, scoped_refptr* override_response_headers, GURL* allowed_unsafe_redirect_url) override; @@ -104,7 +105,7 @@ class AtomNetworkDelegate : public brightray::NetworkDelegate { template int HandleResponseEvent(ResponseEvent type, net::URLRequest* request, - const net::CompletionCallback& callback, + net::CompletionOnceCallback callback, Out out, Args... args); @@ -119,7 +120,7 @@ class AtomNetworkDelegate : public brightray::NetworkDelegate { std::map simple_listeners_; std::map response_listeners_; - std::map callbacks_; + std::map callbacks_; base::Lock lock_; diff --git a/atom/browser/net/url_request_fetch_job.h b/atom/browser/net/url_request_fetch_job.h index c799b6162d..9195a03330 100644 --- a/atom/browser/net/url_request_fetch_job.h +++ b/atom/browser/net/url_request_fetch_job.h @@ -10,6 +10,7 @@ #include "atom/browser/net/js_asker.h" #include "browser/url_request_context_getter.h" +#include "net/base/completion_once_callback.h" #include "net/url_request/url_fetcher_delegate.h" namespace atom { diff --git a/brave/browser/net/tor_proxy_network_delegate.cc b/brave/browser/net/tor_proxy_network_delegate.cc index 8336ddd3fe..1ae2c5017f 100644 --- a/brave/browser/net/tor_proxy_network_delegate.cc +++ b/brave/browser/net/tor_proxy_network_delegate.cc @@ -4,6 +4,8 @@ #include "brave/browser/net/tor_proxy_network_delegate.h" +#include + #include "brave/browser/net/proxy_resolution/proxy_config_service_tor.h" #include "content/public/browser/browser_thread.h" #include "content/public/browser/site_instance.h" @@ -28,23 +30,20 @@ TorProxyNetworkDelegate::~TorProxyNetworkDelegate() {} int TorProxyNetworkDelegate::OnBeforeURLRequest( net::URLRequest* request, - const net::CompletionCallback& callback, + net::CompletionOnceCallback callback, GURL* new_url) { ConfigTorProxyInteral(request); - return extensions::AtomExtensionsNetworkDelegate::OnBeforeURLRequest(request, - callback, - new_url); + return extensions::AtomExtensionsNetworkDelegate::OnBeforeURLRequest( + request, std::move(callback), new_url); } int TorProxyNetworkDelegate::OnBeforeStartTransaction( net::URLRequest* request, - const net::CompletionCallback& callback, + net::CompletionOnceCallback callback, net::HttpRequestHeaders* headers) { ConfigTorProxyInteral(request); - return extensions::AtomExtensionsNetworkDelegate:: - OnBeforeStartTransaction(request, - callback, - headers); + return extensions::AtomExtensionsNetworkDelegate::OnBeforeStartTransaction( + request, std::move(callback), headers); } void TorProxyNetworkDelegate::OnBeforeRedirect( diff --git a/brave/browser/net/tor_proxy_network_delegate.h b/brave/browser/net/tor_proxy_network_delegate.h index 66413a3c06..a1304eb504 100644 --- a/brave/browser/net/tor_proxy_network_delegate.h +++ b/brave/browser/net/tor_proxy_network_delegate.h @@ -7,6 +7,7 @@ #include "atom/browser/extensions/atom_extensions_network_delegate.h" #include "brave/browser/brave_browser_context.h" +#include "net/base/completion_once_callback.h" namespace extensions { class EventRouterForwarder; @@ -27,10 +28,10 @@ class TorProxyNetworkDelegate : private: // NetworkDelegate implementation. int OnBeforeURLRequest(net::URLRequest* request, - const net::CompletionCallback& callback, + net::CompletionOnceCallback callback, GURL* new_url) override; int OnBeforeStartTransaction(net::URLRequest* request, - const net::CompletionCallback& callback, + net::CompletionOnceCallback callback, net::HttpRequestHeaders* headers) override; void OnBeforeRedirect(net::URLRequest* request, const GURL& new_location) override; diff --git a/vendor/brightray/browser/network_delegate.cc b/vendor/brightray/browser/network_delegate.cc index 9c7ca7156e..50fa656560 100644 --- a/vendor/brightray/browser/network_delegate.cc +++ b/vendor/brightray/browser/network_delegate.cc @@ -36,7 +36,7 @@ NetworkDelegate::~NetworkDelegate() { int NetworkDelegate::OnBeforeURLRequest( net::URLRequest* request, - const net::CompletionCallback& callback, + net::CompletionOnceCallback callback, GURL* new_url) { for (const auto& domain : ignore_connections_limit_domains_) { if (request->url().DomainIs(domain)) { @@ -52,7 +52,7 @@ int NetworkDelegate::OnBeforeURLRequest( int NetworkDelegate::OnBeforeStartTransaction( net::URLRequest* request, - const net::CompletionCallback& callback, + net::CompletionOnceCallback callback, net::HttpRequestHeaders* headers) { return net::OK; } @@ -71,7 +71,7 @@ void NetworkDelegate::OnBeforeSendHeaders( int NetworkDelegate::OnHeadersReceived( net::URLRequest* request, - const net::CompletionCallback& callback, + net::CompletionOnceCallback callback, const net::HttpResponseHeaders* original_response_headers, scoped_refptr* override_response_headers, GURL* allowed_unsafe_redirect_url) { @@ -106,7 +106,7 @@ void NetworkDelegate::OnPACScriptError(int line_number, NetworkDelegate::AuthRequiredResponse NetworkDelegate::OnAuthRequired( net::URLRequest* request, const net::AuthChallengeInfo& auth_info, - const AuthCallback& callback, + AuthCallback callback, net::AuthCredentials* credentials) { return AUTH_REQUIRED_RESPONSE_NO_ACTION; } diff --git a/vendor/brightray/browser/network_delegate.h b/vendor/brightray/browser/network_delegate.h index 4544ee2f79..54ae421112 100644 --- a/vendor/brightray/browser/network_delegate.h +++ b/vendor/brightray/browser/network_delegate.h @@ -9,6 +9,7 @@ #include #include +#include "net/base/completion_once_callback.h" #include "net/base/network_delegate.h" #include "net/base/proxy_server.h" @@ -21,10 +22,10 @@ class NetworkDelegate : public net::NetworkDelegate { protected: int OnBeforeURLRequest(net::URLRequest* request, - const net::CompletionCallback& callback, + net::CompletionOnceCallback callback, GURL* new_url) override; int OnBeforeStartTransaction(net::URLRequest* request, - const net::CompletionCallback& callback, + net::CompletionOnceCallback callback, net::HttpRequestHeaders* headers) override; void OnBeforeSendHeaders(net::URLRequest* request, const net::ProxyInfo& proxy_info, @@ -34,7 +35,7 @@ class NetworkDelegate : public net::NetworkDelegate { const net::HttpRequestHeaders& headers) override; int OnHeadersReceived( net::URLRequest* request, - const net::CompletionCallback& callback, + net::CompletionOnceCallback callback, const net::HttpResponseHeaders* original_response_headers, scoped_refptr* override_response_headers, GURL* allowed_unsafe_redirect_url) override; @@ -52,7 +53,7 @@ class NetworkDelegate : public net::NetworkDelegate { AuthRequiredResponse OnAuthRequired( net::URLRequest* request, const net::AuthChallengeInfo& auth_info, - const AuthCallback& callback, + AuthCallback callback, net::AuthCredentials* credentials) override; bool OnCanGetCookies(const net::URLRequest& request, const net::CookieList& cookie_list) override; From 44d39c613bd5690c7d8241e2bc55b89e5541b337 Mon Sep 17 00:00:00 2001 From: Henrique Ferreiro Date: Fri, 6 Jul 2018 08:21:35 +0200 Subject: [PATCH 004/138] Remove PlatformNotificationService::CheckPermissionOn{UI/IO}Thread https://crrev.com/b6742ce84583 https://crrev.com/3db8a18444e5 --- .../platform_notification_service_impl.cc | 16 ---------------- .../platform_notification_service_impl.h | 8 -------- .../browser/platform_notification_service.cc | 15 --------------- .../browser/platform_notification_service.h | 8 -------- 4 files changed, 47 deletions(-) diff --git a/brave/browser/notifications/platform_notification_service_impl.cc b/brave/browser/notifications/platform_notification_service_impl.cc index d493cdf98d..5e7d2a96cb 100644 --- a/brave/browser/notifications/platform_notification_service_impl.cc +++ b/brave/browser/notifications/platform_notification_service_impl.cc @@ -63,22 +63,6 @@ PlatformNotificationServiceImpl::PlatformNotificationServiceImpl() {} PlatformNotificationServiceImpl::~PlatformNotificationServiceImpl() {} -blink::mojom::PermissionStatus - PlatformNotificationServiceImpl::CheckPermissionOnUIThread( - content::BrowserContext* browser_context, - const GURL& origin, - int render_process_id) { - return blink::mojom::PermissionStatus::GRANTED; -} - -blink::mojom::PermissionStatus - PlatformNotificationServiceImpl::CheckPermissionOnIOThread( - content::ResourceContext* resource_context, - const GURL& origin, - int render_process_id) { - return blink::mojom::PermissionStatus::GRANTED; -} - void PlatformNotificationServiceImpl::DisplayNotification( content::BrowserContext* browser_context, const std::string& notification_id, diff --git a/brave/browser/notifications/platform_notification_service_impl.h b/brave/browser/notifications/platform_notification_service_impl.h index c798bff11e..6068970d33 100644 --- a/brave/browser/notifications/platform_notification_service_impl.h +++ b/brave/browser/notifications/platform_notification_service_impl.h @@ -27,14 +27,6 @@ class PlatformNotificationServiceImpl protected: // content::PlatformNotificationService: - blink::mojom::PermissionStatus CheckPermissionOnUIThread( - content::BrowserContext* browser_context, - const GURL& origin, - int render_process_id) override; - blink::mojom::PermissionStatus CheckPermissionOnIOThread( - content::ResourceContext* resource_context, - const GURL& origin, - int render_process_id) override; void DisplayNotification(content::BrowserContext* browser_context, const std::string& notification_id, const GURL& origin, diff --git a/vendor/brightray/browser/platform_notification_service.cc b/vendor/brightray/browser/platform_notification_service.cc index 3506a02876..6dd22ea9d3 100644 --- a/vendor/brightray/browser/platform_notification_service.cc +++ b/vendor/brightray/browser/platform_notification_service.cc @@ -45,21 +45,6 @@ PlatformNotificationService::PlatformNotificationService( PlatformNotificationService::~PlatformNotificationService() {} -blink::mojom::PermissionStatus PlatformNotificationService::CheckPermissionOnUIThread( - content::BrowserContext* browser_context, - const GURL& origin, - int render_process_id) { - render_process_id_ = render_process_id; - return blink::mojom::PermissionStatus::GRANTED; -} - -blink::mojom::PermissionStatus PlatformNotificationService::CheckPermissionOnIOThread( - content::ResourceContext* resource_context, - const GURL& origin, - int render_process_id) { - return blink::mojom::PermissionStatus::GRANTED; -} - void PlatformNotificationService::DisplayNotification( content::BrowserContext* browser_context, const std::string& notification_id, diff --git a/vendor/brightray/browser/platform_notification_service.h b/vendor/brightray/browser/platform_notification_service.h index e50c241ddb..d0b465591d 100644 --- a/vendor/brightray/browser/platform_notification_service.h +++ b/vendor/brightray/browser/platform_notification_service.h @@ -24,14 +24,6 @@ class PlatformNotificationService protected: // content::PlatformNotificationService: - blink::mojom::PermissionStatus CheckPermissionOnUIThread( - content::BrowserContext* browser_context, - const GURL& origin, - int render_process_id) override; - blink::mojom::PermissionStatus CheckPermissionOnIOThread( - content::ResourceContext* resource_context, - const GURL& origin, - int render_process_id) override; void DisplayNotification(content::BrowserContext* browser_context, const std::string& notification_id, const GURL& origin, From f58494ab92571ef3d7e1418972c10d38c90dcc56 Mon Sep 17 00:00:00 2001 From: Henrique Ferreiro Date: Fri, 6 Jul 2018 08:30:05 +0200 Subject: [PATCH 005/138] DeleteCookiePredicate was moved to network::SessionCleanupCookieStore https://crrev.com/385b5a513973 --- vendor/brightray/browser/special_storage_policy.cc | 4 ++-- vendor/brightray/browser/special_storage_policy.h | 3 ++- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/vendor/brightray/browser/special_storage_policy.cc b/vendor/brightray/browser/special_storage_policy.cc index 73690b9fd9..d5f40ee439 100644 --- a/vendor/brightray/browser/special_storage_policy.cc +++ b/vendor/brightray/browser/special_storage_policy.cc @@ -38,9 +38,9 @@ bool SpecialStoragePolicy::HasIsolatedStorage(const GURL& origin) { return false; } -storage::SpecialStoragePolicy::DeleteCookiePredicate +network::SessionCleanupCookieStore::DeleteCookiePredicate SpecialStoragePolicy::CreateDeleteCookieOnExitPredicate() { - return DeleteCookiePredicate(); + return network::SessionCleanupCookieStore::DeleteCookiePredicate(); } } // namespace brightray diff --git a/vendor/brightray/browser/special_storage_policy.h b/vendor/brightray/browser/special_storage_policy.h index fd0da1d0de..156f4ee4c1 100644 --- a/vendor/brightray/browser/special_storage_policy.h +++ b/vendor/brightray/browser/special_storage_policy.h @@ -20,7 +20,8 @@ class SpecialStoragePolicy : public storage::SpecialStoragePolicy { bool IsStorageSessionOnly(const GURL& origin) override; bool HasIsolatedStorage(const GURL& origin) override; bool HasSessionOnlyOrigins() override; - DeleteCookiePredicate CreateDeleteCookieOnExitPredicate() override; + network::SessionCleanupCookieStore::DeleteCookiePredicate + CreateDeleteCookieOnExitPredicate() override; protected: ~SpecialStoragePolicy() override; From b09cd6bf31fe1e57f62ed6c660d9a380e3ed9225 Mon Sep 17 00:00:00 2001 From: Henrique Ferreiro Date: Fri, 6 Jul 2018 08:33:37 +0200 Subject: [PATCH 006/138] Add resource_coordinator:mojo_bindings dependency --- brave/browser/BUILD.gn | 1 + 1 file changed, 1 insertion(+) diff --git a/brave/browser/BUILD.gn b/brave/browser/BUILD.gn index a947ccd0ae..1129df3b5c 100644 --- a/brave/browser/BUILD.gn +++ b/brave/browser/BUILD.gn @@ -123,6 +123,7 @@ source_set("tab_manager") { ] deps = [ + "//chrome/browser/resource_coordinator:mojo_bindings", "//content/public/common", "//electron/chromium_src:tab_manager" ] From 5b4904ad8816aad478395227e32b36d992188fe3 Mon Sep 17 00:00:00 2001 From: Henrique Ferreiro Date: Fri, 6 Jul 2018 08:38:42 +0200 Subject: [PATCH 007/138] Change CreateWebUIControllerForURL() to return a unique_ptr https://crrev.com/318708b8a2e5 --- .../browser/ui/webui/chrome_web_ui_controller_factory.cc | 7 ++++--- vendor/brightray/browser/web_ui_controller_factory.cc | 7 ++++--- vendor/brightray/browser/web_ui_controller_factory.h | 4 +++- 3 files changed, 11 insertions(+), 7 deletions(-) diff --git a/chromium_src/chrome/browser/ui/webui/chrome_web_ui_controller_factory.cc b/chromium_src/chrome/browser/ui/webui/chrome_web_ui_controller_factory.cc index 09370f2ccb..6d92137177 100644 --- a/chromium_src/chrome/browser/ui/webui/chrome_web_ui_controller_factory.cc +++ b/chromium_src/chrome/browser/ui/webui/chrome_web_ui_controller_factory.cc @@ -5,6 +5,7 @@ #include "chrome/browser/ui/webui/chrome_web_ui_controller_factory.h" #include "base/files/file_util.h" +#include "base/memory/ptr_util.h" #include "chrome/browser/profiles/profile.h" #include "chrome/browser/ui/webui/crashes_ui.h" #include "chrome/common/url_constants.h" @@ -179,16 +180,16 @@ bool ChromeWebUIControllerFactory::UseWebUIBindingsForURL( return UseWebUIForURL(browser_context, url); } -WebUIController* +std::unique_ptr ChromeWebUIControllerFactory::CreateWebUIControllerForURL( WebUI* web_ui, const GURL& url) const { Profile* profile = Profile::FromWebUI(web_ui); WebUIFactoryFunction function = GetWebUIFactoryFunction(web_ui, profile, url); if (!function) - return NULL; + return nullptr; - return (*function)(web_ui, url); + return base::WrapUnique((*function)(web_ui, url)); } // static diff --git a/vendor/brightray/browser/web_ui_controller_factory.cc b/vendor/brightray/browser/web_ui_controller_factory.cc index c59e5bb0c6..c73ec82b10 100644 --- a/vendor/brightray/browser/web_ui_controller_factory.cc +++ b/vendor/brightray/browser/web_ui_controller_factory.cc @@ -48,11 +48,12 @@ bool WebUIControllerFactory::UseWebUIBindingsForURL( return UseWebUIForURL(browser_context, url); } -content::WebUIController* WebUIControllerFactory::CreateWebUIControllerForURL( - content::WebUI* web_ui, const GURL& url) const { +std::unique_ptr +WebUIControllerFactory::CreateWebUIControllerForURL(content::WebUI* web_ui, + const GURL& url) const { if (url.host() == kChromeUIDevToolsBundledHost) { auto browser_context = web_ui->GetWebContents()->GetBrowserContext(); - return new DevToolsUI(browser_context, web_ui); + return std::make_unique(browser_context, web_ui); } return nullptr; } diff --git a/vendor/brightray/browser/web_ui_controller_factory.h b/vendor/brightray/browser/web_ui_controller_factory.h index ca86de6baa..6be7485924 100644 --- a/vendor/brightray/browser/web_ui_controller_factory.h +++ b/vendor/brightray/browser/web_ui_controller_factory.h @@ -5,6 +5,8 @@ #ifndef BRIGHTRAY_BROWSER_WEB_UI_CONTROLLER_FACTORY_H_ #define BRIGHTRAY_BROWSER_WEB_UI_CONTROLLER_FACTORY_H_ +#include + #include "base/macros.h" #include "content/public/browser/web_ui.h" #include "content/public/browser/web_ui_controller_factory.h" @@ -30,7 +32,7 @@ class WebUIControllerFactory : public content::WebUIControllerFactory { const GURL& url) const override; bool UseWebUIBindingsForURL(content::BrowserContext* browser_context, const GURL& url) const override; - content::WebUIController* CreateWebUIControllerForURL( + std::unique_ptr CreateWebUIControllerForURL( content::WebUI* web_ui, const GURL& url) const override; From a89c3bafc7ab23eb1495f6eef909592eaf99cdf8 Mon Sep 17 00:00:00 2001 From: Henrique Ferreiro Date: Fri, 6 Jul 2018 08:50:55 +0200 Subject: [PATCH 008/138] REVIEW: DispatchNonPerisistentClickEvent() parameters https://crrev.com/71dba344e19b --- vendor/brightray/browser/notification_delegate.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/vendor/brightray/browser/notification_delegate.cc b/vendor/brightray/browser/notification_delegate.cc index 287a1a6ba5..8fd477dbbe 100644 --- a/vendor/brightray/browser/notification_delegate.cc +++ b/vendor/brightray/browser/notification_delegate.cc @@ -18,7 +18,7 @@ void NotificationDelegate::NotificationDestroyed() { void NotificationDelegate::NotificationClick() { content::NotificationEventDispatcher::GetInstance() - ->DispatchNonPersistentClickEvent(notification_id_); + ->DispatchNonPersistentClickEvent(notification_id_, base::DoNothing()); } void NotificationDelegate::NotificationClosed() { From 2d47feddddebe5e4765affc352970915bee0baec Mon Sep 17 00:00:00 2001 From: Henrique Ferreiro Date: Mon, 9 Jul 2018 12:08:28 +0200 Subject: [PATCH 009/138] CreateLoginDelegate() parameters https://crrev.com/5f734e3228cd --- brave/browser/brave_content_browser_client.cc | 2 ++ brave/browser/brave_content_browser_client.h | 2 ++ 2 files changed, 4 insertions(+) diff --git a/brave/browser/brave_content_browser_client.cc b/brave/browser/brave_content_browser_client.cc index a21a39eb8f..0867039e48 100644 --- a/brave/browser/brave_content_browser_client.cc +++ b/brave/browser/brave_content_browser_client.cc @@ -901,8 +901,10 @@ scoped_refptr BraveContentBrowserClient::CreateLoginDelegate( net::AuthChallengeInfo* auth_info, content::ResourceRequestInfo::WebContentsGetter web_contents_getter, + const content::GlobalRequestID& request_id, bool is_request_for_main_frame, const GURL& url, + scoped_refptr response_headers, bool first_auth_attempt, LoginAuthRequiredCallback auth_required_callback) { return base::MakeRefCounted( diff --git a/brave/browser/brave_content_browser_client.h b/brave/browser/brave_content_browser_client.h index 64f491cfd9..67814db7d2 100644 --- a/brave/browser/brave_content_browser_client.h +++ b/brave/browser/brave_content_browser_client.h @@ -152,8 +152,10 @@ class BraveContentBrowserClient : public atom::AtomBrowserClient { scoped_refptr CreateLoginDelegate( net::AuthChallengeInfo* auth_info, content::ResourceRequestInfo::WebContentsGetter web_contents_getter, + const content::GlobalRequestID& request_id, bool is_request_for_main_frame, const GURL& url, + scoped_refptr response_headers, bool first_auth_attempt, LoginAuthRequiredCallback auth_required_callback) override; From cd3ab8d4ebf75c413c4f746dc8474d1e0b283747 Mon Sep 17 00:00:00 2001 From: Henrique Ferreiro Date: Mon, 9 Jul 2018 14:12:48 +0200 Subject: [PATCH 010/138] Rename WebFrameClient to WebLocalFrameClient https://crrev.com/55944cb91cc2 --- chromium_src/chrome/renderer/content_settings_observer.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/chromium_src/chrome/renderer/content_settings_observer.cc b/chromium_src/chrome/renderer/content_settings_observer.cc index 6923eefd3f..b573152200 100644 --- a/chromium_src/chrome/renderer/content_settings_observer.cc +++ b/chromium_src/chrome/renderer/content_settings_observer.cc @@ -23,7 +23,7 @@ #include "third_party/blink/public/platform/web_security_origin.h" #include "third_party/blink/public/platform/web_url.h" #include "third_party/blink/public/web/web_document.h" -#include "third_party/blink/public/web/web_frame_client.h" +#include "third_party/blink/public/web/web_local_frame_client.h" #include "third_party/blink/public/web/web_local_frame.h" #include "third_party/blink/public/web/web_view.h" #include "url/url_constants.h" From bd5339876d2c29e37edaf917ddde26438b0c6505 Mon Sep 17 00:00:00 2001 From: Henrique Ferreiro Date: Mon, 9 Jul 2018 14:37:23 +0200 Subject: [PATCH 011/138] TODO: Migrate from base::Bind() to base::BindOnce() or base::BindRepeating() https://crbug.com/714018 --- atom/browser/api/atom_api_web_contents.cc | 24 +++++++------- atom/browser/api/atom_api_web_contents.h | 6 ++-- .../atom_extension_host_delegate.cc | 2 +- .../extensions/atom_extension_host_delegate.h | 2 +- atom/browser/extensions/tab_helper.cc | 11 ++++--- atom/browser/extensions/tab_helper.h | 2 +- .../browser/web_contents_permission_helper.cc | 20 +++++++----- atom/browser/web_contents_permission_helper.h | 2 +- .../guest_view/tab_view/tab_view_guest.cc | 4 +-- .../guest_view/tab_view/tab_view_guest.h | 2 +- .../media/media_stream_devices_controller.cc | 32 ++++++++----------- .../media/media_stream_devices_controller.h | 2 +- 12 files changed, 54 insertions(+), 55 deletions(-) diff --git a/atom/browser/api/atom_api_web_contents.cc b/atom/browser/api/atom_api_web_contents.cc index 05d26d6a92..5ce45c9497 100644 --- a/atom/browser/api/atom_api_web_contents.cc +++ b/atom/browser/api/atom_api_web_contents.cc @@ -1310,10 +1310,10 @@ bool WebContents::CheckMediaAccessPermission( void WebContents::RequestMediaAccessPermission( content::WebContents* web_contents, const content::MediaStreamRequest& request, - const content::MediaResponseCallback& callback) { + content::MediaResponseCallback callback) { auto permission_helper = WebContentsPermissionHelper::FromWebContents(web_contents); - permission_helper->RequestMediaAccessPermission(request, callback); + permission_helper->RequestMediaAccessPermission(request, std::move(callback)); } void WebContents::RequestToLockMouse( @@ -2254,14 +2254,14 @@ void WebContents::Clone(mate::Arguments* args) { options = mate::Dictionary::CreateEmpty(isolate()); } - base::Callback callback; + base::OnceCallback callback; if (!args->GetNext(&callback)) { args->ThrowError("`callback` is a required field"); return; } if (!IsGuest()) { - callback.Run(nullptr); + std::move(callback).Run(nullptr); return; } @@ -2281,8 +2281,8 @@ void WebContents::Clone(mate::Arguments* args) { extensions::TabHelper::CreateTab(owner, web_contents()->GetBrowserContext(), create_params, - base::Bind(&WebContents::OnTabCreated, base::Unretained(this), - options, callback)); + base::BindOnce(&WebContents::OnTabCreated, base::Unretained(this), + options, std::move(callback))); } void WebContents::SetActive(bool active) { @@ -2846,7 +2846,7 @@ mate::Handle WebContents::FromTabID(v8::Isolate* isolate, } void WebContents::OnTabCreated(const mate::Dictionary& options, - base::Callback callback, + base::OnceCallback callback, content::WebContents* tab) { node::Environment* env = node::Environment::GetCurrent(isolate()); if (!env) { @@ -2952,9 +2952,9 @@ void WebContents::OnTabCreated(const mate::Dictionary& options, gfx::Rect(), user_gesture, &was_blocked); if (was_blocked) - callback.Run(nullptr); + std::move(callback).Run(nullptr); else - callback.Run(tab); + std::move(callback).Run(tab); } // static @@ -2982,7 +2982,7 @@ void WebContents::CreateTab(mate::Arguments* args) { return; } - base::Callback callback; + base::OnceCallback callback; if (!args->GetNext(&callback)) { args->ThrowError("`callback` is a required field"); return; @@ -3000,8 +3000,8 @@ void WebContents::CreateTab(mate::Arguments* args) { extensions::TabHelper::CreateTab(owner->web_contents(), browser_context, create_params, - base::Bind(&WebContents::OnTabCreated, base::Unretained(owner), - options, callback)); + base::BindOnce(&WebContents::OnTabCreated, base::Unretained(owner), + options, std::move(callback))); } // static diff --git a/atom/browser/api/atom_api_web_contents.h b/atom/browser/api/atom_api_web_contents.h index 54b1fcf21c..c79cd6c8a2 100644 --- a/atom/browser/api/atom_api_web_contents.h +++ b/atom/browser/api/atom_api_web_contents.h @@ -334,8 +334,8 @@ class WebContents : public mate::TrackableObject, const mate::Dictionary& options); void OnTabCreated(const mate::Dictionary& options, - base::Callback callback, - content::WebContents* tab); + base::OnceCallback callback, + content::WebContents* tab); void AuthorizePlugin(mate::Arguments* args); @@ -461,7 +461,7 @@ class WebContents : public mate::TrackableObject, void RequestMediaAccessPermission( content::WebContents* web_contents, const content::MediaStreamRequest& request, - const content::MediaResponseCallback& callback) override; + content::MediaResponseCallback callback) override; void RequestToLockMouse( content::WebContents* web_contents, bool user_gesture, diff --git a/atom/browser/extensions/atom_extension_host_delegate.cc b/atom/browser/extensions/atom_extension_host_delegate.cc index efa5c7217f..1a752d6ec7 100644 --- a/atom/browser/extensions/atom_extension_host_delegate.cc +++ b/atom/browser/extensions/atom_extension_host_delegate.cc @@ -63,7 +63,7 @@ void AtomExtensionHostDelegate::CreateTab( void AtomExtensionHostDelegate::ProcessMediaAccessRequest( content::WebContents* web_contents, const content::MediaStreamRequest& request, - const content::MediaResponseCallback& callback, + content::MediaResponseCallback callback, const Extension* extension) { } diff --git a/atom/browser/extensions/atom_extension_host_delegate.h b/atom/browser/extensions/atom_extension_host_delegate.h index a1a967c5b7..522bf4230d 100644 --- a/atom/browser/extensions/atom_extension_host_delegate.h +++ b/atom/browser/extensions/atom_extension_host_delegate.h @@ -28,7 +28,7 @@ class AtomExtensionHostDelegate : public ExtensionHostDelegate { bool user_gesture) override; void ProcessMediaAccessRequest(content::WebContents* web_contents, const content::MediaStreamRequest& request, - const content::MediaResponseCallback& callback, + content::MediaResponseCallback callback, const Extension* extension) override; bool CheckMediaAccessPermission(content::RenderFrameHost* render_frame_host, const GURL& security_origin, diff --git a/atom/browser/extensions/tab_helper.cc b/atom/browser/extensions/tab_helper.cc index 5457094da2..2a4071312a 100644 --- a/atom/browser/extensions/tab_helper.cc +++ b/atom/browser/extensions/tab_helper.cc @@ -111,10 +111,11 @@ TabHelper::~TabHelper() { } // static -void TabHelper::CreateTab(content::WebContents* owner, - content::BrowserContext* browser_context, - const base::DictionaryValue& create_params, - const GuestViewManager::WebContentsCreatedCallback& callback) { +void TabHelper::CreateTab( + content::WebContents* owner, + content::BrowserContext* browser_context, + const base::DictionaryValue& create_params, + GuestViewManager::WebContentsCreatedCallback callback) { BraveBrowserContext* profile = BraveBrowserContext::FromBrowserContext(browser_context); auto guest_view_manager = static_cast( @@ -135,7 +136,7 @@ void TabHelper::CreateTab(content::WebContents* owner, guest_view_manager->CreateGuest(brave::TabViewGuest::Type, owner, *params.get(), - callback); + std::move(callback)); } // static diff --git a/atom/browser/extensions/tab_helper.h b/atom/browser/extensions/tab_helper.h index a3f55640fb..64f7297e24 100644 --- a/atom/browser/extensions/tab_helper.h +++ b/atom/browser/extensions/tab_helper.h @@ -67,7 +67,7 @@ class TabHelper : public content::WebContentsObserver, static void CreateTab(content::WebContents* owner, content::BrowserContext* browser_context, const base::DictionaryValue& create_params, - const GuestViewManager::WebContentsCreatedCallback& callback); + GuestViewManager::WebContentsCreatedCallback callback); static content::WebContents* CreateTab(content::WebContents* owner, content::WebContents::CreateParams create_params); static void DestroyTab(content::WebContents* tab); diff --git a/atom/browser/web_contents_permission_helper.cc b/atom/browser/web_contents_permission_helper.cc index 0d93638764..922e81d5b5 100644 --- a/atom/browser/web_contents_permission_helper.cc +++ b/atom/browser/web_contents_permission_helper.cc @@ -5,6 +5,7 @@ #include "atom/browser/web_contents_permission_helper.h" #include +#include #include "brave/browser/brave_permission_manager.h" #include "brightray/browser/media/media_stream_devices_controller.h" @@ -20,10 +21,11 @@ namespace { void MediaAccessAllowed( const content::MediaStreamRequest& request, - const content::MediaResponseCallback& callback, + content::MediaResponseCallback callback, bool allowed) { // TODO(bridiver) - IOThread >> - brightray::MediaStreamDevicesController controller(request, callback); + brightray::MediaStreamDevicesController controller(request, + std::move(callback)); if (allowed) controller.TakeAction(); else @@ -81,23 +83,25 @@ void WebContentsPermissionHelper::RequestFullscreenPermission( void WebContentsPermissionHelper::RequestMediaAccessPermission( const content::MediaStreamRequest& request, - const content::MediaResponseCallback& response_callback) { - auto callback = base::Bind(&MediaAccessAllowed, request, response_callback); + content::MediaResponseCallback response_callback) { + auto callback = base::BindOnce(&MediaAccessAllowed, request, + std::move(response_callback)); // The permission type doesn't matter here, AUDIO_CAPTURE/VIDEO_CAPTURE // are presented as same type in content_converter.h. auto rfh = content::RenderFrameHost::FromID(request.render_process_id, request.render_frame_id); if (!rfh) - callback.Run(false); + std::move(callback).Run(false); - RequestPermission(content::PermissionType::AUDIO_CAPTURE, callback, rfh, - request.security_origin); + // TODO(hferreiro) + // RequestPermission(content::PermissionType::AUDIO_CAPTURE, + // std::move(callback), rfh, request.security_origin); } void WebContentsPermissionHelper::RequestWebNotificationPermission( const base::Callback& callback) { RequestPermission(content::PermissionType::NOTIFICATIONS, callback, - web_contents_->GetMainFrame()); + web_contents_->GetMainFrame()); } void WebContentsPermissionHelper::RequestPointerLockPermission( diff --git a/atom/browser/web_contents_permission_helper.h b/atom/browser/web_contents_permission_helper.h index bc81aeba5f..1b1e6c6193 100644 --- a/atom/browser/web_contents_permission_helper.h +++ b/atom/browser/web_contents_permission_helper.h @@ -28,7 +28,7 @@ class WebContentsPermissionHelper const base::Callback& callback); void RequestMediaAccessPermission( const content::MediaStreamRequest& request, - const content::MediaResponseCallback& callback); + content::MediaResponseCallback callback); void RequestWebNotificationPermission( const base::Callback& callback); void RequestPointerLockPermission(bool user_gesture); diff --git a/brave/browser/guest_view/tab_view/tab_view_guest.cc b/brave/browser/guest_view/tab_view/tab_view_guest.cc index 9b3ba4808a..a1bf4ae777 100644 --- a/brave/browser/guest_view/tab_view/tab_view_guest.cc +++ b/brave/browser/guest_view/tab_view/tab_view_guest.cc @@ -267,7 +267,7 @@ void TabViewGuest::DidInitialize(const base::DictionaryValue& create_params) { void TabViewGuest::CreateWebContents( const base::DictionaryValue& params, - const WebContentsCreatedCallback& callback) { + WebContentsCreatedCallback callback) { v8::Isolate* isolate = v8::Isolate::GetCurrent(); v8::Locker locker(isolate); v8::HandleScope handle_scope(isolate); @@ -311,7 +311,7 @@ void TabViewGuest::CreateWebContents( atom::api::WebContents::CreateWithParams(isolate, options, create_params); content::WebContents* web_contents = new_api_web_contents->web_contents(); - callback.Run(web_contents); + std::move(callback).Run(web_contents); } void TabViewGuest::ApplyAttributes(const base::DictionaryValue& params) { diff --git a/brave/browser/guest_view/tab_view/tab_view_guest.h b/brave/browser/guest_view/tab_view/tab_view_guest.h index 873730fd84..f952e797cd 100644 --- a/brave/browser/guest_view/tab_view/tab_view_guest.h +++ b/brave/browser/guest_view/tab_view/tab_view_guest.h @@ -62,7 +62,7 @@ class TabViewGuest : public guest_view::GuestView { void GuestDestroyed() final; void CreateWebContents( const base::DictionaryValue& create_params, - const WebContentsCreatedCallback& callback) final; + WebContentsCreatedCallback callback) final; bool ShouldDestroyOnDetach() const final; void DidAttachToEmbedder() final; void DidDetachFromEmbedder() final; diff --git a/vendor/brightray/browser/media/media_stream_devices_controller.cc b/vendor/brightray/browser/media/media_stream_devices_controller.cc index a744a08ae4..3b6bbc54db 100644 --- a/vendor/brightray/browser/media/media_stream_devices_controller.cc +++ b/vendor/brightray/browser/media/media_stream_devices_controller.cc @@ -26,9 +26,9 @@ bool HasAnyAvailableDevice() { MediaStreamDevicesController::MediaStreamDevicesController( const content::MediaStreamRequest& request, - const content::MediaResponseCallback& callback) + content::MediaResponseCallback callback) : request_(request), - callback_(callback), + callback_(std::move(callback)), // For MEDIA_OPEN_DEVICE requests (Pepper) we always request both webcam // and microphone to avoid popping two infobars. microphone_requested_( @@ -41,9 +41,9 @@ MediaStreamDevicesController::MediaStreamDevicesController( MediaStreamDevicesController::~MediaStreamDevicesController() { if (!callback_.is_null()) { - callback_.Run(content::MediaStreamDevices(), - content::MEDIA_DEVICE_INVALID_STATE, - std::unique_ptr()); + std::move(callback_).Run(content::MediaStreamDevices(), + content::MEDIA_DEVICE_INVALID_STATE, + std::unique_ptr()); } } @@ -140,17 +140,13 @@ void MediaStreamDevicesController::Accept() { } } - content::MediaResponseCallback cb = callback_; - callback_.Reset(); - cb.Run(devices, content::MEDIA_DEVICE_OK, std::unique_ptr()); + std::move(callback_).Run(devices, content::MEDIA_DEVICE_OK, + std::unique_ptr()); } void MediaStreamDevicesController::Deny(content::MediaStreamRequestResult result) { - content::MediaResponseCallback cb = callback_; - callback_.Reset(); - cb.Run(content::MediaStreamDevices(), - result, - std::unique_ptr()); + std::move(callback_).Run(content::MediaStreamDevices(), result, + std::unique_ptr()); } void MediaStreamDevicesController::HandleUserMediaRequest() { @@ -185,12 +181,10 @@ void MediaStreamDevicesController::HandleUserMediaRequest() { screen_id.ToString(), "Screen")); } - content::MediaResponseCallback cb = callback_; - callback_.Reset(); - cb.Run(devices, - devices.empty() ? content::MEDIA_DEVICE_INVALID_STATE : - content::MEDIA_DEVICE_OK, - std::unique_ptr()); + std::move(callback_).Run(devices, + devices.empty() ? content::MEDIA_DEVICE_INVALID_STATE + : content::MEDIA_DEVICE_OK, + std::unique_ptr()); } } // namespace brightray diff --git a/vendor/brightray/browser/media/media_stream_devices_controller.h b/vendor/brightray/browser/media/media_stream_devices_controller.h index 47aacfb66b..77abb50c06 100644 --- a/vendor/brightray/browser/media/media_stream_devices_controller.h +++ b/vendor/brightray/browser/media/media_stream_devices_controller.h @@ -14,7 +14,7 @@ namespace brightray { class MediaStreamDevicesController { public: MediaStreamDevicesController(const content::MediaStreamRequest& request, - const content::MediaResponseCallback& callback); + content::MediaResponseCallback callback); virtual ~MediaStreamDevicesController(); From a357eae9a2c938eaa29a88ee6ab8a03aae4e42a6 Mon Sep 17 00:00:00 2001 From: Lorenzo Tilve Date: Mon, 9 Jul 2018 19:30:55 +0200 Subject: [PATCH 012/138] Add missing GetAppGuid() to configurator https://crrev.com/dbbd2c2c8630 --- .../brave_component_updater_configurator.cc | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/brave/browser/component_updater/brave_component_updater_configurator.cc b/brave/browser/component_updater/brave_component_updater_configurator.cc index 542529866a..969cf9fce8 100644 --- a/brave/browser/component_updater/brave_component_updater_configurator.cc +++ b/brave/browser/component_updater/brave_component_updater_configurator.cc @@ -15,6 +15,7 @@ #include "base/version.h" #if defined(OS_WIN) #include "base/win/win_util.h" +#include "chrome/install_static/install_util.h" #endif #include "chrome/browser/browser_process.h" #include "components/component_updater/component_updater_command_line_config_policy.h" @@ -62,6 +63,7 @@ class BraveConfigurator : public update_client::Configurator { update_client::ActivityDataService* GetActivityDataService() const override; bool IsPerUserInstall() const override; std::vector GetRunActionKeyHash() const override; + std::string GetAppGuid() const override; private: friend class base::RefCountedThreadSafe; @@ -198,6 +200,15 @@ std::vector BraveConfigurator::GetRunActionKeyHash() const { return configurator_impl_.GetRunActionKeyHash(); } +std::string BraveConfigurator::GetAppGuid() const { +#if defined(OS_WIN) + return install_static::UTF16ToUTF8(install_static::GetAppGuid()); +#else + return configurator_impl_.GetAppGuid(); +#endif +} + + } // namespace scoped_refptr From 2db4659f40e6bb6da25f4ed8a11b828a2d564da1 Mon Sep 17 00:00:00 2001 From: Lorenzo Tilve Date: Mon, 9 Jul 2018 22:48:18 +0200 Subject: [PATCH 013/138] Rename WebContentsDelegate methods https://crrev.com/014dec79d523 --- atom/browser/api/atom_api_web_contents.cc | 8 ++------ atom/browser/api/atom_api_web_contents.h | 5 ++--- 2 files changed, 4 insertions(+), 9 deletions(-) diff --git a/atom/browser/api/atom_api_web_contents.cc b/atom/browser/api/atom_api_web_contents.cc index 5ce45c9497..cde47225ff 100644 --- a/atom/browser/api/atom_api_web_contents.cc +++ b/atom/browser/api/atom_api_web_contents.cc @@ -997,8 +997,8 @@ void WebContents::BeforeUnloadFired(content::WebContents* tab, *proceed_to_fire_unload = true; } -void WebContents::MoveContents(content::WebContents* source, - const gfx::Rect& pos) { +void WebContents::SetContentsBounds(content::WebContents* source, + const gfx::Rect& pos) { Emit("move", pos); } @@ -1028,10 +1028,6 @@ void WebContents::LoadProgressChanged(content::WebContents* source, Emit("load-progress-changed", progress); } -bool WebContents::IsPopupOrPanel(const content::WebContents* source) const { - return type_ == BROWSER_WINDOW; -} - void WebContents::HandleKeyboardEvent( content::WebContents* source, const content::NativeWebKeyboardEvent& event) { diff --git a/atom/browser/api/atom_api_web_contents.h b/atom/browser/api/atom_api_web_contents.h index c79cd6c8a2..e3c96d3700 100644 --- a/atom/browser/api/atom_api_web_contents.h +++ b/atom/browser/api/atom_api_web_contents.h @@ -421,14 +421,13 @@ class WebContents : public mate::TrackableObject, void BeforeUnloadFired(content::WebContents* tab, bool proceed, bool* proceed_to_fire_unload) override; - void MoveContents(content::WebContents* source, - const gfx::Rect& pos) override; + void SetContentsBounds(content::WebContents* source, + const gfx::Rect& pos) override; void CloseContents(content::WebContents* source) override; void ActivateContents(content::WebContents* contents) override; void UpdateTargetURL(content::WebContents* source, const GURL& url) override; void LoadProgressChanged(content::WebContents* source, double progress) override; - bool IsPopupOrPanel(const content::WebContents* source) const override; void HandleKeyboardEvent( content::WebContents* source, const content::NativeWebKeyboardEvent& event) override; From 10f27dbd40ba2310d5f42a295887345c830a7ceb Mon Sep 17 00:00:00 2001 From: Lorenzo Tilve Date: Mon, 9 Jul 2018 23:57:25 +0200 Subject: [PATCH 014/138] Refactor RenderWidgetHost RendererUnresponsive() into generic base::Closure https://crrev.com/52b9372f38d4 --- atom/browser/api/atom_api_web_contents.cc | 3 ++- atom/browser/api/atom_api_web_contents.h | 4 +++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/atom/browser/api/atom_api_web_contents.cc b/atom/browser/api/atom_api_web_contents.cc index cde47225ff..9334a90688 100644 --- a/atom/browser/api/atom_api_web_contents.cc +++ b/atom/browser/api/atom_api_web_contents.cc @@ -1082,7 +1082,8 @@ void WebContents::ExitFullscreenModeForTab(content::WebContents* source) { void WebContents::RendererUnresponsive( content::WebContents* source, - content::RenderWidgetHost* render_widget_host) { + content::RenderWidgetHost* render_widget_host, + base::RepeatingClosure hang_monitor_restarter) { Emit("unresponsive"); if ((type_ == BROWSER_WINDOW) && owner_window()) owner_window()->RendererUnresponsive(source); diff --git a/atom/browser/api/atom_api_web_contents.h b/atom/browser/api/atom_api_web_contents.h index e3c96d3700..04b5d43477 100644 --- a/atom/browser/api/atom_api_web_contents.h +++ b/atom/browser/api/atom_api_web_contents.h @@ -5,6 +5,7 @@ #ifndef ATOM_BROWSER_API_ATOM_API_WEB_CONTENTS_H_ #define ATOM_BROWSER_API_ATOM_API_WEB_CONTENTS_H_ +#include #include #include #include @@ -439,7 +440,8 @@ class WebContents : public mate::TrackableObject, void ContentsZoomChange(bool zoom_in) override; void RendererUnresponsive( content::WebContents* source, - content::RenderWidgetHost* render_widget_host) override; + content::RenderWidgetHost* render_widget_host, + base::RepeatingClosure hang_monitor_restarter) override; void RendererResponsive( content::WebContents* source, content::RenderWidgetHost* render_widget_host) override; From 80cadb7d15831b54ab42c39a49240a37e3312372 Mon Sep 17 00:00:00 2001 From: Lorenzo Tilve Date: Tue, 10 Jul 2018 00:16:01 +0200 Subject: [PATCH 015/138] Moved and renamed some Speech Recognition mojom files to Blink https://crrev.com/c35bf396d6b5 https://crrev.com/ce74950625ba https://crrev.com/e75e328a0268 --- atom/browser/atom_speech_recognition_manager_delegate.cc | 7 +++---- atom/browser/atom_speech_recognition_manager_delegate.h | 8 ++++++-- 2 files changed, 9 insertions(+), 6 deletions(-) diff --git a/atom/browser/atom_speech_recognition_manager_delegate.cc b/atom/browser/atom_speech_recognition_manager_delegate.cc index 7d50fce1e2..79af665699 100644 --- a/atom/browser/atom_speech_recognition_manager_delegate.cc +++ b/atom/browser/atom_speech_recognition_manager_delegate.cc @@ -4,7 +4,6 @@ #include "atom/browser/atom_speech_recognition_manager_delegate.h" -#include #include #include "base/callback.h" @@ -40,11 +39,11 @@ void AtomSpeechRecognitionManagerDelegate::OnRecognitionEnd(int session_id) { } void AtomSpeechRecognitionManagerDelegate::OnRecognitionResults( - int session_id, const content::SpeechRecognitionResults& result) { -} + int session_id, + const std::vector& result) {} void AtomSpeechRecognitionManagerDelegate::OnRecognitionError( - int session_id, const content::SpeechRecognitionError& error) { + int session_id, const blink::mojom::SpeechRecognitionError& error) { } void AtomSpeechRecognitionManagerDelegate::OnAudioLevelsChange( diff --git a/atom/browser/atom_speech_recognition_manager_delegate.h b/atom/browser/atom_speech_recognition_manager_delegate.h index 0836d46296..d8ec581e24 100644 --- a/atom/browser/atom_speech_recognition_manager_delegate.h +++ b/atom/browser/atom_speech_recognition_manager_delegate.h @@ -6,6 +6,7 @@ #define ATOM_BROWSER_ATOM_SPEECH_RECOGNITION_MANAGER_DELEGATE_H_ #include +#include #include "base/macros.h" #include "content/public/browser/speech_recognition_event_listener.h" @@ -29,9 +30,12 @@ class AtomSpeechRecognitionManagerDelegate void OnAudioEnd(int session_id) override; void OnRecognitionEnd(int session_id) override; void OnRecognitionResults( - int session_id, const content::SpeechRecognitionResults& result) override; + int session_id, + const std::vector& result) + override; void OnRecognitionError( - int session_id, const content::SpeechRecognitionError& error) override; + int session_id, + const blink::mojom::SpeechRecognitionError& error) override; void OnAudioLevelsChange(int session_id, float volume, float noise_volume) override; From fcd1b854bcb0b9a30901e9d65703652612f8610d Mon Sep 17 00:00:00 2001 From: Lorenzo Tilve Date: Tue, 10 Jul 2018 00:27:45 +0200 Subject: [PATCH 016/138] Remove WebContents::WasRecentlyAudible and fix use in extensions_tab_util https://crrev.com/2013965fad65 https://crrev.com/737e22b4d5c2 --- .../browser/extensions/extension_tab_util.cc | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/chromium_src/chrome/browser/extensions/extension_tab_util.cc b/chromium_src/chrome/browser/extensions/extension_tab_util.cc index 156f0443ee..bb815414b0 100644 --- a/chromium_src/chrome/browser/extensions/extension_tab_util.cc +++ b/chromium_src/chrome/browser/extensions/extension_tab_util.cc @@ -20,6 +20,7 @@ #include "chrome/browser/ui/browser.h" #include "chrome/browser/ui/browser_finder.h" #include "chrome/browser/ui/browser_window.h" +#include "chrome/browser/ui/recently_audible_helper.h" #include "chrome/browser/ui/tab_contents/tab_contents_iterator.h" #include "chrome/browser/ui/tabs/tab_strip_model.h" #include "chrome/common/extensions/api/tabs.h" @@ -145,7 +146,20 @@ std::unique_ptr ExtensionTabUtil::CreateTabObject( tab_object->selected = tab_object->active; tab_object->highlighted = tab_strip && tab_strip->IsTabSelected(tab_index); tab_object->pinned = tab_helper->is_pinned(); - tab_object->audible = std::make_unique(contents->WasRecentlyAudible()); + + auto* audible_helper = RecentlyAudibleHelper::FromWebContents(contents); + bool audible = false; + if (audible_helper) { + // WebContents in a tab strip have RecentlyAudible helpers. They endow the + // tab with a notion of audibility that has a timeout for quiet periods. Use + // that if available. + audible = audible_helper->WasRecentlyAudible(); + } else { + // Otherwise use the instantaneous notion of audibility. + audible = contents->IsCurrentlyAudible(); + } + tab_object->audible = std::make_unique(audible); + auto* tab_lifeycle_unit_external = resource_coordinator::TabLifecycleUnitExternal::FromWebContents(contents); tab_object->discarded = tab_helper->IsDiscarded(); From aa08fe06535f2dcd7e74129a72e93fb8b187d6d5 Mon Sep 17 00:00:00 2001 From: Henrique Ferreiro Date: Tue, 10 Jul 2018 13:30:10 +0200 Subject: [PATCH 017/138] Move ExtensionService to extensions:: namespace https://crrev.com/eea1b7a4b7e6 --- atom/browser/extensions/atom_extension_system.h | 4 ++-- .../content_settings/host_content_settings_map_factory.cc | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/atom/browser/extensions/atom_extension_system.h b/atom/browser/extensions/atom_extension_system.h index c2e6fec01c..d1f88da524 100644 --- a/atom/browser/extensions/atom_extension_system.h +++ b/atom/browser/extensions/atom_extension_system.h @@ -17,6 +17,8 @@ class HostContentSettingsMap; +namespace extensions { + class ExtensionService { public: virtual bool IsExtensionEnabled(const std::string& extension_id) const = 0; @@ -42,8 +44,6 @@ class ExtensionService { virtual bool is_ready() = 0; }; -namespace extensions { - class AtomExtensionSystemSharedFactory; class AppSorting; class StateStore; diff --git a/chromium_src/chrome/browser/content_settings/host_content_settings_map_factory.cc b/chromium_src/chrome/browser/content_settings/host_content_settings_map_factory.cc index 8e5b54d7d2..08f9e42d9a 100644 --- a/chromium_src/chrome/browser/content_settings/host_content_settings_map_factory.cc +++ b/chromium_src/chrome/browser/content_settings/host_content_settings_map_factory.cc @@ -63,7 +63,7 @@ scoped_refptr profile->GetPrefs(), profile->IsOffTheRecord(), false, false)); #if BUILDFLAG(ENABLE_EXTENSIONS) - ExtensionService *ext_service = + extensions::ExtensionService *ext_service = extensions::ExtensionSystem::Get(profile)->extension_service(); // This may be null in testing or when the extenion_service hasn't been // initialized, in which case it will be registered then. From b3c41138faeeff8f40e2840bebdd1cddc50cc9cf Mon Sep 17 00:00:00 2001 From: Henrique Ferreiro Date: Tue, 10 Jul 2018 13:38:22 +0200 Subject: [PATCH 018/138] UserDataKey() return type changed to const void* https://crrev.com/84c29aa09728 --- atom/browser/native_window.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/atom/browser/native_window.h b/atom/browser/native_window.h index 0199216ac6..186f3b3561 100644 --- a/atom/browser/native_window.h +++ b/atom/browser/native_window.h @@ -342,7 +342,7 @@ class NativeWindowRelay : explicit NativeWindowRelay(base::WeakPtr window) : key(UserDataKey()), window(window) {} - void* key; + const void* key; base::WeakPtr window; private: From 7bbf5bc9feff06e0531588c6cf7a263b14866bc3 Mon Sep 17 00:00:00 2001 From: Henrique Ferreiro Date: Tue, 10 Jul 2018 15:38:12 +0200 Subject: [PATCH 019/138] component_updater::ComponentUpdateServiceFactory() changed params Also updated the code to reflect upstream Chromium changes. https://crrev.com/5f173cb15baf --- muon/browser/BUILD.gn | 4 ++++ muon/browser/muon_browser_process_impl.cc | 26 +++++++++++------------ 2 files changed, 17 insertions(+), 13 deletions(-) diff --git a/muon/browser/BUILD.gn b/muon/browser/BUILD.gn index 2a978a24a5..c1d2a9fc9a 100644 --- a/muon/browser/BUILD.gn +++ b/muon/browser/BUILD.gn @@ -10,6 +10,10 @@ source_set("browser") { "muon_browser_process_impl.h", ] + deps = [ + "//components/component_updater", + ] + public_deps = [ "//electron/chromium_src:browser", ] diff --git a/muon/browser/muon_browser_process_impl.cc b/muon/browser/muon_browser_process_impl.cc index 34c9307dbc..353de00d15 100644 --- a/muon/browser/muon_browser_process_impl.cc +++ b/muon/browser/muon_browser_process_impl.cc @@ -11,6 +11,7 @@ #include "chrome/browser/profiles/profile.h" #include "chrome/browser/profiles/profile_manager.h" #include "components/component_updater/component_updater_service.h" +#include "components/component_updater/timer_update_scheduler.h" #include "content/public/browser/browser_thread.h" #include "content/public/browser/resource_dispatcher_host.h" #include "content/public/browser/resource_dispatcher_host_delegate.h" @@ -31,19 +32,18 @@ component_updater::ComponentUpdateService* MuonBrowserProcessImpl::component_updater( std::unique_ptr &component_updater, bool use_brave_server) { - if (!component_updater.get()) { - if (!content::BrowserThread::CurrentlyOn(content::BrowserThread::UI)) - return NULL; - scoped_refptr configurator = - component_updater::MakeBraveComponentUpdaterConfigurator( - base::CommandLine::ForCurrentProcess(), - io_thread()->system_url_request_context_getter(), - use_brave_server); - // Creating the component updater does not do anything, components - // need to be registered and Start() needs to be called. - component_updater.reset(component_updater::ComponentUpdateServiceFactory( - configurator).release()); - } + if (component_updater.get()) + return component_updater.get(); + + if (!content::BrowserThread::CurrentlyOn(content::BrowserThread::UI)) + return nullptr; + + component_updater = component_updater::ComponentUpdateServiceFactory( + component_updater::MakeBraveComponentUpdaterConfigurator( + base::CommandLine::ForCurrentProcess(), + io_thread()->system_url_request_context_getter(), use_brave_server), + std::make_unique()); + return component_updater.get(); } From cdb014405067a596dd336480cca89279816a0541 Mon Sep 17 00:00:00 2001 From: Henrique Ferreiro Date: Tue, 10 Jul 2018 15:45:38 +0200 Subject: [PATCH 020/138] NetworkService: Add ClearHostCache() method https://crrev.com/b458879b37cb --- brave/browser/brave_browser_context.cc | 11 +++++--- chromium_src/chrome/browser/io_thread.cc | 32 +++--------------------- 2 files changed, 12 insertions(+), 31 deletions(-) diff --git a/brave/browser/brave_browser_context.cc b/brave/browser/brave_browser_context.cc index 7db6435935..36c4cb2068 100644 --- a/brave/browser/brave_browser_context.cc +++ b/brave/browser/brave_browser_context.cc @@ -55,7 +55,6 @@ #include "content/public/browser/site_instance.h" #include "content/public/browser/storage_partition.h" #include "content/public/common/service_manager_connection.h" -#include "services/service_manager/public/cpp/connector.h" #include "extensions/browser/pref_names.h" #include "extensions/buildflags/buildflags.h" #include "net/base/escape.h" @@ -64,6 +63,8 @@ #include "net/url_request/url_request_context.h" #include "net/url_request/url_request_context_getter.h" #include "net/url_request/url_request_job_factory_impl.h" +#include "services/network/public/mojom/network_context.mojom.h" +#include "services/service_manager/public/cpp/connector.h" #include "vendor/brightray/browser/browser_client.h" #include "vendor/brightray/browser/net_log.h" @@ -265,6 +266,12 @@ BraveBrowserContext::~BraveBrowserContext() { } } + // Clears any data the network stack contains that may be related to the + // OTR session. Must be done before DestroyBrowserContextServices, since + // the NetworkContext is managed by one such service. + GetDefaultStoragePartition(this)->GetNetworkContext()->ClearHostCache( + nullptr, network::mojom::NetworkContext::ClearHostCacheCallback()); + BrowserContextDependencyManager::GetInstance()-> DestroyBrowserContextServices(this); @@ -277,8 +284,6 @@ BraveBrowserContext::~BraveBrowserContext() { #endif } - g_browser_process->io_thread()->ChangedToOnTheRecord(); - ShutdownStoragePartitions(); } diff --git a/chromium_src/chrome/browser/io_thread.cc b/chromium_src/chrome/browser/io_thread.cc index 7aae065f16..60cb98925b 100644 --- a/chromium_src/chrome/browser/io_thread.cc +++ b/chromium_src/chrome/browser/io_thread.cc @@ -220,14 +220,6 @@ void IOThread::CleanUp() { net_log_->ShutDownBeforeTaskScheduler(); } -void IOThread::ChangedToOnTheRecord() { - DCHECK_CURRENTLY_ON(BrowserThread::UI); - BrowserThread::PostTask( - BrowserThread::IO, FROM_HERE, - base::BindOnce(&IOThread::ChangedToOnTheRecordOnIOThread, - base::Unretained(this))); -} - net::URLRequestContextGetter* IOThread::system_url_request_context_getter() { DCHECK_CURRENTLY_ON(BrowserThread::UI); if (!system_url_request_context_getter_.get()) { @@ -237,28 +229,11 @@ net::URLRequestContextGetter* IOThread::system_url_request_context_getter() { return system_url_request_context_getter_.get(); } -void IOThread::ClearHostCache( - const base::Callback& host_filter) { - DCHECK_CURRENTLY_ON(BrowserThread::IO); - - globals_->system_request_context->host_resolver() - ->GetHostCache() - ->ClearForHosts(host_filter); -} - void IOThread::DisableQuic() { DCHECK_CURRENTLY_ON(BrowserThread::IO); globals_->quic_disabled = true; } -void IOThread::ChangedToOnTheRecordOnIOThread() { - DCHECK_CURRENTLY_ON(BrowserThread::IO); - - // Clear the host cache to avoid showing entries from the OTR session - // in about:net-internals. - ClearHostCache(base::Callback()); -} - // static // static @@ -363,8 +338,6 @@ void IOThread::ConstructSystemRequestContext() { builder->SetHttpAuthHandlerFactory( CreateDefaultAuthHandlerFactory(host_resolver.get())); - builder->set_host_resolver(std::move(host_resolver)); - std::unique_ptr cert_verifier; cert_verifier = net::CertVerifier::CreateDefault(); @@ -384,12 +357,15 @@ void IOThread::ConstructSystemRequestContext() { std::make_unique( std::map()), net_log_); + globals_->deprecated_host_resolver = std::move(host_resolver); globals_->system_request_context_owner = std::move(builder)->Create( std::move(network_context_params_).get(), !is_quic_allowed_on_init_, - net_log_, globals_->deprecated_network_quality_estimator.get()); + net_log_, globals_->deprecated_host_resolver.get(), + globals_->deprecated_network_quality_estimator.get()); globals_->system_request_context = globals_->system_request_context_owner.url_request_context.get(); } else { + content::GetNetworkServiceImpl()->SetHostResolver(std::move(host_resolver)); globals_->system_network_context = content::GetNetworkServiceImpl()->CreateNetworkContextWithBuilder( std::move(network_context_request_), From 582d2a0c27e794fe94640b0dc3d622ddbbfe82cb Mon Sep 17 00:00:00 2001 From: Lorenzo Tilve Date: Tue, 10 Jul 2018 19:11:16 +0200 Subject: [PATCH 021/138] Capture Gaia password hashes used in content area https://crrev.com/019a2dc45de0 --- .../password_manager/brave_credentials_filter.cc | 12 +++++++++++- .../password_manager/brave_credentials_filter.h | 6 +++++- .../brave_password_manager_client.cc | 2 +- .../password_manager/brave_password_manager_client.h | 2 +- 4 files changed, 18 insertions(+), 4 deletions(-) diff --git a/brave/browser/password_manager/brave_credentials_filter.cc b/brave/browser/password_manager/brave_credentials_filter.cc index d40b1b07aa..28a5139511 100644 --- a/brave/browser/password_manager/brave_credentials_filter.cc +++ b/brave/browser/password_manager/brave_credentials_filter.cc @@ -22,11 +22,21 @@ bool BraveCredentialsFilter::ShouldSave( return true; } -bool BraveCredentialsFilter::ShouldSavePasswordHash( +bool BraveCredentialsFilter::ShouldSaveGaiaPasswordHash( const autofill::PasswordForm& form) const { return true; } +bool BraveCredentialsFilter::ShouldSaveEnterprisePasswordHash( + const autofill::PasswordForm& form) const { + return true; +} + +bool BraveCredentialsFilter::IsSyncAccountEmail( + const std::string& username) const { + return true; +} + void BraveCredentialsFilter::ReportFormLoginSuccess( const PasswordFormManager& form_manager) const {} diff --git a/brave/browser/password_manager/brave_credentials_filter.h b/brave/browser/password_manager/brave_credentials_filter.h index 67f3a311a3..d5e2e09d50 100644 --- a/brave/browser/password_manager/brave_credentials_filter.h +++ b/brave/browser/password_manager/brave_credentials_filter.h @@ -6,6 +6,7 @@ #define BRAVE_BROWSER_PASSWORD_MANAGER_BRAVE_CREDENTIALS_FILTER_H_ #include +#include #include #include "base/macros.h" @@ -24,10 +25,13 @@ class BraveCredentialsFilter : public CredentialsFilter { std::vector> results) const override; bool ShouldSave(const autofill::PasswordForm& form) const override; - bool ShouldSavePasswordHash( + bool ShouldSaveGaiaPasswordHash( + const autofill::PasswordForm& form) const override; + bool ShouldSaveEnterprisePasswordHash( const autofill::PasswordForm& form) const override; void ReportFormLoginSuccess( const PasswordFormManager& form_manager) const override; + bool IsSyncAccountEmail(const std::string& username) const override; virtual void FilterResultsPtr( std::vector>* results) const; diff --git a/brave/browser/password_manager/brave_password_manager_client.cc b/brave/browser/password_manager/brave_password_manager_client.cc index 102c67b204..efa39c41b4 100644 --- a/brave/browser/password_manager/brave_password_manager_client.cc +++ b/brave/browser/password_manager/brave_password_manager_client.cc @@ -399,7 +399,7 @@ void BravePasswordManagerClient::CheckSafeBrowsingReputation( void BravePasswordManagerClient::LogPasswordReuseDetectedEvent() {} void BravePasswordManagerClient::CheckProtectedPasswordEntry( - bool matches_sync_password, + password_manager::metrics_util::PasswordType reused_password_type, const std::vector& matching_domains, bool password_field_exists) {} #endif diff --git a/brave/browser/password_manager/brave_password_manager_client.h b/brave/browser/password_manager/brave_password_manager_client.h index 7a2cc051cf..71faf8188f 100644 --- a/brave/browser/password_manager/brave_password_manager_client.h +++ b/brave/browser/password_manager/brave_password_manager_client.h @@ -112,7 +112,7 @@ class BravePasswordManagerClient void CheckSafeBrowsingReputation(const GURL& form_action, const GURL& frame_url) override; void CheckProtectedPasswordEntry( - bool matches_sync_password, + password_manager::metrics_util::PasswordType reused_password_type, const std::vector& matching_domains, bool password_field_exists) override; void LogPasswordReuseDetectedEvent() override; From 9f616ce497e5032baf06fcb5adab5e1da7534793 Mon Sep 17 00:00:00 2001 From: Lorenzo Tilve Date: Tue, 10 Jul 2018 20:03:21 +0200 Subject: [PATCH 022/138] Add missing resource_coordinator:site_characteristics_proto dep https://crrev.com/29ed9114f31f --- chromium_src/BUILD.gn | 1 + 1 file changed, 1 insertion(+) diff --git a/chromium_src/BUILD.gn b/chromium_src/BUILD.gn index d10b5e2afe..cb527d56c3 100644 --- a/chromium_src/BUILD.gn +++ b/chromium_src/BUILD.gn @@ -1234,6 +1234,7 @@ source_set("tab_manager") { deps = [ ":lifetime", + "//chrome/browser/resource_coordinator:site_characteristics_proto", "//chrome/browser/resource_coordinator:tab_metrics_event_proto", "//chrome/browser/resource_coordinator/tab_ranker", "//components/feature_engagement:buildflags", From 5d0fe838bacd60230d5453892419cd1ee1a67011 Mon Sep 17 00:00:00 2001 From: Lorenzo Tilve Date: Tue, 10 Jul 2018 20:29:52 +0200 Subject: [PATCH 023/138] Update GetCurrentPrintPreviewStatus params https://crrev.com/5162124a8b00 --- .../chrome/browser/ui/webui/print_preview/print_preview_ui.cc | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/chromium_src/chrome/browser/ui/webui/print_preview/print_preview_ui.cc b/chromium_src/chrome/browser/ui/webui/print_preview/print_preview_ui.cc index 24d644b194..9b3cea2ac7 100644 --- a/chromium_src/chrome/browser/ui/webui/print_preview/print_preview_ui.cc +++ b/chromium_src/chrome/browser/ui/webui/print_preview/print_preview_ui.cc @@ -5,8 +5,7 @@ #include "chrome/browser/ui/webui/print_preview/print_preview_ui.h" // static -void PrintPreviewUI::GetCurrentPrintPreviewStatus(int32_t preview_ui_id, - int request_id, +void PrintPreviewUI::GetCurrentPrintPreviewStatus(const PrintHostMsg_PreviewIds& ids, bool* cancel) { // TODO(bridiver) - need a real implementation of this return; From c45beac03a55dcc0dc1e950e29c8dafc5588f7a3 Mon Sep 17 00:00:00 2001 From: Lorenzo Tilve Date: Tue, 10 Jul 2018 23:40:00 +0200 Subject: [PATCH 024/138] TODO: Fixed reporting for iframe ugprade-insecure-requests upgrades https://crrev.com/0d67fc7cdf40 --- atom/browser/net/asar/url_request_asar_job.cc | 3 ++- atom/browser/net/asar/url_request_asar_job.h | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/atom/browser/net/asar/url_request_asar_job.cc b/atom/browser/net/asar/url_request_asar_job.cc index 8bb71bb782..92ca6398b2 100644 --- a/atom/browser/net/asar/url_request_asar_job.cc +++ b/atom/browser/net/asar/url_request_asar_job.cc @@ -165,7 +165,8 @@ int URLRequestAsarJob::ReadRawData(net::IOBuffer* dest, int dest_size) { } bool URLRequestAsarJob::IsRedirectResponse(GURL* location, - int* http_status_code) { + int* http_status_code, + bool* insecure_scheme_was_upgraded) { if (type_ != TYPE_FILE) return false; #if defined(OS_WIN) diff --git a/atom/browser/net/asar/url_request_asar_job.h b/atom/browser/net/asar/url_request_asar_job.h index 722992fa4d..2e58f4f8a4 100644 --- a/atom/browser/net/asar/url_request_asar_job.h +++ b/atom/browser/net/asar/url_request_asar_job.h @@ -57,7 +57,8 @@ class URLRequestAsarJob : public net::URLRequestJob { void Start() override; void Kill() override; int ReadRawData(net::IOBuffer* buf, int buf_size) override; - bool IsRedirectResponse(GURL* location, int* http_status_code) override; + bool IsRedirectResponse(GURL* location, int* http_status_code, + bool* insecure_scheme_was_upgraded) override; // URLRequestJob implementation. std::unique_ptr SetUpSourceStream() override; bool GetMimeType(std::string* mime_type) const override; From a2554de03969e79f0da5706ecd81ea82d3ec61f0 Mon Sep 17 00:00:00 2001 From: Lorenzo Tilve Date: Tue, 10 Jul 2018 23:54:16 +0200 Subject: [PATCH 025/138] Remove unused RunMicrotasksObserver https://crrev.com/694a6830e3c5 --- atom/browser/atom_browser_main_parts.cc | 3 --- atom/browser/javascript_environment.cc | 8 -------- atom/browser/javascript_environment.h | 3 --- brave/common/workers/v8_worker_thread.cc | 2 -- 4 files changed, 16 deletions(-) diff --git a/atom/browser/atom_browser_main_parts.cc b/atom/browser/atom_browser_main_parts.cc index fe9a72c4c8..c44727b522 100644 --- a/atom/browser/atom_browser_main_parts.cc +++ b/atom/browser/atom_browser_main_parts.cc @@ -373,7 +373,6 @@ void AtomBrowserMainParts::PreMainMessageLoopRun() { base::Bind(&AtomBrowserMainParts::IdleHandler, base::Unretained(this))); - js_env_->OnMessageLoopCreated(); node_bindings_->PrepareMessageLoop(); node_bindings_->RunMessageLoop(); @@ -416,8 +415,6 @@ void AtomBrowserMainParts::PostMainMessageLoopRun() { browser_context_ = nullptr; brightray::BrowserMainParts::PostMainMessageLoopRun(); - js_env_->OnMessageLoopDestroying(); - js_env_->isolate()->Exit(); #if defined(OS_MACOSX) FreeAppDelegate(); diff --git a/atom/browser/javascript_environment.cc b/atom/browser/javascript_environment.cc index ad4e6e93e3..a030a93558 100644 --- a/atom/browser/javascript_environment.cc +++ b/atom/browser/javascript_environment.cc @@ -185,14 +185,6 @@ JavascriptEnvironment::~JavascriptEnvironment() { } } -void JavascriptEnvironment::OnMessageLoopCreated() { - isolate_holder_->AddRunMicrotasksObserver(); -} - -void JavascriptEnvironment::OnMessageLoopDestroying() { - isolate_holder_->RemoveRunMicrotasksObserver(); -} - bool JavascriptEnvironment::Initialize() { auto cmd = base::CommandLine::ForCurrentProcess(); diff --git a/atom/browser/javascript_environment.h b/atom/browser/javascript_environment.h index 3df16977cf..18e7e6b718 100644 --- a/atom/browser/javascript_environment.h +++ b/atom/browser/javascript_environment.h @@ -25,9 +25,6 @@ class JavascriptEnvironment { JavascriptEnvironment(); ~JavascriptEnvironment(); - void OnMessageLoopCreated(); - void OnMessageLoopDestroying(); - v8::Isolate* isolate() const { return isolate_; } extensions::ScriptContext* script_context() const { return script_context_.get(); diff --git a/brave/common/workers/v8_worker_thread.cc b/brave/common/workers/v8_worker_thread.cc index 5a4e851d58..a6fccf2ea0 100644 --- a/brave/common/workers/v8_worker_thread.cc +++ b/brave/common/workers/v8_worker_thread.cc @@ -92,7 +92,6 @@ void V8WorkerThread::Init() { void V8WorkerThread::Run(base::RunLoop* run_loop) { base::ThreadRestrictions::SetIOAllowed(true); content::WorkerThreadRegistry::Instance()->DidStartCurrentWorkerThread(); - env()->OnMessageLoopCreated(); LoadModule(); BrowserThread::PostTask(BrowserThread::UI, FROM_HERE, base::Bind(&NotifyStart, @@ -105,7 +104,6 @@ void V8WorkerThread::Run(base::RunLoop* run_loop) { void V8WorkerThread::CleanUp() { content::WorkerThreadRegistry::Instance()->WillStopCurrentWorkerThread(); memory_pressure_listener_.reset(); - env()->OnMessageLoopDestroying(); js_env_.reset(); V8WorkerThread::Shutdown(); } From b656050f6bfc3d68b3d32ae0304e72409ced56b6 Mon Sep 17 00:00:00 2001 From: Henrique Ferreiro Date: Wed, 11 Jul 2018 13:25:34 +0200 Subject: [PATCH 026/138] C69 updates to io_thread.cc https://crrev.com/4dfb375cee68 https://crrev.com/b63ff0d946a5 https://crrev.com/b67c0a8eaa84 https://crrev.com/f34bba7c3875 --- .../chrome/browser/browser_process_impl.cc | 1 + chromium_src/chrome/browser/io_thread.cc | 359 ++++++++---------- 2 files changed, 159 insertions(+), 201 deletions(-) diff --git a/chromium_src/chrome/browser/browser_process_impl.cc b/chromium_src/chrome/browser/browser_process_impl.cc index e8d5129260..8bd44d31e8 100644 --- a/chromium_src/chrome/browser/browser_process_impl.cc +++ b/chromium_src/chrome/browser/browser_process_impl.cc @@ -316,6 +316,7 @@ void BrowserProcessImpl::CreateLocalState() { SSLConfigServiceManager::RegisterPrefs(pref_registry.get()); GpuModeManager::RegisterPrefs(pref_registry.get()); safe_browsing::RegisterLocalStatePrefs(pref_registry.get()); + SystemNetworkContextManager::RegisterPrefs(pref_registry.get()); pref_change_registrar_.Init(local_state_.get()); pref_change_registrar_.Add( diff --git a/chromium_src/chrome/browser/io_thread.cc b/chromium_src/chrome/browser/io_thread.cc index 60cb98925b..64cff09310 100644 --- a/chromium_src/chrome/browser/io_thread.cc +++ b/chromium_src/chrome/browser/io_thread.cc @@ -1,4 +1,4 @@ -// Copyright (c) 2017 The Chromium Authors. All rights reserved. +// Copyright (c) 2012 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. @@ -9,14 +9,13 @@ #include "base/debug/leak_tracker.h" #include "base/trace_event/trace_event.h" #include "chrome/browser/data_use_measurement/chrome_data_use_ascriber.h" -#include "chrome/browser/net/chrome_mojo_proxy_resolver_factory.h" #include "chrome/browser/net/dns_probe_service.h" +#include "chrome/browser/net/failing_url_request_interceptor.h" #include "chrome/browser/net/proxy_service_factory.h" #include "chrome/common/chrome_content_client.h" #include "chrome/common/chrome_features.h" #include "chrome/common/chrome_switches.h" #include "chrome/common/pref_names.h" -#include "components/certificate_transparency/tree_state_tracker.h" #include "components/data_usage/core/data_use_aggregator.h" #include "components/net_log/chrome_net_log.h" #include "components/prefs/pref_registry_simple.h" @@ -26,11 +25,12 @@ #include "content/public/common/content_features.h" #include "content/public/common/content_switches.h" #include "extensions/buildflags/buildflags.h" +#include "net/cert/caching_cert_verifier.h" #include "net/cert/cert_verifier.h" +#include "net/cert/cert_verify_proc.h" #include "net/cert/ct_log_verifier.h" +#include "net/cert/multi_threaded_cert_verifier.h" #include "net/dns/mapped_host_resolver.h" -#include "net/http/http_auth_handler_factory.h" -#include "net/http/http_auth_preferences.h" #include "net/nqe/network_quality_estimator.h" #include "net/url_request/url_request_context.h" #include "net/url_request/url_request_context_getter.h" @@ -39,7 +39,6 @@ #include "services/network/public/cpp/features.h" #include "services/network/public/cpp/network_switches.h" #include "services/network/url_request_context_builder_mojo.h" -#include "vendor/brightray/common/content_client.h" #if BUILDFLAG(ENABLE_EXTENSIONS) #include "chrome/browser/extensions/event_router_forwarder.h" @@ -53,6 +52,36 @@ using content::BrowserThread; namespace { +net::CertVerifier* g_cert_verifier_for_io_thread_testing = nullptr; + +// A CertVerifier that forwards all requests to +// |g_cert_verifier_for_io_thread_testing|. This is used to allow IOThread to +// have its own std::unique_ptr while forwarding calls to the +// static verifier. +class WrappedCertVerifierForIOThreadTesting : public net::CertVerifier { + public: + ~WrappedCertVerifierForIOThreadTesting() override = default; + + // CertVerifier implementation + int Verify(const RequestParams& params, + net::CRLSet* crl_set, + net::CertVerifyResult* verify_result, + net::CompletionOnceCallback callback, + std::unique_ptr* out_req, + const net::NetLogWithSource& net_log) override { + verify_result->Reset(); + if (!g_cert_verifier_for_io_thread_testing) + return net::ERR_FAILED; + return g_cert_verifier_for_io_thread_testing->Verify( + params, crl_set, verify_result, std::move(callback), out_req, net_log); + } + bool SupportsOCSPStapling() override { + if (!g_cert_verifier_for_io_thread_testing) + return false; + return g_cert_verifier_for_io_thread_testing->SupportsOCSPStapling(); + } +}; + #if defined(OS_MACOSX) void ObserveKeychainEvents() { DCHECK_CURRENTLY_ON(BrowserThread::UI); @@ -60,76 +89,30 @@ void ObserveKeychainEvents() { } #endif -} // namespace - -IOThread::IOThread( - PrefService* local_state, - policy::PolicyService* policy_service, - net_log::ChromeNetLog* net_log, - extensions::EventRouterForwarder* extension_event_router_forwarder, - SystemNetworkContextManager* system_network_context_manager) - : net_log_(net_log), -#if BUILDFLAG(ENABLE_EXTENSIONS) - extension_event_router_forwarder_(extension_event_router_forwarder), -#endif - globals_(nullptr), - is_quic_allowed_on_init_(false), - weak_factory_(this) { - scoped_refptr io_thread_proxy = - BrowserThread::GetTaskRunnerForThread(BrowserThread::IO); - auth_schemes_ = local_state->GetString(prefs::kAuthSchemes); - negotiate_disable_cname_lookup_.Init( - prefs::kDisableAuthNegotiateCnameLookup, local_state, - base::Bind(&IOThread::UpdateNegotiateDisableCnameLookup, - base::Unretained(this))); - negotiate_disable_cname_lookup_.MoveToThread(io_thread_proxy); - negotiate_enable_port_.Init( - prefs::kEnableAuthNegotiatePort, local_state, - base::Bind(&IOThread::UpdateNegotiateEnablePort, base::Unretained(this))); - negotiate_enable_port_.MoveToThread(io_thread_proxy); - auth_server_whitelist_.Init( - prefs::kAuthServerWhitelist, local_state, - base::Bind(&IOThread::UpdateServerWhitelist, base::Unretained(this))); - auth_server_whitelist_.MoveToThread(io_thread_proxy); - auth_delegate_whitelist_.Init( - prefs::kAuthNegotiateDelegateWhitelist, local_state, - base::Bind(&IOThread::UpdateDelegateWhitelist, base::Unretained(this))); - auth_delegate_whitelist_.MoveToThread(io_thread_proxy); -#if defined(OS_POSIX) - gssapi_library_name_ = local_state->GetString(prefs::kGSSAPILibraryName); -#endif - - local_state->SetDefaultPrefValue( - prefs::kBuiltInDnsClientEnabled, - base::Value(base::FeatureList::IsEnabled(features::kAsyncDns))); - - dns_client_enabled_.Init(prefs::kBuiltInDnsClientEnabled, - local_state, - base::Bind(&IOThread::UpdateDnsClientEnabled, - base::Unretained(this))); - dns_client_enabled_.MoveToThread(io_thread_proxy); - - BrowserThread::SetIOThreadDelegate(this); - - system_network_context_manager->SetUp(&network_context_request_, - &network_context_params_, - &is_quic_allowed_on_init_); -} +std::unique_ptr CreateGlobalHostResolver( + net::NetLog* net_log) { + TRACE_EVENT0("startup", "IOThread::CreateGlobalHostResolver"); -IOThread::~IOThread() { - BrowserThread::SetIOThreadDelegate(nullptr); + using resolver = net::HostResolver; + std::unique_ptr global_host_resolver = + resolver::CreateSystemResolver(net::HostResolver::Options(), net_log); - DCHECK(!globals_); -} + // If hostname remappings were specified on the command-line, layer these + // rules on top of the real host resolver. This allows forwarding all requests + // through a designated test server. + const base::CommandLine& command_line = + *base::CommandLine::ForCurrentProcess(); + if (!command_line.HasSwitch(network::switches::kHostResolverRules)) + return global_host_resolver; -IOThread::Globals* IOThread::globals() { - DCHECK_CURRENTLY_ON(BrowserThread::IO); - return globals_; + auto remapped_resolver = std::make_unique( + std::move(global_host_resolver)); + remapped_resolver->SetRulesFromString( + command_line.GetSwitchValueASCII(network::switches::kHostResolverRules)); + return std::move(remapped_resolver); } -IOThread::Globals::Globals() : system_request_context(nullptr) {} - -IOThread::Globals::~Globals() {} +} // namespace class SystemURLRequestContextGetter : public net::URLRequestContextGetter { public: @@ -170,6 +153,55 @@ SystemURLRequestContextGetter::GetNetworkTaskRunner() const { return network_task_runner_; } +IOThread::Globals::Globals() : system_request_context(nullptr) {} + +IOThread::Globals::~Globals() {} + +IOThread::IOThread( + PrefService* local_state, + policy::PolicyService* policy_service, + net_log::ChromeNetLog* net_log, + extensions::EventRouterForwarder* extension_event_router_forwarder, + SystemNetworkContextManager* system_network_context_manager) + : net_log_(net_log), +#if BUILDFLAG(ENABLE_EXTENSIONS) + extension_event_router_forwarder_(extension_event_router_forwarder), +#endif + globals_(nullptr), + is_quic_allowed_on_init_(false), + weak_factory_(this) { + scoped_refptr io_thread_proxy = + BrowserThread::GetTaskRunnerForThread(BrowserThread::IO); + + BrowserThread::SetIOThreadDelegate(this); + + system_network_context_manager->SetUp( + &network_context_request_, &network_context_params_, + &stub_resolver_enabled_, &dns_over_https_servers_, + &http_auth_static_params_, &http_auth_dynamic_params_, + &is_quic_allowed_on_init_); +} + +IOThread::~IOThread() { + BrowserThread::SetIOThreadDelegate(nullptr); + + DCHECK(!globals_); +} + +IOThread::Globals* IOThread::globals() { + DCHECK_CURRENTLY_ON(BrowserThread::IO); + return globals_; +} + +net::URLRequestContextGetter* IOThread::system_url_request_context_getter() { + DCHECK_CURRENTLY_ON(BrowserThread::UI); + if (!system_url_request_context_getter_.get()) { + system_url_request_context_getter_ = + base::MakeRefCounted(this); + } + return system_url_request_context_getter_.get(); +} + void IOThread::Init() { TRACE_EVENT0("startup", "IOThread::InitAsync"); DCHECK_CURRENTLY_ON(BrowserThread::IO); @@ -194,9 +226,6 @@ void IOThread::Init() { #endif ConstructSystemRequestContext(); - - UpdateDnsClientEnabled(); - } void IOThread::CleanUp() { @@ -220,157 +249,85 @@ void IOThread::CleanUp() { net_log_->ShutDownBeforeTaskScheduler(); } -net::URLRequestContextGetter* IOThread::system_url_request_context_getter() { - DCHECK_CURRENTLY_ON(BrowserThread::UI); - if (!system_url_request_context_getter_.get()) { - system_url_request_context_getter_ = - base::MakeRefCounted(this); - } - return system_url_request_context_getter_.get(); -} +// static +void IOThread::RegisterPrefs(PrefRegistrySimple* registry) {} void IOThread::DisableQuic() { DCHECK_CURRENTLY_ON(BrowserThread::IO); globals_->quic_disabled = true; } -// static - -// static -void IOThread::RegisterPrefs(PrefRegistrySimple* registry) { - registry->RegisterStringPref(prefs::kAuthSchemes, - "basic,digest,ntlm,negotiate"); - registry->RegisterBooleanPref(prefs::kDisableAuthNegotiateCnameLookup, false); - registry->RegisterBooleanPref(prefs::kEnableAuthNegotiatePort, false); - registry->RegisterStringPref(prefs::kAuthServerWhitelist, std::string()); - registry->RegisterStringPref(prefs::kAuthNegotiateDelegateWhitelist, - std::string()); - registry->RegisterStringPref(prefs::kGSSAPILibraryName, std::string()); - registry->RegisterStringPref(prefs::kAuthAndroidNegotiateAccountType, - std::string()); - registry->RegisterBooleanPref(prefs::kEnableReferrers, true); - registry->RegisterBooleanPref(prefs::kBuiltInDnsClientEnabled, true); -} - -void IOThread::UpdateServerWhitelist() { - globals_->http_auth_preferences->SetServerWhitelist( - auth_server_whitelist_.GetValue()); -} - -void IOThread::UpdateDelegateWhitelist() { - globals_->http_auth_preferences->SetDelegateWhitelist( - auth_delegate_whitelist_.GetValue()); -} - -void IOThread::UpdateNegotiateDisableCnameLookup() { - globals_->http_auth_preferences->set_negotiate_disable_cname_lookup( - negotiate_disable_cname_lookup_.GetValue()); -} - -void IOThread::UpdateNegotiateEnablePort() { - globals_->http_auth_preferences->set_negotiate_enable_port( - negotiate_enable_port_.GetValue()); -} - -void IOThread::UpdateDnsClientEnabled() { - globals()->system_request_context->host_resolver()->SetDnsClientEnabled( - *dns_client_enabled_); -} - -std::unique_ptr CreateGlobalHostResolver( - net::NetLog* net_log) { - TRACE_EVENT0("startup", "IOThread::CreateGlobalHostResolver"); - - using resolver = net::HostResolver; - std::unique_ptr global_host_resolver = - resolver::CreateSystemResolver(resolver::Options(), net_log); - - // If hostname remappings were specified on the command-line, layer these - // rules on top of the real host resolver. This allows forwarding all requests - // through a designated test server. - const base::CommandLine& command_line = - *base::CommandLine::ForCurrentProcess(); - if (!command_line.HasSwitch(network::switches::kHostResolverRules)) - return global_host_resolver; - - auto remapped_resolver = std::make_unique( - std::move(global_host_resolver)); - remapped_resolver->SetRulesFromString( - command_line.GetSwitchValueASCII(network::switches::kHostResolverRules)); - return std::move(remapped_resolver); -} - -std::unique_ptr -IOThread::CreateDefaultAuthHandlerFactory(net::HostResolver* host_resolver) { - std::vector supported_schemes = base::SplitString( - auth_schemes_, ",", base::TRIM_WHITESPACE, base::SPLIT_WANT_NONEMPTY); - globals_->http_auth_preferences.reset(new net::HttpAuthPreferences( - supported_schemes -#if defined(OS_POSIX) && !defined(OS_ANDROID) && !defined(OS_CHROMEOS) - , - gssapi_library_name_ -#endif - )); - UpdateServerWhitelist(); - UpdateDelegateWhitelist(); - UpdateNegotiateDisableCnameLookup(); - UpdateNegotiateEnablePort(); - - return net::HttpAuthHandlerRegistryFactory::Create( - globals_->http_auth_preferences.get(), host_resolver); -} - void IOThread::SetUpProxyService( network::URLRequestContextBuilderMojo* builder) const {} void IOThread::ConstructSystemRequestContext() { - std::unique_ptr builder = - std::make_unique(); - - builder->set_user_agent(GetUserAgent()); - std::unique_ptr - atom_network_delegate(new atom::AtomNetworkDelegate()); - - builder->set_network_delegate(std::move(atom_network_delegate)); - std::unique_ptr host_resolver( - CreateGlobalHostResolver(net_log_)); - - builder->SetHttpAuthHandlerFactory( - CreateDefaultAuthHandlerFactory(host_resolver.get())); - - std::unique_ptr cert_verifier; - cert_verifier = net::CertVerifier::CreateDefault(); - - const base::CommandLine& command_line = - *base::CommandLine::ForCurrentProcess(); - builder->SetCertVerifier( - network::IgnoreErrorsCertVerifier::MaybeWrapCertVerifier( - command_line, switches::kUserDataDir, std::move(cert_verifier))); - - SetUpProxyService(builder.get()); - - globals_->quic_disabled = true; - if (base::FeatureList::IsEnabled(network::features::kNetworkService)) { globals_->deprecated_network_quality_estimator = std::make_unique( std::make_unique( std::map()), net_log_); - globals_->deprecated_host_resolver = std::move(host_resolver); - globals_->system_request_context_owner = std::move(builder)->Create( - std::move(network_context_params_).get(), !is_quic_allowed_on_init_, - net_log_, globals_->deprecated_host_resolver.get(), + net::URLRequestContextBuilder builder; + std::vector> + url_request_interceptors; + url_request_interceptors.emplace_back( + std::make_unique()); + builder.SetInterceptors(std::move(url_request_interceptors)); + builder.set_network_quality_estimator( globals_->deprecated_network_quality_estimator.get()); + builder.SetCertVerifier( + std::make_unique()); + builder.set_proxy_resolution_service( + net::ProxyResolutionService::CreateDirect()); + globals_->system_request_context_owner = + network::URLRequestContextOwner(nullptr, builder.Build()); globals_->system_request_context = globals_->system_request_context_owner.url_request_context.get(); + network_context_params_.reset(); } else { - content::GetNetworkServiceImpl()->SetHostResolver(std::move(host_resolver)); + std::unique_ptr builder = + std::make_unique(); + + std::unique_ptr atom_network_delegate = + std::make_unique(); + builder->set_network_delegate(std::move(atom_network_delegate)); + + std::unique_ptr cert_verifier; + if (g_cert_verifier_for_io_thread_testing) { + cert_verifier = std::make_unique(); + } else { + cert_verifier = std::make_unique( + std::make_unique( + net::CertVerifyProc::CreateDefault())); + } + const base::CommandLine& command_line = + *base::CommandLine::ForCurrentProcess(); + builder->SetCertVerifier( + network::IgnoreErrorsCertVerifier::MaybeWrapCertVerifier( + command_line, switches::kUserDataDir, std::move(cert_verifier))); + + SetUpProxyService(builder.get()); + + if (!is_quic_allowed_on_init_) + globals_->quic_disabled = true; + + network::NetworkService* network_service = content::GetNetworkServiceImpl(); + network_service->SetHostResolver(CreateGlobalHostResolver(net_log_)); + + // These must be done after the SetHostResolver call. + network_service->SetUpHttpAuth(std::move(http_auth_static_params_)); + network_service->ConfigureHttpAuthPrefs( + std::move(http_auth_dynamic_params_)); + globals_->system_network_context = - content::GetNetworkServiceImpl()->CreateNetworkContextWithBuilder( + network_service->CreateNetworkContextWithBuilder( std::move(network_context_request_), std::move(network_context_params_), std::move(builder), &globals_->system_request_context); + + // This must be done after the system NetworkContext is created. + network_service->ConfigureStubHostResolver( + stub_resolver_enabled_, std::move(dns_over_https_servers_)); } From e01e46c557675880a42aa363ebfb75f8e761d187 Mon Sep 17 00:00:00 2001 From: Henrique Ferreiro Date: Thu, 12 Jul 2018 00:51:22 +0200 Subject: [PATCH 027/138] Rename PasswordSyncState to SyncState https://crrev.com/d5ecd79b3f85 --- .../browser/password_manager/brave_password_manager_client.cc | 2 +- brave/browser/password_manager/brave_password_manager_client.h | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/brave/browser/password_manager/brave_password_manager_client.cc b/brave/browser/password_manager/brave_password_manager_client.cc index efa39c41b4..0f924be54d 100644 --- a/brave/browser/password_manager/brave_password_manager_client.cc +++ b/brave/browser/password_manager/brave_password_manager_client.cc @@ -408,7 +408,7 @@ ukm::SourceId BravePasswordManagerClient::GetUkmSourceId() { return ukm::GetSourceIdForWebContentsDocument(web_contents()); } -password_manager::PasswordSyncState +password_manager::SyncState BravePasswordManagerClient::GetPasswordSyncState() const { return password_manager_util::GetPasswordSyncState(nullptr); } diff --git a/brave/browser/password_manager/brave_password_manager_client.h b/brave/browser/password_manager/brave_password_manager_client.h index 71faf8188f..04ad31d67d 100644 --- a/brave/browser/password_manager/brave_password_manager_client.h +++ b/brave/browser/password_manager/brave_password_manager_client.h @@ -118,7 +118,8 @@ class BravePasswordManagerClient void LogPasswordReuseDetectedEvent() override; #endif - password_manager::PasswordSyncState GetPasswordSyncState() const override; + password_manager::SyncState GetPasswordSyncState() + const override; bool WasLastNavigationHTTPError() const override; net::CertStatus GetMainFrameCertStatus() const override; bool IsIncognito() const override; From e35202752ae46ee351ac4ae2361edc89e1485897 Mon Sep 17 00:00:00 2001 From: Henrique Ferreiro Date: Thu, 12 Jul 2018 07:30:21 +0200 Subject: [PATCH 028/138] AutofillClient::ConfirmSaveCreditCardToCloud() parameters https://crrev.com/bc672a07dde1 --- atom/browser/autofill/atom_autofill_client.cc | 3 ++- atom/browser/autofill/atom_autofill_client.h | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/atom/browser/autofill/atom_autofill_client.cc b/atom/browser/autofill/atom_autofill_client.cc index fb7cd475c0..d83c8a6de4 100644 --- a/atom/browser/autofill/atom_autofill_client.cc +++ b/atom/browser/autofill/atom_autofill_client.cc @@ -121,7 +121,8 @@ void AtomAutofillClient::ConfirmSaveCreditCardLocally( void AtomAutofillClient::ConfirmSaveCreditCardToCloud( const CreditCard& card, std::unique_ptr legal_message, - const base::Closure& callback) { + bool should_request_name_from_user, + base::OnceCallback callback) { } void AtomAutofillClient::LoadRiskData( diff --git a/atom/browser/autofill/atom_autofill_client.h b/atom/browser/autofill/atom_autofill_client.h index b701c113c1..d216a0cb38 100644 --- a/atom/browser/autofill/atom_autofill_client.h +++ b/atom/browser/autofill/atom_autofill_client.h @@ -65,7 +65,8 @@ class AtomAutofillClient void ConfirmSaveCreditCardToCloud( const CreditCard& card, std::unique_ptr legal_message, - const base::Closure& callback) override; + bool should_request_name_from_user, + base::OnceCallback callback) override; void LoadRiskData( const base::Callback& callback) override; bool HasCreditCardScanFeature() override; From 6fc98efca189818f6de51cdd0f4595554d196c64 Mon Sep 17 00:00:00 2001 From: Henrique Ferreiro Date: Thu, 12 Jul 2018 08:16:37 +0200 Subject: [PATCH 029/138] Implement AtomAutofillClient::GetUkmSourceId() https://crrev.com/68e7601fefa8 --- atom/browser/autofill/atom_autofill_client.cc | 5 +++++ atom/browser/autofill/atom_autofill_client.h | 1 + 2 files changed, 6 insertions(+) diff --git a/atom/browser/autofill/atom_autofill_client.cc b/atom/browser/autofill/atom_autofill_client.cc index d83c8a6de4..fb587b1fc9 100644 --- a/atom/browser/autofill/atom_autofill_client.cc +++ b/atom/browser/autofill/atom_autofill_client.cc @@ -17,6 +17,7 @@ #include "components/autofill/core/browser/webdata/autofill_webdata_service.h" #include "components/autofill/core/common/autofill_pref_names.h" #include "components/password_manager/content/browser/content_password_manager_driver.h" +#include "components/ukm/content/source_url_recorder.h" #include "components/user_prefs/user_prefs.h" #include "content/public/browser/navigation_entry.h" #include "content/public/browser/render_frame_host.h" @@ -93,6 +94,10 @@ ukm::UkmRecorder* AtomAutofillClient::GetUkmRecorder() { return ukm::UkmRecorder::Get(); } +ukm::SourceId AtomAutofillClient::GetUkmSourceId() { + return ukm::GetSourceIdForWebContentsDocument(web_contents()); +} + AddressNormalizer* AtomAutofillClient::GetAddressNormalizer() { return nullptr; } diff --git a/atom/browser/autofill/atom_autofill_client.h b/atom/browser/autofill/atom_autofill_client.h index d216a0cb38..f25f079e54 100644 --- a/atom/browser/autofill/atom_autofill_client.h +++ b/atom/browser/autofill/atom_autofill_client.h @@ -54,6 +54,7 @@ class AtomAutofillClient syncer::SyncService* GetSyncService() override; identity::IdentityManager* GetIdentityManager() override; ukm::UkmRecorder* GetUkmRecorder() override; + ukm::SourceId GetUkmSourceId() override; autofill::AddressNormalizer* GetAddressNormalizer() override; void ShowAutofillSettings() override; void ShowUnmaskPrompt(const CreditCard& card, From a5e051c8358542a90e6b06624f92f74124dcccb5 Mon Sep 17 00:00:00 2001 From: Henrique Ferreiro Date: Thu, 12 Jul 2018 08:33:38 +0200 Subject: [PATCH 030/138] Stub AtomAutofillClient::GetSecurityLevelForUmaHistograms() https://crrev.com/13e0e6f499d8 --- atom/browser/autofill/atom_autofill_client.cc | 5 +++++ atom/browser/autofill/atom_autofill_client.h | 1 + 2 files changed, 6 insertions(+) diff --git a/atom/browser/autofill/atom_autofill_client.cc b/atom/browser/autofill/atom_autofill_client.cc index fb587b1fc9..c914890936 100644 --- a/atom/browser/autofill/atom_autofill_client.cc +++ b/atom/browser/autofill/atom_autofill_client.cc @@ -102,6 +102,11 @@ AddressNormalizer* AtomAutofillClient::GetAddressNormalizer() { return nullptr; } +security_state::SecurityLevel +AtomAutofillClient::GetSecurityLevelForUmaHistograms() { + return security_state::SecurityLevel::SECURITY_LEVEL_COUNT; +} + void AtomAutofillClient::ShowAutofillSettings() { if (api_web_contents_) { api_web_contents_->Emit("show-autofill-settings"); diff --git a/atom/browser/autofill/atom_autofill_client.h b/atom/browser/autofill/atom_autofill_client.h index f25f079e54..2bbcb6717a 100644 --- a/atom/browser/autofill/atom_autofill_client.h +++ b/atom/browser/autofill/atom_autofill_client.h @@ -56,6 +56,7 @@ class AtomAutofillClient ukm::UkmRecorder* GetUkmRecorder() override; ukm::SourceId GetUkmSourceId() override; autofill::AddressNormalizer* GetAddressNormalizer() override; + security_state::SecurityLevel GetSecurityLevelForUmaHistograms() override; void ShowAutofillSettings() override; void ShowUnmaskPrompt(const CreditCard& card, UnmaskCardReason reason, From fa71ce771f54bfdaa86f16859523fbb11b2d6bef Mon Sep 17 00:00:00 2001 From: Henrique Ferreiro Date: Thu, 12 Jul 2018 11:16:09 +0200 Subject: [PATCH 031/138] Refactor the password generation UI flows https://crbug.com/845458 https://crrev.com/7999140d9eda https://crrev.com/09ec7a22025a --- .../brave_password_manager_client.cc | 40 +++++++++++++------ .../brave_password_manager_client.h | 22 +++++++--- 2 files changed, 43 insertions(+), 19 deletions(-) diff --git a/brave/browser/password_manager/brave_password_manager_client.cc b/brave/browser/password_manager/brave_password_manager_client.cc index 0f924be54d..9ab44903ff 100644 --- a/brave/browser/password_manager/brave_password_manager_client.cc +++ b/brave/browser/password_manager/brave_password_manager_client.cc @@ -23,7 +23,6 @@ #include "chrome/browser/profiles/profile.h" #include "chrome/browser/signin/signin_manager_factory.h" #include "chrome/browser/sync/profile_sync_service_factory.h" -#include "chrome/browser/ui/autofill/password_generation_popup_controller_impl.h" #include "chrome/browser/ui/passwords/passwords_client_ui_delegate.h" #include "chrome/common/channel_info.h" #include "chrome/common/chrome_switches.h" @@ -326,9 +325,12 @@ void BravePasswordManagerClient::PasswordWasAutofilled( const std::vector* federated_matches) const { } -void BravePasswordManagerClient::HidePasswordGenerationPopup() { +void BravePasswordManagerClient::PasswordGenerationRejectedByTyping() { + HidePasswordGenerationPopup(); } +void BravePasswordManagerClient::HidePasswordGenerationPopup() {} + PasswordManagerMetricsRecorder& BravePasswordManagerClient::GetMetricsRecorder() { if (!metrics_recorder_) { @@ -482,18 +484,19 @@ gfx::RectF BravePasswordManagerClient::GetBoundsInScreenSpace( return bounds + client_area.OffsetFromOrigin(); } -void BravePasswordManagerClient::ShowPasswordGenerationPopup( - const gfx::RectF& bounds, - int max_length, - const base::string16& generation_element, - bool is_manually_triggered, - const autofill::PasswordForm& form) { - // TODO(gcasto): Validate data in PasswordForm. +void BravePasswordManagerClient::AutomaticGenerationStatusChanged( + bool available, + const base::Optional< + autofill::password_generation::PasswordGenerationUIData>& ui_data) { + if (available) { + ShowPasswordGenerationPopup(ui_data.value(), + false /* is_manually_triggered */); + } +} - auto* driver = driver_factory_->GetDriverForFrame( - password_manager_client_bindings_.GetCurrentTargetFrame()); - password_manager_.SetGenerationElementAndReasonForForm( - driver, form, generation_element, is_manually_triggered); +void BravePasswordManagerClient::ShowManualPasswordGenerationPopup( + const autofill::password_generation::PasswordGenerationUIData& ui_data) { + ShowPasswordGenerationPopup(ui_data, true /* is_manually_triggered */); } void BravePasswordManagerClient::ShowPasswordEditingPopup( @@ -501,6 +504,17 @@ void BravePasswordManagerClient::ShowPasswordEditingPopup( const autofill::PasswordForm& form) { } +void BravePasswordManagerClient::ShowPasswordGenerationPopup( + const autofill::password_generation::PasswordGenerationUIData& ui_data, + bool is_manually_triggered) { + auto* driver = driver_factory_->GetDriverForFrame( + password_manager_client_bindings_.GetCurrentTargetFrame()); + DCHECK(driver); + password_manager_.SetGenerationElementAndReasonForForm( + driver, ui_data.password_form, ui_data.generation_element, + is_manually_triggered); +} + void BravePasswordManagerClient::PromptUserToEnableAutosigninIfNecessary() { if (!password_bubble_experiment::ShouldShowAutoSignInPromptFirstRunExperience( GetPrefs()) || diff --git a/brave/browser/password_manager/brave_password_manager_client.h b/brave/browser/password_manager/brave_password_manager_client.h index 04ad31d67d..033c195203 100644 --- a/brave/browser/password_manager/brave_password_manager_client.h +++ b/brave/browser/password_manager/brave_password_manager_client.h @@ -15,6 +15,7 @@ #include "base/optional.h" #include "brave/browser/password_manager/brave_credentials_filter.h" #include "components/autofill/content/common/autofill_driver.mojom.h" +#include "components/autofill/core/common/password_generation_util.h" #include "components/password_manager/content/browser/content_credential_manager.h" #include "components/password_manager/content/browser/content_password_manager_driver_factory.h" #include "components/password_manager/core/browser/password_manager.h" @@ -134,15 +135,20 @@ class BravePasswordManagerClient const password_manager::LogManager* GetLogManager() const override; // autofill::mojom::PasswordManagerClient overrides. - void ShowPasswordGenerationPopup(const gfx::RectF& bounds, - int max_length, - const base::string16& generation_element, - bool is_manually_triggered, - const autofill::PasswordForm& form) override; + void AutomaticGenerationStatusChanged( + bool available, + const base::Optional< + autofill::password_generation::PasswordGenerationUIData>& ui_data) + override; + void ShowManualPasswordGenerationPopup( + const autofill::password_generation::PasswordGenerationUIData& ui_data) + override; void ShowPasswordEditingPopup(const gfx::RectF& bounds, const autofill::PasswordForm& form) override; void GenerationAvailableForForm(const autofill::PasswordForm& form) override; - void HidePasswordGenerationPopup() override; + void PasswordGenerationRejectedByTyping() override; + + void HidePasswordGenerationPopup(); password_manager::PasswordManagerMetricsRecorder& GetMetricsRecorder() override; @@ -201,6 +207,10 @@ class BravePasswordManagerClient // without custom sync passphrase. static bool ShouldAnnotateNavigationEntries(Profile* profile); + void ShowPasswordGenerationPopup( + const autofill::password_generation::PasswordGenerationUIData& ui_data, + bool is_manually_triggered); + Profile* const profile_; password_manager::PasswordManager password_manager_; From 1d320e1d3c473a460b6bea4f1df0a30a6edc45ec Mon Sep 17 00:00:00 2001 From: Henrique Ferreiro Date: Thu, 12 Jul 2018 12:41:35 +0200 Subject: [PATCH 032/138] Remove ResourceCoordinatorTabHelper::IsEnabled() https://crrev.com/814050de864c --- atom/browser/api/atom_api_web_contents.cc | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/atom/browser/api/atom_api_web_contents.cc b/atom/browser/api/atom_api_web_contents.cc index 9334a90688..8931ce33a2 100644 --- a/atom/browser/api/atom_api_web_contents.cc +++ b/atom/browser/api/atom_api_web_contents.cc @@ -613,9 +613,8 @@ void WebContents::CompleteInit(v8::Isolate* isolate, this); } - if (resource_coordinator::ResourceCoordinatorTabHelper::IsEnabled()) - resource_coordinator::ResourceCoordinatorTabHelper::CreateForWebContents( - web_contents); + resource_coordinator::ResourceCoordinatorTabHelper::CreateForWebContents( + web_contents); } Init(isolate); From c059aea9a8f9875b725c009dc4f67c59ca565871 Mon Sep 17 00:00:00 2001 From: Henrique Ferreiro Date: Thu, 12 Jul 2018 13:45:04 +0200 Subject: [PATCH 033/138] Move PresaveGeneratedPassword to PasswordManagerClient https://crrev.com/2944cf12a76c --- .../password_manager/brave_password_manager_client.cc | 10 ++++++++++ .../password_manager/brave_password_manager_client.h | 4 ++++ 2 files changed, 14 insertions(+) diff --git a/brave/browser/password_manager/brave_password_manager_client.cc b/brave/browser/password_manager/brave_password_manager_client.cc index 9ab44903ff..da4d8a97a1 100644 --- a/brave/browser/password_manager/brave_password_manager_client.cc +++ b/brave/browser/password_manager/brave_password_manager_client.cc @@ -331,6 +331,16 @@ void BravePasswordManagerClient::PasswordGenerationRejectedByTyping() { void BravePasswordManagerClient::HidePasswordGenerationPopup() {} +void BravePasswordManagerClient::PresaveGeneratedPassword( + const autofill::PasswordForm& password_form) { + password_manager_.OnPresaveGeneratedPassword(password_form); +} + +void BravePasswordManagerClient::PasswordNoLongerGenerated( + const autofill::PasswordForm& password_form) { + password_manager_.OnPasswordNoLongerGenerated(password_form); +} + PasswordManagerMetricsRecorder& BravePasswordManagerClient::GetMetricsRecorder() { if (!metrics_recorder_) { diff --git a/brave/browser/password_manager/brave_password_manager_client.h b/brave/browser/password_manager/brave_password_manager_client.h index 033c195203..9cc8bcd2b8 100644 --- a/brave/browser/password_manager/brave_password_manager_client.h +++ b/brave/browser/password_manager/brave_password_manager_client.h @@ -147,6 +147,10 @@ class BravePasswordManagerClient const autofill::PasswordForm& form) override; void GenerationAvailableForForm(const autofill::PasswordForm& form) override; void PasswordGenerationRejectedByTyping() override; + void PresaveGeneratedPassword( + const autofill::PasswordForm& password_form) override; + void PasswordNoLongerGenerated( + const autofill::PasswordForm& password_form) override; void HidePasswordGenerationPopup(); From f8d245a4253405db88a2ae02fbb0f1cb7eaa1389 Mon Sep 17 00:00:00 2001 From: Henrique Ferreiro Date: Thu, 12 Jul 2018 15:42:56 +0200 Subject: [PATCH 034/138] Refactor of ServiceManagerContext https://crrev.com/57b856f8e55 --- brave/browser/brave_content_browser_client.cc | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/brave/browser/brave_content_browser_client.cc b/brave/browser/brave_content_browser_client.cc index 0867039e48..7dedb02c17 100644 --- a/brave/browser/brave_content_browser_client.cc +++ b/brave/browser/brave_content_browser_client.cc @@ -415,21 +415,23 @@ void BraveContentBrowserClient::RegisterInProcessServices( void BraveContentBrowserClient::RegisterOutOfProcessServices( OutOfProcessServiceMap* services) { - (*services)[chrome::mojom::kProfileImportServiceName] = - l10n_util::GetStringUTF16(IDS_UTILITY_PROCESS_PROFILE_IMPORTER_NAME); + (*services)[chrome::mojom::kProfileImportServiceName] = base::BindRepeating( + &l10n_util::GetStringUTF16, IDS_UTILITY_PROCESS_PROFILE_IMPORTER_NAME); (*services)[proxy_resolver::mojom::kProxyResolverServiceName] = - l10n_util::GetStringUTF16(IDS_UTILITY_PROCESS_PROXY_RESOLVER_NAME); + base::BindRepeating(&l10n_util::GetStringUTF16, + IDS_UTILITY_PROCESS_PROXY_RESOLVER_NAME); #if BUILDFLAG(ENABLE_PRINT_PREVIEW) (*services)[printing::mojom::kChromePrintingServiceName] = - l10n_util::GetStringUTF16(IDS_UTILITY_PROCESS_PRINTING_SERVICE_NAME); + base::BindRepeating(&l10n_util::GetStringUTF16, + IDS_UTILITY_PROCESS_PRINTING_SERVICE_NAME); #endif - (*services)[unzip::mojom::kServiceName] = - l10n_util::GetStringUTF16(IDS_UTILITY_PROCESS_UNZIP_NAME); + (*services)[unzip::mojom::kServiceName] = base::BindRepeating( + &l10n_util::GetStringUTF16, IDS_UTILITY_PROCESS_UNZIP_NAME); - (*services)[tor::mojom::kTorServiceName] = - l10n_util::GetStringUTF16(IDS_UTILITY_PROCESS_TOR_LAUNCHER_NAME); + (*services)[tor::mojom::kTorServiceName] = base::BindRepeating( + &l10n_util::GetStringUTF16, IDS_UTILITY_PROCESS_TOR_LAUNCHER_NAME); } void BraveContentBrowserClient::BindInterfaceRequest( From 81fc5c412cc835f2470716cb3a2192bd353c970a Mon Sep 17 00:00:00 2001 From: Lorenzo Tilve Date: Thu, 12 Jul 2018 23:59:14 +0200 Subject: [PATCH 035/138] Separate out HttpAuthPreferences that can't change https://crrev.com/03976eedc5e0 --- vendor/brightray/browser/url_request_context_getter.cc | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/vendor/brightray/browser/url_request_context_getter.cc b/vendor/brightray/browser/url_request_context_getter.cc index f7124ac23b..b3a870d4b9 100644 --- a/vendor/brightray/browser/url_request_context_getter.cc +++ b/vendor/brightray/browser/url_request_context_getter.cc @@ -272,12 +272,7 @@ net::URLRequestContext* URLRequestContextGetter::GetURLRequestContext() { schemes.push_back(std::string("digest")); schemes.push_back(std::string("ntlm")); schemes.push_back(std::string("negotiate")); -#if defined(OS_POSIX) - http_auth_preferences_.reset(new net::HttpAuthPreferences(schemes, - std::string())); -#else - http_auth_preferences_.reset(new net::HttpAuthPreferences(schemes)); -#endif + http_auth_preferences_.reset(new net::HttpAuthPreferences()); // --auth-server-whitelist if (command_line.HasSwitch(switches::kAuthServerWhitelist)) { @@ -294,7 +289,7 @@ net::URLRequestContext* URLRequestContextGetter::GetURLRequestContext() { auto auth_handler_factory = net::HttpAuthHandlerRegistryFactory::Create( - http_auth_preferences_.get(), host_resolver.get()); + host_resolver.get(), http_auth_preferences_.get(), schemes); storage_->set_cert_verifier(delegate_->CreateCertVerifier()); storage_->set_transport_security_state( From 56738b4ffafd514a57281f725a852b62f298e875 Mon Sep 17 00:00:00 2001 From: Henrique Ferreiro Date: Fri, 13 Jul 2018 13:07:57 +0200 Subject: [PATCH 036/138] Remove password generation command line flags https://crrev.com/f9689a069559 --- brave/browser/brave_content_browser_client.cc | 2 -- 1 file changed, 2 deletions(-) diff --git a/brave/browser/brave_content_browser_client.cc b/brave/browser/brave_content_browser_client.cc index 7dedb02c17..edb0525fc9 100644 --- a/brave/browser/brave_content_browser_client.cc +++ b/brave/browser/brave_content_browser_client.cc @@ -654,8 +654,6 @@ void BraveContentBrowserClient::AppendExtraCommandLineSwitches( } static const char* const kSwitchNames[] = { - autofill::switches::kDisablePasswordGeneration, - autofill::switches::kEnablePasswordGeneration, autofill::switches::kEnableSuggestionsWithSubstringMatch, autofill::switches::kIgnoreAutocompleteOffForAutofill, autofill::switches::kLocalHeuristicsOnlyForPasswordGeneration, From 888435d7c659672a0bfb4daa0bf804af61f18e04 Mon Sep 17 00:00:00 2001 From: Henrique Ferreiro Date: Fri, 13 Jul 2018 14:12:28 +0200 Subject: [PATCH 037/138] CHECK: Stop using x-devtools-emulate-network-conditions-client-id header https://crrev.com/c1ab712a08cc --- atom/browser/net/atom_network_delegate.cc | 4 ---- 1 file changed, 4 deletions(-) diff --git a/atom/browser/net/atom_network_delegate.cc b/atom/browser/net/atom_network_delegate.cc index 47a6faaa1c..8479aa064e 100644 --- a/atom/browser/net/atom_network_delegate.cc +++ b/atom/browser/net/atom_network_delegate.cc @@ -327,10 +327,6 @@ int AtomNetworkDelegate::OnBeforeStartTransaction( client_id = client_id_; } - if (!client_id.empty()) - headers->SetHeader(network::ThrottlingNetworkTransaction:: - kDevToolsEmulateNetworkConditionsClientId, - client_id); if (!base::ContainsKey(response_listeners_, kOnBeforeSendHeaders)) return brightray::NetworkDelegate::OnBeforeStartTransaction( request, std::move(callback), headers); From e0a60cbee83158e2aac6cd93e1b65d91b36c00a1 Mon Sep 17 00:00:00 2001 From: Lorenzo Tilve Date: Mon, 16 Jul 2018 15:29:16 +0200 Subject: [PATCH 038/138] Added new struct for CdmCapability https://crrev.com/b78a48babd17 --- .../widevine_cdm_component_installer.cc | 104 +++++++++--------- 1 file changed, 50 insertions(+), 54 deletions(-) diff --git a/brave/browser/component_updater/widevine_cdm_component_installer.cc b/brave/browser/component_updater/widevine_cdm_component_installer.cc index f4718ca68c..ebaa9a87c2 100644 --- a/brave/browser/component_updater/widevine_cdm_component_installer.cc +++ b/brave/browser/component_updater/widevine_cdm_component_installer.cc @@ -180,11 +180,13 @@ bool IsCompatibleWithBrave(const base::DictionaryValue& manifest) { media::IsSupportedCdmHostVersion); } -// Returns true and updates |supported_video_codecs| (if provided) if the -// appropriate manifest entry is valid. Returns false and does not modify -// |supported_video_codecs| if the manifest entry is incorrectly formatted. +// Returns true and updates |video_codecs| if the appropriate manifest entry is +// valid. Returns false and does not modify |video_codecs| if the manifest entry +// is incorrectly formatted. bool GetCodecs(const base::DictionaryValue& manifest, - std::vector* supported_video_codecs) { + std::vector* video_codecs) { + DCHECK(video_codecs); + const base::Value* value = manifest.FindKey(kCdmCodecsListName); if (!value) { DLOG(WARNING) << "Widevine CDM component manifest is missing codecs."; @@ -219,47 +221,50 @@ bool GetCodecs(const base::DictionaryValue& manifest, #endif // BUILDFLAG(USE_PROPRIETARY_CODECS) } - if (supported_video_codecs) - supported_video_codecs->swap(result); + video_codecs->swap(result); return true; } -// Returns true and updates |supports_persistent_license| (if provided) if -// the appropriate manifest entry is valid. Returns false if the manifest -// entry is incorrectly formatted. -bool GetPersistentLicenseSupport(const base::DictionaryValue& manifest, - bool* supports_persistent_license) { - bool result = false; +// Returns true and updates |session_types| if the appropriate manifest entry is +// valid. Returns false if the manifest entry is incorrectly formatted. +bool GetSessionTypes(const base::DictionaryValue& manifest, + base::flat_set* session_types) { + DCHECK(session_types); + + bool is_persistent_license_supported = false; + const base::Value* value = manifest.FindKey(kCdmPersistentLicenseSupportName); if (value) { - if (value->is_bool()) - result = value->GetBool(); - else - return false; + if (!value->is_bool()) + return false; + is_persistent_license_supported = value->GetBool(); } - if (supports_persistent_license) - *supports_persistent_license = result; + // Temporary session is always supported. + session_types->insert(media::CdmSessionType::TEMPORARY_SESSION); + if (is_persistent_license_supported) + session_types->insert(media::CdmSessionType::PERSISTENT_LICENSE_SESSION); + return true; } -// Returns true and updates |supported_encryption_schemes| (if provided) if -// the appropriate manifest entry is valid. Returns false and does not modify -// |supported_encryption_schemes| if the manifest entry is incorrectly -// formatted. It is assumed that all CDMs support 'cenc', so if the manifest -// entry is missing, the result will indicate support for 'cenc' only. -// Incorrect types in the manifest entry will log the error and fail. -// Unrecognized values will be reported but otherwise ignored. +// Returns true and updates |encryption_schemes| if the appropriate manifest +// entry is valid. Returns false and does not modify |encryption_schemes| if the +// manifest entry is incorrectly formatted. It is assumed that all CDMs support +// 'cenc', so if the manifest entry is missing, the result will indicate support +// for 'cenc' only. Incorrect types in the manifest entry will log the error and +// fail. Unrecognized values will be reported but otherwise ignored. bool GetEncryptionSchemes( const base::DictionaryValue& manifest, - base::flat_set* supported_encryption_schemes) { + base::flat_set* encryption_schemes) { + DCHECK(encryption_schemes); + const base::Value* value = manifest.FindKey(kCdmSupportedEncryptionSchemesName); if (!value) { // No manifest entry found, so assume only 'cenc' supported for backwards // compatibility. - if (supported_encryption_schemes) - supported_encryption_schemes->insert(media::EncryptionMode::kCenc); + encryption_schemes->insert(media::EncryptionMode::kCenc); return true; } @@ -294,24 +299,19 @@ bool GetEncryptionSchemes( if (result.empty()) return false; - if (supported_encryption_schemes) - supported_encryption_schemes->swap(result); + encryption_schemes->swap(result); return true; } // Returns true if the entries in the manifest can be parsed correctly, -// false otherwise. Updates |supported_video_codecs|, -// |supports_persistent_license|, and |supported_encryption_schemes|, -// with the values obtained from the manifest, if they are provided. -// If this method returns false, the values may or may not be updated. -bool ParseManifest( - const base::DictionaryValue& manifest, - std::vector* supported_video_codecs, - bool* supports_persistent_license, - base::flat_set* supported_encryption_schemes) { - return GetEncryptionSchemes(manifest, supported_encryption_schemes) && - GetPersistentLicenseSupport(manifest, supports_persistent_license) && - GetCodecs(manifest, supported_video_codecs); +// false otherwise. Updates |capability|, with the values obtained from the +// manifest, if they are provided. If this method returns false, |capability| +// may or may not be updated. +bool ParseManifest(const base::DictionaryValue& manifest, + content::CdmCapability* capability) { + return GetCodecs(manifest, &capability->video_codecs) && + GetEncryptionSchemes(manifest, &capability->encryption_schemes) && + GetSessionTypes(manifest, &capability->session_types); } } // namespace @@ -398,11 +398,12 @@ void WidevineCdmComponentInstallerPolicy::ComponentReady( bool WidevineCdmComponentInstallerPolicy::VerifyInstallation( const base::DictionaryValue& manifest, const base::FilePath& install_dir) const { + content::CdmCapability capability; return IsCompatibleWithBrave(manifest) && base::PathExists(GetPlatformDirectory(install_dir) .AppendASCII(base::GetNativeLibraryName( kWidevineCdmLibraryName))) && - ParseManifest(manifest, nullptr, nullptr, nullptr); + ParseManifest(manifest, &capability); } // The base directory on Windows looks like: @@ -460,16 +461,12 @@ void WidevineCdmComponentInstallerPolicy::RegisterWidevineCdmWithBrave( const base::FilePath& cdm_install_dir, std::unique_ptr manifest) { DCHECK_CURRENTLY_ON(BrowserThread::UI); - std::vector supported_video_codecs; - bool supports_persistent_license; - base::flat_set supported_encryption_schemes; // This check must be a subset of the check in VerifyInstallation() to // avoid the case where the CDM is accepted by the component updater // but not registered. - if (!ParseManifest(*manifest, &supported_video_codecs, - &supports_persistent_license, - &supported_encryption_schemes)) { + content::CdmCapability capability; + if (!ParseManifest(*manifest, &capability)) { VLOG(1) << "Not registering Widevine CDM due to malformed manifest."; return; } @@ -479,11 +476,10 @@ void WidevineCdmComponentInstallerPolicy::RegisterWidevineCdmWithBrave( const base::FilePath cdm_path = GetPlatformDirectory(cdm_install_dir) .AppendASCII(base::GetNativeLibraryName(kWidevineCdmLibraryName)); - CdmRegistry::GetInstance()->RegisterCdm(content::CdmInfo( - kWidevineCdmDisplayName, kWidevineCdmGuid, cdm_version, cdm_path, - kWidevineCdmFileSystemId, supported_video_codecs, - supports_persistent_license, supported_encryption_schemes, - kWidevineKeySystem, false)); + CdmRegistry::GetInstance()->RegisterCdm( + content::CdmInfo(kWidevineCdmDisplayName, kWidevineCdmGuid, cdm_version, + cdm_path, kWidevineCdmFileSystemId, + std::move(capability), kWidevineKeySystem, false)); ready_callback_.Run(cdm_install_dir); } From fc27b38eb494387404bd08a7012d870966df236b Mon Sep 17 00:00:00 2001 From: Lorenzo Tilve Date: Mon, 16 Jul 2018 17:32:20 +0200 Subject: [PATCH 039/138] Update master_patch changes to renamed render_widget_host_ns_view_bridge_local.mm https://crrev.com/98d495604415 --- patches/master_patch.patch | 68 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 68 insertions(+) diff --git a/patches/master_patch.patch b/patches/master_patch.patch index f941afc6cd..586631a8fd 100644 --- a/patches/master_patch.patch +++ b/patches/master_patch.patch @@ -1621,6 +1621,74 @@ index 3761be5f730dd73662acdd016ee098d64556b09c..e3066953627059ec96ebd6b159db7251 private: DISALLOW_COPY_AND_ASSIGN(RenderWidgetHostNSViewBridge); }; +diff --git a/content/browser/renderer_host/render_widget_host_ns_view_bridge_local.mm b/content/browser/renderer_host/render_widget_host_ns_view_bridge_local.mm +index 47338f71c3aa8a4a433ac530517258da2a0ce6a8..fe0f2454e07777d345f2eb36ab9bb6ba94a76448 100644 +--- a/content/browser/renderer_host/render_widget_host_ns_view_bridge_local.mm ++++ b/content/browser/renderer_host/render_widget_host_ns_view_bridge_local.mm +@@ -11,6 +11,9 @@ + #include "base/strings/sys_string_conversions.h" + #import "content/browser/renderer_host/popup_window_mac.h" + #import "content/browser/renderer_host/render_widget_host_view_cocoa.h" ++#if !defined(MUON_CHROMIUM_BUILD) ++#include "content/browser/renderer_host/render_widget_host_view_mac.h" ++#endif + #include "content/common/cursors/webcursor.h" + #import "skia/ext/skia_utils_mac.h" + #include "ui/accelerated_widget_mac/display_ca_layer_tree.h" +@@ -54,6 +57,11 @@ class RenderWidgetHostNSViewBridgeLocal : public RenderWidgetHostNSViewBridge, + void DisplayCursor(const WebCursor& cursor) override; + void SetCursorLocked(bool locked) override; + void ShowDictionaryOverlayForSelection() override; ++#if !defined(MUON_CHROMIUM_BUILD) ++ void ShowDictionaryOverlayForSelection(RenderWidgetHostView* target_view); ++ void SetTargetView(RenderWidgetHostView* target_view) override { ++ target_view_ = static_cast(target_view); }; ++#endif + void ShowDictionaryOverlay( + const mac::AttributedStringCoder::EncodedString& encoded_string, + gfx::Point baseline_point) override; +@@ -90,6 +98,10 @@ class RenderWidgetHostNSViewBridgeLocal : public RenderWidgetHostNSViewBridge, + // Cached copy of the tooltip text, to avoid redundant calls. + base::string16 tooltip_text_; + ++#if !defined(MUON_CHROMIUM_BUILD) ++ RenderWidgetHostViewMac* target_view_; ++#endif ++ + DISALLOW_COPY_AND_ASSIGN(RenderWidgetHostNSViewBridgeLocal); + }; + +@@ -104,6 +116,10 @@ RenderWidgetHostNSViewBridgeLocal::RenderWidgetHostNSViewBridgeLocal( + std::make_unique(background_layer_.get()); + [cocoa_view_ setLayer:background_layer_]; + [cocoa_view_ setWantsLayer:YES]; ++#if !defined(MUON_CHROMIUM_BUILD) ++ target_view_ = NULL; ++#endif ++ + } + + RenderWidgetHostNSViewBridgeLocal::~RenderWidgetHostNSViewBridgeLocal() { +@@ -300,10 +316,17 @@ void RenderWidgetHostNSViewBridgeLocal::ShowDictionaryOverlay( + mac::AttributedStringCoder::Decode(&encoded_string); + if ([string length] == 0) + return; ++ NSView* view = cocoa_view_; ++#if !defined(MUON_CHROMIUM_BUILD) ++ if (target_view_) { ++ view = target_view_->cocoa_view(); ++ } ++#endif ++ + NSPoint flipped_baseline_point = { +- baseline_point.x(), [cocoa_view_ frame].size.height - baseline_point.y(), ++ baseline_point.x(), [view frame].size.height - baseline_point.y(), + }; +- [cocoa_view_ showDefinitionForAttributedString:string ++ [view showDefinitionForAttributedString:string + atPoint:flipped_baseline_point]; + } + diff --git a/content/browser/renderer_host/render_widget_host_view_aura.cc b/content/browser/renderer_host/render_widget_host_view_aura.cc index 50fb4ac83df4440dec8ec85413e40b2c163fc34f..6d7c275596d540fd59cc8bac1e7b4dff337020e7 100644 --- a/content/browser/renderer_host/render_widget_host_view_aura.cc From e48a4051099e1e8c317bde7fc6bf9817b12e8998 Mon Sep 17 00:00:00 2001 From: Lorenzo Tilve Date: Tue, 17 Jul 2018 23:36:17 +0200 Subject: [PATCH 040/138] Remove unused SetOverrideVersionedDirectory https://crrev.com/90ed4e500d4b --- atom/app/atom_main_delegate_mac.mm | 1 - 1 file changed, 1 deletion(-) diff --git a/atom/app/atom_main_delegate_mac.mm b/atom/app/atom_main_delegate_mac.mm index cf5d3e0878..f490f27f1c 100644 --- a/atom/app/atom_main_delegate_mac.mm +++ b/atom/app/atom_main_delegate_mac.mm @@ -39,7 +39,6 @@ void AtomMainDelegate::OverrideFrameworkBundlePath() { base::FilePath* version_path = new base::FilePath(GetFrameworksPath()); - chrome::SetOverrideVersionedDirectory(version_path); base::mac::SetOverrideFrameworkBundlePath( GetFrameworksPath().Append(PRODUCT_SHORTNAME_STRING " Framework.framework")); } From 4c639fba412c525e2acbe28e596c5d006fc5e4c3 Mon Sep 17 00:00:00 2001 From: Henrique Ferreiro Date: Wed, 18 Jul 2018 01:54:30 +0200 Subject: [PATCH 041/138] C69 updates to print_review_message_handler.cc https://crrev.com/5162124a8b00 --- .../printing/print_preview_message_handler.cc | 31 +++++++++---------- .../printing/print_preview_message_handler.h | 18 +++++------ 2 files changed, 24 insertions(+), 25 deletions(-) diff --git a/chromium_src/chrome/browser/printing/print_preview_message_handler.cc b/chromium_src/chrome/browser/printing/print_preview_message_handler.cc index 71f7f6cf91..1562fad452 100644 --- a/chromium_src/chrome/browser/printing/print_preview_message_handler.cc +++ b/chromium_src/chrome/browser/printing/print_preview_message_handler.cc @@ -18,7 +18,6 @@ #include "chrome/browser/printing/print_view_manager.h" #include "chrome/browser/printing/print_view_manager_common.h" #include "chrome/browser/printing/printer_query.h" -#include "components/printing/common/print_messages.h" #include "content/public/browser/browser_thread.h" #include "content/public/browser/render_frame_host.h" #include "content/public/browser/render_process_host.h" @@ -92,8 +91,8 @@ PrintPreviewMessageHandler::PrintPreviewMessageHandler( PrintPreviewMessageHandler::~PrintPreviewMessageHandler() {} void PrintPreviewMessageHandler::OnMetafileReadyForPrinting( - content::RenderFrameHost* rfh, - const PrintHostMsg_DidPreviewDocument_Params& params) { + const PrintHostMsg_DidPreviewDocument_Params& params, + const PrintHostMsg_PreviewIds& ids) { // Always try to stop the worker. StopWorker(params.document_cookie); @@ -102,9 +101,9 @@ void PrintPreviewMessageHandler::OnMetafileReadyForPrinting( return; } - auto key = GetKey(rfh); - if (base::ContainsKey(print_to_pdf_options_map_, key)) - print_to_pdf_options_map_.erase(key); + // auto key = GetKey(rfh); + // if (base::ContainsKey(print_to_pdf_options_map_, key)) + // print_to_pdf_options_map_.erase(key); const PrintHostMsg_DidPrintContent_Params& content = params.content; BrowserThread::PostTaskAndReplyWithResult( @@ -113,7 +112,7 @@ void PrintPreviewMessageHandler::OnMetafileReadyForPrinting( base::Bind(&CopyPDFDataOnIOThread, content), base::Bind(&PrintPreviewMessageHandler::RunPrintToPDFCallback, weak_ptr_factory_.GetWeakPtr(), - params.preview_request_id, + ids.ui_id, content.data_size)); } @@ -132,27 +131,27 @@ void PrintPreviewMessageHandler::OnError(content::RenderFrameHost* rfh, } void PrintPreviewMessageHandler::OnPrintPreviewFailed( - content::RenderFrameHost* rfh, - int document_cookie) { + int document_cookie, + const PrintHostMsg_PreviewIds& ids) { StopWorker(document_cookie); - OnError(rfh, document_cookie, "Failed"); + // OnError(rfh, document_cookie, "Failed"); } void PrintPreviewMessageHandler::OnPrintPreviewCancelled( - content::RenderFrameHost* rfh, - int document_cookie) { + int document_cookie, + const PrintHostMsg_PreviewIds& ids) { StopWorker(document_cookie); - OnError(rfh, document_cookie, "Cancelled"); + // OnError(rfh, document_cookie, "Cancelled"); } void PrintPreviewMessageHandler::OnPrintPreviewInvalidPrinterSettings( - content::RenderFrameHost* rfh, - int document_cookie) { + int document_cookie, + const PrintHostMsg_PreviewIds& ids) { StopWorker(document_cookie); - OnError(rfh, document_cookie, "Invalid Settings"); + // OnError(rfh, document_cookie, "Invalid Settings"); } bool PrintPreviewMessageHandler::OnMessageReceived( diff --git a/chromium_src/chrome/browser/printing/print_preview_message_handler.h b/chromium_src/chrome/browser/printing/print_preview_message_handler.h index 3425a86cfe..bb9cc2be4c 100644 --- a/chromium_src/chrome/browser/printing/print_preview_message_handler.h +++ b/chromium_src/chrome/browser/printing/print_preview_message_handler.h @@ -9,6 +9,7 @@ #include "atom/browser/api/atom_api_web_contents.h" #include "base/compiler_specific.h" +#include "components/printing/common/print_messages.h" #include "content/public/browser/web_contents_observer.h" #include "content/public/browser/web_contents_user_data.h" @@ -51,17 +52,16 @@ class PrintPreviewMessageHandler content::RenderFrameHost* render_frame_host, const PrintHostMsg_RequestPrintPreview_Params& params); void OnMetafileReadyForPrinting( - content::RenderFrameHost* render_frame_host, - const PrintHostMsg_DidPreviewDocument_Params& params); - void OnPrintPreviewFailed( - content::RenderFrameHost* render_frame_host, - int document_cookie); + const PrintHostMsg_DidPreviewDocument_Params& params, + const PrintHostMsg_PreviewIds& ids); + void OnPrintPreviewFailed(int document_cookie, + const PrintHostMsg_PreviewIds& ids); void OnPrintPreviewCancelled( - content::RenderFrameHost* render_frame_host, - int document_cookie); + int document_cookie, + const PrintHostMsg_PreviewIds& ids); void OnPrintPreviewInvalidPrinterSettings( - content::RenderFrameHost* render_frame_host, - int document_cookie); + int document_cookie, + const PrintHostMsg_PreviewIds& ids); void RunPrintToPDFCallbackWithMessage(int request_id, const std::string& message, From d7e6c5bc32b7725cf19dfe27383066e2a1ce2980 Mon Sep 17 00:00:00 2001 From: Henrique Ferreiro Date: Wed, 18 Jul 2018 10:13:18 +0200 Subject: [PATCH 042/138] Update vendor/node to C69 branch --- DEPS | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/DEPS b/DEPS index 8722f8f3ab..2a7028089c 100644 --- a/DEPS +++ b/DEPS @@ -1,7 +1,7 @@ use_relative_paths = True deps = { - "vendor/node": "https://github.com/brave/node.git@18f874a7222698fee07c977b84dc6082e114e185", + "vendor/node": "https://github.com/brave/node.git@86deba03b1b5a9c391dd8dfaec9f02cdf59b59f1", "vendor/ad-block": "https://github.com/brave/ad-block.git@5377ddea390a0641d99556e0cf9d9c15b8ef275c", "vendor/tracking-protection": "https://github.com/brave/tracking-protection.git@bad1cf834508eab25ba6051d04edfb4d68e45401", "vendor/hashset-cpp": "https://github.com/brave/hashset-cpp.git@edd90e8215ea34582811446a143a7c8063f535f0", From 22da3bf44784611be0c7af4c622b0aacbabd1c3a Mon Sep 17 00:00:00 2001 From: Henrique Ferreiro Date: Wed, 18 Jul 2018 12:31:16 +0200 Subject: [PATCH 043/138] Fix C69 linking issues --- chromium_src/BUILD.gn | 39 ++++++++++++++++++- .../chrome/app/vector_icons/vector_icons.cc | 1 + .../chrome/app/vector_icons/vector_icons.h | 1 + .../chrome/browser/browser_process_impl.cc | 11 ++++++ .../browser/devtools/devtools_window.cc | 9 +++++ .../media/webrtc/webrtc_log_uploader.cc | 5 +++ .../desktop_session_duration_tracker.cc | 4 ++ .../chrome/browser/safe_browsing/BUILD.gn | 11 ++++-- .../password_reuse_modal_warning_dialog.cc | 3 ++ .../chrome/browser/themes/theme_service.cc | 4 ++ 10 files changed, 82 insertions(+), 6 deletions(-) create mode 100644 chromium_src/chrome/browser/devtools/devtools_window.cc create mode 100644 chromium_src/chrome/browser/media/webrtc/webrtc_log_uploader.cc diff --git a/chromium_src/BUILD.gn b/chromium_src/BUILD.gn index cb527d56c3..cde54541b1 100644 --- a/chromium_src/BUILD.gn +++ b/chromium_src/BUILD.gn @@ -160,6 +160,7 @@ source_set("browser") { "//components/data_usage/core", "//components/filename_generation", "//components/keep_alive_registry", + "//components/language/core/browser", "//components/net_log", "//components/offline_items_collection/core", "//components/optimization_guide/proto:optimization_guide_proto", @@ -236,7 +237,6 @@ source_set("browser") { "//chrome/browser/icon_loader_win.cc", "//chrome/browser/icon_manager.cc", "//chrome/browser/icon_manager.h", - "//chrome/browser/net/chrome_extensions_network_delegate.cc", "//chrome/browser/net/chrome_extensions_network_delegate.h", "//chrome/browser/net/chrome_mojo_proxy_resolver_factory.cc", @@ -245,6 +245,8 @@ source_set("browser") { "//chrome/browser/net/chrome_report_sender.h", "//chrome/browser/net/default_network_context_params.cc", "//chrome/browser/net/default_network_context_params.h", + "//chrome/browser/net/failing_url_request_interceptor.cc", + "//chrome/browser/net/failing_url_request_interceptor.h", "//chrome/browser/net/proxy_config_monitor.cc", "//chrome/browser/net/proxy_config_monitor.h", "//chrome/browser/net/proxy_service_factory.cc", @@ -285,7 +287,8 @@ source_set("browser") { "//chrome/browser/ui/pdf/adobe_reader_info_win.h", "chrome/browser/ui/profile_error_dialog.cc", - + "//chrome/browser/ui/recently_audible_helper.cc", + "//chrome/browser/ui/recently_audible_helper.h", "//chrome/browser/ui/web_contents_sizer.cc", "//chrome/browser/ui/web_contents_sizer.h", "chrome/browser/ui/webui/chrome_web_ui_controller_factory.cc", @@ -353,6 +356,8 @@ source_set("browser") { ] sources += [ + "chrome/browser/media/webrtc/webrtc_log_uploader.cc", + "//chrome/browser/media/webrtc/webrtc_log_uploader.h", "chrome/browser/media/webrtc/media_capture_devices_dispatcher.cc", "chrome/browser/media/webrtc/media_capture_devices_dispatcher.h", "chrome/browser/media/webrtc/media_stream_capture_indicator.cc", @@ -720,6 +725,8 @@ source_set("devtools") { "//chrome/browser/devtools/devtools_embedder_message_dispatcher.h", "//chrome/browser/devtools/devtools_file_system_indexer.cc", "//chrome/browser/devtools/devtools_file_system_indexer.h", + "chrome/browser/devtools/devtools_window.cc", + "//chrome/browser/devtools/devtools_window.h", "//chrome/browser/devtools/url_constants.cc", "//chrome/browser/devtools/url_constants.h", ] @@ -1161,8 +1168,14 @@ source_set("tab_manager") { "chrome/browser/engagement/site_engagement_service.cc", "//chrome/browser/memory/oom_memory_details.cc", "//chrome/browser/memory/oom_memory_details.h", + "//chrome/browser/resource_coordinator/decision_details.cc", + "//chrome/browser/resource_coordinator/decision_details.h", "//chrome/browser/resource_coordinator/discard_metrics_lifecycle_unit_observer.cc", "//chrome/browser/resource_coordinator/discard_metrics_lifecycle_unit_observer.h", + "//chrome/browser/resource_coordinator/intervention_policy_database.cc", + "//chrome/browser/resource_coordinator/intervention_policy_database.h", + "//chrome/browser/resource_coordinator/leveldb_site_characteristics_database.cc", + "//chrome/browser/resource_coordinator/leveldb_site_characteristics_database.h", "//chrome/browser/resource_coordinator/lifecycle_unit.cc", "//chrome/browser/resource_coordinator/lifecycle_unit.h", "//chrome/browser/resource_coordinator/lifecycle_unit_base.cc", @@ -1171,6 +1184,22 @@ source_set("tab_manager") { "//chrome/browser/resource_coordinator/lifecycle_unit_observer.h", "//chrome/browser/resource_coordinator/lifecycle_unit_source_base.cc", "//chrome/browser/resource_coordinator/lifecycle_unit_source_base.h", + "//chrome/browser/resource_coordinator/local_site_characteristics_data_impl.cc", + "//chrome/browser/resource_coordinator/local_site_characteristics_data_impl.h", + "//chrome/browser/resource_coordinator/local_site_characteristics_data_reader.cc", + "//chrome/browser/resource_coordinator/local_site_characteristics_data_reader.h", + "//chrome/browser/resource_coordinator/local_site_characteristics_data_store.cc", + "//chrome/browser/resource_coordinator/local_site_characteristics_data_store.h", + "//chrome/browser/resource_coordinator/local_site_characteristics_data_store_factory.cc", + "//chrome/browser/resource_coordinator/local_site_characteristics_data_store_factory.h", + "//chrome/browser/resource_coordinator/local_site_characteristics_data_writer.cc", + "//chrome/browser/resource_coordinator/local_site_characteristics_data_writer.h", + "//chrome/browser/resource_coordinator/local_site_characteristics_noop_data_writer.cc", + "//chrome/browser/resource_coordinator/local_site_characteristics_noop_data_writer.h", + "//chrome/browser/resource_coordinator/local_site_characteristics_non_recording_data_store.cc", + "//chrome/browser/resource_coordinator/local_site_characteristics_non_recording_data_store.h", + "//chrome/browser/resource_coordinator/local_site_characteristics_webcontents_observer.cc", + "//chrome/browser/resource_coordinator/local_site_characteristics_webcontents_observer.h", "//chrome/browser/resource_coordinator/page_signal_receiver.cc", "//chrome/browser/resource_coordinator/page_signal_receiver.h", "//chrome/browser/resource_coordinator/tab_activity_watcher.cc", @@ -1202,6 +1231,10 @@ source_set("tab_manager") { "//chrome/browser/resource_coordinator/tab_manager_web_contents_data.h", "//chrome/browser/resource_coordinator/tab_metrics_logger.cc", "//chrome/browser/resource_coordinator/tab_metrics_logger.h", + "//chrome/browser/resource_coordinator/usage_clock.cc", + "//chrome/browser/resource_coordinator/usage_clock.h", + "//chrome/browser/resource_coordinator/utils.cc", + "//chrome/browser/resource_coordinator/utils.h", "//chrome/browser/memory_details.cc", "//chrome/browser/memory_details.h", "//chrome/browser/memory_details_linux.cc", @@ -1233,7 +1266,9 @@ source_set("tab_manager") { ] deps = [ + ":devtools", ":lifetime", + "//chrome/browser/resource_coordinator:intervention_policy_database_proto", "//chrome/browser/resource_coordinator:site_characteristics_proto", "//chrome/browser/resource_coordinator:tab_metrics_event_proto", "//chrome/browser/resource_coordinator/tab_ranker", diff --git a/chromium_src/chrome/app/vector_icons/vector_icons.cc b/chromium_src/chrome/app/vector_icons/vector_icons.cc index 383786763b..4d665c61e0 100644 --- a/chromium_src/chrome/app/vector_icons/vector_icons.cc +++ b/chromium_src/chrome/app/vector_icons/vector_icons.cc @@ -14,4 +14,5 @@ const gfx::VectorIcon icon_name; VECTOR_ICON_TEMPLATE(kBrowserToolsUpdateIcon) +VECTOR_ICON_TEMPLATE(kSecurityIcon) VECTOR_ICON_TEMPLATE(kUsbSecurityKeyIcon) diff --git a/chromium_src/chrome/app/vector_icons/vector_icons.h b/chromium_src/chrome/app/vector_icons/vector_icons.h index 8772e9dab9..e287c77c42 100644 --- a/chromium_src/chrome/app/vector_icons/vector_icons.h +++ b/chromium_src/chrome/app/vector_icons/vector_icons.h @@ -16,6 +16,7 @@ struct VectorIcon; extern const gfx::VectorIcon icon_name; VECTOR_ICON_TEMPLATE_H(kBrowserToolsUpdateIcon) +VECTOR_ICON_TEMPLATE_H(kSecurityIcon) VECTOR_ICON_TEMPLATE_H(kUsbSecurityKeyIcon) #undef VECTOR_ICON_TEMPLATE_H diff --git a/chromium_src/chrome/browser/browser_process_impl.cc b/chromium_src/chrome/browser/browser_process_impl.cc index 8bd44d31e8..2ad39d2530 100644 --- a/chromium_src/chrome/browser/browser_process_impl.cc +++ b/chromium_src/chrome/browser/browser_process_impl.cc @@ -50,6 +50,7 @@ #include "content/public/common/network_connection_tracker.h" #include "content/public/common/service_manager_connection.h" #include "ppapi/buildflags/buildflags.h" +#include "services/network/public/cpp/network_quality_tracker.h" #include "ui/base/idle/idle.h" #include "ui/base/l10n/l10n_util.h" #include "ui/message_center/message_center.h" @@ -589,12 +590,22 @@ BrowserProcessImpl::system_network_context_manager() { return system_network_context_manager_.get(); } +scoped_refptr +BrowserProcessImpl::shared_url_loader_factory() { + return system_network_context_manager()->GetSharedURLLoaderFactory(); +} + content::NetworkConnectionTracker* BrowserProcessImpl::network_connection_tracker() { NOTIMPLEMENTED(); return nullptr; } +network::NetworkQualityTracker* BrowserProcessImpl::network_quality_tracker() { + NOTIMPLEMENTED(); + return nullptr; +} + WatchDogThread* BrowserProcessImpl::watchdog_thread() { NOTIMPLEMENTED(); return nullptr; diff --git a/chromium_src/chrome/browser/devtools/devtools_window.cc b/chromium_src/chrome/browser/devtools/devtools_window.cc new file mode 100644 index 0000000000..e7ef29e8fb --- /dev/null +++ b/chromium_src/chrome/browser/devtools/devtools_window.cc @@ -0,0 +1,9 @@ +#include "chrome/browser/devtools/devtools_window.h" + +using content::WebContents; + +// static +DevToolsWindow* DevToolsWindow::GetInstanceForInspectedWebContents( + WebContents* inspected_web_contents) { + return NULL; +} diff --git a/chromium_src/chrome/browser/media/webrtc/webrtc_log_uploader.cc b/chromium_src/chrome/browser/media/webrtc/webrtc_log_uploader.cc new file mode 100644 index 0000000000..12e869672c --- /dev/null +++ b/chromium_src/chrome/browser/media/webrtc/webrtc_log_uploader.cc @@ -0,0 +1,5 @@ +#include "chrome/browser/media/webrtc/webrtc_log_uploader.h" + +#include "services/network/public/cpp/simple_url_loader.h" + +WebRtcLogUploader::~WebRtcLogUploader() {} diff --git a/chromium_src/chrome/browser/metrics/desktop_session_duration/desktop_session_duration_tracker.cc b/chromium_src/chrome/browser/metrics/desktop_session_duration/desktop_session_duration_tracker.cc index 4d2c66dced..3689ab59d2 100644 --- a/chromium_src/chrome/browser/metrics/desktop_session_duration/desktop_session_duration_tracker.cc +++ b/chromium_src/chrome/browser/metrics/desktop_session_duration/desktop_session_duration_tracker.cc @@ -2,6 +2,10 @@ namespace metrics { +bool DesktopSessionDurationTracker::IsInitialized() { + return false; +} + DesktopSessionDurationTracker* DesktopSessionDurationTracker::Get() { return NULL; } diff --git a/chromium_src/chrome/browser/safe_browsing/BUILD.gn b/chromium_src/chrome/browser/safe_browsing/BUILD.gn index 00c0a1a603..f83e1c6ffc 100644 --- a/chromium_src/chrome/browser/safe_browsing/BUILD.gn +++ b/chromium_src/chrome/browser/safe_browsing/BUILD.gn @@ -1,3 +1,4 @@ +import("//build/config/ui.gni") import("//extensions/buildflags/buildflags.gni") source_set("install_verification") { @@ -66,10 +67,6 @@ source_set("safe_browsing") { configs += [ "//electron/build:electron_config" ] configs += [ "//electron/chromium_src:chromium_src_config" ] - sources = [ - "password_reuse_modal_warning_dialog.cc", - ] - public_deps = [ "//chrome/browser/safe_browsing", ] @@ -89,4 +86,10 @@ source_set("safe_browsing") { ":extensions", ] } + + if (toolkit_views) { + sources = [ + "password_reuse_modal_warning_dialog.cc", + ] + } } diff --git a/chromium_src/chrome/browser/safe_browsing/password_reuse_modal_warning_dialog.cc b/chromium_src/chrome/browser/safe_browsing/password_reuse_modal_warning_dialog.cc index c692f17d1e..a357225349 100644 --- a/chromium_src/chrome/browser/safe_browsing/password_reuse_modal_warning_dialog.cc +++ b/chromium_src/chrome/browser/safe_browsing/password_reuse_modal_warning_dialog.cc @@ -5,11 +5,14 @@ namespace safe_browsing { +#if !defined(OS_MACOSX) || BUILDFLAG(MAC_VIEWS_BROWSER) void ShowPasswordReuseModalWarningDialog( content::WebContents* web_contents, ChromePasswordProtectionService* service, + ReusedPasswordType password_type, OnWarningDone done_callback) { std::move(done_callback).Run(PasswordProtectionService::IGNORE_WARNING); } +#endif // !OS_MACOSX || MAC_VIEWS_BROWSER } // namespace safe_browsing diff --git a/chromium_src/chrome/browser/themes/theme_service.cc b/chromium_src/chrome/browser/themes/theme_service.cc index fc487b9817..4c8cef01fc 100644 --- a/chromium_src/chrome/browser/themes/theme_service.cc +++ b/chromium_src/chrome/browser/themes/theme_service.cc @@ -120,6 +120,10 @@ bool ThemeService::BrowserThemeProvider::HasCustomImage(int id) const { return false; } +bool ThemeService::BrowserThemeProvider::HasCustomColor(int id) const { + return false; +} + base::RefCountedMemory* ThemeService::BrowserThemeProvider::GetRawData( int id, ui::ScaleFactor scale_factor) const { From 34723dab57ebb84870831b47cab5234ad0a7de8e Mon Sep 17 00:00:00 2001 From: Henrique Ferreiro Date: Thu, 19 Jul 2018 12:21:10 +0200 Subject: [PATCH 044/138] Fix lint issue --- atom/common/keyboard_util.cc | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/atom/common/keyboard_util.cc b/atom/common/keyboard_util.cc index b756d63403..84b8218039 100644 --- a/atom/common/keyboard_util.cc +++ b/atom/common/keyboard_util.cc @@ -67,7 +67,8 @@ ui::KeyboardCode KeyboardCodeFromCharCode(base::char16 c, bool* shifted) { case '+': *shifted = true; FALLTHROUGH; case '=': return ui::VKEY_OEM_PLUS; case '<': *shifted = true; FALLTHROUGH; case ',': return ui::VKEY_OEM_COMMA; case '_': *shifted = true; FALLTHROUGH; case '-': return ui::VKEY_OEM_MINUS; - case '>': *shifted = true; FALLTHROUGH; case '.': return ui::VKEY_OEM_PERIOD; + case '>': *shifted = true; FALLTHROUGH; + case '.': return ui::VKEY_OEM_PERIOD; case '?': *shifted = true; FALLTHROUGH; case '/': return ui::VKEY_OEM_2; case '~': *shifted = true; FALLTHROUGH; case '`': return ui::VKEY_OEM_3; case '{': *shifted = true; FALLTHROUGH; case '[': return ui::VKEY_OEM_4; From cf161c108a46fd901981638dd44d2ead3199de97 Mon Sep 17 00:00:00 2001 From: Henrique Ferreiro Date: Wed, 4 Jul 2018 13:42:32 +0200 Subject: [PATCH 045/138] Update patches to 69.0.3493.3 --- patches/master_patch.patch | 250 ++++++++---------- .../third_party/boringssl/src/boringssl.patch | 27 +- patches/v8/filter.patch | 2 +- 3 files changed, 125 insertions(+), 154 deletions(-) diff --git a/patches/master_patch.patch b/patches/master_patch.patch index 586631a8fd..138c70a8bc 100644 --- a/patches/master_patch.patch +++ b/patches/master_patch.patch @@ -1,5 +1,5 @@ diff --git a/base/threading/thread_restrictions.h b/base/threading/thread_restrictions.h -index aaf226b5bf5b0e452cfbb1c0945decc40b288bbe..0a4cb9c31563bd6f78e4ea9596782c2d7fbc1202 100644 +index e76b16208fcceaaa3613a4d462de28e595c6a363..768f980f6b50d23f5556a5bdbba9144df5a18a95 100644 --- a/base/threading/thread_restrictions.h +++ b/base/threading/thread_restrictions.h @@ -34,6 +34,13 @@ class StatisticsProviderImpl; @@ -27,7 +27,7 @@ index aaf226b5bf5b0e452cfbb1c0945decc40b288bbe..0a4cb9c31563bd6f78e4ea9596782c2d // BEGIN USAGE THAT NEEDS TO BE FIXED. friend class ::chromeos::BlockingMethodCaller; // http://crbug.com/125360 diff --git a/build/config/BUILDCONFIG.gn b/build/config/BUILDCONFIG.gn -index 848d3cf68b3df2ec0c11c09cc3aa9fc59b9c1b10..5ad466d6404008bb3c3cddc42bb5a1a92b17ca75 100644 +index 2545815219d44b67dc86c01a42ee4ad306e042d4..edf4bcc817ef88d4050caabaf87d0cc25f28a743 100644 --- a/build/config/BUILDCONFIG.gn +++ b/build/config/BUILDCONFIG.gn @@ -148,6 +148,8 @@ declare_args() { @@ -39,7 +39,7 @@ index 848d3cf68b3df2ec0c11c09cc3aa9fc59b9c1b10..5ad466d6404008bb3c3cddc42bb5a1a9 } declare_args() { -@@ -529,6 +531,14 @@ default_compiler_configs = [ +@@ -538,6 +540,14 @@ default_compiler_configs = [ "//build/config/sanitizers:default_sanitizer_flags", ] @@ -99,7 +99,7 @@ index eb3e2b2b377dde31e062be46837bf509ecab0325..a4bee6058da2366f8b5358072a845828 goma_prefix = "" } diff --git a/chrome/BUILD.gn b/chrome/BUILD.gn -index eb55999a8aa354e403505947e8b126d90b64dff8..ad71409160fb1b82359dfc6325d03516c9f9305e 100644 +index 5d7d370bf6f05a53239575dca2fdc08953db65ae..989bf7f6086d38236e55a0de5ecfa0d120c78dcf 100644 --- a/chrome/BUILD.gn +++ b/chrome/BUILD.gn @@ -41,6 +41,11 @@ if (is_android) { @@ -115,11 +115,11 @@ index eb55999a8aa354e403505947e8b126d90b64dff8..ad71409160fb1b82359dfc6325d03516 assert(!is_ios, "Chromium/iOS shouldn't use anything in //chrome") diff --git a/chrome/app/BUILD.gn b/chrome/app/BUILD.gn -index 22e10d6c2fcf926ce090c25e102883eda8893dad..9fbd92a9e441488f4f4b2cde2b5e77eebeac5296 100644 +index ce6f796ee63a9beac47825fd1a81f133a94c4301..5d0c2f4551b859cbbffcc51677e944a91599a390 100644 --- a/chrome/app/BUILD.gn +++ b/chrome/app/BUILD.gn -@@ -442,6 +442,8 @@ service_manifest("chrome_content_packaged_services_manifest_overlay") { - "//components/services/font:manifest", +@@ -453,6 +453,8 @@ service_manifest("chrome_content_packaged_services_manifest_overlay") { + "//ui/accessibility:manifest", ] } + @@ -128,10 +128,10 @@ index 22e10d6c2fcf926ce090c25e102883eda8893dad..9fbd92a9e441488f4f4b2cde2b5e77ee # Per-profile services. diff --git a/chrome/browser/chrome_content_browser_manifest_overlay.json b/chrome/browser/chrome_content_browser_manifest_overlay.json -index 4bebe8192e2e6fd36aa49aed6e53172edb58e739..e72d31fb327921940fc6c388b5c625496a07c98e 100644 +index 25edd37cb74c7b0ddc98f5294594b589d95bcb9c..ee287c55373f228092e29097fed246280ab466c5 100644 --- a/chrome/browser/chrome_content_browser_manifest_overlay.json +++ b/chrome/browser/chrome_content_browser_manifest_overlay.json -@@ -12,7 +12,7 @@ +@@ -15,7 +15,7 @@ "extensions.StashService", "metrics.mojom.CallStackProfileCollector", "mojom.ModuleEventSink", @@ -140,7 +140,7 @@ index 4bebe8192e2e6fd36aa49aed6e53172edb58e739..e72d31fb327921940fc6c388b5c62549 "safe_browsing.mojom.SafeBrowsing", "translate.mojom.ContentTranslateDriver" ], -@@ -58,6 +58,7 @@ +@@ -61,6 +61,7 @@ "removable_storage_writer": [ "removable_storage_writer" ], "secure_channel": [ "secure_channel" ], "shortcut_viewer_app": [ "shortcut_viewer" ], @@ -265,10 +265,10 @@ index 2592dea8c30aa5e7b9daf614a63fe964471bab7a..5fede5d8ee00b4b06d437b4272ec19a0 callback_fn.Run(updated_pref); } diff --git a/chrome/browser/password_manager/password_store_factory.cc b/chrome/browser/password_manager/password_store_factory.cc -index ef255cb022eb8fdca3a6eb0f3a49e5ec663674ce..e5bc4c49a3d9447ddaa27c4c3caeaaba88767550 100644 +index a234d584154069f036c245823307466df4c7a671..96e21b99d5ac4cc2614aa0f5160820e831608846 100644 --- a/chrome/browser/password_manager/password_store_factory.cc +++ b/chrome/browser/password_manager/password_store_factory.cc -@@ -122,8 +122,10 @@ PasswordStoreFactory::PasswordStoreFactory() +@@ -125,8 +125,10 @@ PasswordStoreFactory::PasswordStoreFactory() #if defined(SYNC_PASSWORD_REUSE_DETECTION_ENABLED) // TODO(crbug.com/715987). Remove when PasswordReuseDetector is decoupled // from PasswordStore. @@ -279,7 +279,7 @@ index ef255cb022eb8fdca3a6eb0f3a49e5ec663674ce..e5bc4c49a3d9447ddaa27c4c3caeaaba } PasswordStoreFactory::~PasswordStoreFactory() {} -@@ -282,12 +284,14 @@ PasswordStoreFactory::BuildServiceInstanceFor( +@@ -283,12 +285,14 @@ PasswordStoreFactory::BuildServiceInstanceFor( password_manager_util::CleanUserDataInBlacklistedCredentials( ps.get(), profile->GetPrefs(), 60); @@ -451,7 +451,7 @@ index 9f0003bc2d80d7c76ab9dd17393d0188fe1ac6fd..88d75d4091fb3dc282998a5d44e63cbf // content::NotificationObserver implementation. void Observe(int type, diff --git a/chrome/browser/resource_coordinator/tab_lifecycle_unit.cc b/chrome/browser/resource_coordinator/tab_lifecycle_unit.cc -index 8075180fd7b00a9dc1ad3860e3e49f15b41eec29..0c001515ff56d7539e78ae88db3c1e6ab2c56fc3 100644 +index 5c7a81142a594d93c46763a728d899f6a00f576e..5ac1956d1094b0770c68f09e55da9295bf076135 100644 --- a/chrome/browser/resource_coordinator/tab_lifecycle_unit.cc +++ b/chrome/browser/resource_coordinator/tab_lifecycle_unit.cc @@ -12,6 +12,7 @@ @@ -459,18 +459,18 @@ index 8075180fd7b00a9dc1ad3860e3e49f15b41eec29..0c001515ff56d7539e78ae88db3c1e6a #include "base/optional.h" #include "base/process/process_metrics.h" +#include "chrome/browser/browser_process.h" + #include "chrome/browser/devtools/devtools_window.h" #include "chrome/browser/media/webrtc/media_capture_devices_dispatcher.h" #include "chrome/browser/media/webrtc/media_stream_capture_indicator.h" - #include "chrome/browser/profiles/profile.h" -@@ -20,6 +21,7 @@ - #include "chrome/browser/resource_coordinator/tab_helper.h" +@@ -24,6 +25,7 @@ #include "chrome/browser/resource_coordinator/tab_lifecycle_observer.h" + #include "chrome/browser/resource_coordinator/tab_lifecycle_unit_source.h" #include "chrome/browser/resource_coordinator/tab_load_tracker.h" +#include "chrome/browser/resource_coordinator/tab_manager.h" #include "chrome/browser/resource_coordinator/tab_manager_features.h" #include "chrome/browser/resource_coordinator/time.h" - #include "chrome/browser/ui/tabs/tab_strip_model.h" -@@ -573,7 +575,7 @@ void TabLifecycleUnitSource::TabLifecycleUnit::FinishDiscard( + #include "chrome/browser/resource_coordinator/utils.h" +@@ -673,7 +675,7 @@ void TabLifecycleUnitSource::TabLifecycleUnit::FinishDiscard( content::WebContents::CreateParams::kNoRendererProcess; create_params.last_active_time = old_contents->GetLastActiveTime(); std::unique_ptr null_contents = @@ -479,7 +479,7 @@ index 8075180fd7b00a9dc1ad3860e3e49f15b41eec29..0c001515ff56d7539e78ae88db3c1e6a content::WebContents* raw_null_contents = null_contents.get(); // Attach the ResourceCoordinatorTabHelper. In production code this has -@@ -630,7 +632,9 @@ void TabLifecycleUnitSource::TabLifecycleUnit::FinishDiscard( +@@ -730,7 +732,9 @@ void TabLifecycleUnitSource::TabLifecycleUnit::FinishDiscard( // TODO(jamescook): This breaks script connections with other tabs. Find a // different approach that doesn't do that, perhaps based on // RenderFrameProxyHosts. @@ -491,10 +491,10 @@ index 8075180fd7b00a9dc1ad3860e3e49f15b41eec29..0c001515ff56d7539e78ae88db3c1e6a SetState(LifecycleUnitState::DISCARDED, DiscardReasonToStateChangeReason(discard_reason)); diff --git a/chrome/browser/resource_coordinator/tab_manager.cc b/chrome/browser/resource_coordinator/tab_manager.cc -index a3fdc6ab26be4871294035e3ef1b788b1cb488ca..5b9b3a46e04fbc04d974cb57cdfaf5b2c2866024 100644 +index eb20716c944aaf633b478758c2a43309ad2763ff..4bb5e1e163c1eedf5c29c724410503bfcec00ecc 100644 --- a/chrome/browser/resource_coordinator/tab_manager.cc +++ b/chrome/browser/resource_coordinator/tab_manager.cc -@@ -490,6 +490,19 @@ void TabManager::PurgeBackgroundedTabsIfNeeded() { +@@ -500,6 +500,19 @@ void TabManager::PurgeBackgroundedTabsIfNeeded() { } } @@ -515,10 +515,10 @@ index a3fdc6ab26be4871294035e3ef1b788b1cb488ca..5b9b3a46e04fbc04d974cb57cdfaf5b2 TRACE_EVENT_INSTANT0("navigation", "TabManager::PauseBackgroundTabOpeningIfNeeded", diff --git a/chrome/browser/resource_coordinator/tab_manager.h b/chrome/browser/resource_coordinator/tab_manager.h -index 103fec465a1d84eb4841fd2d9a6da8c804ee1b24..72f28aeec3a9ca61c398bac663fa0a4df76759e3 100644 +index d02e58a7f4738b46a1f7b42b4b567ce2b72d9a66..21955020f06a7046aae2586c17e4a1a366e3b86d 100644 --- a/chrome/browser/resource_coordinator/tab_manager.h +++ b/chrome/browser/resource_coordinator/tab_manager.h -@@ -31,6 +31,7 @@ +@@ -34,6 +34,7 @@ #include "chrome/browser/ui/browser_tab_strip_tracker.h" #include "chrome/browser/ui/tabs/tab_strip_model_observer.h" #include "content/public/browser/navigation_throttle.h" @@ -526,7 +526,7 @@ index 103fec465a1d84eb4841fd2d9a6da8c804ee1b24..72f28aeec3a9ca61c398bac663fa0a4d #include "ui/gfx/native_widget_types.h" class GURL; -@@ -91,6 +92,13 @@ class TabManager : public LifecycleUnitObserver, +@@ -95,6 +96,13 @@ class TabManager : public LifecycleUnitObserver, TabManager(); ~TabManager() override; @@ -540,8 +540,8 @@ index 103fec465a1d84eb4841fd2d9a6da8c804ee1b24..72f28aeec3a9ca61c398bac663fa0a4d // Start/Stop the Tab Manager. void Start(); void Stop(); -@@ -180,6 +188,7 @@ class TabManager : public LifecycleUnitObserver, - int restored_tab_count() const; +@@ -190,6 +198,7 @@ class TabManager : public LifecycleUnitObserver, + static bool IsTabRestoredInForeground(content::WebContents* web_contents); private: + friend class GuestTabManager; @@ -582,10 +582,10 @@ index 8af376e16e327f97577b0f2bc0487e30751201d2..fc7a2d23ea2ae3db8709036dff062bc5 "//build/config/linux/pangocairo", "//build/config/linux:x11", diff --git a/chrome/common/BUILD.gn b/chrome/common/BUILD.gn -index c36abac4f582b934758001124755536164dbe357..ee3c0e29fd01ba38119b8ae28a9d6e4356041372 100644 +index 9a21e268447a0ea984101132329073dca486f6ad..32c5ec793cd44d5f45b3d5ff7bb769aadc62a576 100644 --- a/chrome/common/BUILD.gn +++ b/chrome/common/BUILD.gn -@@ -496,6 +496,12 @@ static_library("common") { +@@ -497,6 +497,12 @@ static_library("common") { ] public_deps += [ "//chrome/common:version_header" ] } @@ -599,7 +599,7 @@ index c36abac4f582b934758001124755536164dbe357..ee3c0e29fd01ba38119b8ae28a9d6e43 process_version("version_header") { diff --git a/chrome/common/chrome_constants.cc b/chrome/common/chrome_constants.cc -index d4e0823a55994118bacfe4fd7f8ec1881640e8ac..3644624a60bc75b5d6308c30343a25793ccff589 100644 +index 38f30f6ecd6c2073f4f18922c786b93517cf39e8..6a89b71cc022f71c624e89b34519f6fb5fa70c06 100644 --- a/chrome/common/chrome_constants.cc +++ b/chrome/common/chrome_constants.cc @@ -10,11 +10,11 @@ @@ -963,10 +963,10 @@ index d7734d8883c3e438ece3d509b7bb331931831178..6e6cdda19c271de7e5429db02b3e17b2 } # Note: Update the test expectations in GetBaseMessageIdForMode.GoogleStringIds diff --git a/chrome/renderer/BUILD.gn b/chrome/renderer/BUILD.gn -index 0b312fc03b93ec515fdc50ecd6fc4ed2e55dd2c8..ce621207b4da425873d8c3286eb3ab309996ce3c 100644 +index 0a1e5754bb7ad43f9ff7130cdaa2aba0c4b6acd5..13a042811559c77a16b96f7524db3cd7cad139e1 100644 --- a/chrome/renderer/BUILD.gn +++ b/chrome/renderer/BUILD.gn -@@ -406,6 +406,19 @@ static_library("renderer") { +@@ -412,6 +412,19 @@ static_library("renderer") { "searchbox/searchbox_extension.h", ] } @@ -1129,10 +1129,10 @@ index c4c5f83886574956b3abdfa77a07500a2ee6de9e..edbfde3c41a1e38bcdedd09aaa41d8a1 std::unique_ptr ref_factory_; service_manager::BinderRegistry registry_; diff --git a/components/autofill/core/browser/credit_card_save_manager.cc b/components/autofill/core/browser/credit_card_save_manager.cc -index 359c92bf2df0c436b1b7cb67bfde3677df2a1fac..fdf8cd6760d014eece1d137930433024df810b7b 100644 +index 6103a334623510fd36c295ffe6be192b48b33f79..4fa55fa3ed76168ae8d578e5923b1bff0c6c51ff 100644 --- a/components/autofill/core/browser/credit_card_save_manager.cc +++ b/components/autofill/core/browser/credit_card_save_manager.cc -@@ -202,12 +202,17 @@ void CreditCardSaveManager::AttemptToOfferCardUploadSave( +@@ -182,12 +182,17 @@ void CreditCardSaveManager::AttemptToOfferCardUploadSave( } bool CreditCardSaveManager::IsCreditCardUploadEnabled() { @@ -1151,10 +1151,10 @@ index 359c92bf2df0c436b1b7cb67bfde3677df2a1fac..fdf8cd6760d014eece1d137930433024 void CreditCardSaveManager::OnDidUploadCard( diff --git a/components/crash/content/app/breakpad_linux.cc b/components/crash/content/app/breakpad_linux.cc -index 76f15cb5b511877a489e1a4f13350a712bc0a677..dc02ac413d44ac6942915fa0469b04b68860e058 100644 +index a7378204ffaa5586be9789a552de0f2a951ad208..25d0ed3e2b2a13e4c8c939e1dfe14586920f2273 100644 --- a/components/crash/content/app/breakpad_linux.cc +++ b/components/crash/content/app/breakpad_linux.cc -@@ -86,8 +86,10 @@ namespace breakpad { +@@ -87,8 +87,10 @@ namespace breakpad { namespace { @@ -1166,7 +1166,7 @@ index 76f15cb5b511877a489e1a4f13350a712bc0a677..dc02ac413d44ac6942915fa0469b04b6 #endif bool g_is_crash_reporter_enabled = false; -@@ -1342,6 +1344,7 @@ void ExecUploadProcessOrTerminate(const BreakpadInfo& info, +@@ -1358,6 +1360,7 @@ void ExecUploadProcessOrTerminate(const BreakpadInfo& info, header_content_type, post_file, kUploadURL, @@ -1174,7 +1174,7 @@ index 76f15cb5b511877a489e1a4f13350a712bc0a677..dc02ac413d44ac6942915fa0469b04b6 "--timeout=10", // Set a timeout so we don't hang forever. "--tries=1", // Don't retry if the upload fails. "-O", // Output reply to the file descriptor path. -@@ -1897,6 +1900,7 @@ void HandleCrashDump(const BreakpadInfo& info) { +@@ -1912,6 +1915,7 @@ void HandleCrashDump(const BreakpadInfo& info) { const size_t kCrashIdLength = 16; char id_buf[kCrashIdLength + 1]; @@ -1450,10 +1450,10 @@ index ac7a6eb8c3298bbf6a25bf3eb623a8875383bc1e..e5383acaae9965d602ce3a46671026ea } // namespace password_manager diff --git a/content/app/content_main_runner_impl.cc b/content/app/content_main_runner_impl.cc -index 4787f14958265ffe6b2d505996175aaf2571f6b8..e3c6739233355ceb4123a42b77fc9e298f68b7e1 100644 +index 8d789ef1b9f76aacbf1bc8c13b79de04618b9141..5f29cccc1f0af8a1b47666a374e75dc3e05fc9ee 100644 --- a/content/app/content_main_runner_impl.cc +++ b/content/app/content_main_runner_impl.cc -@@ -847,7 +847,7 @@ int ContentMainRunnerImpl::Initialize(const ContentMainParams& params) { +@@ -835,7 +835,7 @@ int ContentMainRunnerImpl::Initialize(const ContentMainParams& params) { return nullptr; })); @@ -1462,7 +1462,7 @@ index 4787f14958265ffe6b2d505996175aaf2571f6b8..e3c6739233355ceb4123a42b77fc9e29 #if defined(OS_WIN) bool should_enable_stack_dump = !process_type.empty(); #else -@@ -863,7 +863,7 @@ int ContentMainRunnerImpl::Initialize(const ContentMainParams& params) { +@@ -851,7 +851,7 @@ int ContentMainRunnerImpl::Initialize(const ContentMainParams& params) { service_manager::switches::kDisableInProcessStackTraces)) { base::debug::EnableInProcessStackDumping(); } @@ -1472,7 +1472,7 @@ index 4787f14958265ffe6b2d505996175aaf2571f6b8..e3c6739233355ceb4123a42b77fc9e29 delegate_->PreSandboxStartup(); diff --git a/content/browser/browser_plugin/browser_plugin_guest.cc b/content/browser/browser_plugin/browser_plugin_guest.cc -index 5b9fca0cf04f4d928090632e6483eefa2e35456d..8ee9662335415d8cad6292b42a681438b9fc08ca 100644 +index f56ce93c3d5b1b46b706800a12a21f29cabafb33..745a5f821a3b49f95d0181381b6fa616e7cf7a11 100644 --- a/content/browser/browser_plugin/browser_plugin_guest.cc +++ b/content/browser/browser_plugin/browser_plugin_guest.cc @@ -830,6 +830,8 @@ void BrowserPluginGuest::OnDetach(int browser_plugin_instance_id) { @@ -1540,7 +1540,7 @@ index 91bf248a67a5a82eab9c5942be54465599bf397a..b2dbd9a97dce6c402f0d3f87b452613d // In this loop, copy the WebPluginInfo (and do not use a reference) because // the filter might mutate it. diff --git a/content/browser/frame_host/render_widget_host_view_guest.cc b/content/browser/frame_host/render_widget_host_view_guest.cc -index 6a47f48f920fbb6266e4041d42903e76478fd3ab..f4134fa198e1adb6bdae70c8a6fc677d92c8326d 100644 +index 2b567985fa0621004af209fb45fe8da9977cc797..cd5efd1515bd0699f1c73433fd5bcaeb80a12727 100644 --- a/content/browser/frame_host/render_widget_host_view_guest.cc +++ b/content/browser/frame_host/render_widget_host_view_guest.cc @@ -591,7 +591,14 @@ void RenderWidgetHostViewGuest::ShowDefinitionForSelection() { @@ -1627,27 +1627,34 @@ index 47338f71c3aa8a4a433ac530517258da2a0ce6a8..fe0f2454e07777d345f2eb36ab9bb6ba +++ b/content/browser/renderer_host/render_widget_host_ns_view_bridge_local.mm @@ -11,6 +11,9 @@ #include "base/strings/sys_string_conversions.h" +diff --git a/content/browser/renderer_host/render_widget_host_ns_view_bridge_local.h b/content/browser/renderer_host/render_widget_host_ns_view_bridge_local.h +index a7678f05d794a4ea0498fa698d3b051b8e7e908b..b8434a3832c8c86a21ad9363a380ccae58fd0302 100644 +--- a/content/browser/renderer_host/render_widget_host_ns_view_bridge_local.h ++++ b/content/browser/renderer_host/render_widget_host_ns_view_bridge_local.h +@@ -10,6 +10,9 @@ + #import "base/mac/scoped_nsobject.h" #import "content/browser/renderer_host/popup_window_mac.h" #import "content/browser/renderer_host/render_widget_host_view_cocoa.h" +#if !defined(MUON_CHROMIUM_BUILD) +#include "content/browser/renderer_host/render_widget_host_view_mac.h" +#endif - #include "content/common/cursors/webcursor.h" - #import "skia/ext/skia_utils_mac.h" + #include "content/common/render_widget_host_ns_view.mojom.h" #include "ui/accelerated_widget_mac/display_ca_layer_tree.h" -@@ -54,6 +57,11 @@ class RenderWidgetHostNSViewBridgeLocal : public RenderWidgetHostNSViewBridge, + #include "ui/display/display_observer.h" +@@ -54,6 +57,12 @@ class RenderWidgetHostNSViewBridgeLocal void DisplayCursor(const WebCursor& cursor) override; void SetCursorLocked(bool locked) override; void ShowDictionaryOverlayForSelection() override; +#if !defined(MUON_CHROMIUM_BUILD) + void ShowDictionaryOverlayForSelection(RenderWidgetHostView* target_view); + void SetTargetView(RenderWidgetHostView* target_view) override { -+ target_view_ = static_cast(target_view); }; ++ target_view_ = static_cast(target_view); ++ }; +#endif void ShowDictionaryOverlay( const mac::AttributedStringCoder::EncodedString& encoded_string, - gfx::Point baseline_point) override; -@@ -90,6 +98,10 @@ class RenderWidgetHostNSViewBridgeLocal : public RenderWidgetHostNSViewBridge, + const gfx::Point& baseline_point) override; +@@ -91,6 +100,10 @@ class RenderWidgetHostNSViewBridgeLocal // Cached copy of the tooltip text, to avoid redundant calls. base::string16 tooltip_text_; @@ -1658,7 +1665,11 @@ index 47338f71c3aa8a4a433ac530517258da2a0ce6a8..fe0f2454e07777d345f2eb36ab9bb6ba DISALLOW_COPY_AND_ASSIGN(RenderWidgetHostNSViewBridgeLocal); }; -@@ -104,6 +116,10 @@ RenderWidgetHostNSViewBridgeLocal::RenderWidgetHostNSViewBridgeLocal( +diff --git a/content/browser/renderer_host/render_widget_host_ns_view_bridge_local.mm b/content/browser/renderer_host/render_widget_host_ns_view_bridge_local.mm +index 9df5543cc218f073d65ab153a66a4cb1c80657fa..47532c173d1da797b122e8ae1c1c37473cb952a3 100644 +--- a/content/browser/renderer_host/render_widget_host_ns_view_bridge_local.mm ++++ b/content/browser/renderer_host/render_widget_host_ns_view_bridge_local.mm +@@ -29,6 +29,10 @@ RenderWidgetHostNSViewBridgeLocal::RenderWidgetHostNSViewBridgeLocal( std::make_unique(background_layer_.get()); [cocoa_view_ setLayer:background_layer_]; [cocoa_view_ setWantsLayer:YES]; @@ -1669,7 +1680,7 @@ index 47338f71c3aa8a4a433ac530517258da2a0ce6a8..fe0f2454e07777d345f2eb36ab9bb6ba } RenderWidgetHostNSViewBridgeLocal::~RenderWidgetHostNSViewBridgeLocal() { -@@ -300,10 +316,17 @@ void RenderWidgetHostNSViewBridgeLocal::ShowDictionaryOverlay( +@@ -225,10 +229,17 @@ void RenderWidgetHostNSViewBridgeLocal::ShowDictionaryOverlay( mac::AttributedStringCoder::Decode(&encoded_string); if ([string length] == 0) return; @@ -1690,10 +1701,10 @@ index 47338f71c3aa8a4a433ac530517258da2a0ce6a8..fe0f2454e07777d345f2eb36ab9bb6ba } diff --git a/content/browser/renderer_host/render_widget_host_view_aura.cc b/content/browser/renderer_host/render_widget_host_view_aura.cc -index 50fb4ac83df4440dec8ec85413e40b2c163fc34f..6d7c275596d540fd59cc8bac1e7b4dff337020e7 100644 +index 1333bcecaace57311ca570bd5d1bb2223a8f5ede..35e9085576856825f2831c79516bdd8266ef7458 100644 --- a/content/browser/renderer_host/render_widget_host_view_aura.cc +++ b/content/browser/renderer_host/render_widget_host_view_aura.cc -@@ -1634,8 +1634,23 @@ bool RenderWidgetHostViewAura::TransformPointToLocalCoordSpaceLegacy( +@@ -1637,8 +1637,23 @@ bool RenderWidgetHostViewAura::TransformPointToLocalCoordSpaceLegacy( !delegated_frame_host_->TransformPointToLocalCoordSpaceLegacy( point_in_pixels, original_surface, transformed_point)) return false; @@ -1720,10 +1731,10 @@ index 50fb4ac83df4440dec8ec85413e40b2c163fc34f..6d7c275596d540fd59cc8bac1e7b4dff } diff --git a/content/browser/renderer_host/render_widget_host_view_cocoa.mm b/content/browser/renderer_host/render_widget_host_view_cocoa.mm -index acd073c5a1647fac743f10399440068c004f9b65..d4fd2534f4ce314a2e9bd53c08ce190c205d60ed 100644 +index 8b84322baa808f66044361d1033ec63805856227..956e4851aa8a9371e972d7f4307b72d356737172 100644 --- a/content/browser/renderer_host/render_widget_host_view_cocoa.mm +++ b/content/browser/renderer_host/render_widget_host_view_cocoa.mm -@@ -180,6 +180,12 @@ void ExtractUnderlines(NSAttributedString* string, +@@ -174,6 +174,12 @@ void ExtractUnderlines(NSAttributedString* string, } // namespace @@ -1751,18 +1762,7 @@ index acd073c5a1647fac743f10399440068c004f9b65..d4fd2534f4ce314a2e9bd53c08ce190c } - (void)setCloseOnDeactivate:(BOOL)b { -@@ -643,8 +656,10 @@ void ExtractUnderlines(NSAttributedString* string, - if (EventIsReservedBySystem(theEvent)) - return; - -+#ifdef MUON_CHROMIUM_BUILD - DCHECK(eventType != NSKeyDown || - !equiv == !(modifierFlags & NSCommandKeyMask)); -+#endif // MUON_CHROMIUM_BUILD - - if (eventType == NSFlagsChanged) { - // Ignore NSFlagsChanged events from the NumLock and Fn keys as -@@ -691,6 +706,12 @@ void ExtractUnderlines(NSAttributedString* string, +@@ -687,6 +700,12 @@ void ExtractUnderlines(NSAttributedString* string, bool shouldAutohideCursor = textInputType_ != ui::TEXT_INPUT_TYPE_NONE && eventType == NSKeyDown && !(modifierFlags & NSCommandKeyMask); @@ -1776,11 +1776,11 @@ index acd073c5a1647fac743f10399440068c004f9b65..d4fd2534f4ce314a2e9bd53c08ce190c // We only handle key down events and just simply forward other events. if (eventType != NSKeyDown) { diff --git a/content/browser/renderer_host/render_widget_host_view_mac.h b/content/browser/renderer_host/render_widget_host_view_mac.h -index 8dffe1b810ebb8494be3a41fe2ed2daa034a85ad..07ca961edc65ded67a8b595d5e1106717fecbf89 100644 +index 1a60e3cddb6d96b8c0aca2e588de9c7a3392c296..0ee7b2c018427e5bde4c04aeed1704261091db7c 100644 --- a/content/browser/renderer_host/render_widget_host_view_mac.h +++ b/content/browser/renderer_host/render_widget_host_view_mac.h -@@ -108,6 +108,9 @@ class CONTENT_EXPORT RenderWidgetHostViewMac - gfx::Rect GetViewBounds() const override; +@@ -109,6 +109,9 @@ class CONTENT_EXPORT RenderWidgetHostViewMac + bool IsMouseLocked() override; void SetActive(bool active) override; void ShowDefinitionForSelection() override; +#if !defined(MUON_CHROMIUM_BUILD) @@ -1790,10 +1790,10 @@ index 8dffe1b810ebb8494be3a41fe2ed2daa034a85ad..07ca961edc65ded67a8b595d5e110671 void SetNeedsBeginFrames(bool needs_begin_frames) override; void GetScreenInfo(ScreenInfo* screen_info) const override; diff --git a/content/browser/renderer_host/render_widget_host_view_mac.mm b/content/browser/renderer_host/render_widget_host_view_mac.mm -index 1e06f2c9934cd99c43c411ace9d4309a959e832f..3102a8322149dc86276bb3d8e7ba79585973ba81 100644 +index d34b8d22269b17404b1c57c9bcf606acc11c9c0e..2d1dbf21131b8ee58214da9df87798b8683d8fe9 100644 --- a/content/browser/renderer_host/render_widget_host_view_mac.mm +++ b/content/browser/renderer_host/render_widget_host_view_mac.mm -@@ -1216,6 +1216,10 @@ void RenderWidgetHostViewMac::SetActive(bool active) { +@@ -1230,6 +1230,10 @@ void RenderWidgetHostViewMac::SetActive(bool active) { if (host()) { host()->SetActive(active); if (active) { @@ -1804,7 +1804,7 @@ index 1e06f2c9934cd99c43c411ace9d4309a959e832f..3102a8322149dc86276bb3d8e7ba7958 if (HasFocus()) host()->Focus(); } else { -@@ -1233,6 +1237,14 @@ void RenderWidgetHostViewMac::ShowDefinitionForSelection() { +@@ -1247,6 +1251,14 @@ void RenderWidgetHostViewMac::ShowDefinitionForSelection() { ns_view_bridge_->ShowDictionaryOverlayForSelection(); } @@ -1820,7 +1820,7 @@ index 1e06f2c9934cd99c43c411ace9d4309a959e832f..3102a8322149dc86276bb3d8e7ba7958 // This is called by the embedding code prior to the first frame appearing, // to set a reasonable color to show before the web content generates its diff --git a/content/browser/renderer_host/render_widget_targeter.cc b/content/browser/renderer_host/render_widget_targeter.cc -index c5f44fc0abf56b3a8daa297a11774005b32f06a7..414ab6d8086f59096074abc9ea4945bbfddca085 100644 +index 4a5acc5f53bfe872a605b7fe289e60c478b620ba..ded4e8573213cebd05333d2f2b71102f2b2853e9 100644 --- a/content/browser/renderer_host/render_widget_targeter.cc +++ b/content/browser/renderer_host/render_widget_targeter.cc @@ -6,6 +6,7 @@ @@ -1831,7 +1831,7 @@ index c5f44fc0abf56b3a8daa297a11774005b32f06a7..414ab6d8086f59096074abc9ea4945bb #include "content/browser/renderer_host/input/one_shot_timeout_monitor.h" #include "content/browser/renderer_host/render_widget_host_impl.h" #include "content/browser/renderer_host/render_widget_host_view_base.h" -@@ -154,7 +155,13 @@ void RenderWidgetTargeter::FindTargetAndDispatch( +@@ -156,7 +157,13 @@ void RenderWidgetTargeter::FindTargetAndDispatch( // TODO(kenrb, wjmaclean): Asynchronous hit tests don't work properly with // GuestViews, so rely on the synchronous result. // See https://crbug.com/802378. @@ -1846,7 +1846,7 @@ index c5f44fc0abf56b3a8daa297a11774005b32f06a7..414ab6d8086f59096074abc9ea4945bb // TODO(kenrb, sadrul): When all event types support asynchronous hit // testing, we should be able to have FindTargetSynchronously return the // view and location to use for the renderer hit test query. -@@ -167,6 +174,9 @@ void RenderWidgetTargeter::FindTargetAndDispatch( +@@ -169,6 +176,9 @@ void RenderWidgetTargeter::FindTargetAndDispatch( FoundTarget(root_view, target, *event_ptr, latency, result.target_location, result.latched_target); } @@ -1894,10 +1894,10 @@ index 39b89cd36c327f27da7f687c3179ace964fc6d63..9140ff961245e4e4e222986e48297906 process_->Launch(std::make_unique( diff --git a/content/browser/web_contents/web_contents_impl.cc b/content/browser/web_contents/web_contents_impl.cc -index 70c8438e18516985ec7fa6c2c5245a5f7ac63a50..66e8cf16d398aab8c67c6097981d918b94ac09c7 100644 +index 1d4d7e62968b9fb75aefa0bb8aadf2f2db29e906..800c4f1e6a4b00254bad8cff7848743563609cf4 100644 --- a/content/browser/web_contents/web_contents_impl.cc +++ b/content/browser/web_contents/web_contents_impl.cc -@@ -1872,8 +1872,9 @@ void WebContentsImpl::Init(const WebContents::CreateParams& params) { +@@ -2011,8 +2011,9 @@ void WebContentsImpl::Init(const WebContents::CreateParams& params) { // This is set before initializing the render manager since // RenderFrameHostManager::Init calls back into us via its delegate to ask if // it should be hidden. @@ -1909,7 +1909,7 @@ index 70c8438e18516985ec7fa6c2c5245a5f7ac63a50..66e8cf16d398aab8c67c6097981d918b if (!params.last_active_time.is_null()) last_active_time_ = params.last_active_time; -@@ -2554,7 +2555,8 @@ void WebContentsImpl::CreateNewWindow( +@@ -2693,7 +2694,8 @@ void WebContentsImpl::CreateNewWindow( DCHECK(!params.opener_suppressed || render_view_route_id == MSG_ROUTING_NONE); scoped_refptr site_instance = @@ -1920,10 +1920,10 @@ index 70c8438e18516985ec7fa6c2c5245a5f7ac63a50..66e8cf16d398aab8c67c6097981d918b : source_site_instance; diff --git a/content/browser/web_contents/web_contents_view_mac.mm b/content/browser/web_contents/web_contents_view_mac.mm -index 00b2d2a729da28f55cd0bbbe8ab923da9462e093..6ebef5c88c12cec86fcf8e95a123295f0e0880a3 100644 +index 082b74eff5b2d57851f35f34e1f8d0155976f8f1..7b9a53ccd7d49f151d6e77fcb3917f1d9b00c811 100644 --- a/content/browser/web_contents/web_contents_view_mac.mm +++ b/content/browser/web_contents/web_contents_view_mac.mm -@@ -596,6 +596,7 @@ void WebContentsViewMac::SetParentUiLayer(ui::Layer* parent_ui_layer) { +@@ -595,6 +595,7 @@ void WebContentsViewMac::SetParentUiLayer(ui::Layer* parent_ui_layer) { endedAt:(NSPoint)screenPoint operation:(NSDragOperation)operation { [dragSource_ endDragAt:screenPoint operation:operation]; @@ -2003,10 +2003,10 @@ index fd088fb170bead6452ded14016f21f0c29659e03..2d51cbc6c9b58263a345b7d641f8d89e (*map_type)[key] = value; ResetKeyIterator(); diff --git a/content/public/app/mojo/content_renderer_manifest.json b/content/public/app/mojo/content_renderer_manifest.json -index 71bc81d6183df0dbd118e9c91a88c39ec14a9b60..c2917293b9f58df1e80725217c407eada67d7f16 100644 +index 70c678203f239b6c3e1ad5167d46473f1e953240..10378d20d6684708a67aeab91da88f35e85a6e67 100644 --- a/content/public/app/mojo/content_renderer_manifest.json +++ b/content/public/app/mojo/content_renderer_manifest.json -@@ -48,6 +48,7 @@ +@@ -49,6 +49,7 @@ "navigation:frame": { "provides": { "browser": [ @@ -2029,7 +2029,7 @@ index 0f2bbdcf4b2b25f938fde6c8433390f6adc1d384..45fc9e5353dcdaa2b368e62981f0597f // Tells the view to speak the currently selected text. virtual void SpeakSelection() = 0; diff --git a/content/renderer/browser_plugin/browser_plugin.cc b/content/renderer/browser_plugin/browser_plugin.cc -index 1651db088d0c510313c8f569c56fc236d2cc635e..c68b252a58de26d920c912497fa0ffe04d9fb274 100644 +index 4d8251069ae9a45e1be22fa03f23b3196116b612..970eb343c09d03065310c1ad1c11dcb8e7ceb4ea 100644 --- a/content/renderer/browser_plugin/browser_plugin.cc +++ b/content/renderer/browser_plugin/browser_plugin.cc @@ -105,6 +105,7 @@ BrowserPlugin::BrowserPlugin( @@ -2054,7 +2054,7 @@ index 1651db088d0c510313c8f569c56fc236d2cc635e..c68b252a58de26d920c912497fa0ffe0 BrowserPluginManager::Get()->Send( new BrowserPluginHostMsg_Detach(browser_plugin_instance_id_)); -@@ -659,8 +665,6 @@ blink::WebInputEventResult BrowserPlugin::HandleInputEvent( +@@ -668,8 +674,6 @@ blink::WebInputEventResult BrowserPlugin::HandleInputEvent( if (blink::WebInputEvent::IsGestureEventType(event.GetType())) { auto gesture_event = static_cast(event); @@ -2063,38 +2063,8 @@ index 1651db088d0c510313c8f569c56fc236d2cc635e..c68b252a58de26d920c912497fa0ffe0 // We shouldn't be forwarding GestureEvents to the Guest anymore. Indicate // we handled this only if it's a non-resent event. -diff --git a/device/geolocation/BUILD.gn b/device/geolocation/BUILD.gn -index 924390705c3f95b55183e3fde5bc40a2c48cd60a..093a9c379177bf347f17134da3162a340fc4665a 100644 ---- a/device/geolocation/BUILD.gn -+++ b/device/geolocation/BUILD.gn -@@ -10,6 +10,8 @@ if (is_android) { - } - - source_set("geolocation") { -+ configs += [ "//electron/build/geolocation" ] -+ - sources = [ - "empty_wifi_data_provider.cc", - "empty_wifi_data_provider.h", -diff --git a/device/geolocation/network_location_request.cc b/device/geolocation/network_location_request.cc -index a9a739e4f9a707faaf195f0747b560197b97a1be..2c34b71205886e239151ba56e5c8f7f878c9d611 100644 ---- a/device/geolocation/network_location_request.cc -+++ b/device/geolocation/network_location_request.cc -@@ -32,8 +32,12 @@ - namespace device { - namespace { - -+#if defined(GOOGLEAPIS_ENDPOINT) -+const char kNetworkLocationBaseUrl[] = GOOGLEAPIS_ENDPOINT; -+#else - const char kNetworkLocationBaseUrl[] = - "https://www.googleapis.com/geolocation/v1/geolocate"; -+#endif - - const char kLocationString[] = "location"; - const char kLatitudeString[] = "lat"; diff --git a/extensions/browser/BUILD.gn b/extensions/browser/BUILD.gn -index f293adbf7c3b5b70815f67df89b8813c75430c30..a4ca01157a9235cca2f72d40fd454023af8b4848 100644 +index 26d6afa1c49c01fdba83e398266c7be2c13d85bc..404b862aabdf08388d835d96d0be5e5c96ae681c 100644 --- a/extensions/browser/BUILD.gn +++ b/extensions/browser/BUILD.gn @@ -329,8 +329,8 @@ jumbo_source_set("browser_sources") { @@ -2140,7 +2110,7 @@ index ffa79cf2918bc0c651448cb27bebcb780f9c4e6c..5f78f790bccf27fc2349d95324cf1a4f content::WebContents* owner = guest->owner_web_contents(); if (!owner) diff --git a/extensions/browser/guest_view/web_view/web_view_guest.cc b/extensions/browser/guest_view/web_view/web_view_guest.cc -index 716f3f074a4e38958368649a1e51afde6a352c42..ce200abedc23bba890193dd09235252f4b1a1f62 100644 +index 0121a18ddef5cb744bcabc2838d2891690a9bce3..a9b11454e77701258e50dead3d58d6ebfc1c3dff 100644 --- a/extensions/browser/guest_view/web_view/web_view_guest.cc +++ b/extensions/browser/guest_view/web_view/web_view_guest.cc @@ -306,7 +306,7 @@ std::string WebViewGuest::GetPartitionID( @@ -2255,10 +2225,10 @@ index d985c0df7a9cb9543003ac32751f3fc80633248a..02bd6daf7e48de8345ce3be506e02110 proto.attachedCallback = function() { diff --git a/media/base/media_switches.cc b/media/base/media_switches.cc -index d8505dbe1427ce17bf02640ea39e4dbf9c3387a0..82ae6153c02f5cd6ba0bf905111b87330fd1974d 100644 +index f3fbc82a555386f4665586e009353b6904f1aa0c..db8813e71a8dcab35c5223d0d75edd6068e69ee9 100644 --- a/media/base/media_switches.cc +++ b/media/base/media_switches.cc -@@ -405,7 +405,7 @@ std::string GetEffectiveAutoplayPolicy(const base::CommandLine& command_line) { +@@ -416,7 +416,7 @@ std::string GetEffectiveAutoplayPolicy(const base::CommandLine& command_line) { return switches::autoplay::kDocumentUserActivationRequiredPolicy; // The default value is platform dependent. @@ -2268,10 +2238,10 @@ index d8505dbe1427ce17bf02640ea39e4dbf9c3387a0..82ae6153c02f5cd6ba0bf905111b8733 #else return switches::autoplay::kNoUserGestureRequiredPolicy; diff --git a/net/BUILD.gn b/net/BUILD.gn -index 80ba467c4f8cb7a3442de92a307285a94b10c694..270379a30a01dffdf2ed0882389abb927bab4ac3 100644 +index 7f9901a8826ce131181b3febdef9b911bae23d12..fb1d8dccc32bf4d287440e3ac301bc37eb77ebf9 100644 --- a/net/BUILD.gn +++ b/net/BUILD.gn -@@ -367,6 +367,10 @@ component("net") { +@@ -364,6 +364,10 @@ component("net") { "ssl/token_binding.h", "third_party/quic/core/quic_error_codes.cc", "third_party/quic/core/quic_error_codes.h", @@ -2413,10 +2383,10 @@ index e26c7d78b7d379dd010ba6ac6afdf494ecd5c563..3e827a41f18577b1f1f4f9744cfab83f } diff --git a/net/http/transport_security_state.cc b/net/http/transport_security_state.cc -index cd6128c229248675c2b22224f306d0d8df5740dd..cf90a3f065eb57fb4c85724a656afb4eeacdff6f 100644 +index 2dc467772e8625ef702c5e28165b1f161f0c7932..a09e271f10d83a2bd24f667cb927c54b1915cdaa 100644 --- a/net/http/transport_security_state.cc +++ b/net/http/transport_security_state.cc -@@ -508,6 +508,10 @@ TransportSecurityState::TransportSecurityState() +@@ -414,6 +414,10 @@ TransportSecurityState::TransportSecurityState() enable_static_pins_ = false; enable_static_expect_ct_ = false; #endif @@ -2428,10 +2398,10 @@ index cd6128c229248675c2b22224f306d0d8df5740dd..cf90a3f065eb57fb4c85724a656afb4e } diff --git a/net/log/net_log_event_type_list.h b/net/log/net_log_event_type_list.h -index 949de470e2919a25a5a53a963cd61052847e2329..3853d5904b7c561e0d0aee7f9ff0fcfc29afb77c 100644 +index 3c5cbce3e412cd76459d3289a6031e78b743abdb..df756b0498af45f736fddc5870761a32fcd58e1f 100644 --- a/net/log/net_log_event_type_list.h +++ b/net/log/net_log_event_type_list.h -@@ -2121,6 +2121,12 @@ EVENT_TYPE(SOCKS5_GREET_WRITE) +@@ -2124,6 +2124,12 @@ EVENT_TYPE(SOCKS5_GREET_WRITE) // The time spent waiting for the "greeting" response from the SOCKS server. EVENT_TYPE(SOCKS5_GREET_READ) @@ -2560,7 +2530,7 @@ index b6e59ae6b07823087e44ffc40fb7d2d54c6a7c3e..98ee500609b2a72970387324a09da102 // Writes the SOCKS handshake buffer into |handshake| // and return OK on success. diff --git a/net/socket/socks_client_socket_pool.cc b/net/socket/socks_client_socket_pool.cc -index 2dad2733466a194da7898919604ebf4dcb463d74..30cb9d1955a034d2a6bcec97a2a286589881f310 100644 +index d5da29925a083ac263d4c58d893f69552098850b..b2fda922fe442a448c3d3bc562bb12054eae5f19 100644 --- a/net/socket/socks_client_socket_pool.cc +++ b/net/socket/socks_client_socket_pool.cc @@ -16,7 +16,7 @@ @@ -2588,10 +2558,10 @@ index 2dad2733466a194da7898919604ebf4dcb463d74..30cb9d1955a034d2a6bcec97a2a28658 socket_.reset(new SOCKSClientSocket( std::move(transport_socket_handle_), socks_params_->destination(), diff --git a/net/url_request/url_request_job.h b/net/url_request/url_request_job.h -index cad145dad56c3d2512b2d03d78a12a9e3a35c9d0..8239098264ff4dee5b8b031def94c492028b4f31 100644 +index 7a223958751012b2042a91edf85578b00702d565..08a3940915c61746c7bf80d24400875099f9686c 100644 --- a/net/url_request/url_request_job.h +++ b/net/url_request/url_request_job.h -@@ -291,6 +291,7 @@ class NET_EXPORT URLRequestJob : public base::PowerObserver { +@@ -292,6 +292,7 @@ class NET_EXPORT URLRequestJob : public base::PowerObserver { void OnCallToDelegate(NetLogEventType type); void OnCallToDelegateComplete(); @@ -2600,10 +2570,10 @@ index cad145dad56c3d2512b2d03d78a12a9e3a35c9d0..8239098264ff4dee5b8b031def94c492 // |buf_size| bytes into |buf|. // Possible return values: diff --git a/services/service_manager/sandbox/win/sandbox_win.cc b/services/service_manager/sandbox/win/sandbox_win.cc -index 31edb20931f11bcff578eede005b8c44b3fa5700..7c0877140c2712fad4fc2ca359f790ad4233afaf 100644 +index 7beb41460e7d1a7340cca8ebc98a114ec41b3e44..3b3e1aa30f342971b96b4213ed85718d36fb3aa6 100644 --- a/services/service_manager/sandbox/win/sandbox_win.cc +++ b/services/service_manager/sandbox/win/sandbox_win.cc -@@ -830,6 +830,9 @@ sandbox::ResultCode SandboxWin::StartSandboxedProcess( +@@ -831,6 +831,9 @@ sandbox::ResultCode SandboxWin::StartSandboxedProcess( service_manager::switches::kNoSandbox)) { base::LaunchOptions options; options.handles_to_inherit = handles_to_inherit; @@ -2627,10 +2597,10 @@ index 90f13baf5daa216c0832b39137ba87f60aa2ccd2..643caf4e6825e3da6678af6a1a981c42 bool ShouldSelectReplacement() const { diff --git a/third_party/blink/renderer/core/exported/web_view_impl.cc b/third_party/blink/renderer/core/exported/web_view_impl.cc -index b5c2685603c6db968436d8c8399325dd9495ba36..69d3aaac0cee0bff4649546aacc054a2eaa6a552 100644 +index 355d0393070ce2a32a60992699490a4735e2318d..61773e9ee6804b6613b400f740c65bb4ed6df4a2 100644 --- a/third_party/blink/renderer/core/exported/web_view_impl.cc +++ b/third_party/blink/renderer/core/exported/web_view_impl.cc -@@ -3116,6 +3116,7 @@ void WebViewImpl::DidCloseContextMenu() { +@@ -3034,6 +3034,7 @@ void WebViewImpl::DidCloseContextMenu() { LocalFrame* frame = page_->GetFocusController().FocusedFrame(); if (frame) frame->Selection().SetCaretBlinkingSuspended(false); @@ -2639,7 +2609,7 @@ index b5c2685603c6db968436d8c8399325dd9495ba36..69d3aaac0cee0bff4649546aacc054a2 void WebViewImpl::HidePopups() { diff --git a/third_party/blink/renderer/core/html/media/autoplay_policy.cc b/third_party/blink/renderer/core/html/media/autoplay_policy.cc -index b6d8c82aa42a39cfab90fd8814906413761396c6..fa75d18084e01a86c02521727807dd117f903deb 100644 +index 70d1323967869929988baea80ead2fb997244ee6..80f262e1bd2711243c6f2d5e6a9a5e66346f0df2 100644 --- a/third_party/blink/renderer/core/html/media/autoplay_policy.cc +++ b/third_party/blink/renderer/core/html/media/autoplay_policy.cc @@ -343,6 +343,12 @@ bool AutoplayPolicy::IsGestureNeededForPlaybackIfPendingUserGestureIsLocked() @@ -2714,10 +2684,10 @@ index 5d115f0cc12f124d57df088b6b1add05e47e7b68..af49abf95e2268fdcc49cc60d988772b MHTMLArchive* Archive() const override; diff --git a/third_party/blink/renderer/platform/bindings/v8_per_isolate_data.cc b/third_party/blink/renderer/platform/bindings/v8_per_isolate_data.cc -index 4096a64a8683cf759092ca44c4e1ce84b3e1535c..e65c46f609c96228d943e5cb93de6863cebc651a 100644 +index 44cb5a9489f1938b0078f20fedc0ef7831a3d9e1..51212af2879e940931ea49cc10eac9707541bbe3 100644 --- a/third_party/blink/renderer/platform/bindings/v8_per_isolate_data.cc +++ b/third_party/blink/renderer/platform/bindings/v8_per_isolate_data.cc -@@ -50,7 +50,8 @@ v8::Isolate* MainThreadIsolate() { +@@ -55,7 +55,8 @@ v8::Isolate* MainThreadIsolate() { static V8PerIsolateData* g_main_thread_per_isolate_data = nullptr; static void BeforeCallEnteredCallback(v8::Isolate* isolate) { @@ -2728,10 +2698,10 @@ index 4096a64a8683cf759092ca44c4e1ce84b3e1535c..e65c46f609c96228d943e5cb93de6863 static void MicrotasksCompletedCallback(v8::Isolate* isolate) { diff --git a/third_party/boringssl/BUILD.generated.gni b/third_party/boringssl/BUILD.generated.gni -index 65148fd17deb60813838de1d994c0b106f6cd737..d83c74331ee6e624b5600bc2408149fbc274a958 100644 +index 67ff124e5009500f9f853aff9b5beb392c6a52b5..e4743ab9eeea0b6ea177ac176f8cc17c4923869e 100644 --- a/third_party/boringssl/BUILD.generated.gni +++ b/third_party/boringssl/BUILD.generated.gni -@@ -387,6 +387,24 @@ ssl_headers = [ +@@ -386,6 +386,24 @@ ssl_headers = [ "src/include/openssl/tls1.h", ] @@ -2786,10 +2756,10 @@ index 4783ecb252b11a56550d4a6f684bd15c89fc4eb7..9ffdb7c00af09accc1883c525332271f database_->SkipReportUpload( report.uuid, Metrics::CrashSkippedReason::kUploadThrottled); diff --git a/ui/views/controls/menu/menu_controller.cc b/ui/views/controls/menu/menu_controller.cc -index 7db3c69b1a3b7d57eb12f13f96dda38a5a635fee..3ae5151eaabc7522f70f0887b6b2825b944258ba 100644 +index beecb7f271772cc9a19d2ca5476d60069e218e17..fc4b16eb6999700ad212319a3b525679a4b770df 100644 --- a/ui/views/controls/menu/menu_controller.cc +++ b/ui/views/controls/menu/menu_controller.cc -@@ -620,6 +620,7 @@ bool MenuController::OnMouseDragged(SubmenuView* source, +@@ -621,6 +621,7 @@ bool MenuController::OnMouseDragged(SubmenuView* source, return true; } MenuItemView* mouse_menu = NULL; @@ -2797,7 +2767,7 @@ index 7db3c69b1a3b7d57eb12f13f96dda38a5a635fee..3ae5151eaabc7522f70f0887b6b2825b if (part.type == MenuPart::MENU_ITEM) { // If there is no menu target, but a submenu target, then we are interacting // with an empty menu item within a submenu. These cannot become selection -@@ -644,7 +645,10 @@ bool MenuController::OnMouseDragged(SubmenuView* source, +@@ -645,7 +646,10 @@ bool MenuController::OnMouseDragged(SubmenuView* source, } } } diff --git a/patches/third_party/boringssl/src/boringssl.patch b/patches/third_party/boringssl/src/boringssl.patch index 1267f4354e..84e2caad51 100644 --- a/patches/third_party/boringssl/src/boringssl.patch +++ b/patches/third_party/boringssl/src/boringssl.patch @@ -1,5 +1,5 @@ diff --git a/crypto/cipher_extra/cipher_extra.c b/crypto/cipher_extra/cipher_extra.c -index 2b88fb6c10644b6932b8ebb76a4e53132d49fad6..0ceb2c5aecc48d293f0203bf72fc99ce7ae5d2f2 100644 +index 1b23ad32f8cff2a00512ba58d24b47b628e7920c..0e9e4edc4490838c2722eb91b608704240d31289 100644 --- a/crypto/cipher_extra/cipher_extra.c +++ b/crypto/cipher_extra/cipher_extra.c @@ -83,6 +83,8 @@ const EVP_CIPHER *EVP_get_cipherbynid(int nid) { @@ -165,10 +165,10 @@ index afeb2dea4e0464082fa72fd1404f9321eb656dec..2c3c842cb4a21e937993132f7a7cfbae #define LN_ripemd160WithRSA "ripemd160WithRSA" #define NID_ripemd160WithRSA 119 diff --git a/include/openssl/ssl.h b/include/openssl/ssl.h -index 2558732c5d8ec7b873dd2a82ca869bcfad1a4f8c..2fe9b19e5c4738ac0c00d3c651d65ede78b9f717 100644 +index f693030a8a7c4bf79dd791e1abd0e94f8e97a292..721a00de9aebddc8b9b90665300fae2e60428fa9 100644 --- a/include/openssl/ssl.h +++ b/include/openssl/ssl.h -@@ -4290,6 +4290,15 @@ OPENSSL_EXPORT int SSL_CTX_set_tlsext_status_cb(SSL_CTX *ctx, +@@ -4338,6 +4338,15 @@ OPENSSL_EXPORT int SSL_CTX_set_tlsext_status_cb(SSL_CTX *ctx, // |SSL_CTX_set_tlsext_status_cb|'s callback and returns one. OPENSSL_EXPORT int SSL_CTX_set_tlsext_status_arg(SSL_CTX *ctx, void *arg); @@ -185,10 +185,10 @@ index 2558732c5d8ec7b873dd2a82ca869bcfad1a4f8c..2fe9b19e5c4738ac0c00d3c651d65ede // Nodejs compatibility section (hidden). // diff --git a/ssl/internal.h b/ssl/internal.h -index 412c1fe71286b7df0ec66912f7dfd0945c623f09..e860499831ba91ae80ea6ea308fde12eb2eb1562 100644 +index e3f0984cd09aa7aed5025db5a6eddc2de8a41b28..a7b7f8dc0eb4b3e223ad1d58f08d4653eeb17c13 100644 --- a/ssl/internal.h +++ b/ssl/internal.h -@@ -2080,6 +2080,8 @@ struct SSLContext { +@@ -2122,6 +2122,8 @@ struct SSLContext { void (*remove_session_cb)(SSL_CTX *ctx, SSL_SESSION *sess); SSL_SESSION *(*get_session_cb)(SSL *ssl, const uint8_t *data, int len, int *copy); @@ -198,10 +198,10 @@ index 412c1fe71286b7df0ec66912f7dfd0945c623f09..e860499831ba91ae80ea6ea308fde12e CRYPTO_refcount_t references; diff --git a/ssl/ssl_session.cc b/ssl/ssl_session.cc -index 5e8ffe0b5608c94b0cf09c441b2392c3334619d6..ddc176b703b51df3c3795c4c6c3d3b239c22778c 100644 +index 379cea793502d8b33544b7c7fe02bc4b9b32cc51..4d0913a247740587ebc450949320faffd5699b0c 100644 --- a/ssl/ssl_session.cc +++ b/ssl/ssl_session.cc -@@ -686,10 +686,17 @@ static enum ssl_hs_wait_t ssl_lookup_session( +@@ -672,10 +672,18 @@ static enum ssl_hs_wait_t ssl_lookup_session( } // Fall back to the external cache, if it exists. @@ -209,20 +209,21 @@ index 5e8ffe0b5608c94b0cf09c441b2392c3334619d6..ddc176b703b51df3c3795c4c6c3d3b23 + if (!session && (ssl->session_ctx->get_session_cb != nullptr || + ssl->session_ctx->get_session_cb_legacy != nullptr)) { int copy = 1; -- session.reset(ssl->session_ctx->get_session_cb(ssl, session_id, -- session_id_len, ©)); +- session.reset(ssl->session_ctx->get_session_cb(ssl, session_id.data(), +- session_id.size(), ©)); + if (ssl->session_ctx->get_session_cb != nullptr) { -+ session.reset(ssl->session_ctx->get_session_cb(ssl, session_id, -+ session_id_len, ©)); ++ session.reset(ssl->session_ctx->get_session_cb(ssl, session_id.data(), ++ session_id.size(), ©)); + } else { + session.reset(ssl->session_ctx->get_session_cb_legacy( -+ ssl, const_cast(session_id), session_id_len, ©)); ++ ssl, const_cast(session_id.data()), session_id.size(), ++ ©)); + } + if (!session) { return ssl_hs_ok; } -@@ -1265,6 +1272,12 @@ void SSL_CTX_sess_set_get_cb(SSL_CTX *ctx, +@@ -1249,6 +1257,12 @@ void SSL_CTX_sess_set_get_cb(SSL_CTX *ctx, ctx->get_session_cb = cb; } diff --git a/patches/v8/filter.patch b/patches/v8/filter.patch index 41703fe09c..dd1d0b0af5 100644 --- a/patches/v8/filter.patch +++ b/patches/v8/filter.patch @@ -1,5 +1,5 @@ diff --git a/BUILD.gn b/BUILD.gn -index 92277c2e52fccd844f0eca42515f1a27f58f7893..9ebfd30d4faddd1bda60cad3e0bd690c3b291ad5 100644 +index 8931e4fc620693676e5f290c261cf9d0f89f282d..4d97ddb5bacaf277fe0bfe27a66f31ba0c5cfc4f 100644 --- a/BUILD.gn +++ b/BUILD.gn @@ -208,9 +208,15 @@ config("internal_config") { From 40d9ba69f0dcead079ffdc0b0f016ae433151619 Mon Sep 17 00:00:00 2001 From: Henrique Ferreiro Date: Fri, 20 Jul 2018 12:03:00 +0200 Subject: [PATCH 046/138] Remove Expect-Staple code https://crrev.com/2c10daa8c2c8 --- .../transport_security_state_static.json | 71 +++---------------- 1 file changed, 8 insertions(+), 63 deletions(-) diff --git a/atom/browser/resources/transport_security_state_static.json b/atom/browser/resources/transport_security_state_static.json index 14bc965a02..2ed28ae517 100644 --- a/atom/browser/resources/transport_security_state_static.json +++ b/atom/browser/resources/transport_security_state_static.json @@ -27,8 +27,7 @@ // preload list. This field is used for list maintenance. // - test: test domains. // - google: Google-owned sites. -// - custom: entries without includeSubdomains or with HPKP, Expect-CT, -// or Expect-Staple. +// - custom: entries without includeSubdomains or with HPKP/Expect-CT. // - bulk-legacy: bulk entries preloaded before Chrome 50. // - bulk-18-weeks: bulk entries with max-age >= 18 weeks (Chrome 50-63). // - bulk-1-year: bulk entries with max-age >= 1 year (after Chrome 63). @@ -51,12 +50,6 @@ // URI to which reports should be sent when valid Certificate // Transparency information is not present. // -// expect_staple: (optional boolean) true if the site expects responses to -// contain stapled OCSP responses. -// expect_staple_report_uri: (optional string) if expect_staple is true, the -// URI to which expect_staple reports should be sent. -// include_subdomains_for_expect_staple: (optional boolean) whether subdomains -// of |name| are also covered for |expect_staple|. { "pinsets": [ @@ -271,17 +264,6 @@ ], "entries": [ - { - "name": "preloaded-expect-staple.badssl.com", "policy": "test", - "expect_staple": true, - "expect_staple_report_uri": "https://report.badssl.com/expect-staple" - }, - { - "name": "preloaded-expect-staple-include-subdomains.badssl.com", "policy": "test", - "expect_staple": true, "include_subdomains_for_expect_staple": true, - "expect_staple_report_uri": "https://report.badssl.com/expect-staple" - }, - //Brave { "name": "ledger.mercury.basicattentiontoken.org", "policy": "custom", "mode": "force-https", "pins": "brave"}, { "name": "ledger-staging.mercury.basicattentiontoken.org", "policy": "custom", "mode": "force-https", "pins": "brave"}, @@ -657,9 +639,7 @@ }, { "name": "www.dropbox.com", "policy": "custom", - "mode": "force-https", "include_subdomains": true, - "expect_staple": true, "include_subdomains_for_expect_staple": true, - "expect_staple_report_uri": "https://log.getdropbox.com/log/ocsp_expect_staple" + "mode": "force-https", "include_subdomains": true }, { "name": "jackyyf.com", "policy": "custom", "mode": "force-https" }, @@ -44004,18 +43984,13 @@ // IPv6 { "name": "ipv6only.network", "policy": "custom", "mode": "force-https", "include_subdomains": true }, { "name": "trinity.fr.eu.org", "policy": "custom", "mode": "force-https", "include_subdomains": true }, - // Expect-CT/Expect-Staple + // Expect-CT { "name": "crt.sh", "policy": "custom", "mode": "force-https", "include_subdomains": true, "expect_ct": true, "expect_ct_report_uri": "https://clients3.google.com/ct_upload" }, - { - "name": "caddyserver.com", "policy": "custom", - "expect_staple": true, - "expect_staple_report_uri": "https://reporting.caddyserver.com/expect-staple" - }, { "name": "crypto.is", "policy": "custom", "mode": "force-https", "include_subdomains": true, @@ -44026,8 +44001,6 @@ "name": "scotthelme.co.uk", "policy": "custom", "mode": "force-https", "include_subdomains": true, - "expect_staple": true, "include_subdomains_for_expect_staple": true, - "expect_staple_report_uri": "https://scotthelme.report-uri.com/r/d/staple/reportOnly", "expect_ct": true, "expect_ct_report_uri": "https://scotthelme.report-uri.com/r/d/ct/reportOnly" }, @@ -44035,31 +44008,23 @@ "name": "matteomarescotti.it", "policy": "custom", "mode": "force-https", "include_subdomains": true, - "expect_staple": true, "include_subdomains_for_expect_staple": true, - "expect_staple_report_uri": "https://matteomarescotti.report-uri.com/r/d/staple/reportOnly", "expect_ct": true, "expect_ct_report_uri": "https://matteomarescotti.report-uri.com/r/d/ct/reportOnly" }, { "name": "alessandroz.pro", "policy": "custom", - "mode": "force-https", "include_subdomains": true, - "expect_staple": true, "include_subdomains_for_expect_staple": true, - "expect_staple_report_uri": "https://azreport.report-uri.com/r/d/staple/reportOnly" + "mode": "force-https", "include_subdomains": true }, { "name": "minecraftforum.de", "policy": "custom", - "mode": "force-https", "include_subdomains": true, - "expect_staple": true, "include_subdomains_for_expect_staple": true, - "expect_staple_report_uri": "https://minecraft.report-uri.com/r/d/staple/reportOnly" + "mode": "force-https", "include_subdomains": true }, { "name": "tobiassachs.de", "policy": "custom", "mode": "force-https", "include_subdomains": true, - "expect_staple": true, "include_subdomains_for_expect_staple": true, - "expect_staple_report_uri": "https://tobiassachs.report-uri.com/r/d/staple/reportOnly", "expect_ct": true, "expect_ct_report_uri": "https://tobiassachs.report-uri.com/r/d/ct/reportOnly" }, @@ -44067,8 +44032,6 @@ "name": "gc-mc.de", "policy": "custom", "mode": "force-https", "include_subdomains": true, - "expect_staple": true, "include_subdomains_for_expect_staple": true, - "expect_staple_report_uri": "https://tobiassachs.report-uri.com/r/d/staple/reportOnly", "expect_ct": true, "expect_ct_report_uri": "https://tobiassachs.report-uri.com/r/d/ct/reportOnly" }, @@ -44076,8 +44039,6 @@ "name": "knightsblog.de", "policy": "custom", "mode": "force-https", "include_subdomains": true, - "expect_staple": true, "include_subdomains_for_expect_staple": true, - "expect_staple_report_uri": "https://tobiassachs.report-uri.com/r/d/staple/reportOnly", "expect_ct": true, "expect_ct_report_uri": "https://tobiassachs.report-uri.com/r/d/ct/reportOnly" }, @@ -44085,33 +44046,25 @@ "name": "cloudflare.com", "policy": "custom", "mode": "force-https", "include_subdomains": true, - "expect_staple": true, - "expect_staple_report_uri": "https://report-uri.cloudflare.com/expect-staple", "expect_ct": true, "expect_ct_report_uri": "https://report-uri.cloudflare.com/expect-ct" }, { "name": "weeblrpress.com", "policy": "custom", - "mode": "force-https", "include_subdomains": true, - "expect_staple": true, "include_subdomains_for_expect_staple": true, - "expect_staple_report_uri": "https://weeblr.report-uri.com/r/d/staple/reportOnly" + "mode": "force-https", "include_subdomains": true }, { "name": "0.me.uk", "policy": "custom", "mode": "force-https", "include_subdomains": true, - "expect_staple": true, "include_subdomains_for_expect_staple": true, - "expect_staple_report_uri": "https://log.ncsccs.com/report/expectstaple", "expect_ct": true, "expect_ct_report_uri": "https://log.ncsccs.com/report/expectct" }, { "name": "photistic.org", "policy": "custom", - "mode": "force-https", "include_subdomains": true, - "expect_staple": true, "include_subdomains_for_expect_staple": true, - "expect_staple_report_uri": "https://photistic.report-uri.com/r/d/staple/reportOnly" + "mode": "force-https", "include_subdomains": true }, { "name": "www.tumblr.com", @@ -44123,8 +44076,6 @@ "name": "history.pe", "policy": "custom", "mode": "force-https", "include_subdomains": true, - "expect_staple": true, "include_subdomains_for_expect_staple": true, - "expect_staple_report_uri": "https://history.report-uri.com/r/d/staple/reportOnly", "expect_ct": true, "expect_ct_report_uri": "https://history.report-uri.com/r/d/ct/reportOnly" }, @@ -44132,8 +44083,6 @@ "name": "www.history.pe", "policy": "custom", "mode": "force-https", "include_subdomains": true, - "expect_staple": true, "include_subdomains_for_expect_staple": true, - "expect_staple_report_uri": "https://history.report-uri.com/r/d/staple/reportOnly", "expect_ct": true, "expect_ct_report_uri": "https://history.report-uri.com/r/d/ct/reportOnly" }, @@ -44141,17 +44090,13 @@ "name": "sirburton.com", "policy": "custom", "mode": "force-https", "include_subdomains": true, - "expect_staple": true, "include_subdomains_for_expect_staple": true, - "expect_staple_report_uri": "https://log.ncsccs.com/report/expectstaple", "expect_ct": true, "expect_ct_report_uri": "https://log.ncsccs.com/report/expectct" }, { "name": "cortis-consulting.ch", "policy": "custom", - "mode": "force-https", "include_subdomains": true, - "expect_staple": true, - "expect_staple_report_uri": "https://cortisconsultingch.report-uri.com/r/d/staple/reportOnly" + "mode": "force-https", "include_subdomains": true }, // END OF MANUAL CUSTOM ENTRIES From 345b3500d8bd2b41087497359b7642ff8ffa6b5d Mon Sep 17 00:00:00 2001 From: Henrique Ferreiro Date: Fri, 20 Jul 2018 12:04:07 +0200 Subject: [PATCH 047/138] Delete mojo/edk https://crrev.com/27bf8b2a4009 --- brave/browser/BUILD.gn | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/brave/browser/BUILD.gn b/brave/browser/BUILD.gn index 1129df3b5c..2359c78c7b 100644 --- a/brave/browser/BUILD.gn +++ b/brave/browser/BUILD.gn @@ -69,7 +69,7 @@ source_set("browser") { "//device/usb/mojo", "//device/usb/public/mojom", "//gpu/config", - "//mojo/edk", + "//mojo/core/embedder", "//mojo/public/cpp/bindings", "//services/device/public/mojom", "//services/identity:lib", From e2b95b65d558f1505794f004dacf8f0ba69870bb Mon Sep 17 00:00:00 2001 From: Henrique Ferreiro Date: Fri, 20 Jul 2018 12:04:41 +0200 Subject: [PATCH 048/138] Move //device/geolocation to //services/device https://crrev.com/f417339214f2 --- atom/browser/atom_browser_main_parts.cc | 2 +- brave/browser/BUILD.gn | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/atom/browser/atom_browser_main_parts.cc b/atom/browser/atom_browser_main_parts.cc index c44727b522..e1bd6ff323 100644 --- a/atom/browser/atom_browser_main_parts.cc +++ b/atom/browser/atom_browser_main_parts.cc @@ -45,11 +45,11 @@ #include "content/public/browser/web_ui_controller_factory.h" #include "content/public/common/content_features.h" #include "content/public/common/content_switches.h" -#include "device/geolocation/geolocation_provider.h" #include "extensions/browser/extension_api_frame_id_map.h" #include "media/base/media_switches.h" #include "muon/app/muon_crash_reporter_client.h" #include "muon/browser/muon_browser_process_impl.h" +#include "services/device/geolocation/geolocation_provider.h" #include "services/metrics/public/cpp/ukm_recorder.h" #include "v8/include/v8.h" diff --git a/brave/browser/BUILD.gn b/brave/browser/BUILD.gn index 2359c78c7b..4e49ee0447 100644 --- a/brave/browser/BUILD.gn +++ b/brave/browser/BUILD.gn @@ -65,13 +65,13 @@ source_set("browser") { "//components/visitedlink/common", "//components/webdata_services", "//content/public/common:service_names", - "//device/geolocation", "//device/usb/mojo", "//device/usb/public/mojom", "//gpu/config", "//mojo/core/embedder", "//mojo/public/cpp/bindings", "//services/device/public/mojom", + # "//services/device/public/cpp/geolocation", "//services/identity:lib", "//third_party/blink/public:image_resources", "//third_party/blink/public:resources", From 922d4c89e2647ad0099d69f0baf9c852bc7a25a3 Mon Sep 17 00:00:00 2001 From: Henrique Ferreiro Date: Fri, 20 Jul 2018 12:05:50 +0200 Subject: [PATCH 049/138] Use AddBrave*Features method instead of a provider class https://crrev.com/9ee032f8792a --- brave/common/extensions/api/BUILD.gn | 18 +++--------------- .../extensions/chrome_extensions_client.cc | 19 +++++++++++++------ 2 files changed, 16 insertions(+), 21 deletions(-) diff --git a/brave/common/extensions/api/BUILD.gn b/brave/common/extensions/api/BUILD.gn index 28c3d8867d..0e4a21d3c5 100644 --- a/brave/common/extensions/api/BUILD.gn +++ b/brave/common/extensions/api/BUILD.gn @@ -34,46 +34,34 @@ json_schema_api("api_registration") { json_features("api_features") { feature_type = "APIFeature" - provider_class = "BraveAPIFeatureProvider" + method_name = "AddBraveAPIFeatures" sources = [ "../../../../../chrome/common/extensions/api/_api_features.json", - "../../../../../extensions/common/api/_api_features.json", "_api_features.json", ] } json_features("permission_features") { feature_type = "PermissionFeature" - provider_class = "BravePermissionFeatureProvider" + method_name = "AddBravePermissionFeatures" sources = [ "../../../../../chrome/common/extensions/api/_permission_features.json", - "../../../../../extensions/common/api/_permission_features.json", "_permission_features.json", ] } json_features("manifest_features") { feature_type = "ManifestFeature" - provider_class = "BraveManifestFeatureProvider" + method_name = "AddBraveManifestFeatures" sources = [ "../../../../../chrome/common/extensions/api/_manifest_features.json", - "../../../../../extensions/common/api/_manifest_features.json", # "_manifest_features.json", ] } -json_features("behavior_features") { - feature_type = "BehaviorFeature" - provider_class = "BraveBehaviorFeatureProvider" - sources = [ - "../../../../../extensions/common/api/_behavior_features.json", - ] -} - group("extensions_features") { public_deps = [ ":api_features", - ":behavior_features", ":manifest_features", ":permission_features", ] diff --git a/chromium_src/chrome/common/extensions/chrome_extensions_client.cc b/chromium_src/chrome/common/extensions/chrome_extensions_client.cc index a8cb13e5fb..a35b5d1686 100644 --- a/chromium_src/chrome/common/extensions/chrome_extensions_client.cc +++ b/chromium_src/chrome/common/extensions/chrome_extensions_client.cc @@ -16,7 +16,6 @@ #include "brave/grit/brave_strings.h" // NOLINT: This file is generated #include "brave/common/extensions/api/generated_schemas.h" // NOLINT: This file is generated #include "brave/common/extensions/api/api_features.h" -#include "brave/common/extensions/api/behavior_features.h" #include "brave/common/extensions/api/manifest_features.h" #include "brave/common/extensions/api/permission_features.h" #include "chrome/common/chrome_content_client.h" @@ -26,7 +25,11 @@ #include "chrome/common/extensions/chrome_manifest_handlers.h" #include "chrome/common/url_constants.h" #include "chrome/grit/common_resources.h" // NOLINT: This file is generated +#include "extensions/common/api/api_features.h" +#include "extensions/common/api/behavior_features.h" #include "extensions/common/api/generated_schemas.h" // NOLINT: This file is generated +#include "extensions/common/api/manifest_features.h" +#include "extensions/common/api/permission_features.h" #include "extensions/common/common_manifest_handlers.h" #include "extensions/common/extension_api.h" #include "extensions/common/extension_urls.h" @@ -95,15 +98,19 @@ const std::string ChromeExtensionsClient::GetProductName() { std::unique_ptr ChromeExtensionsClient::CreateFeatureProvider( const std::string& name) const { - std::unique_ptr provider; + auto provider = std::make_unique(); if (name == "api") { - provider.reset(new BraveAPIFeatureProvider()); + AddCoreAPIFeatures(provider.get()); + AddBraveAPIFeatures(provider.get()); } else if (name == "manifest") { - provider.reset(new BraveManifestFeatureProvider()); + AddCoreManifestFeatures(provider.get()); + AddBraveManifestFeatures(provider.get()); } else if (name == "permission") { - provider.reset(new BravePermissionFeatureProvider()); + AddCorePermissionFeatures(provider.get()); + AddBravePermissionFeatures(provider.get()); } else if (name == "behavior") { - provider.reset(new BraveBehaviorFeatureProvider()); + // Note: There are no chrome-specific behavior features. + AddCoreBehaviorFeatures(provider.get()); } else { NOTREACHED(); } From 39169381eb45ac12570cdd6852d495b39c7d4262 Mon Sep 17 00:00:00 2001 From: Henrique Ferreiro Date: Fri, 20 Jul 2018 12:27:54 +0200 Subject: [PATCH 050/138] Override Configurator::URLLoaderFactory() in BraveConfigurator https://crrev.com/b616250114f1 --- .../brave_component_updater_configurator.cc | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/brave/browser/component_updater/brave_component_updater_configurator.cc b/brave/browser/component_updater/brave_component_updater_configurator.cc index 969cf9fce8..8f4a37b426 100644 --- a/brave/browser/component_updater/brave_component_updater_configurator.cc +++ b/brave/browser/component_updater/brave_component_updater_configurator.cc @@ -18,6 +18,7 @@ #include "chrome/install_static/install_util.h" #endif #include "chrome/browser/browser_process.h" +#include "chrome/browser/net/system_network_context_manager.h" #include "components/component_updater/component_updater_command_line_config_policy.h" #include "components/component_updater/configurator_impl.h" #include "components/prefs/pref_service.h" @@ -53,6 +54,8 @@ class BraveConfigurator : public update_client::Configurator { std::string ExtraRequestParams() const override; std::string GetDownloadPreference() const override; scoped_refptr RequestContext() const override; + scoped_refptr URLLoaderFactory() + const override; std::unique_ptr CreateServiceManagerConnector() const override; bool EnabledDeltas() const override; @@ -154,6 +157,16 @@ scoped_refptr return g_browser_process->system_request_context(); } +scoped_refptr +BraveConfigurator::URLLoaderFactory() const { + SystemNetworkContextManager* system_network_context_manager = + g_browser_process->system_network_context_manager(); + // Manager will be null if called from InitializeForTesting. + if (!system_network_context_manager) + return nullptr; + return system_network_context_manager->GetSharedURLLoaderFactory(); +} + std::unique_ptr BraveConfigurator::CreateServiceManagerConnector() const { DCHECK_CURRENTLY_ON(content::BrowserThread::UI); From 359b378966c6bad5a8e923ae3f6f2c23dc92d9fd Mon Sep 17 00:00:00 2001 From: Henrique Ferreiro Date: Fri, 20 Jul 2018 13:09:54 +0200 Subject: [PATCH 051/138] NetworkDelegate::OnCanGetCookies() parameters https://crrev.com/8420d58c08a2 --- vendor/brightray/browser/network_delegate.cc | 6 ++++-- vendor/brightray/browser/network_delegate.h | 6 ++++-- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/vendor/brightray/browser/network_delegate.cc b/vendor/brightray/browser/network_delegate.cc index 50fa656560..e08faedb10 100644 --- a/vendor/brightray/browser/network_delegate.cc +++ b/vendor/brightray/browser/network_delegate.cc @@ -112,13 +112,15 @@ NetworkDelegate::AuthRequiredResponse NetworkDelegate::OnAuthRequired( } bool NetworkDelegate::OnCanGetCookies(const net::URLRequest& request, - const net::CookieList& cookie_list) { + const net::CookieList& cookie_list, + bool allow_from_caller) { return true; } bool NetworkDelegate::OnCanSetCookie(const net::URLRequest& request, const net::CanonicalCookie& cookie, - net::CookieOptions* options) { + net::CookieOptions* options, + bool allow_from_caller) { return true; } diff --git a/vendor/brightray/browser/network_delegate.h b/vendor/brightray/browser/network_delegate.h index 54ae421112..7895b53d65 100644 --- a/vendor/brightray/browser/network_delegate.h +++ b/vendor/brightray/browser/network_delegate.h @@ -56,10 +56,12 @@ class NetworkDelegate : public net::NetworkDelegate { AuthCallback callback, net::AuthCredentials* credentials) override; bool OnCanGetCookies(const net::URLRequest& request, - const net::CookieList& cookie_list) override; + const net::CookieList& cookie_list, + bool allow_from_caller) override; bool OnCanSetCookie(const net::URLRequest& request, const net::CanonicalCookie& cookie, - net::CookieOptions* options) override; + net::CookieOptions* options, + bool allow_from_caller) override; bool OnCanAccessFile(const net::URLRequest& request, const base::FilePath& original_path, const base::FilePath& path) const override; From b0e115c30076eb03fd642ad6de403983eda07a49 Mon Sep 17 00:00:00 2001 From: Henrique Ferreiro Date: Mon, 23 Jul 2018 12:36:32 +0200 Subject: [PATCH 052/138] ExtensionSystem::InstallUpdate() parameters https://crrev.com/039eb991af1c --- atom/browser/extensions/atom_extension_system.cc | 1 + atom/browser/extensions/atom_extension_system.h | 1 + 2 files changed, 2 insertions(+) diff --git a/atom/browser/extensions/atom_extension_system.cc b/atom/browser/extensions/atom_extension_system.cc index e9b8dcc2c9..7ebe581ba2 100644 --- a/atom/browser/extensions/atom_extension_system.cc +++ b/atom/browser/extensions/atom_extension_system.cc @@ -570,6 +570,7 @@ void AtomExtensionSystem::InstallUpdate( const std::string& extension_id, const std::string& public_key, const base::FilePath& unpacked_dir, + bool install_immediately, InstallUpdateCallback install_update_callback) { NOTREACHED(); } diff --git a/atom/browser/extensions/atom_extension_system.h b/atom/browser/extensions/atom_extension_system.h index d1f88da524..4f65caaac7 100644 --- a/atom/browser/extensions/atom_extension_system.h +++ b/atom/browser/extensions/atom_extension_system.h @@ -87,6 +87,7 @@ class AtomExtensionSystem : public ExtensionSystem { void InstallUpdate(const std::string& extension_id, const std::string& public_key, const base::FilePath& unpacked_dir, + bool install_immediately, InstallUpdateCallback install_update_callback) override; bool FinishDelayedInstallationIfReady(const std::string& extension_id, bool install_immediately) override; From 460d2b51d1e549b183189e574d2891fe0c61890e Mon Sep 17 00:00:00 2001 From: Henrique Ferreiro Date: Mon, 23 Jul 2018 13:03:54 +0200 Subject: [PATCH 053/138] Stop using ResourceContext::GetHostResolver() https://crrev.com/ed5e651e10cd --- vendor/brightray/browser/browser_context.cc | 4 ---- 1 file changed, 4 deletions(-) diff --git a/vendor/brightray/browser/browser_context.cc b/vendor/brightray/browser/browser_context.cc index b66c5d79e3..50765b3b6a 100644 --- a/vendor/brightray/browser/browser_context.cc +++ b/vendor/brightray/browser/browser_context.cc @@ -47,10 +47,6 @@ class BrowserContext::ResourceContext : public content::ResourceContext { } private: - net::HostResolver* GetHostResolver() override { - return getter_->host_resolver(); - } - net::URLRequestContext* GetRequestContext() override { return getter_->GetURLRequestContext(); } From e9cdbc6d9f8e520e583fa520f66eda7d7c12cd5a Mon Sep 17 00:00:00 2001 From: Henrique Ferreiro Date: Mon, 23 Jul 2018 13:14:09 +0200 Subject: [PATCH 054/138] Rename ChildProcessSecurityPolicy::GrantOrigin() to GrantRequestOrigin https://crrev.com/4ebba554ef97 --- .../atom_extension_web_contents_observer.cc | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/atom/browser/extensions/atom_extension_web_contents_observer.cc b/atom/browser/extensions/atom_extension_web_contents_observer.cc index bbda68e5e5..440c5ab88a 100644 --- a/atom/browser/extensions/atom_extension_web_contents_observer.cc +++ b/atom/browser/extensions/atom_extension_web_contents_observer.cc @@ -53,10 +53,10 @@ void AtomExtensionWebContentsObserver::RenderFrameCreated( // are allowed to use chrome://resources/ and chrome://theme/ URLs. if ((extension->is_extension() || extension->is_platform_app()) && Manifest::IsComponentLocation(extension->location())) { - policy->GrantOrigin( + policy->GrantRequestOrigin( process_id, url::Origin::Create(GURL(content::kChromeUIResourcesURL))); - policy->GrantOrigin(process_id, - url::Origin::Create(GURL(chrome::kChromeUIThemeURL))); + policy->GrantRequestOrigin( + process_id, url::Origin::Create(GURL(chrome::kChromeUIThemeURL))); } // Extensions, legacy packaged apps, and component platform apps are allowed @@ -67,9 +67,9 @@ void AtomExtensionWebContentsObserver::RenderFrameCreated( extension->is_legacy_packaged_app() || (extension->is_platform_app() && Manifest::IsComponentLocation(extension->location()))) { - policy->GrantOrigin(process_id, - url::Origin::Create(GURL(chrome::kChromeUIFaviconURL))); - policy->GrantOrigin( + policy->GrantRequestOrigin( + process_id, url::Origin::Create(GURL(chrome::kChromeUIFaviconURL))); + policy->GrantRequestOrigin( process_id, url::Origin::Create(GURL(chrome::kChromeUIExtensionIconURL))); } From 01cbf81213f83e25c81e175c80c1390a2d338e49 Mon Sep 17 00:00:00 2001 From: Henrique Ferreiro Date: Mon, 23 Jul 2018 13:18:44 +0200 Subject: [PATCH 055/138] Move kApplicationLocale pref to components/language/ https://crrev.com/73f3b43c1a65 --- .../extensions/atom_browser_client_extensions_part.cc | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/atom/browser/extensions/atom_browser_client_extensions_part.cc b/atom/browser/extensions/atom_browser_client_extensions_part.cc index 1a0ec4a569..640736c4e9 100644 --- a/atom/browser/extensions/atom_browser_client_extensions_part.cc +++ b/atom/browser/extensions/atom_browser_client_extensions_part.cc @@ -16,6 +16,7 @@ #include "chrome/browser/renderer_host/chrome_extension_message_filter.h" #include "chrome/common/chrome_constants.h" #include "chrome/common/pref_names.h" +#include "components/language/core/browser/pref_names.h" #include "components/prefs/pref_change_registrar.h" #include "components/prefs/pref_registry_simple.h" #include "components/prefs/pref_service.h" @@ -362,8 +363,8 @@ void AtomBrowserClientExtensionsPart::SetApplicationLocale(std::string locale) { // static void AtomBrowserClientExtensionsPart::RegisterProfilePrefs( PrefRegistrySimple* registry) { - registry->RegisterStringPref(prefs::kApplicationLocale, - extension_l10n_util::CurrentLocaleOrDefault()); + registry->RegisterStringPref(language::prefs::kApplicationLocale, + extension_l10n_util::CurrentLocaleOrDefault()); } void AtomBrowserClientExtensionsPart::OverrideWebkitPrefs( From 507a4ac7ed97829b83f72e727a495965dfe28d70 Mon Sep 17 00:00:00 2001 From: Henrique Ferreiro Date: Mon, 23 Jul 2018 14:41:10 +0200 Subject: [PATCH 056/138] Revert "Parameterize Callback to accept both OnceCallback and RepeatingCallback" This reverts commit f2f8212261b7316f2c3c89b9bd839724cd330f30. --- atom/common/native_mate_converters/callback.h | 24 ++++---- .../native_mate/function_template.h | 61 +++++++++---------- 2 files changed, 39 insertions(+), 46 deletions(-) diff --git a/atom/common/native_mate_converters/callback.h b/atom/common/native_mate_converters/callback.h index a7d55fa07e..43a927888e 100644 --- a/atom/common/native_mate_converters/callback.h +++ b/atom/common/native_mate_converters/callback.h @@ -110,16 +110,14 @@ v8::Local CreateFunctionFromTranslater( v8::Isolate* isolate, const Translater& translater); // Calls callback with Arguments. -template