Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

WIP: Update patches from Chromium 76.0.3809.100 to Chromium 77.0.3865.35 #3180

Closed
wants to merge 51 commits into from
Closed
Changes from 1 commit
Commits
Show all changes
51 commits
Select commit Hold shift + click to select a range
423a083
Update patches from Chromium 76.0.3809.100 to Chromium 77.0.3865.35
mkarolin Jul 24, 2019
bd9ec36
Process version shouldn't create a source set.
mkarolin Jul 24, 2019
d3f7753
Updated chrome_constants override with the changes in the original.
mkarolin Jul 25, 2019
1ab6a1a
OmniboxInputType::INVALID was renamed to EMPTY.
mkarolin Jul 25, 2019
94ca89d
Updated HandleExternalProtocol signature in BraveContentBrowserClient.
mkarolin Jul 31, 2019
62db6f1
Updated signature of BraveExtensionsAPIClient::ShouldHideBrowserNetwo…
mkarolin Jul 31, 2019
fcad3da
AddRestoredTab now takes a tab group param.
mkarolin Jul 31, 2019
c288e60
content/public interfaces are no longer const.
mkarolin Jul 31, 2019
e9d0417
Removed unused source_set from the build.
mkarolin Aug 2, 2019
51e9a45
Readded code to get top document GURL in NavigationRequest.
mkarolin Aug 2, 2019
04a52ec
Moved start of Brave services to BraveBrowserMainExtraParts::PreMainM…
mkarolin Aug 2, 2019
7356b53
PrefProvider::is_incognito_ was renamed to off_the_record_.
mkarolin Aug 2, 2019
001d02b
APISignature::ParseArgumentsToJSON signature change.
mkarolin Aug 5, 2019
a85619c
ComponentLoader ctor signature change.
mkarolin Aug 5, 2019
28afa6d
SimplifyHttpsIndicator feature is now on by default.
mkarolin Aug 5, 2019
780ef50
Removed Win10 specific welcome UI flow.
mkarolin Aug 6, 2019
41b5d1f
Signin restructure.
mkarolin Aug 6, 2019
ac771a5
Use base::Contains instead of ContainsKey.
mkarolin Aug 6, 2019
5ab6339
IOThread class has been removed.
mkarolin Aug 6, 2019
6cb9e48
Fixes compilation of brave_actions_container.h
mkarolin Aug 6, 2019
b7f5923
views::BoxLayout orientation is now a class enum.
mkarolin Aug 6, 2019
47fbab7
Fixes RenderViewContextMenu override compilation.
mkarolin Aug 6, 2019
35fce2e
Enable networking service.
mkarolin Aug 10, 2019
58c6807
Fixes location change of md_select_css.html.
mkarolin Aug 13, 2019
fdae8cf
GridLayout::AddView now takes unique_ptr.
mkarolin Aug 13, 2019
53b5099
GridLayout c'tor signature change.
mkarolin Aug 13, 2019
672cf89
Signature change in WillCreateURLLoaderFactory in
mkarolin Aug 14, 2019
f4050a9
Removed BraveNetworkDelegateBase and subclasses.
mkarolin Aug 14, 2019
e1d5146
Removed AllowGetCookie/AllowSetCookie from BraveContentBrowserClient.
mkarolin Aug 16, 2019
cccb7d4
StringDataSource replaced StringDataPipeProducer.
mkarolin Aug 15, 2019
abbd577
Fixes Chromium bluetooth UUID dependency bug.
mkarolin Aug 17, 2019
cda6703
TreeNode::GetChild and child_count were removed.
mkarolin Aug 20, 2019
ff7751d
syncer::Cryptographer c'tor signature change.
mkarolin Aug 20, 2019
fe976d2
Added a missing header include.
mkarolin Aug 20, 2019
37232ce
paper-button has been replaced with cr-button.
mkarolin Aug 19, 2019
5bc7db7
Fixes missing pref in Shields settings radio buttons.
mkarolin Aug 20, 2019
024cef0
Transition CSS from [dark] to @media.
mkarolin Aug 20, 2019
9625fa3
Unit tests: Fixes MCSClient API signature changes.
mkarolin Aug 12, 2019
8fc861a
Unit tests: fixes GCMDriver c'tor signature change.
mkarolin Aug 12, 2019
54d16c0
Unit tests: Fixes CreateProfileAsyncHelper signature.
mkarolin Aug 12, 2019
c85d11c
Unit test: BraveSyncServiceTest.GetDisableReasons fix.
mkarolin Aug 21, 2019
54b356e
Browser Test: SendToOmniboxAndSubmit signature change.
mkarolin Aug 21, 2019
42fe586
Browser Test: added missing overrides to BraveMockRenderViewContextMenu.
mkarolin Aug 21, 2019
49d495f
Browser Test: Removed SetUrlRequestMocksEnabled.
mkarolin Aug 21, 2019
1c405a2
Browser Test: Added a missing header include.
mkarolin Aug 21, 2019
884a909
Browser Test: Rename ContextualSuggestionsService => RemoteSuggestion…
mkarolin Aug 21, 2019
2fe7418
Browser Test: clean up disabled features.
mkarolin Aug 22, 2019
8dd6ea2
Moved starting of Brave services to PostBrowserStart.
mkarolin Aug 22, 2019
bfe3812
Browser Test: Allow intentional crash.
mkarolin Aug 22, 2019
67605b2
Update strings for 77.0.3865.19.
mkarolin Jul 25, 2019
8a0679d
TEMPORARY: commented out code affected by Chromium commit 6811de35a39…
mkarolin Aug 16, 2019
File filter...
Filter file types
Jump to…
Jump to file
Failed to load files.

Always

Just for now

Readded code to get top document GURL in NavigationRequest.

We patch NavigationRequest::OnStartChecksComplete to call
MaybeHideReferrer. One of the params to MaybeHideReferrer is top
document GURL which was available in OnStartCheckComplete. The Chromium
change below removed it. Added a chromium_src override that includes
GetTopDocumentGURL function that containes the deleted functionality.

Chromium change:

https://chromium.googlesource.com/chromium/src/+/435bcb58bb2c75be8276f1dde69fc6c9891c45ba

commit 435bcb58bb2c75be8276f1dde69fc6c9891c45ba
Author: Lukasz Anforowicz <lukasza@chromium.org>
Date:   Fri Jul 12 20:50:06 2019 +0000

    Store |initiator_origin| in FrameNavigationEntry.

    Changes in this CL
    ==================

    This CL:

    1. Updates FrameNavigationEntry::UpdateEntry and
       FrameNavigationEntry's constructor so that they both take
       |const base::Optional<url::Origin>& initiator_origin| which
       gets stored in a new FrameNavigationEntry::initiator_origin_ field.

    2. Updates callers of FNE::UpdateEntry and FNE's constructor to
       provide/propagate the initiator as needed.  This includes
       adding an |initiator_origin| parameter to
       - NavigationEntryImpl's constructor
       - NavigationEntryImpl::AddOrUpdateFrameEntry
       - NavigationController::CreateNavigationEntry
       (the list above is not necessarily exhaustive/complete)

    3. Uses the new |FrameNavigationEntry::initiator_origin()| from
       NavigationEntryImpl::ConstructCommonNavigationParams (which
       used to always provide |base::nullopt| initiator for history
       navigations - always treating them as browser-initiated, rather
       than replaying the original initiator).

    The changes above makes sure that the right Sec-Fetch-Site http request header is
    "replayed" during history navigations.  The CL adds browser tests and
    WPT tests to cover the new, desired behavior.

    Follow-up changes
    =================

    This CL does not:

    - Use |FrameNavigationEntry::initiator_origin()| in GetOriginForURLLoaderFactory
      in render_frame_host_impl.cc (this will be done in a follow-up CL at
      https://crrev.com/c/1672176)

    - Handle persisting |FrameNavigationEntry::initiator_origin()| for
      session restore (this is tracked in a separate https://crbug.com/976055).

    Bug: 946503
  • Loading branch information
mkarolin committed Aug 2, 2019
commit 51e9a4568a2fc207ca014393bfa5bb11ddeb4fc3
@@ -0,0 +1,41 @@
/* Copyright (c) 2019 The Brave Authors. All rights reserved.
* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this file,
* You can obtain one at http://mozilla.org/MPL/2.0/. */

#include "content/browser/frame_host/frame_tree.h"
#include "content/browser/frame_host/frame_tree_node.h"
#include "url/gurl.h"

#if defined(OS_ANDROID)
#include "content/browser/frame_host/navigator.h"
#include "content/public/browser/navigation_controller.h"
#include "content/public/browser/navigation_entry.h"
#endif

namespace {

GURL GetTopDocumentGURL(const content::FrameTreeNode* frame_tree_node) {
GURL gurl;
#if defined(OS_ANDROID)
// On Android, a base URL can be set for the frame. If this the case, it is
// the URL to use for cookies.
content::NavigationEntry* last_committed_entry =
frame_tree_node_->navigator()->GetController()->GetLastCommittedEntry();
if (last_committed_entry)
gurl = last_committed_entry->GetBaseURLForDataURL();
#endif
if (gurl.is_empty())
gurl = frame_tree_node->frame_tree()->root()->current_url();
return gurl;
}

} // namespace

#define BRAVE_ONSTARTCHECKSCOMPLETE_MAYBEHIDEREFERRER \
GetContentClient()->browser()->MaybeHideReferrer( \
browser_context, common_params_.url, \
GetTopDocumentGURL(frame_tree_node_), frame_tree_node_->IsMainFrame(), \
&common_params_.referrer);

#include "../../../../../content/browser/frame_host/navigation_request.cc"
@@ -1,21 +1,12 @@
diff --git a/content/browser/frame_host/navigation_request.cc b/content/browser/frame_host/navigation_request.cc
index f8d5c526f2f7074130823267d6615a6bd6298112..3be1a1a13b3ded4d54ac7699b56e8e8f904f8afb 100644
index f8d5c526f2f7074130823267d6615a6bd6298112..848d39fd5dd746644bdc0f80dfa8dd7dda4965d6 100644
--- a/content/browser/frame_host/navigation_request.cc
+++ b/content/browser/frame_host/navigation_request.cc
@@ -1747,9 +1747,16 @@ void NavigationRequest::OnStartChecksComplete(
@@ -1747,6 +1747,7 @@ void NavigationRequest::OnStartChecksComplete(
headers.MergeFrom(navigation_handle_->TakeModifiedRequestHeaders());
begin_params_->headers = headers.ToString();

+ GetContentClient()->browser()->MaybeHideReferrer(browser_context,
+ common_params_.url,
+ top_document_url,
+ frame_tree_node_->IsMainFrame(),
+ &common_params_.referrer);
+
+ BRAVE_ONSTARTCHECKSCOMPLETE_MAYBEHIDEREFERRER
std::vector<std::unique_ptr<NavigationLoaderInterceptor>> interceptor;
if (bundled_exchanges_factory_)
interceptor.push_back(bundled_exchanges_factory_->CreateInterceptor());
+
loader_ = NavigationURLLoader::Create(
browser_context, browser_context->GetResourceContext(), partition,
std::make_unique<NavigationRequestInfo>(
ProTip! Use n and p to navigate between commits in a pull request.
You can’t perform that action at this time.