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

Upgrade from Chromium 91 to Chromium 92 #8545

Merged
merged 178 commits into from
Jun 30, 2021
Merged

Upgrade from Chromium 91 to Chromium 92 #8545

merged 178 commits into from
Jun 30, 2021

Conversation

mkarolin
Copy link
Collaborator

@mkarolin mkarolin commented Apr 15, 2021

Fixes brave/brave-browser#15316
Related PR: brave/brave-browser#15317

Fixes brave/brave-browser#15871

Submitter Checklist:

  • I confirm that no security/privacy review is needed, or that I have requested one
  • There is a ticket for my issue
  • Used Github auto-closing keywords in the PR description above
  • Wrote a good PR/commit description
  • Added appropriate labels (QA/Yes or QA/No; release-notes/include or release-notes/exclude; OS/...) to the associated issue
  • Checked the PR locally: npm run test -- brave_browser_tests, npm run test -- brave_unit_tests, npm run lint, npm run gn_check, npm run tslint
  • Ran git rebase master (if needed)

Reviewer Checklist:

  • A security review is not needed, or a link to one is included in the PR description
  • New files have MPL-2.0 license header
  • Adequate test coverage exists to prevent regressions
  • Major classes, functions and non-trivial code blocks are well-commented
  • Changes in component dependencies are properly reflected in gn
  • Code follows the style guide
  • Test plan is specified in PR before merging

After-merge Checklist:

Test Plan:

@mkarolin mkarolin added the CI/run-network-audit Run network-audit label Apr 15, 2021
@mariospr mariospr force-pushed the cr92 branch 6 times, most recently from 13fe236 to 7eb8df8 Compare April 22, 2021 11:13
@mariospr mariospr force-pushed the cr92 branch 5 times, most recently from 7ec677f to ffd4773 Compare April 30, 2021 13:18
@mkarolin mkarolin added CI/skip-android Do not run CI builds for Android CI/skip-ios Do not run CI builds for iOS CI/skip-linux CI/skip-macos-x64 Do not run CI builds for macOS x64 labels May 3, 2021
@mkarolin mkarolin marked this pull request as ready for review May 3, 2021 22:17
@mkarolin mkarolin removed the CI/run-network-audit Run network-audit label May 3, 2021
@mariospr mariospr force-pushed the cr92 branch 5 times, most recently from 0f24546 to c6adb01 Compare May 6, 2021 16:45
mkarolin and others added 20 commits June 29, 2021 16:37
We need to import loadTimeData from the internal module and
use it from there instead of accessing window.loadTimeData.

ERROR in /home/work/brave-browser/src/brave/components/brave_welcome_ui/reducers/welcome_reducer.ts
in /home/work/brave-browser/src/brave/components/brave_welcome_ui/reducers/welcome_reducer.ts(47,40)
TS2339: Property \'loadTimeData\' does not exist on type \'Window & typeof globalThis\'.
npm ERR! code ELIFECYCLE
npm ERR! errno 2
npm ERR! [email protected] web-ui: `webpack --config
components/webpack/webpack.config.js --progress --colors "--mode=development"
"brave_welcome=/home/work/brave-browser/src/brave/components/brave_welcome_ui/brave_welcome.tsx"`

Traceback (most recent call last):
  File "/home/work/brave-browser/src/out/Component/../../brave/script/transpile-web-ui.py", line 118, in <module>
    sys.exit(main())
  File "/home/work/brave-browser/src/out/Component/../../brave/script/transpile-web-ui.py", line 31, in main
    transpile_web_uis(args.production, webpack_gen_dir, root_gen_dir,
  File "/home/work/brave-browser/src/out/Component/../../brave/script/transpile-web-ui.py", line 98, in transpile_web_uis
    execute_stdout(args, env)
  File "/home/work/brave-browser/src/brave/script/lib/util.py", line 192, in execute_stdout
    execute(argv, env)
  File "/home/work/brave-browser/src/brave/script/lib/util.py", line 180, in execute
    raise e
  File "/home/work/brave-browser/src/brave/script/lib/util.py", line 173, in execute
    output = subprocess.check_output(argv, stderr=subprocess.STDOUT,
  File "/usr/lib/python3.9/subprocess.py", line 424, in check_output
    return run(*popenargs, stdout=PIPE, timeout=timeout, check=True,
  File "/usr/lib/python3.9/subprocess.py", line 528, in run
    raise CalledProcessError(retcode, process.args,
subprocess.CalledProcessError: Command '['npm', 'run', 'web-ui', '--', '--mode=development', 'brave_welcome=/home/work/brave-browser/src/brave/components/brave_welcome_ui/brave_welcome.tsx']' returned non-zero exit status 2.
Chromium change:
https://chromium.googlesource.com/chromium/src/+/abbbe264b20f2b8ada3dc4476d38caee13e79f75

Android: Switch to LensController.getInstance()

Have all the callsites of AppHooks.getLensController() switch to
LensController.getInstance(). Singleton LensController is managed
within LensController as well. This effectively decouples Lens
package from AppHooks.

The follow-up CL's will clean up all the references of LensController
in AppHooks.

This is patch 5/7 for moving the package from AppHooks to its
own build rule-based link.

Bug: 1188049
The following error shows on the console when navigating to the new tab
page:

[23636:27956:0622/165858.015:ERROR:CONSOLE(0)] "Unrecognized Content-Security-Policy directive 'defaultframe-ancestors'.", source: chrome://newtab/ (0)

OverrideContentSecurityPolicy method requires full policy to be
specified in the override.
It's confusing to have this in chromium_src/services/network/DEPS when
it's only needed from chromium_src/services/network/public/cpp.
The warning is:
/usr/lib/python3.8/subprocess.py:844: RuntimeWarning: line buffering
(buffering=1) isn't supported in binary mode, the default buffer size
will be used self.stdout = io.open(c2pread, 'rb', bufsize)

Removed bufsize=1 parameter from subprocess.Popen. Also, used
subprocess.DEVNULL param for stderr instead of opening os.devnull
explicitly in the script.
Chromium change:

https://source.chromium.org/chromium/chromium/src/+/e0e07a0e60557782a957168d0d62dedc2e7cf26b

commit e0e07a0e60557782a957168d0d62dedc2e7cf26b
Author: Shakti Sahu <[email protected]>
Date:   Sun Jun 6 00:07:52 2021 +0000

    Added multiple callback support for histograms in StatisticsRecorder

    This CL adds multiple callback support for histogram samples. The
    callback to be invoked is wrapped inside a ScopedHistogramSampleObserver
    which unregisters itself on destruction. A base::ObserverListThreadSafe
    is used for each histogram to maintain the list of observers.

    There is a slight change in the behavior of these observers in that
    the samples are now always posted, whereas before they were notified
    synchronously on the sequence the histogram was recorded on. The
    posting of samples happens in the same thread in which the observer
    was registered.

    Bug: 1119851
Early return in BraveP3AService::OnHistogramChanged() instead of
DCHECK-ing to prevent crashes that will happen for some histograms
that we found would be reported twice for the actual same event
as part of the same sequence, calling crashes on DCHECK-enabled builds.

So far, the events investigated were 3:

  Brave.NTP.SponsoredImagesEnabled
  Brave.SpeedReader.ToggleCount
  Brave.SpeedReader.Enabled

And in the three cases the actual same event (e.g. finishing the
initialization of the profile, restoring a previous session) ended
up trying to report the same histogram twice for the same event,
resulting on the histogram being properly sent on the first go
and then crashing on the second attempt (which would no longer be
necessary).

This patch simply replaces the DCHECK with an early return to make
sure that we don't crash on that second attempt when it happens,
and simply gracefully return instead.
We should use InkDropHost::AnimateToState() now.

Chromium changes:

https://chromium.googlesource.com/chromium/src/+/7a956cd01727bd626ca2711671935efa0128ee28

commit 7a956cd01727bd626ca2711671935efa0128ee28
Author: Peter Boström <[email protected]>
Date:   Fri May 7 20:08:13 2021 +0000

    Separate InkDropHost from InkDropHostView

    This essentially moves InkDropHostView into a new class with the
    temporary name InkDropHost. All accesses to InkDropHost are done through
    InkDropHostView::ink_drop(). InkDropHostView is now a new trivial View
    subclass which is provides an InkDropHost.

    A latter step will move ink_drop() down to InkDropHostView subclasses.
    Several clean-up steps are missing, but this may be easier to review.

    Bug: 931964
A number of browser tests crash on Linux and MacOS in release build with
the stack ending on something like

base::internal::WeakLinkNode<base::ObserverList<extensions::ExtensionHostObserver, false, true, base::internal::UncheckedObserverAdapter> >::SetList(base::ObserverList<extensions::ExtensionHostObserver, false, true, base::internal::UncheckedObserverAdapter>*) + 393
base::ObserverList<extensions::ExtensionHostObserver, false, true, base::internal::UncheckedObserverAdapter>::Iter::Iter(base::ObserverList<extensions::ExtensionHostObserver, false, true, base::internal::UncheckedObserverAdapter> const*) + 46
extensions::ExtensionHost::Close() + 81
ExtensionActionViewController::HidePopup()

While I haven't gotten to the bottom of it, I am currently suspecting
that there is a problem with the base::ObserverList class. Specifically,
the fact that the list's begin method considers the list empty based on
the internal observers_ vector, while the list's empty method relies on
the separate observers_count_. In the debugger it looks to me like
begin() attempts to construct const_iterator(this) instead of
const_iterator() when the list is empty.

The workaround follows the example of ExtensionActionViewController by
adding an observer to the popup_host_, which we don't need but it should
prevent the ObserverList from being empty.
@mkarolin mkarolin assigned mkarolin and unassigned mkarolin Jun 29, 2021
@bbondy bbondy merged commit d9d0401 into master Jun 30, 2021
@bbondy bbondy deleted the cr92 branch June 30, 2021 03:02
@bbondy bbondy added this to the 1.28.x - Nightly milestone Jun 30, 2021
mkarolin pushed a commit that referenced this pull request Jul 7, 2021
Upgrade from Chromium 91 to Chromium 92
mkarolin pushed a commit that referenced this pull request Jul 14, 2021
Upgrade from Chromium 91 to Chromium 92
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CI/run-network-audit Run network-audit
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Remove setting to toggle privacy sandbox Upgrade from Chromium 91 to Chromium 92