DevTools: do not clear memory cache when restoring emulation [chromium/src : main]

0 views
Skip to first unread message

Alex Rudenko (Gerrit)

unread,
Sep 19, 2025, 5:13:52 AM (7 days ago) Sep 19
to Philip Pfaffe, Chromium LUCI CQ, AI Code Reviewer, chromium...@chromium.org, Daniel Cheng, devtools...@chromium.org, blink-re...@chromium.org, blink-revi...@chromium.org, blink-...@chromium.org, devtools-re...@chromium.org, ipc-securi...@chromium.org, kinuko...@chromium.org
Attention needed from Philip Pfaffe

Alex Rudenko voted and added 3 comments

Votes added by Alex Rudenko

Commit-Queue+1

3 comments

File third_party/blink/renderer/core/exported/web_view_impl.h
Line 351, Patchset 1: void ActivateDevToolsTransform(const DeviceEmulationParams&,
AI Code Reviewer . resolved

Blink Style Guide: Prefer enums or StrongAliases to bare bools for function parameters. The meaning of the 'restore' boolean is not clear at call sites. Please consider using a `base::StrongAlias` or an enum to improve readability, for example `using RestoreState = base::StrongAlias<class RestoreStateTag, bool>;`.

_To keep this interaction as brief and non-intrusive as possible, please consider responding with one of following options:
**Done** | **Won't fix**: reason | **b/<bug_id>** | **Invalid:** reason

This comment was generated by [Experimental Blink C++ Code Review Agent](http://go/blink-c++-code-review-agent).AI reviews can sometimes be inaccurate; We appreciate your 🙏 feedback 🙏 to help us improve.[File a bug](http://go/blink-c++-code-review-agent-feedback) | [Provide feedback on chat](https://chat.google.com/room/AAQA0zhQHe0?cls=4) | [Opt-out](https://ganpati2.corp.google.com/group/peep-genai-blink-agent-optout.prod)_

Alex Rudenko

Done

File third_party/blink/renderer/core/frame/screen_metrics_emulator.h
Line 71, Patchset 1: void ChangeEmulationParams(const DeviceEmulationParams& params,
AI Code Reviewer . resolved

Blink Style Guide: Prefer enums or StrongAliases to bare bools for function parameters. The meaning of the 'restore' boolean is not clear at call sites. Please consider using a `base::StrongAlias` or an enum to improve readability, for example `using RestoreState = base::StrongAlias<class RestoreStateTag, bool>;`.

_To keep this interaction as brief and non-intrusive as possible, please consider responding with one of following options:
**Done** | **Won't fix**: reason | **b/<bug_id>** | **Invalid:** reason

This comment was generated by [Experimental Blink C++ Code Review Agent](http://go/blink-c++-code-review-agent).AI reviews can sometimes be inaccurate; We appreciate your 🙏 feedback 🙏 to help us improve.[File a bug](http://go/blink-c++-code-review-agent-feedback) | [Provide feedback on chat](https://chat.google.com/room/AAQA0zhQHe0?cls=4) | [Opt-out](https://ganpati2.corp.google.com/group/peep-genai-blink-agent-optout.prod)_

Alex Rudenko

Done

File third_party/blink/renderer/core/frame/web_frame_widget_impl.h
Line 874, Patchset 1: void EnableDeviceEmulation(const DeviceEmulationParams& parameters,
AI Code Reviewer . resolved

Blink Style Guide: Prefer enums or StrongAliases to bare bools for function parameters. The meaning of the 'restore' boolean is not clear at call sites. Please consider using a `base::StrongAlias` or an enum to improve readability, for example `using RestoreState = base::StrongAlias<class RestoreStateTag, bool>;`.

_To keep this interaction as brief and non-intrusive as possible, please consider responding with one of following options:
**Done** | **Won't fix**: reason | **b/<bug_id>** | **Invalid:** reason

This comment was generated by [Experimental Blink C++ Code Review Agent](http://go/blink-c++-code-review-agent).AI reviews can sometimes be inaccurate; We appreciate your 🙏 feedback 🙏 to help us improve.[File a bug](http://go/blink-c++-code-review-agent-feedback) | [Provide feedback on chat](https://chat.google.com/room/AAQA0zhQHe0?cls=4) | [Opt-out](https://ganpati2.corp.google.com/group/peep-genai-blink-agent-optout.prod)_

Alex Rudenko

Done

Open in Gerrit

Related details

Attention is currently required from:
  • Philip Pfaffe
Submit Requirements:
  • requirement satisfiedCode-Coverage
  • requirement is not satisfiedCode-Owners
  • requirement is not satisfiedCode-Review
Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
Gerrit-MessageType: comment
Gerrit-Project: chromium/src
Gerrit-Branch: main
Gerrit-Change-Id: I3b6052051a9d0c963637b422ac31f5a1bd18e67a
Gerrit-Change-Number: 6965238
Gerrit-PatchSet: 4
Gerrit-Owner: Alex Rudenko <alexr...@chromium.org>
Gerrit-Reviewer: Alex Rudenko <alexr...@chromium.org>
Gerrit-Reviewer: Philip Pfaffe <pfa...@chromium.org>
Gerrit-CC: AI Code Reviewer <peep-gen...@system.gserviceaccount.com>
Gerrit-CC: Daniel Cheng <dch...@chromium.org>
Gerrit-Attention: Philip Pfaffe <pfa...@chromium.org>
Gerrit-Comment-Date: Fri, 19 Sep 2025 09:13:38 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: Yes
Comment-In-Reply-To: AI Code Reviewer <peep-gen...@system.gserviceaccount.com>
satisfied_requirement
unsatisfied_requirement
open
diffy

Philip Pfaffe (Gerrit)

unread,
Sep 19, 2025, 5:33:07 AM (7 days ago) Sep 19
to Alex Rudenko, Chromium LUCI CQ, AI Code Reviewer, chromium...@chromium.org, Daniel Cheng, devtools...@chromium.org, blink-re...@chromium.org, blink-revi...@chromium.org, blink-...@chromium.org, devtools-re...@chromium.org, ipc-securi...@chromium.org, kinuko...@chromium.org
Attention needed from Alex Rudenko

Philip Pfaffe voted and added 3 comments

Votes added by Philip Pfaffe

Code-Review+1

3 comments

File content/public/test/fake_frame_widget.h
Line 88, Patchset 4 (Latest): const blink::mojom::DeviceEmulationUpdateReason restore) override {}
Philip Pfaffe . unresolved

const ref?

File third_party/blink/renderer/core/frame/web_frame_widget_impl.h
Line 877, Patchset 4 (Latest): const mojom::blink::DeviceEmulationUpdateReason reason) override;
Philip Pfaffe . unresolved

const ref?

File third_party/blink/renderer/core/frame/web_frame_widget_impl.cc
Line 2305, Patchset 4 (Latest): const mojom::blink::DeviceEmulationUpdateReason reason) {
Philip Pfaffe . unresolved

const ref?

Open in Gerrit

Related details

Attention is currently required from:
  • Alex Rudenko
Submit Requirements:
    • requirement satisfiedCode-Coverage
    • requirement is not satisfiedCode-Owners
    • requirement satisfiedCode-Review
    • requirement is not satisfiedNo-Unresolved-Comments
    Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
    Gerrit-MessageType: comment
    Gerrit-Project: chromium/src
    Gerrit-Branch: main
    Gerrit-Change-Id: I3b6052051a9d0c963637b422ac31f5a1bd18e67a
    Gerrit-Change-Number: 6965238
    Gerrit-PatchSet: 4
    Gerrit-Owner: Alex Rudenko <alexr...@chromium.org>
    Gerrit-Reviewer: Alex Rudenko <alexr...@chromium.org>
    Gerrit-Reviewer: Philip Pfaffe <pfa...@chromium.org>
    Gerrit-CC: AI Code Reviewer <peep-gen...@system.gserviceaccount.com>
    Gerrit-CC: Daniel Cheng <dch...@chromium.org>
    Gerrit-Attention: Alex Rudenko <alexr...@chromium.org>
    Gerrit-Comment-Date: Fri, 19 Sep 2025 09:32:48 +0000
    Gerrit-HasComments: Yes
    Gerrit-Has-Labels: Yes
    satisfied_requirement
    unsatisfied_requirement
    open
    diffy

    Alex Rudenko (Gerrit)

    unread,
    Sep 19, 2025, 5:40:37 AM (7 days ago) Sep 19
    to Philip Pfaffe, Chromium LUCI CQ, AI Code Reviewer, chromium...@chromium.org, Daniel Cheng, devtools...@chromium.org, blink-re...@chromium.org, blink-revi...@chromium.org, blink-...@chromium.org, devtools-re...@chromium.org, ipc-securi...@chromium.org, kinuko...@chromium.org

    Alex Rudenko added 3 comments

    File content/public/test/fake_frame_widget.h
    Line 88, Patchset 4 (Latest): const blink::mojom::DeviceEmulationUpdateReason restore) override {}
    Philip Pfaffe . resolved

    const ref?

    Alex Rudenko

    it is not compatible with the base class generated based on mojom so I think it's not possible?

    File third_party/blink/renderer/core/frame/web_frame_widget_impl.h
    Line 877, Patchset 4 (Latest): const mojom::blink::DeviceEmulationUpdateReason reason) override;
    Philip Pfaffe . resolved

    const ref?

    Alex Rudenko

    ditto

    File third_party/blink/renderer/core/frame/web_frame_widget_impl.cc
    Line 2305, Patchset 4 (Latest): const mojom::blink::DeviceEmulationUpdateReason reason) {
    Philip Pfaffe . resolved

    const ref?

    Alex Rudenko

    ditto

    Open in Gerrit

    Related details

    Attention set is empty
    Submit Requirements:
    • requirement satisfiedCode-Coverage
    • requirement is not satisfiedCode-Owners
    • requirement satisfiedCode-Review
    Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
    Gerrit-MessageType: comment
    Gerrit-Project: chromium/src
    Gerrit-Branch: main
    Gerrit-Change-Id: I3b6052051a9d0c963637b422ac31f5a1bd18e67a
    Gerrit-Change-Number: 6965238
    Gerrit-PatchSet: 4
    Gerrit-Owner: Alex Rudenko <alexr...@chromium.org>
    Gerrit-Reviewer: Alex Rudenko <alexr...@chromium.org>
    Gerrit-Reviewer: Philip Pfaffe <pfa...@chromium.org>
    Gerrit-CC: AI Code Reviewer <peep-gen...@system.gserviceaccount.com>
    Gerrit-CC: Daniel Cheng <dch...@chromium.org>
    Gerrit-Comment-Date: Fri, 19 Sep 2025 09:40:18 +0000
    Gerrit-HasComments: Yes
    Gerrit-Has-Labels: No
    Comment-In-Reply-To: Philip Pfaffe <pfa...@chromium.org>
    satisfied_requirement
    unsatisfied_requirement
    open
    diffy

    gwsq (Gerrit)

    unread,
    Sep 19, 2025, 7:29:39 AM (7 days ago) Sep 19
    to Alex Rudenko, Chromium IPC Reviews, Arthur Sonzogni, Philip Pfaffe, Chromium LUCI CQ, AI Code Reviewer, chromium...@chromium.org, devtools...@chromium.org, blink-re...@chromium.org, blink-revi...@chromium.org, blink-...@chromium.org, devtools-re...@chromium.org, ipc-securi...@chromium.org, kinuko...@chromium.org
    Attention needed from Arthur Sonzogni

    Message from gwsq

    From googleclient/chrome/chromium_gwsq/ipc/config.gwsq:
    IPC: arthurs...@chromium.org

    📎 It looks like you’re making a possibly security-sensitive change! 📎 IPC security review isn’t a rubberstamp, so your friendly security reviewer will need a fair amount of context to review your CL effectively. Please review your CL description and code comments to make sure they provide context for someone unfamiliar with your project/area. Pay special attention to where data comes from and which processes it flows between (and their privilege levels). Feel free to point your security reviewer at design docs, bugs, or other links if you can’t reasonably make a self-contained CL description. (Also see https://cbea.ms/git-commit/).

    IPC reviewer(s): arthurs...@chromium.org

    Note: IPC gwsq added no new reviewers; existing reviewers satisfied requirements!

    Reviewer source(s):
    arthurs...@chromium.org is from context(googleclient/chrome/chromium_gwsq/ipc/config.gwsq)

    Open in Gerrit

    Related details

    Attention is currently required from:
    • Arthur Sonzogni
    Submit Requirements:
    • requirement satisfiedCode-Coverage
    • requirement is not satisfiedCode-Owners
    • requirement satisfiedCode-Review
    Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
    Gerrit-MessageType: comment
    Gerrit-Project: chromium/src
    Gerrit-Branch: main
    Gerrit-Change-Id: I3b6052051a9d0c963637b422ac31f5a1bd18e67a
    Gerrit-Change-Number: 6965238
    Gerrit-PatchSet: 4
    Gerrit-Owner: Alex Rudenko <alexr...@chromium.org>
    Gerrit-Reviewer: Alex Rudenko <alexr...@chromium.org>
    Gerrit-Reviewer: Arthur Sonzogni <arthurs...@chromium.org>
    Gerrit-Reviewer: Philip Pfaffe <pfa...@chromium.org>
    Gerrit-CC: AI Code Reviewer <peep-gen...@system.gserviceaccount.com>
    Gerrit-CC: Chromium IPC Reviews <chrome-ip...@google.com>
    Gerrit-CC: gwsq
    Gerrit-Attention: Arthur Sonzogni <arthurs...@chromium.org>
    Gerrit-Comment-Date: Fri, 19 Sep 2025 11:29:32 +0000
    Gerrit-HasComments: No
    Gerrit-Has-Labels: No
    satisfied_requirement
    unsatisfied_requirement
    open
    diffy

    Daniel Cheng (Gerrit)

    unread,
    Sep 19, 2025, 1:44:21 PM (6 days ago) Sep 19
    to Alex Rudenko, Rakina Zata Amni, Daniel Cheng, Chromium IPC Reviews, Arthur Sonzogni, Philip Pfaffe, Chromium LUCI CQ, AI Code Reviewer, chromium...@chromium.org, devtools...@chromium.org, blink-re...@chromium.org, blink-revi...@chromium.org, blink-...@chromium.org, devtools-re...@chromium.org, ipc-securi...@chromium.org, kinuko...@chromium.org
    Attention needed from Alex Rudenko and Arthur Sonzogni

    Daniel Cheng added 2 comments

    File third_party/blink/public/mojom/page/widget.mojom
    Line 171, Patchset 4 (Latest): EnableDeviceEmulation(DeviceEmulationParams parameters, DeviceEmulationUpdateReason reason);
    Daniel Cheng . unresolved

    Nit: wrap at 80 (git cl format --mojom might fix this)

    File third_party/blink/renderer/core/inspector/dev_tools_emulator.cc
    Line 330, Patchset 4 (Latest): reason != mojom::blink::DeviceEmulationUpdateReason::kRestore) {
    Daniel Cheng . unresolved

    I don't think it's entirely obvious why:

    • we have to evict the memory cache at all to begin with
    • why `kRestore` is exempt from this

    I think comments here and perhaps different names for the reason variants might help?

    Open in Gerrit

    Related details

    Attention is currently required from:
    • Alex Rudenko
    • Arthur Sonzogni
    Submit Requirements:
      • requirement satisfiedCode-Coverage
      • requirement is not satisfiedCode-Owners
      • requirement satisfiedCode-Review
      • requirement is not satisfiedNo-Unresolved-Comments
      Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
      Gerrit-MessageType: comment
      Gerrit-Project: chromium/src
      Gerrit-Branch: main
      Gerrit-Change-Id: I3b6052051a9d0c963637b422ac31f5a1bd18e67a
      Gerrit-Change-Number: 6965238
      Gerrit-PatchSet: 4
      Gerrit-Owner: Alex Rudenko <alexr...@chromium.org>
      Gerrit-Reviewer: Alex Rudenko <alexr...@chromium.org>
      Gerrit-Reviewer: Arthur Sonzogni <arthurs...@chromium.org>
      Gerrit-Reviewer: Daniel Cheng <dch...@chromium.org>
      Gerrit-Reviewer: Philip Pfaffe <pfa...@chromium.org>
      Gerrit-CC: AI Code Reviewer <peep-gen...@system.gserviceaccount.com>
      Gerrit-CC: Chromium IPC Reviews <chrome-ip...@google.com>
      Gerrit-CC: Rakina Zata Amni <rak...@chromium.org>
      Gerrit-CC: gwsq
      Gerrit-Attention: Arthur Sonzogni <arthurs...@chromium.org>
      Gerrit-Attention: Alex Rudenko <alexr...@chromium.org>
      Gerrit-Comment-Date: Fri, 19 Sep 2025 17:44:11 +0000
      Gerrit-HasComments: Yes
      Gerrit-Has-Labels: No
      satisfied_requirement
      unsatisfied_requirement
      open
      diffy

      Arthur Sonzogni (Gerrit)

      unread,
      Sep 19, 2025, 1:49:04 PM (6 days ago) Sep 19
      to Alex Rudenko, Rakina Zata Amni, Daniel Cheng, Chromium IPC Reviews, Philip Pfaffe, Chromium LUCI CQ, AI Code Reviewer, chromium...@chromium.org, devtools...@chromium.org, blink-re...@chromium.org, blink-revi...@chromium.org, blink-...@chromium.org, devtools-re...@chromium.org, ipc-securi...@chromium.org, kinuko...@chromium.org
      Attention needed from Alex Rudenko

      Arthur Sonzogni added 2 comments

      File content/public/test/fake_frame_widget.h
      Line 88, Patchset 4 (Latest): const blink::mojom::DeviceEmulationUpdateReason restore) override {}
      Arthur Sonzogni . unresolved

      The parameter is named `reason` in every other part of the patch (the Mojo interface, implementation files, etc.). Renaming `restore` to `reason` here would improve consistency, even in a test mock.

      File third_party/blink/renderer/core/inspector/dev_tools_emulator.cc
      Line 330, Patchset 4 (Latest): reason != mojom::blink::DeviceEmulationUpdateReason::kRestore) {
      Daniel Cheng . unresolved

      I don't think it's entirely obvious why:

      • we have to evict the memory cache at all to begin with
      • why `kRestore` is exempt from this

      I think comments here and perhaps different names for the reason variants might help?

      Arthur Sonzogni

      +1.

      Open in Gerrit

      Related details

      Attention is currently required from:
      • Alex Rudenko
      Gerrit-Attention: Alex Rudenko <alexr...@chromium.org>
      Gerrit-Comment-Date: Fri, 19 Sep 2025 17:48:47 +0000
      Gerrit-HasComments: Yes
      Gerrit-Has-Labels: No
      Comment-In-Reply-To: Daniel Cheng <dch...@chromium.org>
      satisfied_requirement
      unsatisfied_requirement
      open
      diffy

      Alex Rudenko (Gerrit)

      unread,
      Sep 22, 2025, 5:05:11 AM (4 days ago) Sep 22
      to Rakina Zata Amni, Daniel Cheng, Chromium IPC Reviews, Arthur Sonzogni, Philip Pfaffe, Chromium LUCI CQ, AI Code Reviewer, chromium...@chromium.org, devtools...@chromium.org, blink-re...@chromium.org, blink-revi...@chromium.org, blink-...@chromium.org, devtools-re...@chromium.org, ipc-securi...@chromium.org, kinuko...@chromium.org
      Attention needed from Arthur Sonzogni and Daniel Cheng

      Alex Rudenko voted and added 3 comments

      Votes added by Alex Rudenko

      Commit-Queue+1

      3 comments

      File content/public/test/fake_frame_widget.h
      Line 88, Patchset 4: const blink::mojom::DeviceEmulationUpdateReason restore) override {}
      Arthur Sonzogni . resolved

      The parameter is named `reason` in every other part of the patch (the Mojo interface, implementation files, etc.). Renaming `restore` to `reason` here would improve consistency, even in a test mock.

      Alex Rudenko

      Done

      File third_party/blink/public/mojom/page/widget.mojom
      Line 171, Patchset 4: EnableDeviceEmulation(DeviceEmulationParams parameters, DeviceEmulationUpdateReason reason);
      Daniel Cheng . resolved

      Nit: wrap at 80 (git cl format --mojom might fix this)

      Alex Rudenko

      Thanks, `git cl format --mojom` fixed it but there were a bunch of unrelated fixes (I reverted those). Curious if there is there a reason why mojom formatter does not run by default?

      File third_party/blink/renderer/core/inspector/dev_tools_emulator.cc
      Line 330, Patchset 4: reason != mojom::blink::DeviceEmulationUpdateReason::kRestore) {
      Daniel Cheng . unresolved

      I don't think it's entirely obvious why:

      • we have to evict the memory cache at all to begin with
      • why `kRestore` is exempt from this

      I think comments here and perhaps different names for the reason variants might help?

      Arthur Sonzogni

      +1.

      Alex Rudenko

      Thanks, I have added a comment here explaining the situation. I have not renamed the variable and enums so far to hear if you have any suggestions on what names would make it clearer?

      Open in Gerrit

      Related details

      Attention is currently required from:
      • Arthur Sonzogni
      • Daniel Cheng
      Gerrit-Attention: Arthur Sonzogni <arthurs...@chromium.org>
      Gerrit-Attention: Daniel Cheng <dch...@chromium.org>
      Gerrit-Comment-Date: Mon, 22 Sep 2025 09:04:57 +0000
      Gerrit-HasComments: Yes
      Gerrit-Has-Labels: Yes
      Comment-In-Reply-To: Arthur Sonzogni <arthurs...@chromium.org>
      Comment-In-Reply-To: Daniel Cheng <dch...@chromium.org>
      satisfied_requirement
      unsatisfied_requirement
      open
      diffy

      Daniel Cheng (Gerrit)

      unread,
      Sep 22, 2025, 12:23:12 PM (3 days ago) Sep 22
      to Alex Rudenko, Rakina Zata Amni, Daniel Cheng, Chromium IPC Reviews, Arthur Sonzogni, Philip Pfaffe, Chromium LUCI CQ, AI Code Reviewer, chromium...@chromium.org, devtools...@chromium.org, blink-re...@chromium.org, blink-revi...@chromium.org, blink-...@chromium.org, devtools-re...@chromium.org, ipc-securi...@chromium.org, kinuko...@chromium.org
      Attention needed from Alex Rudenko and Arthur Sonzogni

      Daniel Cheng added 1 comment

      File third_party/blink/renderer/core/inspector/dev_tools_emulator.cc
      Line 330, Patchset 4: reason != mojom::blink::DeviceEmulationUpdateReason::kRestore) {
      Daniel Cheng . unresolved

      I don't think it's entirely obvious why:

      • we have to evict the memory cache at all to begin with
      • why `kRestore` is exempt from this

      I think comments here and perhaps different names for the reason variants might help?

      Arthur Sonzogni

      +1.

      Alex Rudenko

      Thanks, I have added a comment here explaining the situation. I have not renamed the variable and enums so far to hear if you have any suggestions on what names would make it clearer?

      Daniel Cheng

      Maybe it should just be named for what it does: whether or not to invalidate the memory cache?

      Open in Gerrit

      Related details

      Attention is currently required from:
      • Alex Rudenko
      • Arthur Sonzogni
      Submit Requirements:
      • requirement satisfiedCode-Coverage
      • requirement is not satisfiedCode-Owners
      • requirement satisfiedCode-Review
      • requirement is not satisfiedNo-Unresolved-Comments
      Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
      Gerrit-MessageType: comment
      Gerrit-Project: chromium/src
      Gerrit-Branch: main
      Gerrit-Change-Id: I3b6052051a9d0c963637b422ac31f5a1bd18e67a
      Gerrit-Change-Number: 6965238
      Gerrit-PatchSet: 5
      Gerrit-Owner: Alex Rudenko <alexr...@chromium.org>
      Gerrit-Reviewer: Alex Rudenko <alexr...@chromium.org>
      Gerrit-Reviewer: Arthur Sonzogni <arthurs...@chromium.org>
      Gerrit-Reviewer: Daniel Cheng <dch...@chromium.org>
      Gerrit-Reviewer: Philip Pfaffe <pfa...@chromium.org>
      Gerrit-CC: AI Code Reviewer <peep-gen...@system.gserviceaccount.com>
      Gerrit-CC: Chromium IPC Reviews <chrome-ip...@google.com>
      Gerrit-CC: Rakina Zata Amni <rak...@chromium.org>
      Gerrit-CC: gwsq
      Gerrit-Attention: Arthur Sonzogni <arthurs...@chromium.org>
      Gerrit-Attention: Alex Rudenko <alexr...@chromium.org>
      Gerrit-Comment-Date: Mon, 22 Sep 2025 16:23:00 +0000
      Gerrit-HasComments: Yes
      Gerrit-Has-Labels: No
      Comment-In-Reply-To: Arthur Sonzogni <arthurs...@chromium.org>
      Comment-In-Reply-To: Alex Rudenko <alexr...@chromium.org>
      Comment-In-Reply-To: Daniel Cheng <dch...@chromium.org>
      satisfied_requirement
      unsatisfied_requirement
      open
      diffy

      Alex Rudenko (Gerrit)

      unread,
      Sep 23, 2025, 6:50:13 AM (3 days ago) Sep 23
      to Rakina Zata Amni, Daniel Cheng, Chromium IPC Reviews, Arthur Sonzogni, Philip Pfaffe, Chromium LUCI CQ, AI Code Reviewer, chromium...@chromium.org, devtools...@chromium.org, blink-re...@chromium.org, blink-revi...@chromium.org, blink-...@chromium.org, devtools-re...@chromium.org, ipc-securi...@chromium.org, kinuko...@chromium.org
      Attention needed from Arthur Sonzogni and Daniel Cheng

      Alex Rudenko added 1 comment

      File third_party/blink/renderer/core/inspector/dev_tools_emulator.cc
      Line 330, Patchset 4: reason != mojom::blink::DeviceEmulationUpdateReason::kRestore) {
      Daniel Cheng . resolved

      I don't think it's entirely obvious why:

      • we have to evict the memory cache at all to begin with
      • why `kRestore` is exempt from this

      I think comments here and perhaps different names for the reason variants might help?

      Arthur Sonzogni

      +1.

      Alex Rudenko

      Thanks, I have added a comment here explaining the situation. I have not renamed the variable and enums so far to hear if you have any suggestions on what names would make it clearer?

      Daniel Cheng

      Maybe it should just be named for what it does: whether or not to invalidate the memory cache?

      Alex Rudenko

      I checked and it does appear that memory cache behavior is the only piece of the per-process logic here so I renamed the enum accordingly:

      ```
      enum DeviceEmulationCacheBehavior {
      // Clear memory cache when emulation parameters change.
      kClearCache,
      // Keep the memory cache when emulation parameters change.
      kKeepCache,
      };
      ```
      Open in Gerrit

      Related details

      Attention is currently required from:
      • Arthur Sonzogni
      • Daniel Cheng
      Submit Requirements:
      • requirement satisfiedCode-Coverage
      • requirement is not satisfiedCode-Owners
      • requirement satisfiedCode-Review
      Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
      Gerrit-MessageType: comment
      Gerrit-Project: chromium/src
      Gerrit-Branch: main
      Gerrit-Change-Id: I3b6052051a9d0c963637b422ac31f5a1bd18e67a
      Gerrit-Change-Number: 6965238
      Gerrit-PatchSet: 7
      Gerrit-Owner: Alex Rudenko <alexr...@chromium.org>
      Gerrit-Reviewer: Alex Rudenko <alexr...@chromium.org>
      Gerrit-Reviewer: Arthur Sonzogni <arthurs...@chromium.org>
      Gerrit-Reviewer: Daniel Cheng <dch...@chromium.org>
      Gerrit-Reviewer: Philip Pfaffe <pfa...@chromium.org>
      Gerrit-CC: AI Code Reviewer <peep-gen...@system.gserviceaccount.com>
      Gerrit-CC: Chromium IPC Reviews <chrome-ip...@google.com>
      Gerrit-CC: Rakina Zata Amni <rak...@chromium.org>
      Gerrit-CC: gwsq
      Gerrit-Attention: Arthur Sonzogni <arthurs...@chromium.org>
      Gerrit-Attention: Daniel Cheng <dch...@chromium.org>
      Gerrit-Comment-Date: Tue, 23 Sep 2025 10:49:51 +0000
      satisfied_requirement
      unsatisfied_requirement
      open
      diffy

      Daniel Cheng (Gerrit)

      unread,
      Sep 23, 2025, 11:45:02 AM (2 days ago) Sep 23
      to Alex Rudenko, Daniel Cheng, Rakina Zata Amni, Chromium IPC Reviews, Arthur Sonzogni, Philip Pfaffe, Chromium LUCI CQ, AI Code Reviewer, chromium...@chromium.org, devtools...@chromium.org, blink-re...@chromium.org, blink-revi...@chromium.org, blink-...@chromium.org, devtools-re...@chromium.org, ipc-securi...@chromium.org, kinuko...@chromium.org
      Attention needed from Alex Rudenko and Arthur Sonzogni

      Daniel Cheng voted and added 3 comments

      Votes added by Daniel Cheng

      Code-Review+1

      3 comments

      Patchset-level comments
      File-level comment, Patchset 7 (Latest):
      Daniel Cheng . resolved

      LGTM w/nits

      File third_party/blink/public/mojom/page/widget.mojom
      Line 55, Patchset 7 (Latest): // Keep the memory cache when emulation parameters change.
      Daniel Cheng . unresolved

      It would be nice to give a brief example here of when a caller would use it. Something like:
      "Typically used when committing a navigation in a new Document, which has to re-sync the device emulation state, but should not clobber the global memory cache since the parameters did not actually change."

      Line 172, Patchset 7 (Latest): DeviceEmulationParams parameters, DeviceEmulationCacheBehavior cache_behavior);
      Daniel Cheng . unresolved

      Nit: wrapping :)

      Open in Gerrit

      Related details

      Attention is currently required from:
      • Alex Rudenko
      • Arthur Sonzogni
      Submit Requirements:
        • requirement satisfiedCode-Coverage
        • requirement is not satisfiedCode-Owners
        • requirement satisfiedCode-Review
        • requirement is not satisfiedNo-Unresolved-Comments
        Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
        Gerrit-MessageType: comment
        Gerrit-Project: chromium/src
        Gerrit-Branch: main
        Gerrit-Change-Id: I3b6052051a9d0c963637b422ac31f5a1bd18e67a
        Gerrit-Change-Number: 6965238
        Gerrit-PatchSet: 7
        Gerrit-Owner: Alex Rudenko <alexr...@chromium.org>
        Gerrit-Reviewer: Alex Rudenko <alexr...@chromium.org>
        Gerrit-Reviewer: Arthur Sonzogni <arthurs...@chromium.org>
        Gerrit-Reviewer: Daniel Cheng <dch...@chromium.org>
        Gerrit-Reviewer: Philip Pfaffe <pfa...@chromium.org>
        Gerrit-CC: AI Code Reviewer <peep-gen...@system.gserviceaccount.com>
        Gerrit-CC: Chromium IPC Reviews <chrome-ip...@google.com>
        Gerrit-CC: Rakina Zata Amni <rak...@chromium.org>
        Gerrit-CC: gwsq
        Gerrit-Attention: Arthur Sonzogni <arthurs...@chromium.org>
        Gerrit-Attention: Alex Rudenko <alexr...@chromium.org>
        Gerrit-Comment-Date: Tue, 23 Sep 2025 15:44:50 +0000
        Gerrit-HasComments: Yes
        Gerrit-Has-Labels: Yes
        satisfied_requirement
        unsatisfied_requirement
        open
        diffy

        Alex Rudenko (Gerrit)

        unread,
        Sep 23, 2025, 2:51:21 PM (2 days ago) Sep 23
        to Daniel Cheng, Rakina Zata Amni, Chromium IPC Reviews, Arthur Sonzogni, Philip Pfaffe, Chromium LUCI CQ, AI Code Reviewer, chromium...@chromium.org, devtools...@chromium.org, blink-re...@chromium.org, blink-revi...@chromium.org, blink-...@chromium.org, devtools-re...@chromium.org, ipc-securi...@chromium.org, kinuko...@chromium.org
        Attention needed from Arthur Sonzogni

        Alex Rudenko added 2 comments

        File third_party/blink/public/mojom/page/widget.mojom
        Line 55, Patchset 7: // Keep the memory cache when emulation parameters change.
        Daniel Cheng . resolved

        It would be nice to give a brief example here of when a caller would use it. Something like:
        "Typically used when committing a navigation in a new Document, which has to re-sync the device emulation state, but should not clobber the global memory cache since the parameters did not actually change."

        Alex Rudenko

        Done, thanks!

        Line 172, Patchset 7: DeviceEmulationParams parameters, DeviceEmulationCacheBehavior cache_behavior);
        Daniel Cheng . resolved

        Nit: wrapping :)

        Alex Rudenko

        Done

        Open in Gerrit

        Related details

        Attention is currently required from:
        • Arthur Sonzogni
        Submit Requirements:
        • requirement satisfiedCode-Coverage
        • requirement is not satisfiedCode-Owners
        • requirement satisfiedCode-Review
        Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
        Gerrit-MessageType: comment
        Gerrit-Project: chromium/src
        Gerrit-Branch: main
        Gerrit-Change-Id: I3b6052051a9d0c963637b422ac31f5a1bd18e67a
        Gerrit-Change-Number: 6965238
        Gerrit-PatchSet: 8
        Gerrit-Owner: Alex Rudenko <alexr...@chromium.org>
        Gerrit-Reviewer: Alex Rudenko <alexr...@chromium.org>
        Gerrit-Reviewer: Arthur Sonzogni <arthurs...@chromium.org>
        Gerrit-Reviewer: Daniel Cheng <dch...@chromium.org>
        Gerrit-Reviewer: Philip Pfaffe <pfa...@chromium.org>
        Gerrit-CC: AI Code Reviewer <peep-gen...@system.gserviceaccount.com>
        Gerrit-CC: Chromium IPC Reviews <chrome-ip...@google.com>
        Gerrit-CC: Rakina Zata Amni <rak...@chromium.org>
        Gerrit-CC: gwsq
        Gerrit-Attention: Arthur Sonzogni <arthurs...@chromium.org>
        Gerrit-Comment-Date: Tue, 23 Sep 2025 18:51:06 +0000
        Gerrit-HasComments: Yes
        Gerrit-Has-Labels: No
        Comment-In-Reply-To: Daniel Cheng <dch...@chromium.org>
        satisfied_requirement
        unsatisfied_requirement
        open
        diffy

        Arthur Sonzogni (Gerrit)

        unread,
        Sep 23, 2025, 2:52:29 PM (2 days ago) Sep 23
        to Alex Rudenko, Daniel Cheng, Rakina Zata Amni, Chromium IPC Reviews, Philip Pfaffe, Chromium LUCI CQ, AI Code Reviewer, chromium...@chromium.org, devtools...@chromium.org, blink-re...@chromium.org, blink-revi...@chromium.org, blink-...@chromium.org, devtools-re...@chromium.org, ipc-securi...@chromium.org, kinuko...@chromium.org
        Attention needed from Alex Rudenko

        Arthur Sonzogni voted Code-Review+1

        Code-Review+1
        Open in Gerrit

        Related details

        Attention is currently required from:
        • Alex Rudenko
        Submit Requirements:
        • requirement satisfiedCode-Coverage
        • requirement satisfiedCode-Owners
        • requirement satisfiedCode-Review
        Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
        Gerrit-MessageType: comment
        Gerrit-Project: chromium/src
        Gerrit-Branch: main
        Gerrit-Change-Id: I3b6052051a9d0c963637b422ac31f5a1bd18e67a
        Gerrit-Change-Number: 6965238
        Gerrit-PatchSet: 8
        Gerrit-Owner: Alex Rudenko <alexr...@chromium.org>
        Gerrit-Reviewer: Alex Rudenko <alexr...@chromium.org>
        Gerrit-Reviewer: Arthur Sonzogni <arthurs...@chromium.org>
        Gerrit-Reviewer: Daniel Cheng <dch...@chromium.org>
        Gerrit-Reviewer: Philip Pfaffe <pfa...@chromium.org>
        Gerrit-CC: AI Code Reviewer <peep-gen...@system.gserviceaccount.com>
        Gerrit-CC: Chromium IPC Reviews <chrome-ip...@google.com>
        Gerrit-CC: Rakina Zata Amni <rak...@chromium.org>
        Gerrit-CC: gwsq
        Gerrit-Attention: Alex Rudenko <alexr...@chromium.org>
        Gerrit-Comment-Date: Tue, 23 Sep 2025 18:52:13 +0000
        Gerrit-HasComments: No
        Gerrit-Has-Labels: Yes
        satisfied_requirement
        open
        diffy

        Alex Rudenko (Gerrit)

        unread,
        Sep 24, 2025, 2:10:58 AM (yesterday) Sep 24
        to Arthur Sonzogni, Daniel Cheng, Rakina Zata Amni, Chromium IPC Reviews, Philip Pfaffe, Chromium LUCI CQ, AI Code Reviewer, chromium...@chromium.org, devtools...@chromium.org, blink-re...@chromium.org, blink-revi...@chromium.org, blink-...@chromium.org, devtools-re...@chromium.org, ipc-securi...@chromium.org, kinuko...@chromium.org

        Alex Rudenko voted Commit-Queue+2

        Commit-Queue+2
        Open in Gerrit

        Related details

        Attention set is empty
        Submit Requirements:
        • requirement satisfiedCode-Coverage
        • requirement satisfiedCode-Owners
        • requirement satisfiedCode-Review
        Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
        Gerrit-MessageType: comment
        Gerrit-Project: chromium/src
        Gerrit-Branch: main
        Gerrit-Change-Id: I3b6052051a9d0c963637b422ac31f5a1bd18e67a
        Gerrit-Change-Number: 6965238
        Gerrit-PatchSet: 8
        Gerrit-Owner: Alex Rudenko <alexr...@chromium.org>
        Gerrit-Reviewer: Alex Rudenko <alexr...@chromium.org>
        Gerrit-Reviewer: Arthur Sonzogni <arthurs...@chromium.org>
        Gerrit-Reviewer: Daniel Cheng <dch...@chromium.org>
        Gerrit-Reviewer: Philip Pfaffe <pfa...@chromium.org>
        Gerrit-CC: AI Code Reviewer <peep-gen...@system.gserviceaccount.com>
        Gerrit-CC: Chromium IPC Reviews <chrome-ip...@google.com>
        Gerrit-CC: Rakina Zata Amni <rak...@chromium.org>
        Gerrit-CC: gwsq
        Gerrit-Comment-Date: Wed, 24 Sep 2025 06:10:44 +0000
        Gerrit-HasComments: No
        Gerrit-Has-Labels: Yes
        satisfied_requirement
        open
        diffy

        Chromium LUCI CQ (Gerrit)

        unread,
        Sep 24, 2025, 2:26:20 AM (yesterday) Sep 24
        to Alex Rudenko, Arthur Sonzogni, Daniel Cheng, Rakina Zata Amni, Chromium IPC Reviews, Philip Pfaffe, AI Code Reviewer, chromium...@chromium.org, devtools...@chromium.org, blink-re...@chromium.org, blink-revi...@chromium.org, blink-...@chromium.org, devtools-re...@chromium.org, ipc-securi...@chromium.org, kinuko...@chromium.org

        Chromium LUCI CQ submitted the change

        Change information

        Commit message:
        DevTools: do not clear memory cache when restoring emulation

        With RenderDocument, the codepath that syncs device emulation
        settings with new renderers runs for every navigation. That prevents
        memory caches from working as expected on navigation (and reload).

        This CL adds the indication of the reason for the device emulation
        parameters update to skip the cache logic.

        Drive-by: adds missing tests for the Network.restoredFromCache.
        Fixed: 444369637
        Change-Id: I3b6052051a9d0c963637b422ac31f5a1bd18e67a
        Reviewed-by: Arthur Sonzogni <arthurs...@chromium.org>
        Commit-Queue: Alex Rudenko <alexr...@chromium.org>
        Reviewed-by: Philip Pfaffe <pfa...@chromium.org>
        Reviewed-by: Daniel Cheng <dch...@chromium.org>
        Cr-Commit-Position: refs/heads/main@{#1519786}
        Files:
        • M content/browser/devtools/protocol/emulation_handler.cc
        • M content/browser/devtools/protocol/emulation_handler.h
        • M content/public/test/fake_frame_widget.h
        • M third_party/blink/public/mojom/page/widget.mojom
        • M third_party/blink/renderer/core/exported/web_view_impl.cc
        • M third_party/blink/renderer/core/exported/web_view_impl.h
        • M third_party/blink/renderer/core/frame/screen_metrics_emulator.cc
        • M third_party/blink/renderer/core/frame/screen_metrics_emulator.h
        • M third_party/blink/renderer/core/frame/web_frame_widget_impl.cc
        • M third_party/blink/renderer/core/frame/web_frame_widget_impl.h
        • M third_party/blink/renderer/core/inspector/dev_tools_emulator.cc
        • M third_party/blink/renderer/core/inspector/dev_tools_emulator.h
        • A third_party/blink/web_tests/http/tests/inspector-protocol/network/request-served-from-cache-expected.txt
        • A third_party/blink/web_tests/http/tests/inspector-protocol/network/request-served-from-cache-with-emulation-expected.txt
        • A third_party/blink/web_tests/http/tests/inspector-protocol/network/request-served-from-cache-with-emulation.js
        • A third_party/blink/web_tests/http/tests/inspector-protocol/network/request-served-from-cache.js
        • A third_party/blink/web_tests/http/tests/inspector-protocol/network/resources/one-script.html
        • A third_party/blink/web_tests/http/tests/inspector-protocol/network/resources/one-script.php
        Change size: M
        Delta: 18 files changed, 187 insertions(+), 31 deletions(-)
        Branch: refs/heads/main
        Submit Requirements:
        • requirement satisfiedCode-Review: +1 by Daniel Cheng, +1 by Arthur Sonzogni, +1 by Philip Pfaffe
        Open in Gerrit
        Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
        Gerrit-MessageType: merged
        Gerrit-Project: chromium/src
        Gerrit-Branch: main
        Gerrit-Change-Id: I3b6052051a9d0c963637b422ac31f5a1bd18e67a
        Gerrit-Change-Number: 6965238
        Gerrit-PatchSet: 9
        Gerrit-Owner: Alex Rudenko <alexr...@chromium.org>
        Gerrit-Reviewer: Alex Rudenko <alexr...@chromium.org>
        Gerrit-Reviewer: Arthur Sonzogni <arthurs...@chromium.org>
        Gerrit-Reviewer: Chromium LUCI CQ <chromiu...@luci-project-accounts.iam.gserviceaccount.com>
        Gerrit-Reviewer: Daniel Cheng <dch...@chromium.org>
        Gerrit-Reviewer: Philip Pfaffe <pfa...@chromium.org>
        Gerrit-CC: AI Code Reviewer <peep-gen...@system.gserviceaccount.com>
        Gerrit-CC: Chromium IPC Reviews <chrome-ip...@google.com>
        open
        diffy
        satisfied_requirement
        Reply all
        Reply to author
        Forward
        0 new messages