Prerender: Retrigger UpdateSpeculationCandidates on BFCache restoration for prerender [chromium/src : main]

0 views
Skip to first unread message

Taiyo Mizuhashi (Gerrit)

unread,
Jun 8, 2023, 1:45:52 PM6/8/23
to blink-re...@chromium.org, kinuko...@chromium.org, blink-...@chromium.org

Attention is currently required from: Taiyo Mizuhashi.

Taiyo Mizuhashi uploaded patch set #10 to this change.

View Change

Prerender: Retrigger UpdateSpeculationCandidates on BFCache restoration for prerender

Before this CL, speculation rules preloading is not processed again on
the pages restored from BFCache. This CL introduces a feature to
retrigger speculation rules on BFCache restoration for prerender by retriggering `DocumentSpeculationRules::UpdateSpeculationCandidates()`.

For more information, please see the design doc on crbug.

Note that
- This project tries to target preload(both prefetch/
prerender). This CL focuses on prerender first.
- This CL focuses on verifying the default prerendering behavior first
(list rules, eagerness is kEager). This CL also expects to be worked with other prerendering cases and these tests will be added in the
following CL.

Bug: 1449163
Change-Id: I9b3390eee68fb075a472558d4c79d0df861bf49c
---
M content/browser/preloading/prerender/prerender_browsertest.cc
M third_party/blink/common/features.cc
M third_party/blink/public/common/features.h
M third_party/blink/renderer/core/exported/web_view_impl.cc
M third_party/blink/renderer/core/speculation_rules/document_speculation_rules.cc
M third_party/blink/renderer/core/speculation_rules/document_speculation_rules.h
6 files changed, 99 insertions(+), 14 deletions(-)

To view, visit change 4578345. To unsubscribe, or for help writing mail filters, visit settings.

Gerrit-MessageType: newpatchset
Gerrit-Project: chromium/src
Gerrit-Branch: main
Gerrit-Change-Id: I9b3390eee68fb075a472558d4c79d0df861bf49c
Gerrit-Change-Number: 4578345
Gerrit-PatchSet: 10
Gerrit-Owner: Taiyo Mizuhashi <ta...@chromium.org>
Gerrit-Reviewer: Taiyo Mizuhashi <ta...@chromium.org>
Gerrit-CC: Hiroki Nakagawa <nhi...@chromium.org>
Gerrit-CC: Huanpo Lin <robe...@chromium.org>
Gerrit-CC: Lingqi Chi <lin...@chromium.org>
Gerrit-Attention: Taiyo Mizuhashi <ta...@chromium.org>

Taiyo Mizuhashi (Gerrit)

unread,
Jun 8, 2023, 1:54:27 PM6/8/23
to Hiroki Nakagawa, Huanpo Lin, blink-re...@chromium.org, kinuko...@chromium.org, blink-...@chromium.org

Attention is currently required from: Hiroki Nakagawa, Huanpo Lin.

Taiyo Mizuhashi would like Hiroki Nakagawa and Huanpo Lin to review this change.

View Change

Prerender: Retrigger UpdateSpeculationCandidates on BFCache restoration for prerender

Before this CL, speculation rules preloading is not processed again on
the pages restored from BFCache. This CL introduces a feature to
retrigger speculation rules on BFCache restoration for prerender by retriggering `DocumentSpeculationRules::UpdateSpeculationCandidates()`.

For more information, please see the design doc on crbug.

Note that
- This project tries to target preload(both prefetch/
prerender). This CL focuses on prerender first.
- This CL focuses on verifying the default prerendering behavior first
(list rules, eagerness is kEager). This CL also expects to be worked with other prerendering cases and these tests will be added in the
following CL.

Bug: 1449163
Change-Id: I9b3390eee68fb075a472558d4c79d0df861bf49c
---
M content/browser/preloading/prerender/prerender_browsertest.cc
M third_party/blink/common/features.cc
M third_party/blink/public/common/features.h
M third_party/blink/renderer/core/exported/web_view_impl.cc
M third_party/blink/renderer/core/speculation_rules/document_speculation_rules.cc
M third_party/blink/renderer/core/speculation_rules/document_speculation_rules.h
6 files changed, 100 insertions(+), 14 deletions(-)


To view, visit change 4578345. To unsubscribe, or for help writing mail filters, visit settings.

Gerrit-MessageType: newchange
Gerrit-Project: chromium/src
Gerrit-Branch: main
Gerrit-Change-Id: I9b3390eee68fb075a472558d4c79d0df861bf49c
Gerrit-Change-Number: 4578345
Gerrit-PatchSet: 11
Gerrit-Owner: Taiyo Mizuhashi <ta...@chromium.org>
Gerrit-Reviewer: Hiroki Nakagawa <nhi...@chromium.org>
Gerrit-Reviewer: Huanpo Lin <robe...@chromium.org>
Gerrit-Reviewer: Taiyo Mizuhashi <ta...@chromium.org>
Gerrit-CC: Lingqi Chi <lin...@chromium.org>
Gerrit-Attention: Hiroki Nakagawa <nhi...@chromium.org>
Gerrit-Attention: Huanpo Lin <robe...@chromium.org>

Taiyo Mizuhashi (Gerrit)

unread,
Jun 8, 2023, 1:54:32 PM6/8/23
to blink-re...@chromium.org, kinuko...@chromium.org, blink-...@chromium.org, Hiroki Nakagawa, Huanpo Lin, Lingqi Chi, Chromium LUCI CQ, chromium...@chromium.org

Attention is currently required from: Hiroki Nakagawa, Huanpo Lin.

View Change

1 comment:

  • Patchset:

    • Patch Set #11:

      +nhiroki@, robertlin@: Can you please review this CL first? Thanks!

To view, visit change 4578345. To unsubscribe, or for help writing mail filters, visit settings.

Gerrit-MessageType: comment
Gerrit-Project: chromium/src
Gerrit-Branch: main
Gerrit-Change-Id: I9b3390eee68fb075a472558d4c79d0df861bf49c
Gerrit-Change-Number: 4578345
Gerrit-PatchSet: 11
Gerrit-Owner: Taiyo Mizuhashi <ta...@chromium.org>
Gerrit-Reviewer: Hiroki Nakagawa <nhi...@chromium.org>
Gerrit-Reviewer: Huanpo Lin <robe...@chromium.org>
Gerrit-Reviewer: Taiyo Mizuhashi <ta...@chromium.org>
Gerrit-CC: Lingqi Chi <lin...@chromium.org>
Gerrit-Attention: Hiroki Nakagawa <nhi...@chromium.org>
Gerrit-Attention: Huanpo Lin <robe...@chromium.org>
Gerrit-Comment-Date: Thu, 08 Jun 2023 17:54:23 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No

Hiroki Nakagawa (Gerrit)

unread,
Jun 8, 2023, 9:17:48 PM6/8/23
to Taiyo Mizuhashi, blink-re...@chromium.org, kinuko...@chromium.org, blink-...@chromium.org, Huanpo Lin, Lingqi Chi, Chromium LUCI CQ, chromium...@chromium.org

Attention is currently required from: Huanpo Lin, Taiyo Mizuhashi.

Patch set 11:Code-Review +1

View Change

9 comments:

  • Patchset:

  • File content/browser/preloading/prerender/prerender_browsertest.cc:

    • Patch Set #11, Line 7614: false

      Can you keep this comment? `/*ignore_outstanding_network_request=*/false`

    • Patch Set #11, Line 7651: // BFCache restoration.

      Now we could remove this TODO comment?

    • Patch Set #11, Line 7685: // When kRetriggerPreloadingOnBFCacheRestoration is enabled:

      Instead of explaining in comments, how about representing this as code like this?


      ```
      // In PrerenderBackForwardCacheRestorationBrowserTest
      bool ShouldRetriggerOnRestoration() {
      return GetParam();
      }
      // In test
      if (ShouldRetriggerOnRestoration()) {
      ...
      } else {
      ...
      }
      ```
    • Patch Set #11, Line 7687: g

      "retriggering." (adding a trailing period)

    • Patch Set #11, Line 7700: // When kRetriggerPreloadingOnBFCacheRestoration is disabled:

      Ditto. This comment may not be necessary if the function name is clear.

    • Patch Set #11, Line 7709: // BFCache restoration.

      Ditto.

    • Patch Set #11, Line 7745: // When kRetriggerPreloadingOnBFCacheRestoration is enabled:

      Ditto.

  • File third_party/blink/renderer/core/speculation_rules/document_speculation_rules.cc:

    • Patch Set #11, Line 434: // TODO(crbug.com/1449163): Add implementation for Prefetch.

      Can you briefly explain the current behavior on prefetch? Otherwise, code readers don't understand what we need to implement for prefetch. For example,

      ```
      // This retriggers only speculation rules prerender, not speculation rules
      // prefetch, as prefetch has a different lifecycle model from prerender.
      // TODO(crbug.com/1449163): Add implementation for Prefetch.
      ```

      (Feel free to rewrite)


      By the way, do we plan to implement something for prefetch here? If not and instead we're going to implement something in the browser side, then we may not have to put TODO comments here in the first place.

To view, visit change 4578345. To unsubscribe, or for help writing mail filters, visit settings.

Gerrit-MessageType: comment
Gerrit-Project: chromium/src
Gerrit-Branch: main
Gerrit-Change-Id: I9b3390eee68fb075a472558d4c79d0df861bf49c
Gerrit-Change-Number: 4578345
Gerrit-PatchSet: 11
Gerrit-Owner: Taiyo Mizuhashi <ta...@chromium.org>
Gerrit-Reviewer: Hiroki Nakagawa <nhi...@chromium.org>
Gerrit-Reviewer: Huanpo Lin <robe...@chromium.org>
Gerrit-Reviewer: Taiyo Mizuhashi <ta...@chromium.org>
Gerrit-CC: Lingqi Chi <lin...@chromium.org>
Gerrit-Attention: Taiyo Mizuhashi <ta...@chromium.org>
Gerrit-Attention: Huanpo Lin <robe...@chromium.org>
Gerrit-Comment-Date: Fri, 09 Jun 2023 01:17:41 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: Yes

Hiroki Nakagawa (Gerrit)

unread,
Jun 8, 2023, 9:18:03 PM6/8/23
to prerenderi...@chromium.org, blink-re...@chromium.org, kinuko...@chromium.org, blink-...@chromium.org, Taiyo Mizuhashi, Huanpo Lin

Attention is currently required from: Huanpo Lin, Taiyo Mizuhashi.

Taiyo Mizuhashi has uploaded this change for review.

View Change

Prerender: Retrigger UpdateSpeculationCandidates on BFCache restoration for prerender

Before this CL, speculation rules preloading is not processed again on
the pages restored from BFCache. This CL introduces a feature to
retrigger speculation rules on BFCache restoration for prerender by retriggering `DocumentSpeculationRules::UpdateSpeculationCandidates()`.

For more information, please see the design doc on crbug.

Note that
- This project tries to target preload(both prefetch/
prerender). This CL focuses on prerender first.
- This CL focuses on verifying the default prerendering behavior first
(list rules, eagerness is kEager). This CL also expects to be worked with other prerendering cases and these tests will be added in the
following CL.

Bug: 1449163
Change-Id: I9b3390eee68fb075a472558d4c79d0df861bf49c
---
M content/browser/preloading/prerender/prerender_browsertest.cc
M third_party/blink/common/features.cc
M third_party/blink/public/common/features.h
M third_party/blink/renderer/core/exported/web_view_impl.cc
M third_party/blink/renderer/core/speculation_rules/document_speculation_rules.cc
M third_party/blink/renderer/core/speculation_rules/document_speculation_rules.h
6 files changed, 100 insertions(+), 14 deletions(-)


To view, visit change 4578345. To unsubscribe, or for help writing mail filters, visit settings.

Gerrit-MessageType: newchange

Huanpo Lin (Gerrit)

unread,
Jun 8, 2023, 9:41:14 PM6/8/23
to Taiyo Mizuhashi, prerenderi...@chromium.org, blink-re...@chromium.org, kinuko...@chromium.org, blink-...@chromium.org, Hiroki Nakagawa, Lingqi Chi, Chromium LUCI CQ, chromium...@chromium.org

Attention is currently required from: Hiroki Nakagawa, Taiyo Mizuhashi.

Patch set 11:Code-Review +1

View Change

3 comments:

    • File content/browser/preloading/prerender/prerender_browsertest.cc:

      • Patch Set #11, Line 7685: // When kRetriggerPreloadingOnBFCacheRestoration is enabled:

        Instead of explaining in comments, how about representing this as code like this? […]

        +1

    • File third_party/blink/renderer/core/speculation_rules/document_speculation_rules.cc:

      • Can you briefly explain the current behavior on prefetch? Otherwise, code readers don't understand w […]

        A bit curious about whether this TODO is desired or any better place to put this, because in the design doc says simply re-trigger of this function call won't be sufficient for prefetch.

    To view, visit change 4578345. To unsubscribe, or for help writing mail filters, visit settings.

    Gerrit-MessageType: comment
    Gerrit-Project: chromium/src
    Gerrit-Branch: main
    Gerrit-Change-Id: I9b3390eee68fb075a472558d4c79d0df861bf49c
    Gerrit-Change-Number: 4578345
    Gerrit-PatchSet: 11
    Gerrit-Owner: Taiyo Mizuhashi <ta...@chromium.org>
    Gerrit-Reviewer: Hiroki Nakagawa <nhi...@chromium.org>
    Gerrit-Reviewer: Huanpo Lin <robe...@chromium.org>
    Gerrit-Reviewer: Taiyo Mizuhashi <ta...@chromium.org>
    Gerrit-CC: Lingqi Chi <lin...@chromium.org>
    Gerrit-Attention: Hiroki Nakagawa <nhi...@chromium.org>
    Gerrit-Attention: Taiyo Mizuhashi <ta...@chromium.org>
    Gerrit-Comment-Date: Fri, 09 Jun 2023 01:41:06 +0000
    Gerrit-HasComments: Yes
    Gerrit-Has-Labels: Yes
    Comment-In-Reply-To: Hiroki Nakagawa <nhi...@chromium.org>

    Taiyo Mizuhashi (Gerrit)

    unread,
    Jun 9, 2023, 7:36:58 AM6/9/23
    to prerenderi...@chromium.org, blink-re...@chromium.org, kinuko...@chromium.org, blink-...@chromium.org, Huanpo Lin, Hiroki Nakagawa, Lingqi Chi, Chromium LUCI CQ, chromium...@chromium.org

    Attention is currently required from: Hiroki Nakagawa.

    View Change

    8 comments:

      • Can you keep this comment? `/*ignore_outstanding_network_request=*/false`

      • Done

      • Done

      • +1

        Done

      • Patch Set #11, Line 7700: // When kRetriggerPreloadingOnBFCacheRestoration is disabled:

        Ditto. This comment may not be necessary if the function name is clear.

      • Done

    • File third_party/blink/renderer/core/speculation_rules/document_speculation_rules.cc:

      • A bit curious about whether this TODO is desired or any better place to put this, because in the des […]

        My thought was it would be good to have a TODO comment indicating that this CL is not sufficient for prefetch, but yes I also believed this is not the best place for a comment, as you mentioned.
        I now believe that the CL description is sufficient to have this information, so I'm going to remove it. What are your thoughts?

    To view, visit change 4578345. To unsubscribe, or for help writing mail filters, visit settings.

    Gerrit-MessageType: comment
    Gerrit-Project: chromium/src
    Gerrit-Branch: main
    Gerrit-Change-Id: I9b3390eee68fb075a472558d4c79d0df861bf49c
    Gerrit-Change-Number: 4578345
    Gerrit-PatchSet: 12
    Gerrit-Owner: Taiyo Mizuhashi <ta...@chromium.org>
    Gerrit-Reviewer: Hiroki Nakagawa <nhi...@chromium.org>
    Gerrit-Reviewer: Huanpo Lin <robe...@chromium.org>
    Gerrit-Reviewer: Taiyo Mizuhashi <ta...@chromium.org>
    Gerrit-CC: Lingqi Chi <lin...@chromium.org>
    Gerrit-Attention: Hiroki Nakagawa <nhi...@chromium.org>
    Gerrit-Comment-Date: Fri, 09 Jun 2023 11:36:48 +0000
    Gerrit-HasComments: Yes
    Gerrit-Has-Labels: No
    Comment-In-Reply-To: Hiroki Nakagawa <nhi...@chromium.org>
    Comment-In-Reply-To: Huanpo Lin <robe...@chromium.org>

    Taiyo Mizuhashi (Gerrit)

    unread,
    Jun 9, 2023, 7:37:37 AM6/9/23
    to prerenderi...@chromium.org, blink-re...@chromium.org, kinuko...@chromium.org, blink-...@chromium.org, Huanpo Lin, Hiroki Nakagawa, Lingqi Chi, Chromium LUCI CQ, chromium...@chromium.org

    Attention is currently required from: Hiroki Nakagawa.

    View Change

    1 comment:

    To view, visit change 4578345. To unsubscribe, or for help writing mail filters, visit settings.

    Gerrit-MessageType: comment
    Gerrit-Project: chromium/src
    Gerrit-Branch: main
    Gerrit-Change-Id: I9b3390eee68fb075a472558d4c79d0df861bf49c
    Gerrit-Change-Number: 4578345
    Gerrit-PatchSet: 12
    Gerrit-Owner: Taiyo Mizuhashi <ta...@chromium.org>
    Gerrit-Reviewer: Hiroki Nakagawa <nhi...@chromium.org>
    Gerrit-Reviewer: Huanpo Lin <robe...@chromium.org>
    Gerrit-Reviewer: Taiyo Mizuhashi <ta...@chromium.org>
    Gerrit-CC: Lingqi Chi <lin...@chromium.org>
    Gerrit-Attention: Hiroki Nakagawa <nhi...@chromium.org>
    Gerrit-Comment-Date: Fri, 09 Jun 2023 11:37:27 +0000

    Huanpo Lin (Gerrit)

    unread,
    Jun 9, 2023, 7:45:37 AM6/9/23
    to Taiyo Mizuhashi, prerenderi...@chromium.org, blink-re...@chromium.org, kinuko...@chromium.org, blink-...@chromium.org, Hiroki Nakagawa, Lingqi Chi, Chromium LUCI CQ, chromium...@chromium.org

    Attention is currently required from: Hiroki Nakagawa, Taiyo Mizuhashi.

    Patch set 12:Code-Review +1

    View Change

    1 comment:

    • File third_party/blink/renderer/core/speculation_rules/document_speculation_rules.cc:

      • My thought was it would be good to have a TODO comment indicating that this CL is not sufficient for […]

        IMHO, it is OK to remove it here since the crbug says that preloading is the scope. It should be sufficient to mention it in the description.

    To view, visit change 4578345. To unsubscribe, or for help writing mail filters, visit settings.

    Gerrit-MessageType: comment
    Gerrit-Project: chromium/src
    Gerrit-Branch: main
    Gerrit-Change-Id: I9b3390eee68fb075a472558d4c79d0df861bf49c
    Gerrit-Change-Number: 4578345
    Gerrit-PatchSet: 12
    Gerrit-Owner: Taiyo Mizuhashi <ta...@chromium.org>
    Gerrit-Reviewer: Hiroki Nakagawa <nhi...@chromium.org>
    Gerrit-Reviewer: Huanpo Lin <robe...@chromium.org>
    Gerrit-Reviewer: Taiyo Mizuhashi <ta...@chromium.org>
    Gerrit-CC: Lingqi Chi <lin...@chromium.org>
    Gerrit-Attention: Hiroki Nakagawa <nhi...@chromium.org>
    Gerrit-Attention: Taiyo Mizuhashi <ta...@chromium.org>
    Gerrit-Comment-Date: Fri, 09 Jun 2023 11:45:27 +0000
    Gerrit-HasComments: Yes
    Gerrit-Has-Labels: Yes
    Comment-In-Reply-To: Hiroki Nakagawa <nhi...@chromium.org>
    Comment-In-Reply-To: Taiyo Mizuhashi <ta...@chromium.org>
    Comment-In-Reply-To: Huanpo Lin <robe...@chromium.org>

    Taiyo Mizuhashi (Gerrit)

    unread,
    Jun 9, 2023, 10:12:53 AM6/9/23
    to Ken Okada, prerenderi...@chromium.org, blink-re...@chromium.org, kinuko...@chromium.org, blink-...@chromium.org, Huanpo Lin, Hiroki Nakagawa

    Attention is currently required from: Hiroki Nakagawa, Ken Okada.

    Taiyo Mizuhashi would like Ken Okada to review this change.

    View Change

    Prerender: Retrigger UpdateSpeculationCandidates on BFCache restoration for prerender

    Before this CL, speculation rules preloading is not processed again on
    the pages restored from BFCache. This CL introduces a feature to
    retrigger speculation rules on BFCache restoration for prerender by retriggering `DocumentSpeculationRules::UpdateSpeculationCandidates()`.

    For more information, please see the design doc on crbug.

    Note that
    - This project tries to target preload(both prefetch/
    prerender). This CL focuses on prerender first.
    - This CL focuses on verifying the default prerendering behavior first
    (list rules, eagerness is kEager). This CL also expects to be worked with other prerendering cases and these tests will be added in the
    following CL.

    Bug: 1449163
    Change-Id: I9b3390eee68fb075a472558d4c79d0df861bf49c
    ---
    M content/browser/preloading/prerender/prerender_browsertest.cc
    M third_party/blink/common/features.cc
    M third_party/blink/public/common/features.h
    M third_party/blink/renderer/core/exported/web_view_impl.cc
    M third_party/blink/renderer/core/speculation_rules/document_speculation_rules.cc
    M third_party/blink/renderer/core/speculation_rules/document_speculation_rules.h
    6 files changed, 93 insertions(+), 18 deletions(-)


    To view, visit change 4578345. To unsubscribe, or for help writing mail filters, visit settings.

    Gerrit-MessageType: newchange
    Gerrit-Project: chromium/src
    Gerrit-Branch: main
    Gerrit-Change-Id: I9b3390eee68fb075a472558d4c79d0df861bf49c
    Gerrit-Change-Number: 4578345
    Gerrit-PatchSet: 12
    Gerrit-Owner: Taiyo Mizuhashi <ta...@chromium.org>
    Gerrit-Reviewer: Hiroki Nakagawa <nhi...@chromium.org>
    Gerrit-Reviewer: Huanpo Lin <robe...@chromium.org>
    Gerrit-Reviewer: Ken Okada <ken...@chromium.org>
    Gerrit-Reviewer: Taiyo Mizuhashi <ta...@chromium.org>
    Gerrit-CC: Lingqi Chi <lin...@chromium.org>
    Gerrit-Attention: Ken Okada <ken...@chromium.org>
    Gerrit-Attention: Hiroki Nakagawa <nhi...@chromium.org>

    Taiyo Mizuhashi (Gerrit)

    unread,
    Jun 9, 2023, 10:12:58 AM6/9/23
    to prerenderi...@chromium.org, blink-re...@chromium.org, kinuko...@chromium.org, blink-...@chromium.org, Ken Okada, Huanpo Lin, Hiroki Nakagawa, Lingqi Chi, Chromium LUCI CQ, chromium...@chromium.org

    Attention is currently required from: Hiroki Nakagawa, Ken Okada.

    View Change

    1 comment:

    • Patchset:

      • Patch Set #12:

        +kenoss@: Hello, can you please review this with DevTools perspective?
        I confirm that DevTools doesn’t work on BFCache restoration at this CL, but the reason is a part of crbug.com/1448790 and I believe this CL maintains necessary CDP events to work with DevTools. I would like to confirm this is aligned with your thought.

    To view, visit change 4578345. To unsubscribe, or for help writing mail filters, visit settings.

    Gerrit-MessageType: comment
    Gerrit-Project: chromium/src
    Gerrit-Branch: main
    Gerrit-Change-Id: I9b3390eee68fb075a472558d4c79d0df861bf49c
    Gerrit-Change-Number: 4578345
    Gerrit-PatchSet: 12
    Gerrit-Owner: Taiyo Mizuhashi <ta...@chromium.org>
    Gerrit-Reviewer: Hiroki Nakagawa <nhi...@chromium.org>
    Gerrit-Reviewer: Huanpo Lin <robe...@chromium.org>
    Gerrit-Reviewer: Ken Okada <ken...@chromium.org>
    Gerrit-Reviewer: Taiyo Mizuhashi <ta...@chromium.org>
    Gerrit-CC: Lingqi Chi <lin...@chromium.org>
    Gerrit-Attention: Ken Okada <ken...@chromium.org>
    Gerrit-Attention: Hiroki Nakagawa <nhi...@chromium.org>
    Gerrit-Comment-Date: Fri, 09 Jun 2023 14:12:47 +0000
    Gerrit-HasComments: Yes
    Gerrit-Has-Labels: No

    Taiyo Mizuhashi (Gerrit)

    unread,
    Jun 9, 2023, 10:40:34 AM6/9/23
    to Adithya Srinivasan, prerenderi...@chromium.org, blink-re...@chromium.org, kinuko...@chromium.org, blink-...@chromium.org, Ken Okada, Huanpo Lin, Hiroki Nakagawa

    Attention is currently required from: Adithya Srinivasan, Hiroki Nakagawa, Ken Okada.

    Taiyo Mizuhashi would like Adithya Srinivasan to review this change.

    View Change

    Prerender: Retrigger UpdateSpeculationCandidates on BFCache restoration for prerender

    Before this CL, speculation rules preloading is not processed again on
    the pages restored from BFCache. This CL introduces a feature to
    retrigger speculation rules on BFCache restoration for prerender by retriggering `DocumentSpeculationRules::UpdateSpeculationCandidates()`.

    For more information, please see the design doc on crbug.

    Note that
    - This project tries to target preload(both prefetch/
    prerender). This CL focuses on prerender first.
    - This CL focuses on verifying the default prerendering behavior first
    (list rules, eagerness is kEager). This CL also expects to be worked with other prerendering cases and these tests will be added in the
    following CL.

    Bug: 1449163
    Change-Id: I9b3390eee68fb075a472558d4c79d0df861bf49c
    ---
    M content/browser/preloading/prerender/prerender_browsertest.cc
    M third_party/blink/common/features.cc
    M third_party/blink/public/common/features.h
    M third_party/blink/renderer/core/exported/web_view_impl.cc
    M third_party/blink/renderer/core/speculation_rules/document_speculation_rules.cc
    M third_party/blink/renderer/core/speculation_rules/document_speculation_rules.h
    6 files changed, 93 insertions(+), 18 deletions(-)


    To view, visit change 4578345. To unsubscribe, or for help writing mail filters, visit settings.

    Gerrit-MessageType: newchange
    Gerrit-Project: chromium/src
    Gerrit-Branch: main
    Gerrit-Change-Id: I9b3390eee68fb075a472558d4c79d0df861bf49c
    Gerrit-Change-Number: 4578345
    Gerrit-PatchSet: 12
    Gerrit-Owner: Taiyo Mizuhashi <ta...@chromium.org>
    Gerrit-Reviewer: Adithya Srinivasan <adit...@chromium.org>
    Gerrit-Reviewer: Hiroki Nakagawa <nhi...@chromium.org>
    Gerrit-Reviewer: Huanpo Lin <robe...@chromium.org>
    Gerrit-Reviewer: Ken Okada <ken...@chromium.org>
    Gerrit-Reviewer: Taiyo Mizuhashi <ta...@chromium.org>
    Gerrit-CC: Lingqi Chi <lin...@chromium.org>
    Gerrit-Attention: Ken Okada <ken...@chromium.org>
    Gerrit-Attention: Adithya Srinivasan <adit...@chromium.org>
    Gerrit-Attention: Hiroki Nakagawa <nhi...@chromium.org>

    Taiyo Mizuhashi (Gerrit)

    unread,
    Jun 9, 2023, 10:40:39 AM6/9/23
    to prerenderi...@chromium.org, blink-re...@chromium.org, kinuko...@chromium.org, blink-...@chromium.org, Adithya Srinivasan, Ken Okada, Huanpo Lin, Hiroki Nakagawa, Lingqi Chi, Chromium LUCI CQ, chromium...@chromium.org

    Attention is currently required from: Adithya Srinivasan, Hiroki Nakagawa, Ken Okada.

    View Change

    1 comment:

    • Patchset:

      • Patch Set #12:

        +adithyas@: Hello, could you please review especially under
        third_party/blink/renderer/core/* ? Thanks.

    To view, visit change 4578345. To unsubscribe, or for help writing mail filters, visit settings.

    Gerrit-MessageType: comment
    Gerrit-Project: chromium/src
    Gerrit-Branch: main
    Gerrit-Change-Id: I9b3390eee68fb075a472558d4c79d0df861bf49c
    Gerrit-Change-Number: 4578345
    Gerrit-PatchSet: 12
    Gerrit-Owner: Taiyo Mizuhashi <ta...@chromium.org>
    Gerrit-Reviewer: Adithya Srinivasan <adit...@chromium.org>
    Gerrit-Reviewer: Hiroki Nakagawa <nhi...@chromium.org>
    Gerrit-Reviewer: Huanpo Lin <robe...@chromium.org>
    Gerrit-Reviewer: Ken Okada <ken...@chromium.org>
    Gerrit-Reviewer: Taiyo Mizuhashi <ta...@chromium.org>
    Gerrit-CC: Lingqi Chi <lin...@chromium.org>
    Gerrit-Attention: Ken Okada <ken...@chromium.org>
    Gerrit-Attention: Adithya Srinivasan <adit...@chromium.org>
    Gerrit-Attention: Hiroki Nakagawa <nhi...@chromium.org>
    Gerrit-Comment-Date: Fri, 09 Jun 2023 14:40:29 +0000
    Gerrit-HasComments: Yes
    Gerrit-Has-Labels: No

    Ken Okada (Gerrit)

    unread,
    Jun 9, 2023, 2:01:20 PM6/9/23
    to Taiyo Mizuhashi, prerenderi...@chromium.org, blink-re...@chromium.org, kinuko...@chromium.org, blink-...@chromium.org, Adithya Srinivasan, Huanpo Lin, Hiroki Nakagawa, Lingqi Chi, Chromium LUCI CQ, chromium...@chromium.org

    Attention is currently required from: Adithya Srinivasan, Hiroki Nakagawa, Taiyo Mizuhashi.

    Patch set 12:Code-Review +1

    View Change

    1 comment:

    • Patchset:

      • Patch Set #12:

        +kenoss@: Hello, can you please review this with DevTools perspective? […]

        I tried and confirmed that DevTools received retriggered status updates. Thanks!

    To view, visit change 4578345. To unsubscribe, or for help writing mail filters, visit settings.

    Gerrit-MessageType: comment
    Gerrit-Project: chromium/src
    Gerrit-Branch: main
    Gerrit-Change-Id: I9b3390eee68fb075a472558d4c79d0df861bf49c
    Gerrit-Change-Number: 4578345
    Gerrit-PatchSet: 12
    Gerrit-Owner: Taiyo Mizuhashi <ta...@chromium.org>
    Gerrit-Reviewer: Adithya Srinivasan <adit...@chromium.org>
    Gerrit-Reviewer: Hiroki Nakagawa <nhi...@chromium.org>
    Gerrit-Reviewer: Huanpo Lin <robe...@chromium.org>
    Gerrit-Reviewer: Ken Okada <ken...@chromium.org>
    Gerrit-Reviewer: Taiyo Mizuhashi <ta...@chromium.org>
    Gerrit-CC: Lingqi Chi <lin...@chromium.org>
    Gerrit-Attention: Adithya Srinivasan <adit...@chromium.org>
    Gerrit-Attention: Hiroki Nakagawa <nhi...@chromium.org>
    Gerrit-Attention: Taiyo Mizuhashi <ta...@chromium.org>
    Gerrit-Comment-Date: Fri, 09 Jun 2023 18:01:11 +0000
    Gerrit-HasComments: Yes
    Gerrit-Has-Labels: Yes
    Comment-In-Reply-To: Taiyo Mizuhashi <ta...@chromium.org>

    Adithya Srinivasan (Gerrit)

    unread,
    Jun 9, 2023, 3:35:10 PM6/9/23
    to Taiyo Mizuhashi, prerenderi...@chromium.org, blink-re...@chromium.org, kinuko...@chromium.org, blink-...@chromium.org, Ken Okada, Huanpo Lin, Hiroki Nakagawa, Lingqi Chi, Chromium LUCI CQ, chromium...@chromium.org

    Attention is currently required from: Hiroki Nakagawa, Taiyo Mizuhashi.

    Patch set 12:Code-Review +1

    View Change

    2 comments:

    • Patchset:

      • Patch Set #12:

        speculation_rules changes LGTM! (with comment addressed)

    • File third_party/blink/renderer/core/speculation_rules/document_speculation_rules.h:

      • Patch Set #12, Line 69: void RetriggerUpdateSpeculationCandidates();

        nit: We've usually named these methods based on the trigger that caused it and not by what the method itself does, so I would rename it to `DocumentRestoredFromBFCache()`

    To view, visit change 4578345. To unsubscribe, or for help writing mail filters, visit settings.

    Gerrit-MessageType: comment
    Gerrit-Project: chromium/src
    Gerrit-Branch: main
    Gerrit-Change-Id: I9b3390eee68fb075a472558d4c79d0df861bf49c
    Gerrit-Change-Number: 4578345
    Gerrit-PatchSet: 12
    Gerrit-Owner: Taiyo Mizuhashi <ta...@chromium.org>
    Gerrit-Reviewer: Adithya Srinivasan <adit...@chromium.org>
    Gerrit-Reviewer: Hiroki Nakagawa <nhi...@chromium.org>
    Gerrit-Reviewer: Huanpo Lin <robe...@chromium.org>
    Gerrit-Reviewer: Ken Okada <ken...@chromium.org>
    Gerrit-Reviewer: Taiyo Mizuhashi <ta...@chromium.org>
    Gerrit-CC: Lingqi Chi <lin...@chromium.org>
    Gerrit-Attention: Hiroki Nakagawa <nhi...@chromium.org>
    Gerrit-Attention: Taiyo Mizuhashi <ta...@chromium.org>
    Gerrit-Comment-Date: Fri, 09 Jun 2023 19:35:01 +0000
    Gerrit-HasComments: Yes
    Gerrit-Has-Labels: Yes

    Taiyo Mizuhashi (Gerrit)

    unread,
    Jun 12, 2023, 3:20:04 AM6/12/23
    to prerenderi...@chromium.org, blink-re...@chromium.org, kinuko...@chromium.org, blink-...@chromium.org

    Attention is currently required from: Taiyo Mizuhashi.

    Taiyo Mizuhashi uploaded patch set #14 to this change.

    View Change

    Prerender: Retrigger UpdateSpeculationCandidates on BFCache restoration for prerender

    Before this CL, speculation rules preloading is not processed again on
    the pages restored from BFCache. This CL introduces a feature to
    retrigger speculation rules on BFCache restoration for prerender by retriggering `DocumentSpeculationRules::UpdateSpeculationCandidates()`.

    For more information, please see the design doc on crbug.

    Note that
    - This project tries to target preload(both prefetch/
    prerender). This CL focuses on prerender first(Just calling
    `UpdateSpeculationCandidates()` is insufficient for the current prefetch
    implementation to retrigger).

    - This CL focuses on verifying the default prerendering behavior first
    (list rules, eagerness is kEager). This CL also expects to be worked with other prerendering cases and these tests will be added in the
    following CL.
    - DevTools doesn’t work on BFCache restoration at this CL, but the
    reason is a part of crbug.com/1448790 and this CL will maintain

    necessary CDP events to work with DevTools.

    Bug: 1449163
    Change-Id: I9b3390eee68fb075a472558d4c79d0df861bf49c
    ---
    M content/browser/preloading/prerender/prerender_browsertest.cc
    M third_party/blink/common/features.cc
    M third_party/blink/public/common/features.h
    M third_party/blink/renderer/core/exported/web_view_impl.cc
    M third_party/blink/renderer/core/speculation_rules/document_speculation_rules.cc
    M third_party/blink/renderer/core/speculation_rules/document_speculation_rules.h
    6 files changed, 93 insertions(+), 18 deletions(-)

    To view, visit change 4578345. To unsubscribe, or for help writing mail filters, visit settings.

    Gerrit-MessageType: newpatchset
    Gerrit-Project: chromium/src
    Gerrit-Branch: main
    Gerrit-Change-Id: I9b3390eee68fb075a472558d4c79d0df861bf49c
    Gerrit-Change-Number: 4578345
    Gerrit-PatchSet: 14
    Gerrit-Owner: Taiyo Mizuhashi <ta...@chromium.org>
    Gerrit-Reviewer: Adithya Srinivasan <adit...@chromium.org>
    Gerrit-Reviewer: Hiroki Nakagawa <nhi...@chromium.org>
    Gerrit-Reviewer: Huanpo Lin <robe...@chromium.org>
    Gerrit-Reviewer: Ken Okada <ken...@chromium.org>
    Gerrit-Reviewer: Taiyo Mizuhashi <ta...@chromium.org>
    Gerrit-CC: Lingqi Chi <lin...@chromium.org>
    Gerrit-Attention: Taiyo Mizuhashi <ta...@chromium.org>

    Taiyo Mizuhashi (Gerrit)

    unread,
    Jun 12, 2023, 3:40:59 AM6/12/23
    to prerenderi...@chromium.org, blink-re...@chromium.org, kinuko...@chromium.org, blink-...@chromium.org

    Attention is currently required from: Taiyo Mizuhashi.

    Taiyo Mizuhashi uploaded patch set #15 to this change.

    Gerrit-PatchSet: 15

    Taiyo Mizuhashi (Gerrit)

    unread,
    Jun 12, 2023, 3:42:49 AM6/12/23
    to prerenderi...@chromium.org, blink-re...@chromium.org, kinuko...@chromium.org, blink-...@chromium.org, Adithya Srinivasan, Ken Okada, Huanpo Lin, Hiroki Nakagawa, Lingqi Chi, Chromium LUCI CQ, chromium...@chromium.org

    View Change

    4 comments:

    • Patchset:

      • Patch Set #12:

        I tried and confirmed that DevTools received retriggered status updates. […]

        Thanks for checking!

    • Patchset:

      • Thank you for the review!

    • File third_party/blink/renderer/core/speculation_rules/document_speculation_rules.h:

      • nit: We've usually named these methods based on the trigger that caused it and not by what the metho […]

        DONE, thanks for pointing this out!

    • File third_party/blink/renderer/core/speculation_rules/document_speculation_rules.cc:

      • IMHO, it is OK to remove it here since the crbug says that preloading is the scope. […]

        Thanks, I revised the CL description.

    To view, visit change 4578345. To unsubscribe, or for help writing mail filters, visit settings.

    Gerrit-MessageType: comment
    Gerrit-Project: chromium/src
    Gerrit-Branch: main
    Gerrit-Change-Id: I9b3390eee68fb075a472558d4c79d0df861bf49c
    Gerrit-Change-Number: 4578345
    Gerrit-PatchSet: 16
    Gerrit-Owner: Taiyo Mizuhashi <ta...@chromium.org>
    Gerrit-Reviewer: Adithya Srinivasan <adit...@chromium.org>
    Gerrit-Reviewer: Hiroki Nakagawa <nhi...@chromium.org>
    Gerrit-Reviewer: Huanpo Lin <robe...@chromium.org>
    Gerrit-Reviewer: Ken Okada <ken...@chromium.org>
    Gerrit-Reviewer: Taiyo Mizuhashi <ta...@chromium.org>
    Gerrit-CC: Lingqi Chi <lin...@chromium.org>
    Gerrit-Comment-Date: Mon, 12 Jun 2023 07:42:41 +0000
    Gerrit-HasComments: Yes
    Gerrit-Has-Labels: No
    Comment-In-Reply-To: Ken Okada <ken...@chromium.org>
    Comment-In-Reply-To: Adithya Srinivasan <adit...@chromium.org>

    Taiyo Mizuhashi (Gerrit)

    unread,
    Jun 12, 2023, 4:51:34 AM6/12/23
    to prerenderi...@chromium.org, blink-re...@chromium.org, kinuko...@chromium.org, blink-...@chromium.org, Adithya Srinivasan, Ken Okada, Huanpo Lin, Hiroki Nakagawa, Lingqi Chi, Chromium LUCI CQ, chromium...@chromium.org

    Attention is currently required from: Taiyo Mizuhashi.

    Patch set 16:Commit-Queue +2

    View Change

      To view, visit change 4578345. To unsubscribe, or for help writing mail filters, visit settings.

      Gerrit-MessageType: comment
      Gerrit-Project: chromium/src
      Gerrit-Branch: main
      Gerrit-Change-Id: I9b3390eee68fb075a472558d4c79d0df861bf49c
      Gerrit-Change-Number: 4578345
      Gerrit-PatchSet: 16
      Gerrit-Owner: Taiyo Mizuhashi <ta...@chromium.org>
      Gerrit-Reviewer: Adithya Srinivasan <adit...@chromium.org>
      Gerrit-Reviewer: Hiroki Nakagawa <nhi...@chromium.org>
      Gerrit-Reviewer: Huanpo Lin <robe...@chromium.org>
      Gerrit-Reviewer: Ken Okada <ken...@chromium.org>
      Gerrit-Reviewer: Taiyo Mizuhashi <ta...@chromium.org>
      Gerrit-CC: Lingqi Chi <lin...@chromium.org>
      Gerrit-Attention: Taiyo Mizuhashi <ta...@chromium.org>
      Gerrit-Comment-Date: Mon, 12 Jun 2023 08:51:23 +0000
      Gerrit-HasComments: No
      Gerrit-Has-Labels: Yes

      Chromium LUCI CQ (Gerrit)

      unread,
      Jun 12, 2023, 4:55:45 AM6/12/23
      to Taiyo Mizuhashi, prerenderi...@chromium.org, blink-re...@chromium.org, kinuko...@chromium.org, blink-...@chromium.org, Adithya Srinivasan, Ken Okada, Huanpo Lin, Hiroki Nakagawa, Lingqi Chi, chromium...@chromium.org

      Chromium LUCI CQ submitted this change.

      View Change



      12 is the latest approved patch-set.
      The change was submitted with unreviewed changes in the following files:

      ```
      The name of the file: third_party/blink/renderer/core/speculation_rules/document_speculation_rules.cc
      Insertions: 1, Deletions: 1.

      The diff is too large to show. Please review the diff.
      ```
      ```
      The name of the file: third_party/blink/renderer/core/speculation_rules/document_speculation_rules.h
      Insertions: 1, Deletions: 1.

      The diff is too large to show. Please review the diff.
      ```
      ```
      The name of the file: third_party/blink/renderer/core/exported/web_view_impl.cc
      Insertions: 1, Deletions: 1.

      The diff is too large to show. Please review the diff.
      ```

      Approvals: Adithya Srinivasan: Looks good to me Ken Okada: Looks good to me Taiyo Mizuhashi: Commit Hiroki Nakagawa: Looks good to me Huanpo Lin: Looks good to me
      Prerender: Retrigger UpdateSpeculationCandidates on BFCache restoration
      for prerender

      Before this CL, speculation rules preloading is not processed again on
      the pages restored from BFCache. This CL introduces a feature to
      retrigger speculation rules on BFCache restoration for prerender by
      retriggering `DocumentSpeculationRules::UpdateSpeculationCandidates()`.

      For more information, please see the design doc on crbug.

      Note that
      - This project tries to target preload(both prefetch/
      prerender). This CL focuses on prerender first(Just calling
      `UpdateSpeculationCandidates()` is insufficient for the current prefetch
      implementation to retrigger).
      - This CL focuses on verifying the default prerendering behavior first
      (list rules, eagerness is kEager). This CL also expects to be worked
      with other prerendering cases and these tests will be added in the
      following CL.
      - DevTools doesn’t work on BFCache restoration at this CL, but the
      reason is a part of crbug.com/1448790 and this CL will maintain
      necessary CDP events to work with DevTools.

      Bug: 1449163
      Change-Id: I9b3390eee68fb075a472558d4c79d0df861bf49c
      Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4578345
      Commit-Queue: Taiyo Mizuhashi <ta...@chromium.org>
      Reviewed-by: Ken Okada <ken...@chromium.org>
      Reviewed-by: Adithya Srinivasan <adit...@chromium.org>
      Reviewed-by: Hiroki Nakagawa <nhi...@chromium.org>
      Reviewed-by: Huanpo Lin <robe...@chromium.org>
      Cr-Commit-Position: refs/heads/main@{#1156094}

      ---
      M content/browser/preloading/prerender/prerender_browsertest.cc
      M third_party/blink/common/features.cc
      M third_party/blink/public/common/features.h
      M third_party/blink/renderer/core/exported/web_view_impl.cc
      M third_party/blink/renderer/core/speculation_rules/document_speculation_rules.cc
      M third_party/blink/renderer/core/speculation_rules/document_speculation_rules.h
      6 files changed, 93 insertions(+), 18 deletions(-)


      To view, visit change 4578345. To unsubscribe, or for help writing mail filters, visit settings.

      Gerrit-MessageType: merged
      Gerrit-Project: chromium/src
      Gerrit-Branch: main
      Gerrit-Change-Id: I9b3390eee68fb075a472558d4c79d0df861bf49c
      Gerrit-Change-Number: 4578345
      Gerrit-PatchSet: 17
      Gerrit-Owner: Taiyo Mizuhashi <ta...@chromium.org>
      Gerrit-Reviewer: Adithya Srinivasan <adit...@chromium.org>
      Gerrit-Reviewer: Chromium LUCI CQ <chromiu...@luci-project-accounts.iam.gserviceaccount.com>
      Gerrit-Reviewer: Hiroki Nakagawa <nhi...@chromium.org>
      Gerrit-Reviewer: Huanpo Lin <robe...@chromium.org>
      Gerrit-Reviewer: Ken Okada <ken...@chromium.org>
      Gerrit-Reviewer: Taiyo Mizuhashi <ta...@chromium.org>
      Reply all
      Reply to author
      Forward
      0 new messages