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

Fixed download button is not shown when dangerous file downloaded (uplift to 1.52.x) #19151

Merged
merged 2 commits into from
Jul 5, 2023

Conversation

emerick
Copy link
Contributor

@emerick emerick commented Jul 5, 2023

Uplift of #18243

@emerick emerick added this to the 1.52.x - Release #7 milestone Jul 5, 2023
@emerick emerick requested a review from a team as a code owner July 5, 2023 16:32
@emerick emerick self-assigned this Jul 5, 2023
simonhong and others added 2 commits July 5, 2023 14:42
Chromium changes:

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

commit e1a48ccd6d3ea6fb6bd8a9d82cecd4cad1b3a202
Author: Lily Chen <chlily@chromium.org>
Date:   Fri Apr 21 20:11:47 2023 +0000

    [DownloadBubble] Compute info relevant to button state in update service

    This moves the computation of the AllDownloadUIModelsInfo from the
    per-window DownloadDisplayController to the per-profile
    DownloadBubbleUpdateService. This avoids redundant fetching of models
    from the update service, which is expensive and potentially causes jank
    while downloading files, since the models are not needed (just the info
    about them) in order to update the button state.

    Bug: 1434670

https://source.chromium.org/chromium/chromium/src/+/3381daf526425ad5b99d5678adab03c073531531

commit 3381daf526425ad5b99d5678adab03c073531531
Author: Lily Chen <chlily@chromium.org>
Date:   Fri Apr 21 12:57:07 2023 +0000

    [DownloadBubble] Defer GetDownloadManager() calls

    This defers calls to GetDownloadManager() to avoid calling it
    at startup, which may be expensive as it may cause the
    DownloadManager to be created immediately. These calls were
    potentially causing large performance regressions in
    startup time when the download bubble is enabled.

    This fixes 3 places:

    1. DownloadBubbleUpdateService: This CL now splits the
       initialization of the service, adding a separate function to
       start listening to the DownloadManager (by creating an
       AllDownloadItemNotifier) after the DownloadManager is ready.
       This function is called from DownloadUIController's ctor,
       which runs immediately after the DownloadManager has been
       created by DownloadCoreService in GetDownloadManagerDelegate.

    2. DownloadBubbleUIController: This CL removes the ctor
       call to GetDownloadManager() in favor of getting the manager
       only when needed, i.e. when retrying a download, by which
       time the manager should be initialized.

    3. DownloadDisplayController: This was calling
       GetDownloadManager() on construction (i.e. startup)
       completely unnecessarily, to get the DownloadPrefs, which
       also has a getter based on BrowserContext.

    Bug: 1421426
@emerick emerick force-pushed the download_button_danger_file_1.52.x branch from 2a6bfb6 to e53592d Compare July 5, 2023 18:43
Copy link
Member

@kjozwiak kjozwiak left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Uplift into 1.52.x approved 👍 QA has verified the PR on 1.53.x (BETA) as per brave/brave-browser#29651 (comment) & brave/brave-browser#29651 (comment).

@kjozwiak kjozwiak merged commit 54ce9d5 into 1.52.x Jul 5, 2023
3 checks passed
@kjozwiak kjozwiak deleted the download_button_danger_file_1.52.x branch July 5, 2023 21:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants