Chromium change:
https://chromium.googlesource.com/chromium/src/+/b7f34d81f8ead36200b8882389d9f892946d4713
commit b7f34d81f8ead36200b8882389d9f892946d4713
Author: Felix Weilbach <feweilbach@gmail.com>
Date: Wed Nov 17 18:42:45 2021 +0000
Change ReadBigEndian to take a uint8_t* input
ReadBigEndian() is interpreting the input as bytes not as characters
(e.g. UTF-8). Therefore it makes sense that ReadBidEndian() gets the
input as uint8_t.
Bug: 1219110
It only contained one constant that has been removed upstream now.
Chromium change:
https://chromium.googlesource.com/chromium/src/+/5ec55b48883d7182a9c9a0217f63c5fd3bd1ead5
commit 5ec55b48883d7182a9c9a0217f63c5fd3bd1ead5
Author: Nate Fischer <ntfschr@chromium.org>
Date: Wed Nov 17 09:11:13 2021 +0000
Safe Browsing: remove unused constant
This removes an unused string constant. The string was used when
chrome://safe-browsing was still under construction, but this has since
launched.
The switch statement being modified lives in clients.cc now.
Chromium change:
https://chromium.googlesource.com/chromium/src/+/20fa4aa8c7eac0a799bee8f1b6cb33c43e59a657
commit 20fa4aa8c7eac0a799bee8f1b6cb33c43e59a657
Author: Xing Liu <xingliu@chromium.org>
Date: Sat Nov 20 01:40:32 2021 +0000
Background download: Use one string conversion function for clients.
Make logger_impl.cc to reuse the string conversion function in
stats.cc. Also move the conversion to clients.cc.
Bug: NONE
The GitHub mirrow has been temporarily out-of-sync since past Wednesday
November 17th which, even though they run a couple of manual syncs in
the past days, is causing trouble for us to work on rebases because we
can't fetch the right tags from the mirror.
This change changes the URL in package.json to point to the upstream
repository and makes the necessary changes to npm run sync so that
the gclient and git configurations get updated to it.
According to the upstream bug at https://crbug.com/1272797, this
situation should be fixed soon as it's been treated as high prio,
but we can't depend on that to be able to update to newer tags, so
we'd better make this change now, and then maybe return to using the
GitHub mirror later on when the situation is fixed, if needed.
We need to manually add a ChromeExtensionWebContentsObserver to the
WebView's WebContents now that the |enable_extension_apis| parameter
is gone from the constructor, which we used to set to |true| causing
the BubbleContentsWrapper to do it for us.
Chromium change:
https://github.com/chromium/chromium/commit/183029096a06ae326108700c8f6272c6cec9b174
commit 183029096a06ae326108700c8f6272c6cec9b174
Author: Lukasz Anforowicz <lukasza@chromium.org>
Date: Tue Nov 16 19:45:05 2021 +0000
Introduce ContentBrowserClient::AttachUniversalWebContentsObservers.
Problem description
===================
Before this CL, there was a discrepancy in how Chrome Extensions were
handled in the Browser process VS the Renderer processes:
1. Code in a Renderer process ensures that content scripts are injected
into *all* elligible documents (ones with URLs that match patterns
requested by an extension). This Renderer-side code is agnostic to
whether the document is in a browser tab or in a different flavor of
WebContents.
This universal applicability of content scripts is desirable - if a
user installs an extension to modify certain documents (e.g. change
the behavior of https://example.com) then such user intent should be
respected in all WebContents hosting such documents.
2. Code in the Browser process would create ExtensionWebContentsObserver
(EWCO) only for some, but not for all WebContents. This was because
when creating a new flavour of WebContents it was possible to miss
the responsibility to construct EWCO - we've identified multiple
WebContents flavours were EWCO was missing.
The discrepancy between the Browser and the Rednderer processes would
mean that some content scripts are injected but:
A. They cannot talk to extensions::mojom::LocalFrameHost (which is
bound by EWCO::BindLocalFrameHost) and therefore extension API calls
do not work
B. They are not recognized by ContentScriptTracker (which relies on
notifications like EWCO::ReadyToCommitNavigation). This was
responsible for majority of DumpWithoutCrashing reports tracked in
https://crbug.com/1212918.
Changes in this CL
==================
This CL adds a new method to ContentBrowserClient -
AttachUniversalWebContentsObservers (which gets called by the //content
layer for every WebContents after it gets created and initialized).
Implementation of the new method in ChromeContentBrowserClient
constructs ChromeExtensionWebContentsObserver for each WebContents.
For more background (and discussion of alternative approaches for
addressing the problem) please see the document here:
https://docs.google.com/document/d/1zITHyso0axNdAZV3qySgsoWW-p6jOEKbWqoVJbOW92c/edit?usp=sharing
Bug: 1212918
This reverts commit 586ece5d2b35c881e7160a95538466204b03b267.
commit 479c46912860e1cf1fb4624487322eca607a60ad
Author: Jan Krcal <jkrcal@chromium.org>
Date: Mon Nov 15 12:51:48 2021 +0000
Revert "[Avatar button] Dim the button when the window is in background"
This reverts commit a004286d08ac95c80c0341ea2f93ea40efb285cd.
Reason for revert: Unexpectedly high memory regression crbug.com/1269135 (350K)
Original change's description:
> [Avatar button] Dim the button when the window is in background
>
> This CL makes all modes of AvatarToolbarButton respect the color
> specified by ToolbarButton::GetForegroundColor(state). To this end:
> - in guest mode, the button uses the color as the stroke for the icon;
> - in normal mode, the button extracts alpha value of the color and
> applies that to whatever avatar icon is displayed (including custom
> Chrome avatars, the GAIA avatars, and the default avatars,
> potentially colored according to the theme color).
>
> Screenshots:
> https://drive.google.com/drive/folders/1mwt5UWIrPBm8H2QLtRwsXLE1qVBDUp_n?resourcekey=0-V3FGpFsRvGZjPzasVTq5Kw&usp=sharing
>
>
> Bug: 1198208
> Change-Id: Ia8c17d6550af1b26ded51b6dae758e3ffd2152c7
> Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3220331
> Commit-Queue: Jan Krcal <jkrcal@chromium.org>
> Reviewed-by: Alex Ilin <alexilin@chromium.org>
> Reviewed-by: Peter Boström <pbos@chromium.org>
> Reviewed-by: Mitsuru Oshima <oshima@chromium.org>
> Cr-Commit-Position: refs/heads/main@{#940486}
# Not skipping CQ checks because original CL landed > 1 day ago.
Bug: 1198208
The NavigatorPluginsFixed feature is now unconditionally enabled, so
we need to add some extra code to make sure that we always rely on
Brave's farbling mechanism, instead of returning upstream's fixed
plugins data.
Chromium change:
https://github.com/chromium/chromium/commit/c2abba012946a341b479821594eccaf45c893b3f
commit c2abba012946a341b479821594eccaf45c893b3f
Author: Mason Freed <masonf@chromium.org>
Date: Tue Nov 16 00:38:55 2021 +0000
Remove the NavigatorPluginsFixed feature flag
This feature shipped successfully in M94, with no reported bugs.
As such, this CL removes the feature flags. Note that the various
uses of |should_return_fixed_plugin_data_| need to stay, as they
are still used to re-enable the dynamic plugin lists for apps,
which is controlled via:
GetSettings()->GetAllowNonEmptyNavigatorPlugins()
until at least June, 2022.
Bug: 1171373,1164635
Chromium change:
https://github.com/chromium/chromium/commit/a3c39f54fc21ebbe8878a5753782bc102366d9a6
commit a3c39f54fc21ebbe8878a5753782bc102366d9a6
Author: Stephen McGruer <smcgruer@chromium.org>
Date: Mon Nov 15 23:05:59 2021 +0000
[SPC] Clean-up: rename instrument to credential in places
We have long since stopped storing instrument information in the user
profile database; nowadays we only store the credential information.
Doing this renaming makes the code easier to understand.
There are a few places where the old name remains, because they cannot
be renamed without losing data - the SQL table itself and some
histogram-related code.
Bug: None
Change-Id:
Chromium change:
https://github.com/chromium/chromium/commit/fee97f92a2beb2d82ccced2a90a8f5931b976c2f
[Start] Clean up unnecessary codes in StartSurfaceToolbar*.
1. LayoutStateProvider and LayoutStateObserver logic is removed in
StartSurfaceToolbar* because StartSurfaceState#onStateChanged should
already cover all layout state changes.
Lazy inflation in StartSurfaceToolbarCoordinator.java is moved to
onStartSurfaceStateChanged() accordingly.
Clean up StartSurfaceMediatorUnitTest.java accordingly.
2. hasIncognitoTabs() in StartSurfaceToolbarMediator.java is removed
because the previous CL has added an incognito tab model observer which
could observe whether there is incognito tab directly.
3. Stop passing isStartSurfaceEnabled into
TabSwitcherModeTTCoordinatorPhone.java because it's always false.
Change-Id: I024f77b4d7ece51ddd53fc1c0b2bc7cedcfa3c2f
Chromium changes:
https://chromium.googlesource.com/chromium/src.git/+/fbeeb1c228427bcc94d22747210309b99f88c0b1
commit fbeeb1c228427bcc94d22747210309b99f88c0b1
Author: Gabriel Charette <gab@chromium.org>
Date: Wed Nov 10 20:50:06 2021 +0000
[content] Make ContentMainParams and MainFunctionParams move-only
This is taking care of a long-standing TODO to move these OnceClosure
holders rather than copy them around with their OnceClosure* members.
This is a precursor to
https://chromium-review.googlesource.com/c/chromium/src/+/3187153/35#message-fcc92e9f85e73f0e5ba6c03610a95cda8736f1f9
which highlighted a problem where some tests see a non-null
MainFunctionParams::ui_task but running the closure results in a UAF.
Logs show that the test hitting the UAF is not the one setting this
field. This CL makes that impossible and fixes the issue in the
follow-up CL.
This CL is intended to be a logical no-op.
This CL touches a lot of files and must happen all at once.
The core change is that ContentMainParams and MainFunctionParams's
moveable fields (ui_task, created_main_parts_closure, and startup_data)
are now held by moveable types rather than raw pointers.
This trickles in the following chain:
main() (in various *_main.cc)
(or SetUp() in !OS_ANDROID browser_test_base.cc)
-> ContentMain()
-> ContentMainRunnerImpl::Initialize()
(forwards arg into MainFunctionParams)
-> RunBrowser()
-> BrowserMain()
-> BrowserMainRunnerImpl::Initialize()
-> BrowserMainLoop (stores MainFunctionParams)
-> BrowserMainLoop::Init
-> ContentBrowserClient::CreateBrowserMainParts()
-> (Embedder)ContentBrowserClient::CreateBrowserMainParts()
-> (Embedder)BrowserMainParts(Platform)
-> (Embedder)BrowserMainParts
-> RunOtherNamedProcessTypeMain()
-> (Embedder)ContentMainDelegate::RunProcess()
(or)
-> FooMain() (kMainFunctions)
(or)
-> RunZygote()
(creates its own MainFunctionParams)
-> (Embedder)ContentMainDelegate::RunProcess()
(on OS_ANDROID, browser_test_base.cc calls directly into
ContentMainDelegate::RunProcess())
Few of these needed the params after passing them down so a move-only
model was simple to adapt (even if invasive). The few exceptions like
BrowserMainRunnerImpl::Initialize consuming |created_main_parts_closure|
are better off in the new model (where they take the OnceClosure before
passing down the params) because that prevents others down the chain
from having access to a OnceClosure they shouldn't invoke anyways.
Noteworthy:
- ContentMainDelegate::RunProcess():
Returned an exit_code >= 0 to indicate the embedder elected to handle
the run request given these params. With move-only semantics it is
necessary to return the params back when the embedder declines
handling this run request. An absl::variant return value is used
to satisfy this requirement.
- content/public/test/test_launcher.h : GetContentMainParams():
Becomes CopyContentMainParams() and only exposes a copy of copyable
params. Uses new ContentMainParams::ShallowCopyForTesting() which
verifies that moveable fields are still null by that time as should be
the case in the order browser tests are initialized.
- MainFunctionParams::command_line being const& violated the style-guide
rule to "avoid defining functions that require a const reference
parameter to outlive the call". This also prevented moving. The type
was hence switched to a const CommandLine*.
- BUILD.gn changes for nacl_helper_win_64 which requires static linking
of its minimal //content deps (was previously missing a dep but was
getting away with it because MainFunctionParams was .h only; required
now with .cc). This was already done for static_switches and this CL
adds static_main_function_params, reusing a similar static_features
target that already existed but was no longer required in
/c/nacl/broker, cleaning that up by replacing rather than copying that
target's definition in this CL.
- ContentMainParams::minimal_browser_mode was weirdly passed as a
parameter to ContentMainRunner::Run(bool start_minimal_browser) but
that method also has access to the ContentMainParams originally passed
via ContentMainRunner::Init(). Passing the param again from Run()
would be a use-after-move in content_main.cc, instead
content_main_runner_impl.cc was updated to use the param it already
has in store.
Bug: 1175074
Only a couple of files really need to include this header now to use
ignore_result(), and we can just drop the include from everywhere else.
Chromium changes:
https://chromium.googlesource.com/chromium/src.git/+/2e6be1400ab678f21d871d0d3a1199912967324fhttps://chromium.googlesource.com/chromium/src.git/+/5666ff4f5077a7e2f72902f3a95f5d553ea0d88dhttps://chromium.googlesource.com/chromium/src.git/+/3a3f9436142e712d4a7e2a962d85154876fa395f
commit 2e6be1400ab678f21d871d0d3a1199912967324f
Author: Peter Boström <pbos@chromium.org>
Date: Sat Nov 13 01:28:25 2021 +0000
Rename "base/macros.h" => "base/ignore_result.h"
This file only contains ignore_result() and is no longer a collection of
macros.
This change fixes a couple of missing IWYU removals as well.
Bug: 1010217
commit 5666ff4f5077a7e2f72902f3a95f5d553ea0d88d
Author: Peter Boström <pbos@chromium.org>
Date: Fri Nov 12 03:40:24 2021 +0000
Remove most remaining unused "base/macros.h"
Removes `#include "base/macros.h"` from remaining .cc, .h and .mm files
that do not contain `ignore_result(` and do not trigger pre-commit or
pre-upload errors.
Bug: 1010217
commit 3a3f9436142e712d4a7e2a962d85154876fa395f
Author: Peter Boström <pbos@chromium.org>
Date: Mon Nov 8 21:04:37 2021 +0000
Add #include "base/macros.h" for ignore_result()
This fixes IWYU for existing instances of ignore_result() to make
removal of #include "base/macros.h" from files using it for DISALLOW_*
macros easier.
Bug: 1010217
This target is no longer in the public_deps for //ui/base, so we need
to explicitly list it now to avoid link errors.
Chromium change:
https://chromium.googlesource.com/chromium/src.git/+/2b98feda0cb0ef000c2f41d3f729cf7189bf394b
commit 2b98feda0cb0ef000c2f41d3f729cf7189bf394b
Author: Maksim Sisov <msisov@igalia.com>
Date: Fri Nov 5 16:22:03 2021 +0000
ozone: //ui/base: clean up from USE_X11 1/*
This is another CL that removes USE_X11 define and
gn arg usage from //ui/base and also removes
IsUsingOzonePlatform condition as it's no longer
needed as it always resolves to true.
Please note that //ui/base used to have
//ui/base/x in public_deps. That resulted in other
components implicitly depending on the //ui/base/x
as well. However, after it was deleted, it was
required to fix deps in //remoting/host,
//components/viz/service and //chrome/test/chromedriver.
Changes:
1) Moved hit_tests_x11 to //ui/platform_window/x11
2) Moved os_exhange_data_provider_x11 to //ui/platform_window/x11
3) Fixed deps
4) //ui/base:ui_base_unittests no longer includes //ui/base/x:unittests.
Instead, the //ui/base/x:unittests target is included in
//ui/platform_window/x11:x11_unittests and these base x11 unittests
run as part of x11_unittests.
Bug: 1096425