From cr97 on, having this feature enabled means that the browser will
attempt to reach the Optimization Guide Server every now and then at
the https://optimizationguide-pa.googleapis.com endpoint, as it was
detected by the npm run network-audit command:
[:ERROR:brave_network_audit_browsertest.cc(151)] NETWORK AUDIT FAIL:https://optimizationguide-pa.googleapis.com/v1:GetModels?key=dummytoken
[:ERROR:brave_network_audit_browsertest.cc(151)] NETWORK AUDIT FAIL:https://optimizationguide-pa.googleapis.com/v1:GetModels?key=dummytoken
[...]
[:ERROR:brave_network_audit_browsertest.cc(151)] NETWORK AUDIT FAIL:https://optimizationguide-pa.googleapis.com/v1:GetModels?key=dummytoken
../../brave/browser/net/brave_network_audit_browsertest.cc:249: Failure
Value of: PerformNetworkAuditProcess(events)
Actual: false
Expected: true
network-audit FAILED. Import /home/mario/work/brave-rebases/brave-browser/src/network_log.json in chrome://net-internals for more details.
Stack trace:
#0 0x55f213f6cc10 brave::(anonymous namespace)::BraveNetworkAuditTest::TearDownInProcessBrowserTestFixture()
#1 0x55f215bda3be content::BrowserTestBase::SetUp()
#2 0x55f215bd741e InProcessBrowserTest::SetUp()
This patch disables the kkOptimizationHints feature. TBD if this is
needed.
This patch disables the kRemoteOptimizationGuideFetching features that
are otherwise enabled by default, avoiding this URL requests.
PS: I couldn't pinpoint yet where exactly in Chromium 97 this started
happening, but I can consistently reproduce it on my local cr97 branch
setting kMaxTimeoutPerLoadedURL in brave_network_audit_browsertest.cc
to at least 20 seconds, while this doesn't happen on cr96 even when
using the default timeout of 5 minutes, so it's cr97-related.
When building tests the following error happens:
17:40:57 gen/chrome/test/data/webui/settings/preprocessed/test_lifetime_browser_proxy.ts:11:14 - error TS2420: Class 'TestLifetimeBrowserProxy' incorrectly implements interface 'LifetimeBrowserProxy'.
17:40:57 Property 'relaunchOnMac' is missing in type 'TestLifetimeBrowserProxy' but required in type 'LifetimeBrowserProxy'.
17:40:57
17:40:57 11 export class TestLifetimeBrowserProxy extends TestBrowserProxy implements
17:40:57 ~~~~~~~~~~~~~~~~~~~~~~~~
17:40:57
17:40:57 gen/chrome/browser/resources/settings/tsc/lifetime_browser_proxy.d.ts:4:5
17:40:57 4 relaunchOnMac(): void;
17:40:57 ~~~~~~~~~~~~~~~~~~~~~~
17:40:57 'relaunchOnMac' is declared here.
which means we'd have to add a patch to test_lifetime_proxy.ts to add our relaunchOnMac functionality.
Instead, this change removes all relaunchOnMac functionality from WebUI and moves it
into the BrowserLifetimeHandler.
This reverts previous commit:
[Android] Filter warning after bytecode pacthing
With new R8 library there is a warning related to our bytecode patching:
Warning: Missing method void Lg2.d() (referenced from: void Vf2.run())
Without obfuscation it looks like this:
Warning: Missing method void org.chromium.chrome.browser.toolbar.ToolbarManager.$invoke$special$updateButtonStatus() (referenced from: void org.chromium.chrome.browser.toolbar.ToolbarManager$$ExternalSyntheticLambda3.run())
We do change invoke special to invoke virtual for this method and this is expected.
Chromium change:
chromium/chromium@e3db48a
Android: Stop disabling R8's allowaccessmodification -keep semantics
Causes a 5.5kb regression, but brings us closer to stock R8, and will
ensure visibility of test @rule fields are not changed, thus avoiding
bugs like bug 1265431.
Bug: 1265431
With new R8 library there is a warning related to our bytecode patching:
Warning: Missing method void Lg2.d() (referenced from: void Vf2.run())
Without obfuscation it looks like this:
Warning: Missing method void org.chromium.chrome.browser.toolbar.ToolbarManager.$invoke$special$updateButtonStatus() (referenced from: void org.chromium.chrome.browser.toolbar.ToolbarManager$$ExternalSyntheticLambda3.run())
We do change invoke special to invoke virtual for this method and this is expected.
Chromium change:
https://github.com/chromium/chromium/commit/e3db48a5ea7b9e3165ad4a9e8d01dc0f1450191f
Android: Stop disabling R8's allowaccessmodification -keep semantics
Causes a 5.5kb regression, but brings us closer to stock R8, and will
ensure visibility of test @rule fields are not changed, thus avoiding
bugs like bug 1265431.
Bug: 1265431
Chromium change:
https://github.com/chromium/chromium/commit/f7e3a4176bff898bbcfeba7dfc709a018fe08924
Adds ability to include both v8 snapshot types
And adds feature as to which one is used at runtime. Specific
parts:
. adds gn arg: include_both_v8_snapshots. At this time this is
only supported on android. I will likely make it work on chromeos
next.
. Adds feature kUseContextSnapshot. This feature is available if
include_both_v8_snapshots is set.
. Adds switch kUseContextSnapshotSwitch. This is passed from browser
to renderer if kUseContextSnapshot is enabled. A separate switch is
used as at the time the v8 snapshot is loaded features have not been
loaded.
And this updates a bunch of build targets accordingly.
BUG=1257321
TEST=none
Change-Id: I225a9235ac00e1c25ceaf0423587a00a1aafc740
The following URLs were missing from the list in brave://about:
* brave://adblock
* brave://ipfs-internals
* brave://rewards
* brave://rewards-internals
* brave://tor-internals
* brave://wallet
* brave://welcome
...because the constant used to inject that list into kChromeHostURLs
is no longer there, so we need to pick a new "anchor" now.
Chromium change:
https://chromium.googlesource.com/chromium/src.git/+/188f97443d21b20a33e6cad3ab8179dee24e62c8
commit 188f97443d21b20a33e6cad3ab8179dee24e62c8
Author: Adrienne Walker <enne@chromium.org>
Date: Wed Oct 27 10:20:48 2021 +0000
appcache: remove internals ui hookup
This removes the chrome://appcache-internals url. The code
that backs this will be removed in a followup.
Bug: 582750
The `#define StandardReferralCodeLen 6` in the chromium_src override
for mini_installer.h is only used from mini_installer.cc, so we can
simply replace it with a constant private to that translation unit.
This override does no longer make sense, so we can drop it.
Chromium change:
https://chromium.googlesource.com/chromium/src.git/+/c162640e5196c2e230262ce1062f262a5b61ef21
commit c162640e5196c2e230262ce1062f262a5b61ef21
Author: Daniel Rubery <drubery@chromium.org>
Date: Wed Oct 13 15:02:01 2021 +0000
Remove client_side_model_loader.cc
This CL removes a file missed by the previous cleanup, as well as
marking a histogram from that file obsolete.
Fixed: 1252857, 1258690
This was an upstream patch that now made it to cr97.
Chromium change:
https://chromium.googlesource.com/chromium/src/+/f077b2ff2c8ed4b1772f04fcdff67abd74d47c17
commit f077b2ff2c8ed4b1772f04fcdff67abd74d47c17
Author: Brian Ryner <bryner@google.com>
Date: Thu Oct 14 21:15:11 2021 +0000
Use a newer version of numpy on mac-arm64.
Older versions of numpy do not build for arm64. Sadly, the newer
version does not work on very old (but supported) versions of macOS,
so keep using the old version for all other platforms.
Bug: 1235841
Chromium change:
https://chromium.googlesource.com/chromium/src.git/+/ea58b457dd75daeeba5911a5b32b2cef7a5ed3c9
commit ea58b457dd75daeeba5911a5b32b2cef7a5ed3c9
Author: Istiaque Ahmed <lazyboy@chromium.org>
Date: Wed Nov 3 17:33:47 2021 +0000
[Extensions] RunFunctionAndReturnSingleResult returns owned result.
This CL makes
extension_function_test_utils::RunFunctionAndReturnSingleResult return
std::unique_ptr instead of unowned base::Value*. This will make the
"result" to never leak.
Bug: 1263370
Chromium change:
https://chromium.googlesource.com/chromium/src.git/+/61e816d489f1f574b609435922de3a48334c7b8d
commit 61e816d489f1f574b609435922de3a48334c7b8d
Author: Andrew Williams <awillia@google.com>
Date: Mon Nov 1 04:41:04 2021 +0000
BroadcastChannel: Partition using StorageKey instead of Origin
This CL updates the BroadcastChannel implementation so that partitioning
is done by StorageKey instead of Origin. To facilitate this, it also
changes the way in which Mojo messages are sent to preserve per-thread
message ordering (as required by the BroadcastChannel specification).
Previously, a shared, per-thread Remote was used to send messages from
the renderer to RenderProcessHost on the browser side. This message would
contain the origin, which the browser code would verify was accurate, and
would then be used to establish the channel connection. This approach
presents a challenge when switching to StorageKey, in that there's not a
way to have the renderer send the StorageKey and have the browser verify
it at the process level.
This CL removes the origin from the message definition and replaces the
RenderProcessHost handler (BroadcastChannelProvider instance) with
separate ones for RenderFrameHostImpl, DedicatedWorkerHost,
SharedWorkerHost, and ServiceWorkerHost instances. These new handles
associate incoming connection attempts with their StorageKeys, allowing
partitioning to be done without any information directly provided by the
renderer. Shared per-thread Remotes are still used for workers to send
messages to their corresponding host instance's BroadcastChannelProvider,
and for frames a channel-associated interface is used to ensure that
renderer messages are received in-order by the corresponding
RenderFrameHostImpl.
For more details, see the "Partitioned BroadcastChannel Design" document:
https://docs.google.com/document/d/1CchMLU8QmDEx_tA0y57qLyQWvaTT3dlWF-4P_ncc06E/edit?usp=sharing
Bug: 1239274
Chromium change:
https://chromium.googlesource.com/chromium/src.git/+/f28af265fea678a12de47233836c2d08fab3641c
commit f28af265fea678a12de47233836c2d08fab3641c
Author: Nicolas Dossou-Gbete <dgn@chromium.org>
Date: Thu Nov 4 13:36:41 2021 +0000
Make component updater registration stop depending on a profile
The only dependency was due to cleanup code for the flash plugin's local
artifacts. That cleanup has been shipped for more than a year (see
https://crbug.com/1069814), so can now be removed.
With that done, we can simplify the registration to make it more
explicit that the component updater registration does need a profile
anymore.
Bug: 1069814, 1150326
The TabStrip::ShouldHideCloseButtonForTab() method has been removed
upstream. To preserve the behavior to show close button on inactive tabs
only on hover added an additional chromium_src override to tab.cc
Chromium change:
https://chromium.googlesource.com/chromium/src.git/+/bc1aac74a88ad9ce554f048b6404b9e72383c832
commit bc1aac74a88ad9ce554f048b6404b9e72383c832
Author: Taylor Bergquist <tbergquist@chromium.org>
Date: Thu Nov 4 21:40:49 2021 +0000
Remove stacked tabs from the rest of TabStrip.
Bug: 1250061