Add the new FileSystem domain for the DevTools Protocol. [chromium/src : main]

0 views
Skip to first unread message

Etienne Noël (Gerrit)

unread,
Sep 12, 2023, 6:16:28 PM9/12/23
to blink-re...@chromium.org, blink-...@chromium.org, devtools-re...@chromium.org, headless...@chromium.org

Attention is currently required from: Etienne Noël.

Etienne Noël uploaded patch set #2 to this change.

View Change

Add the new FileSystem domain for the DevTools Protocol.

This CL adds the new FileSystem domain required for
the Origin Private File System in DevTools new feature.

Change-Id: I3e7fe86192df507b7cdf313e819f93a677b2388b
---
M headless/BUILD.gn
M third_party/blink/public/devtools_protocol/browser_protocol.pdl
M third_party/blink/renderer/core/inspector/BUILD.gn
M third_party/blink/renderer/core/inspector/inspector_protocol_config.json
4 files changed, 71 insertions(+), 0 deletions(-)

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

Gerrit-MessageType: newpatchset
Gerrit-Project: chromium/src
Gerrit-Branch: main
Gerrit-Change-Id: I3e7fe86192df507b7cdf313e819f93a677b2388b
Gerrit-Change-Number: 4860661
Gerrit-PatchSet: 2
Gerrit-Owner: Etienne Noël <etien...@chromium.org>
Gerrit-Reviewer: Etienne Noël <etien...@chromium.org>
Gerrit-Attention: Etienne Noël <etien...@chromium.org>

Etienne Noël (Gerrit)

unread,
Sep 12, 2023, 6:17:35 PM9/12/23
to Danil Somsikov, Andrey Kosyakov, blink-re...@chromium.org, blink-...@chromium.org, devtools-re...@chromium.org, headless...@chromium.org

Attention is currently required from: Andrey Kosyakov, Danil Somsikov.

Etienne Noël would like Danil Somsikov and Andrey Kosyakov to review this change.

View Change

Add the new FileSystem domain for the DevTools Protocol.

This CL adds the new FileSystem domain required for
the Origin Private File System in DevTools new feature.

Change-Id: I3e7fe86192df507b7cdf313e819f93a677b2388b
---
M headless/BUILD.gn
M third_party/blink/public/devtools_protocol/browser_protocol.pdl
M third_party/blink/renderer/core/inspector/BUILD.gn
M third_party/blink/renderer/core/inspector/inspector_protocol_config.json
4 files changed, 71 insertions(+), 0 deletions(-)


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

Gerrit-MessageType: newchange
Gerrit-Project: chromium/src
Gerrit-Branch: main
Gerrit-Change-Id: I3e7fe86192df507b7cdf313e819f93a677b2388b
Gerrit-Change-Number: 4860661
Gerrit-PatchSet: 2
Gerrit-Owner: Etienne Noël <etien...@chromium.org>
Gerrit-Reviewer: Andrey Kosyakov <ca...@chromium.org>
Gerrit-Reviewer: Danil Somsikov <d...@chromium.org>
Gerrit-Reviewer: Etienne Noël <etien...@chromium.org>
Gerrit-Attention: Danil Somsikov <d...@chromium.org>
Gerrit-Attention: Andrey Kosyakov <ca...@chromium.org>

Andrey Kosyakov (Gerrit)

unread,
Sep 12, 2023, 7:05:48 PM9/12/23
to Etienne Noël, blink-re...@chromium.org, blink-...@chromium.org, devtools-re...@chromium.org, headless...@chromium.org, Danil Somsikov, Chromium LUCI CQ, chromium...@chromium.org, devtools...@chromium.org

Attention is currently required from: Danil Somsikov, Etienne Noël.

View Change

5 comments:

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

Gerrit-MessageType: comment
Gerrit-Project: chromium/src
Gerrit-Branch: main
Gerrit-Change-Id: I3e7fe86192df507b7cdf313e819f93a677b2388b
Gerrit-Change-Number: 4860661
Gerrit-PatchSet: 2
Gerrit-Owner: Etienne Noël <etien...@chromium.org>
Gerrit-Reviewer: Andrey Kosyakov <ca...@chromium.org>
Gerrit-Reviewer: Danil Somsikov <d...@chromium.org>
Gerrit-Reviewer: Etienne Noël <etien...@chromium.org>
Gerrit-Attention: Danil Somsikov <d...@chromium.org>
Gerrit-Attention: Etienne Noël <etien...@chromium.org>
Gerrit-Comment-Date: Tue, 12 Sep 2023 23:05:36 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No

Etienne Noël (Gerrit)

unread,
Sep 13, 2023, 5:39:18 PM9/13/23
to blink-re...@chromium.org, blink-...@chromium.org, devtools-re...@chromium.org, headless...@chromium.org, Danil Somsikov, Andrey Kosyakov, Chromium LUCI CQ, chromium...@chromium.org, devtools...@chromium.org

Attention is currently required from: Andrey Kosyakov, Danil Somsikov.

View Change

1 comment:

  • Patchset:

    • Patch Set #2:

      No major issues with this, but let's see the implementation too!

    • Perfect, the implementation will take a bit of time but will keep you posted. Thank you.

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

Gerrit-MessageType: comment
Gerrit-Project: chromium/src
Gerrit-Branch: main
Gerrit-Change-Id: I3e7fe86192df507b7cdf313e819f93a677b2388b
Gerrit-Change-Number: 4860661
Gerrit-PatchSet: 2
Gerrit-Owner: Etienne Noël <etien...@chromium.org>
Gerrit-Reviewer: Andrey Kosyakov <ca...@chromium.org>
Gerrit-Reviewer: Danil Somsikov <d...@chromium.org>
Gerrit-Reviewer: Etienne Noël <etien...@chromium.org>
Gerrit-Attention: Danil Somsikov <d...@chromium.org>
Gerrit-Attention: Andrey Kosyakov <ca...@chromium.org>
Gerrit-Comment-Date: Wed, 13 Sep 2023 21:39:09 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
Comment-In-Reply-To: Andrey Kosyakov <ca...@chromium.org>

Etienne Noël (Gerrit)

unread,
Oct 16, 2023, 5:05:17 PM10/16/23
to blink-re...@chromium.org, blink-...@chromium.org, devtools-re...@chromium.org, headless...@chromium.org

Attention is currently required from: Andrey Kosyakov, Danil Somsikov.

Etienne Noël uploaded patch set #3 to this change.

View Change

Add the new FileSystem domain for the DevTools Protocol.

This CL adds the new FileSystem domain required for
the Origin Private File System in DevTools new feature.

Change-Id: I3e7fe86192df507b7cdf313e819f93a677b2388b
---
M headless/BUILD.gn
M third_party/blink/public/devtools_protocol/browser_protocol.pdl
M third_party/blink/renderer/core/inspector/BUILD.gn
M third_party/blink/renderer/core/inspector/inspector_protocol_config.json
M third_party/blink/renderer/modules/file_system_access/BUILD.gn
M third_party/blink/renderer/modules/file_system_access/DEPS
A third_party/blink/renderer/modules/file_system_access/bucket_file_system_agent.cc
A third_party/blink/renderer/modules/file_system_access/bucket_file_system_agent.h
A third_party/blink/renderer/modules/file_system_access/bucket_file_system_builder.cc
A third_party/blink/renderer/modules/file_system_access/bucket_file_system_builder.h
M third_party/blink/renderer/modules/modules_initializer.cc
11 files changed, 860 insertions(+), 3 deletions(-)

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

Gerrit-MessageType: newpatchset
Gerrit-Project: chromium/src
Gerrit-Branch: main
Gerrit-Change-Id: I3e7fe86192df507b7cdf313e819f93a677b2388b
Gerrit-Change-Number: 4860661
Gerrit-PatchSet: 3

Etienne Noël (Gerrit)

unread,
Oct 16, 2023, 6:07:29 PM10/16/23
to Ayu Ishii, blink-re...@chromium.org, blink-...@chromium.org, devtools-re...@chromium.org, headless...@chromium.org, Danil Somsikov, Andrey Kosyakov

Attention is currently required from: Andrey Kosyakov, Ayu Ishii, Danil Somsikov.

Etienne Noël would like Ayu Ishii to review this change.

View Change

Add the new FileSystem domain for the DevTools Protocol.

This CL adds the new FileSystem domain required for
the Origin Private File System in DevTools new feature.

Change-Id: I3e7fe86192df507b7cdf313e819f93a677b2388b
---
M headless/BUILD.gn
M third_party/blink/public/devtools_protocol/browser_protocol.pdl
M third_party/blink/renderer/core/inspector/BUILD.gn
M third_party/blink/renderer/core/inspector/inspector_protocol_config.json
M third_party/blink/renderer/modules/file_system_access/BUILD.gn
M third_party/blink/renderer/modules/file_system_access/DEPS
A third_party/blink/renderer/modules/file_system_access/bucket_file_system_agent.cc
A third_party/blink/renderer/modules/file_system_access/bucket_file_system_agent.h
A third_party/blink/renderer/modules/file_system_access/bucket_file_system_builder.cc
A third_party/blink/renderer/modules/file_system_access/bucket_file_system_builder.h
M third_party/blink/renderer/modules/modules_initializer.cc
11 files changed, 860 insertions(+), 3 deletions(-)


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

Gerrit-MessageType: newchange
Gerrit-Project: chromium/src
Gerrit-Branch: main
Gerrit-Change-Id: I3e7fe86192df507b7cdf313e819f93a677b2388b
Gerrit-Change-Number: 4860661
Gerrit-PatchSet: 3
Gerrit-Owner: Etienne Noël <etien...@chromium.org>
Gerrit-Reviewer: Andrey Kosyakov <ca...@chromium.org>
Gerrit-Reviewer: Ayu Ishii <ay...@chromium.org>
Gerrit-Reviewer: Danil Somsikov <d...@chromium.org>
Gerrit-Reviewer: Etienne Noël <etien...@chromium.org>
Gerrit-Attention: Ayu Ishii <ay...@chromium.org>

Etienne Noël (Gerrit)

unread,
Oct 16, 2023, 6:21:37 PM10/16/23
to blink-re...@chromium.org, blink-...@chromium.org, devtools-re...@chromium.org, headless...@chromium.org, Ayu Ishii, Tricium, Danil Somsikov, Andrey Kosyakov, Chromium LUCI CQ, chromium...@chromium.org, devtools...@chromium.org

Attention is currently required from: Andrey Kosyakov, Ayu Ishii, Danil Somsikov.

View Change

4 comments:

  • Patchset:

    • Patch Set #3:

      I've fixed the comments, but this is still WIP. I've decided to reduce the number of methods in the `browser_protocol.pdl` for now and will iterate over time after this one is merged or else this CL will become monstrous.

      I have implemented the Agent with the `getDirectory` method and have handled the errors.

      I have tested locally but I am not ready to commit or open a CL on the JS side yet.

      Questions for reviewers:

      • I'm managing one instance of a class manually since I'm iterating over an AsyncPromiseIterator, it needs to survive. I haven't found a better way to do this, but maybe you will
      • Are agent classes tested somewhere other than in the JS code?
      • I am using crdtp::DispatchResponse to pass along success or errors but I'm getting a warning. Looking at the intent of the classes, I still think that coupling it to this class makes a lot of sense since in the end, that is what we will be returning and this Agent class will only be used for DevTools.
  • File third_party/blink/public/devtools_protocol/browser_protocol.pdl:

    • Done

    • Yes.

  • File third_party/blink/renderer/core/inspector/inspector_protocol_config.json:

    • Done

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

Gerrit-MessageType: comment
Gerrit-Project: chromium/src
Gerrit-Branch: main
Gerrit-Change-Id: I3e7fe86192df507b7cdf313e819f93a677b2388b
Gerrit-Change-Number: 4860661
Gerrit-PatchSet: 3
Gerrit-Owner: Etienne Noël <etien...@chromium.org>
Gerrit-Reviewer: Andrey Kosyakov <ca...@chromium.org>
Gerrit-Reviewer: Ayu Ishii <ay...@chromium.org>
Gerrit-Reviewer: Danil Somsikov <d...@chromium.org>
Gerrit-Reviewer: Etienne Noël <etien...@chromium.org>
Gerrit-Attention: Ayu Ishii <ay...@chromium.org>
Gerrit-Attention: Danil Somsikov <d...@chromium.org>
Gerrit-Attention: Andrey Kosyakov <ca...@chromium.org>
Gerrit-Comment-Date: Mon, 16 Oct 2023 22:21:27 +0000

Etienne Noël (Gerrit)

unread,
Oct 16, 2023, 6:21:49 PM10/16/23
to blink-re...@chromium.org, blink-...@chromium.org, devtools-re...@chromium.org, headless...@chromium.org, Ayu Ishii, Tricium, Danil Somsikov, Andrey Kosyakov, Chromium LUCI CQ, chromium...@chromium.org, devtools...@chromium.org

Attention is currently required from: Andrey Kosyakov, Ayu Ishii, Danil Somsikov.

View Change

1 comment:

    • Is this the same as `pathComponents` above?

    • Done

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

Gerrit-MessageType: comment
Gerrit-Project: chromium/src
Gerrit-Branch: main
Gerrit-Change-Id: I3e7fe86192df507b7cdf313e819f93a677b2388b
Gerrit-Change-Number: 4860661
Gerrit-PatchSet: 3
Gerrit-Owner: Etienne Noël <etien...@chromium.org>
Gerrit-Reviewer: Andrey Kosyakov <ca...@chromium.org>
Gerrit-Reviewer: Ayu Ishii <ay...@chromium.org>
Gerrit-Reviewer: Danil Somsikov <d...@chromium.org>
Gerrit-Reviewer: Etienne Noël <etien...@chromium.org>
Gerrit-Attention: Ayu Ishii <ay...@chromium.org>
Gerrit-Attention: Danil Somsikov <d...@chromium.org>
Gerrit-Attention: Andrey Kosyakov <ca...@chromium.org>
Gerrit-Comment-Date: Mon, 16 Oct 2023 22:21:40 +0000

Etienne Noël (Gerrit)

unread,
Oct 16, 2023, 6:45:27 PM10/16/23
to blink-re...@chromium.org, blink-...@chromium.org, devtools-re...@chromium.org, headless...@chromium.org

Attention is currently required from: Andrey Kosyakov, Ayu Ishii, Danil Somsikov.

Etienne Noël uploaded patch set #4 to this change.

View Change

Add the new FileSystem domain for the DevTools Protocol.

This CL adds the new FileSystem domain required for
the Origin Private File System in DevTools new feature.

Change-Id: I3e7fe86192df507b7cdf313e819f93a677b2388b
---
M headless/BUILD.gn
M third_party/blink/public/devtools_protocol/browser_protocol.pdl
M third_party/blink/renderer/core/inspector/BUILD.gn
M third_party/blink/renderer/core/inspector/inspector_protocol_config.json
M third_party/blink/renderer/modules/file_system_access/BUILD.gn
M third_party/blink/renderer/modules/file_system_access/DEPS
A third_party/blink/renderer/modules/file_system_access/bucket_file_system_agent.cc
A third_party/blink/renderer/modules/file_system_access/bucket_file_system_agent.h
A third_party/blink/renderer/modules/file_system_access/bucket_file_system_builder.cc
A third_party/blink/renderer/modules/file_system_access/bucket_file_system_builder.h
M third_party/blink/renderer/modules/modules_initializer.cc
11 files changed, 860 insertions(+), 3 deletions(-)

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

Gerrit-MessageType: newpatchset
Gerrit-Project: chromium/src
Gerrit-Branch: main
Gerrit-Change-Id: I3e7fe86192df507b7cdf313e819f93a677b2388b
Gerrit-Change-Number: 4860661
Gerrit-PatchSet: 4

Etienne Noël (Gerrit)

unread,
Oct 18, 2023, 11:15:03 AM10/18/23
to blink-re...@chromium.org, blink-...@chromium.org, devtools-re...@chromium.org, headless...@chromium.org

Attention is currently required from: Andrey Kosyakov, Ayu Ishii, Danil Somsikov, Etienne Noël.

Etienne Noël uploaded patch set #5 to this change.

View Change

Add the new FileSystem domain for the DevTools Protocol.

This CL adds the new FileSystem domain required for
the Origin Private File System in DevTools new feature.

Change-Id: I3e7fe86192df507b7cdf313e819f93a677b2388b
---
M headless/BUILD.gn
M third_party/blink/public/devtools_protocol/browser_protocol.pdl
M third_party/blink/renderer/core/inspector/BUILD.gn
M third_party/blink/renderer/core/inspector/inspector_protocol_config.json
M third_party/blink/renderer/modules/file_system_access/BUILD.gn
M third_party/blink/renderer/modules/file_system_access/DEPS
A third_party/blink/renderer/modules/file_system_access/bucket_file_system_agent.cc
A third_party/blink/renderer/modules/file_system_access/bucket_file_system_agent.h
A third_party/blink/renderer/modules/file_system_access/bucket_file_system_builder.cc
A third_party/blink/renderer/modules/file_system_access/bucket_file_system_builder.h
M third_party/blink/renderer/modules/modules_initializer.cc
11 files changed, 861 insertions(+), 3 deletions(-)

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

Gerrit-MessageType: newpatchset
Gerrit-Project: chromium/src
Gerrit-Branch: main
Gerrit-Change-Id: I3e7fe86192df507b7cdf313e819f93a677b2388b
Gerrit-Change-Number: 4860661
Gerrit-PatchSet: 5
Gerrit-Owner: Etienne Noël <etien...@chromium.org>
Gerrit-Reviewer: Andrey Kosyakov <ca...@chromium.org>
Gerrit-Reviewer: Ayu Ishii <ay...@chromium.org>
Gerrit-Reviewer: Danil Somsikov <d...@chromium.org>
Gerrit-Reviewer: Etienne Noël <etien...@chromium.org>
Gerrit-Attention: Ayu Ishii <ay...@chromium.org>
Gerrit-Attention: Danil Somsikov <d...@chromium.org>
Gerrit-Attention: Andrey Kosyakov <ca...@chromium.org>
Gerrit-Attention: Etienne Noël <etien...@chromium.org>

Ayu Ishii (Gerrit)

unread,
Oct 18, 2023, 7:03:27 PM10/18/23
to Etienne Noël, blink-re...@chromium.org, blink-...@chromium.org, devtools-re...@chromium.org, headless...@chromium.org, Tricium, Danil Somsikov, Andrey Kosyakov, Chromium LUCI CQ, chromium...@chromium.org, devtools...@chromium.org

Attention is currently required from: Andrey Kosyakov, Danil Somsikov, Etienne Noël.

View Change

5 comments:

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

Gerrit-MessageType: comment
Gerrit-Project: chromium/src
Gerrit-Branch: main
Gerrit-Change-Id: I3e7fe86192df507b7cdf313e819f93a677b2388b
Gerrit-Change-Number: 4860661
Gerrit-PatchSet: 5
Gerrit-Owner: Etienne Noël <etien...@chromium.org>
Gerrit-Reviewer: Andrey Kosyakov <ca...@chromium.org>
Gerrit-Reviewer: Ayu Ishii <ay...@chromium.org>
Gerrit-Reviewer: Danil Somsikov <d...@chromium.org>
Gerrit-Reviewer: Etienne Noël <etien...@chromium.org>
Gerrit-Attention: Danil Somsikov <d...@chromium.org>
Gerrit-Attention: Andrey Kosyakov <ca...@chromium.org>
Gerrit-Attention: Etienne Noël <etien...@chromium.org>
Gerrit-Comment-Date: Wed, 18 Oct 2023 23:03:20 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No

Andrey Kosyakov (Gerrit)

unread,
Oct 20, 2023, 3:50:56 PM10/20/23
to Etienne Noël, blink-re...@chromium.org, blink-...@chromium.org, devtools-re...@chromium.org, headless...@chromium.org, Ayu Ishii, Tricium, Danil Somsikov, Chromium LUCI CQ, chromium...@chromium.org, devtools...@chromium.org

Attention is currently required from: Ayu Ishii, Danil Somsikov, Etienne Noël.

View Change

1 comment:

  • File third_party/blink/renderer/modules/file_system_access/bucket_file_system_agent.cc:

    • Looks like having to deal with these promises are creating a lot of complexity. […]

      My understanding is that this is goes through a thin proxy and ends up being a mojo request to the browser? Why do we implement the agent in the renderer in the first place? Is there any renderer-specific state that it uses? Can we do it in the browser right away? See content/browser/devtools/protocol/storage_handler.cc for an example.

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

Gerrit-MessageType: comment
Gerrit-Project: chromium/src
Gerrit-Branch: main
Gerrit-Change-Id: I3e7fe86192df507b7cdf313e819f93a677b2388b
Gerrit-Change-Number: 4860661
Gerrit-PatchSet: 5
Gerrit-Owner: Etienne Noël <etien...@chromium.org>
Gerrit-Reviewer: Andrey Kosyakov <ca...@chromium.org>
Gerrit-Reviewer: Ayu Ishii <ay...@chromium.org>
Gerrit-Reviewer: Danil Somsikov <d...@chromium.org>
Gerrit-Reviewer: Etienne Noël <etien...@chromium.org>
Gerrit-Attention: Ayu Ishii <ay...@chromium.org>
Gerrit-Attention: Danil Somsikov <d...@chromium.org>
Gerrit-Attention: Etienne Noël <etien...@chromium.org>
Gerrit-Comment-Date: Fri, 20 Oct 2023 19:50:48 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
Comment-In-Reply-To: Ayu Ishii <ay...@chromium.org>

Etienne Noël (Gerrit)

unread,
Oct 24, 2023, 5:25:39 PM10/24/23
to blink-re...@chromium.org, blink-...@chromium.org, devtools-re...@chromium.org, headless...@chromium.org, Code Review Nudger, Ayu Ishii, Tricium, Danil Somsikov, Andrey Kosyakov, Chromium LUCI CQ, chromium...@chromium.org, devtools...@chromium.org

Attention is currently required from: Andrey Kosyakov, Ayu Ishii, Danil Somsikov.

View Change

1 comment:

  • File third_party/blink/renderer/modules/file_system_access/bucket_file_system_agent.cc:

    • My understanding is that this is goes through a thin proxy and ends up being a mojo request to the b […]

      The main issue I would have with doing it in the Browser is that a lot of logic (security and business logic) would have to be reimplemented. There were a lot of discussions with security regarding what can be passed through a mojo call and they didn't want a full path to be passable for example. I have put together a new CL that avoids using promises and directly uses the mojo endpoints. It is obviously still complicated but I think it's a step in the right direction (https://chromium-review.googlesource.com/c/chromium/src/+/4970306)

      It's still in draft so that's why I haven't tagged anyone other than Ayu yet, but feel free to take a look nonetheless.

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

Gerrit-MessageType: comment
Gerrit-Project: chromium/src
Gerrit-Branch: main
Gerrit-Change-Id: I3e7fe86192df507b7cdf313e819f93a677b2388b
Gerrit-Change-Number: 4860661
Gerrit-PatchSet: 5
Gerrit-Owner: Etienne Noël <etien...@chromium.org>
Gerrit-Reviewer: Andrey Kosyakov <ca...@chromium.org>
Gerrit-Reviewer: Ayu Ishii <ay...@chromium.org>
Gerrit-Reviewer: Danil Somsikov <d...@chromium.org>
Gerrit-Reviewer: Etienne Noël <etien...@chromium.org>
Gerrit-CC: Code Review Nudger <android-build...@prod.google.com>
Gerrit-Attention: Ayu Ishii <ay...@chromium.org>
Gerrit-Attention: Danil Somsikov <d...@chromium.org>
Gerrit-Attention: Andrey Kosyakov <ca...@chromium.org>
Gerrit-Comment-Date: Tue, 24 Oct 2023 21:25:30 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
Comment-In-Reply-To: Ayu Ishii <ay...@chromium.org>
Comment-In-Reply-To: Andrey Kosyakov <ca...@chromium.org>

Etienne Noël (Gerrit)

unread,
Oct 25, 2023, 12:03:03 PM10/25/23
to blink-re...@chromium.org, blink-...@chromium.org, devtools-re...@chromium.org, headless...@chromium.org

Attention is currently required from: Etienne Noël.

Etienne Noël uploaded patch set #2 to this change.

View Change

Add the new FileSystem domain for the DevTools Protocol.

This CL adds the new FileSystem domain required for
the Origin Private File System in DevTools new feature.

Design doc: https://docs.google.com/document/d/1NLIVz0viaXbX_OrbmjY42ph1IcZmLJfkTBYlma0ZuLk/edit

Bug:1258806
Change-Id: Ia4a512e4c1d0b1cb44be785598df082b9aef5865

---
M headless/BUILD.gn
M third_party/blink/public/devtools_protocol/browser_protocol.pdl
M third_party/blink/renderer/core/inspector/BUILD.gn
M third_party/blink/renderer/core/inspector/inspector_protocol_config.json
M third_party/blink/renderer/modules/buckets/storage_bucket.cc
M third_party/blink/renderer/modules/buckets/storage_bucket.h

M third_party/blink/renderer/modules/file_system_access/BUILD.gn
M third_party/blink/renderer/modules/file_system_access/DEPS
A third_party/blink/renderer/modules/file_system_access/bucket_file_system_agent.cc
A third_party/blink/renderer/modules/file_system_access/bucket_file_system_agent.h
A third_party/blink/renderer/modules/file_system_access/bucket_file_system_builder.cc
A third_party/blink/renderer/modules/file_system_access/bucket_file_system_builder.h
M third_party/blink/renderer/modules/file_system_access/storage_manager_file_system_access.cc
M third_party/blink/renderer/modules/file_system_access/storage_manager_file_system_access.h
M third_party/blink/renderer/modules/modules_initializer.cc
15 files changed, 778 insertions(+), 28 deletions(-)

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

Gerrit-MessageType: newpatchset
Gerrit-Project: chromium/src
Gerrit-Branch: main
Gerrit-Change-Id: Ia4a512e4c1d0b1cb44be785598df082b9aef5865
Gerrit-Change-Number: 4970306
Gerrit-PatchSet: 2
Gerrit-Owner: Etienne Noël <etien...@chromium.org>
Gerrit-Reviewer: Etienne Noël <etien...@chromium.org>
Gerrit-Attention: Etienne Noël <etien...@chromium.org>

Etienne Noël (Gerrit)

unread,
Oct 25, 2023, 8:49:16 PM10/25/23
to blink-re...@chromium.org, blink-...@chromium.org, devtools-re...@chromium.org, headless...@chromium.org

Etienne Noël uploaded patch set #3 to this change.

View Change

Add the new FileSystem domain for the DevTools Protocol.

This CL adds the new FileSystem domain required for
the Origin Private File System in DevTools new feature.

Design doc: https://docs.google.com/document/d/1NLIVz0viaXbX_OrbmjY42ph1IcZmLJfkTBYlma0ZuLk/edit

Bug:1258806
Change-Id: Ia4a512e4c1d0b1cb44be785598df082b9aef5865
---
M headless/BUILD.gn
M third_party/blink/public/devtools_protocol/browser_protocol.pdl
M third_party/blink/renderer/core/inspector/BUILD.gn
M third_party/blink/renderer/core/inspector/inspector_protocol_config.json
M third_party/blink/renderer/modules/buckets/storage_bucket.cc
M third_party/blink/renderer/modules/buckets/storage_bucket.h
M third_party/blink/renderer/modules/file_system_access/BUILD.gn
M third_party/blink/renderer/modules/file_system_access/DEPS
A third_party/blink/renderer/modules/file_system_access/bucket_file_system_agent.cc
A third_party/blink/renderer/modules/file_system_access/bucket_file_system_agent.h
A third_party/blink/renderer/modules/file_system_access/bucket_file_system_builder.cc
A third_party/blink/renderer/modules/file_system_access/bucket_file_system_builder.h
M third_party/blink/renderer/modules/file_system_access/storage_manager_file_system_access.cc
M third_party/blink/renderer/modules/file_system_access/storage_manager_file_system_access.h
M third_party/blink/renderer/modules/modules_initializer.cc
15 files changed, 829 insertions(+), 28 deletions(-)

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

Gerrit-MessageType: newpatchset
Gerrit-Project: chromium/src
Gerrit-Branch: main
Gerrit-Change-Id: Ia4a512e4c1d0b1cb44be785598df082b9aef5865
Gerrit-Change-Number: 4970306
Gerrit-PatchSet: 3

Etienne Noël (Gerrit)

unread,
Oct 30, 2023, 7:06:17 PM10/30/23
to blink-re...@chromium.org, blink-...@chromium.org, devtools-re...@chromium.org, headless...@chromium.org

Etienne Noël uploaded patch set #4 to this change.

View Change

Add the new FileSystem domain for the DevTools Protocol.

This CL adds the new FileSystem domain required for
the Origin Private File System in DevTools new feature.

Design doc: https://docs.google.com/document/d/1NLIVz0viaXbX_OrbmjY42ph1IcZmLJfkTBYlma0ZuLk/edit

Bug:1258806
Change-Id: Ia4a512e4c1d0b1cb44be785598df082b9aef5865
---
M headless/BUILD.gn
M third_party/blink/public/devtools_protocol/browser_protocol.pdl
M third_party/blink/renderer/core/inspector/BUILD.gn
M third_party/blink/renderer/core/inspector/inspector_protocol_config.json
M third_party/blink/renderer/modules/buckets/storage_bucket.cc
M third_party/blink/renderer/modules/buckets/storage_bucket.h
M third_party/blink/renderer/modules/file_system_access/BUILD.gn
M third_party/blink/renderer/modules/file_system_access/DEPS
A third_party/blink/renderer/modules/file_system_access/bucket_file_system_agent.cc
A third_party/blink/renderer/modules/file_system_access/bucket_file_system_agent.h
A third_party/blink/renderer/modules/file_system_access/bucket_file_system_builder.cc
A third_party/blink/renderer/modules/file_system_access/bucket_file_system_builder.h
M third_party/blink/renderer/modules/file_system_access/storage_manager_file_system_access.cc
M third_party/blink/renderer/modules/file_system_access/storage_manager_file_system_access.h
M third_party/blink/renderer/modules/modules_initializer.cc
15 files changed, 831 insertions(+), 28 deletions(-)

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

Gerrit-MessageType: newpatchset
Gerrit-Project: chromium/src
Gerrit-Branch: main
Gerrit-Change-Id: Ia4a512e4c1d0b1cb44be785598df082b9aef5865
Gerrit-Change-Number: 4970306
Gerrit-PatchSet: 4

Ayu Ishii (Gerrit)

unread,
Oct 31, 2023, 7:29:05 PM10/31/23
to Etienne Noël, blink-re...@chromium.org, blink-...@chromium.org, devtools-re...@chromium.org, headless...@chromium.org, Chromium LUCI CQ, Tricium, chromium...@chromium.org, devtools...@chromium.org

Attention is currently required from: Etienne Noël.

View Change

18 comments:

  • Patchset:

    • Patch Set #4:

      Sorry for the delay, here are some comments from a partial review.

  • File third_party/blink/renderer/modules/file_system_access/bucket_file_system_agent.h:

    • Patch Set #4, Line 49:

       // This method implements the protocol::FileSystem::Metainfo which directly
      // receives and returns the response to DevTools. The response to the promise
      // is provided through the callback parameter.
      // It takes in a BucketFileSystemLocator which specifies a storage key, a
      // storage bucket and a path component array (it can receive a nested path (in
      // the case of a refresh action)). It's an array where each element is a
      // nested directory level.
      // This method gets the Root handle of the OPFS (for a
      // specific storage key and bucket), finds the specified path by iterating
      // from the root and then recursively iterates inside the specified directory
      // to retrieve its nested files and directories.

      I think some of specific implementation details can be removed. Generally what I'm looking for here are things that simply answer, "what does it do?" "when should I call this?" type details. Especially since this `getDirectory` method (while it has the same name) works differently from the actual API itself. What do you think about something like...

      ```
      This method is called by DevTools to find the specified path within the OPFS
      given a `BucketFileSystemLocator`, and retrieve all nested files and directories
      to build the complete directory tree, which is then returned to the callback.
      ```

  • File third_party/blink/renderer/modules/file_system_access/bucket_file_system_agent.cc:

  • File third_party/blink/renderer/modules/file_system_access/bucket_file_system_agent.cc:

    • Patch Set #4, Line 93:

       If there are still path_components in the array, it means we haven't yet
      // reached the requested directory and must continue to recursively retrieve
      // the handle for it.

      It does stink to have to go the browser process every time just to ignore irrelevant paths. Have we considered creating a special mojo method just for DevTools so we don't have to do this?

    • Patch Set #4, Line 142: BucketFileSystemBuilder

      Can you add back the comment about lifecycle? I think that was useful here.

    • Patch Set #4, Line 173: path_components

      Curious when this might be called with a path? Seems like we build the entire directory tree anyway. Or is it used to refresh parts of the directory tree when files are created?

  • File third_party/blink/renderer/modules/file_system_access/bucket_file_system_builder.h:

    • Patch Set #4, Line 58: BuildDirectory

      What about `BuildDirectoryTree`?

    • Patch Set #4, Line 67: BuildFile

      Curious if you think this needs to be a `static` method or anticipate this needing to be called like `BuildDirectory`? It seems like all the files will be created already with `BuildDirectory`.

    • Patch Set #4, Line 69: Better to call `BuildDirectory` than to manually instantiate.

      Should this be private?

    • Patch Set #4, Line 75:

        // Implements the FileSystemAccessDirectoryEntriesListener::DidReadDirectory
      // method.

      Typically methods overridden are specified by adding the class above the methods.
      `// mojom::blink::FileSystemAccessDirectoryEntriesListener`

  • File third_party/blink/renderer/modules/file_system_access/bucket_file_system_builder.h:

  • File third_party/blink/renderer/modules/file_system_access/bucket_file_system_builder.h:

  • File third_party/blink/renderer/modules/file_system_access/bucket_file_system_builder.cc:

    • Patch Set #1, Line 1: #include "third_party/blink/renderer/modules/file_system_access/bucket_file_system_builder.h"

      Copyright above

  • File third_party/blink/renderer/modules/file_system_access/bucket_file_system_builder.cc:

    • Patch Set #4, Line 119: iterator_callback

      How about `barrier_callback`? It helps to know that this the callback that needs to run to eventually trigger the `completion_callback_`

    • Patch Set #4, Line 135: BuildDirectory

      Do you think we can do this without recursion? Recursion is often hard to follow and can lead to scary bugs.

    • Patch Set #4, Line 159: callback

      Maybe `barrier_callback` to differentiate from other callbacks? Also this should be `base::OnceClosure` as I think this should be running multiple times once it arrives here.

    • Patch Set #4, Line 182: base::RepeatingClosure callback

      Ditto `base::OnceClosure barrier_callback`

    • Patch Set #4, Line 204: DidIterateDirectory

      How about something like `DidCompleteBuildDirectory`? To make it more obvious that this is the final step.

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

Gerrit-MessageType: comment
Gerrit-Project: chromium/src
Gerrit-Branch: main
Gerrit-Change-Id: Ia4a512e4c1d0b1cb44be785598df082b9aef5865
Gerrit-Change-Number: 4970306
Gerrit-PatchSet: 4
Gerrit-Owner: Etienne Noël <etien...@chromium.org>
Gerrit-Reviewer: Ayu Ishii <ay...@chromium.org>
Gerrit-Reviewer: Etienne Noël <etien...@chromium.org>
Gerrit-Attention: Etienne Noël <etien...@chromium.org>
Gerrit-Comment-Date: Tue, 31 Oct 2023 23:28:56 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No

Etienne Noël (Gerrit)

unread,
Nov 2, 2023, 9:47:58 AM11/2/23
to blink-re...@chromium.org, blink-...@chromium.org, devtools-re...@chromium.org, headless...@chromium.org

Attention is currently required from: Etienne Noël.

Etienne Noël uploaded patch set #5 to this change.

View Change

Add the new FileSystem domain for the DevTools Protocol.

This CL adds the new FileSystem domain required for
the Origin Private File System in DevTools new feature.

Design doc: https://docs.google.com/document/d/1NLIVz0viaXbX_OrbmjY42ph1IcZmLJfkTBYlma0ZuLk/edit

Bug:1258806
Change-Id: Ia4a512e4c1d0b1cb44be785598df082b9aef5865
---
M headless/BUILD.gn
M third_party/blink/public/devtools_protocol/browser_protocol.pdl
M third_party/blink/renderer/core/inspector/BUILD.gn
M third_party/blink/renderer/core/inspector/inspector_protocol_config.json
M third_party/blink/renderer/modules/buckets/storage_bucket.cc
M third_party/blink/renderer/modules/buckets/storage_bucket.h
M third_party/blink/renderer/modules/file_system_access/BUILD.gn
M third_party/blink/renderer/modules/file_system_access/DEPS
A third_party/blink/renderer/modules/file_system_access/bucket_file_system_agent.cc
A third_party/blink/renderer/modules/file_system_access/bucket_file_system_agent.h
A third_party/blink/renderer/modules/file_system_access/bucket_file_system_builder.cc
A third_party/blink/renderer/modules/file_system_access/bucket_file_system_builder.h
M third_party/blink/renderer/modules/file_system_access/storage_manager_file_system_access.cc
M third_party/blink/renderer/modules/file_system_access/storage_manager_file_system_access.h
M third_party/blink/renderer/modules/modules_initializer.cc
15 files changed, 828 insertions(+), 28 deletions(-)

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

Gerrit-MessageType: newpatchset
Gerrit-Project: chromium/src
Gerrit-Branch: main
Gerrit-Change-Id: Ia4a512e4c1d0b1cb44be785598df082b9aef5865
Gerrit-Change-Number: 4970306
Gerrit-PatchSet: 5

Etienne Noël (Gerrit)

unread,
Nov 2, 2023, 9:48:40 AM11/2/23
to blink-re...@chromium.org, blink-...@chromium.org, devtools-re...@chromium.org, headless...@chromium.org, Ayu Ishii, Chromium LUCI CQ, Tricium, chromium...@chromium.org, devtools...@chromium.org

Attention is currently required from: Ayu Ishii.

View Change

16 comments:

  • File third_party/blink/renderer/modules/file_system_access/bucket_file_system_agent.h:

    • Patch Set #4, Line 49:

       // This method implements the protocol::FileSystem::Metainfo which directly
      // receives and returns the response to DevTools. The response to the promise
      // is provided through the callback parameter.
      // It takes in a BucketFileSystemLocator which specifies a storage key, a
      // storage bucket and a path component array (it can receive a nested path (in
      // the case of a refresh action)). It's an array where each element is a
      // nested directory level.
      // This method gets the Root handle of the OPFS (for a
      // specific storage key and bucket), finds the specified path by iterating
      // from the root and then recursively iterates inside the specified directory
      // to retrieve its nested files and directories.

    • I think some of specific implementation details can be removed. […]

      Done

  • File third_party/blink/renderer/modules/file_system_access/bucket_file_system_agent.cc:

    • Done

  • File third_party/blink/renderer/modules/file_system_access/bucket_file_system_agent.cc:

    • Can you add back the comment about lifecycle? I think that was useful here.

    • With this refactor, the instantiation of the BucketFileSystemBuilder is hidden to anyone else calling it. Is it useful to still mention that the BuildDirectory instantiates the Builder using `MakeGarbageCollected`?

    • Curious when this might be called with a path? Seems like we build the entire directory tree anyway. […]

      Yes, it's used to refresh parts of the directory tree. Eventually, this method will support a parameter that specifies how many nesting levels should be returned to avoid building the entire tree.

  • File third_party/blink/renderer/modules/file_system_access/bucket_file_system_builder.h:

    • Done

    • Curious if you think this needs to be a `static` method or anticipate this needing to be called like […]

      This will eventually be used to refresh a file so I think it makes sense to leave it as is.

    • I don't think I can make it private since it's the `std::make_unique` library that is invoking the constructor in the `BuildDirectoryTree` method.

    • Patch Set #4, Line 75:

        // Implements the FileSystemAccessDirectoryEntriesListener::DidReadDirectory
      // method.

    • Typically methods overridden are specified by adding the class above the methods. […]

      Done

  • File third_party/blink/renderer/modules/file_system_access/bucket_file_system_builder.h:

    • Done

  • File third_party/blink/renderer/modules/file_system_access/bucket_file_system_builder.h:

    • Done

  • File third_party/blink/renderer/modules/file_system_access/bucket_file_system_builder.cc:

    • Patch Set #1, Line 1: #include "third_party/blink/renderer/modules/file_system_access/bucket_file_system_builder.h"

      Copyright above

    • Done

  • File third_party/blink/renderer/modules/file_system_access/bucket_file_system_builder.cc:

    • How about `barrier_callback`? It helps to know that this the callback that needs to run to eventuall […]

      Done

    • Patch Set #4, Line 133: recurisvely

      "recurisvely" is a possible misspelling of "recursively".

      Please fix.

    • Maybe `barrier_callback` to differentiate from other callbacks? Also this should be `base::OnceClosu […]

      Done

    • Done

    • How about something like `DidCompleteBuildDirectory`? To make it more obvious that this is the final […]

      Done

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

Gerrit-MessageType: comment
Gerrit-Project: chromium/src
Gerrit-Branch: main
Gerrit-Change-Id: Ia4a512e4c1d0b1cb44be785598df082b9aef5865
Gerrit-Change-Number: 4970306
Gerrit-PatchSet: 5
Gerrit-Owner: Etienne Noël <etien...@chromium.org>
Gerrit-Reviewer: Ayu Ishii <ay...@chromium.org>
Gerrit-Reviewer: Etienne Noël <etien...@chromium.org>
Gerrit-Attention: Ayu Ishii <ay...@chromium.org>
Gerrit-Comment-Date: Thu, 02 Nov 2023 13:48:32 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
Comment-In-Reply-To: Ayu Ishii <ay...@chromium.org>

Andrey Kosyakov (Gerrit)

unread,
Nov 6, 2023, 5:31:45 PM11/6/23
to Etienne Noël, blink-re...@chromium.org, blink-...@chromium.org, devtools-re...@chromium.org, headless...@chromium.org, Code Review Nudger, Ayu Ishii, Tricium, Danil Somsikov, Chromium LUCI CQ, chromium...@chromium.org, devtools...@chromium.org

Attention is currently required from: Ayu Ishii, Danil Somsikov, Etienne Noël.

View Change

1 comment:

  • File third_party/blink/renderer/modules/file_system_access/bucket_file_system_agent.cc:

    • The main issue I would have with doing it in the Browser is that a lot of logic (security and busine […]

      As for the security requirements, the CDP client is considered trusted and can already do a lot, at least within given browser context (e.g. navigate to any origin, then evaluate things in page), so in terms of security, it's a bit more relaxed compared to the page-side view. And anyway, I would expect all those checks to be on the browser side anyway, is that not so?

      As for the business logic, I didn't see much in the renderer, it appeared that it goes more or less straight to the mojo call to browser, am I missing something?

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

Gerrit-MessageType: comment
Gerrit-Project: chromium/src
Gerrit-Branch: main
Gerrit-Change-Id: I3e7fe86192df507b7cdf313e819f93a677b2388b
Gerrit-Change-Number: 4860661
Gerrit-PatchSet: 5
Gerrit-Owner: Etienne Noël <etien...@chromium.org>
Gerrit-Reviewer: Andrey Kosyakov <ca...@chromium.org>
Gerrit-Reviewer: Ayu Ishii <ay...@chromium.org>
Gerrit-Reviewer: Danil Somsikov <d...@chromium.org>
Gerrit-Reviewer: Etienne Noël <etien...@chromium.org>
Gerrit-CC: Code Review Nudger <android-build...@prod.google.com>
Gerrit-Attention: Ayu Ishii <ay...@chromium.org>
Gerrit-Attention: Danil Somsikov <d...@chromium.org>
Gerrit-Attention: Etienne Noël <etien...@chromium.org>
Gerrit-Comment-Date: Mon, 06 Nov 2023 22:31:38 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
Comment-In-Reply-To: Ayu Ishii <ay...@chromium.org>
Comment-In-Reply-To: Andrey Kosyakov <ca...@chromium.org>
Comment-In-Reply-To: Etienne Noël <etien...@chromium.org>

Ayu Ishii (Gerrit)

unread,
Nov 17, 2023, 5:06:03 PM11/17/23
to Etienne Noël, blink-re...@chromium.org, blink-...@chromium.org, devtools-re...@chromium.org, headless...@chromium.org, Code Review Nudger, Chromium LUCI CQ, Tricium, chromium...@chromium.org, devtools...@chromium.org

Attention is currently required from: Etienne Noël.

View Change

38 comments:

  • Patchset:

    • Patch Set #5:

      Sorry for the super delayed review 😞
      Some questions and a lots of stylistic feedback.
      Thanks for the iterations so far!

  • File third_party/blink/renderer/modules/file_system_access/bucket_file_system_agent.h:

    • Patch Set #5, Line 8: #include <unordered_map>

      Separate different include groups by adding a blank line below.

      go/cstyle#Names_and_Order_of_Includes

    • Patch Set #5, Line 71:

      This private method returns the root directory handle of the OPFS for a
      // specific storage key and bucket.

      Some details can be omitted here.
      ```
      This method retrieves the root directory handle for the OPFS.
      ```

  • File third_party/blink/renderer/modules/file_system_access/bucket_file_system_agent.cc:

  • File third_party/blink/renderer/modules/file_system_access/bucket_file_system_builder.h:

    • Patch Set #5, Line 6: #define THIRD_PARTY_BLINK_RENDERER_MODULES_FILE_SYSTEM_ACCESS_BUCKET_FILE_SYSTEM_BUILDER_H_

      Space below.

    • Patch Set #5, Line 7: #include <deque>

      Separate and group includes by includes types.

      go/cstyle#Names_and_Order_of_Includes

    • Patch Set #5, Line 14:

      #include "third_party/blink/renderer/bindings/core/v8/async_iterable.h"
      #include "third_party/blink/renderer/bindings/core/v8/iterable.h"

      Lets clean up some includes we're not using, here and others.

    • Patch Set #5, Line 33: `

      End sentence with period.

    • Patch Set #5, Line 39: e`

      End sentence with period.

    • Patch Set #5, Line 48: FileSystemAccessDirectoryEntriesListener

      I think you can remove this detail, since we can see that right below.

    • Patch Set #5, Line 48:

      This means that for each entry in
      // the directory, the `DidReadDirectory` method is being called.

      This too, the override method comments helps see this.

    • Patch Set #5, Line 69: Better to call

      I think it's better to be decisive here, and say that this should only be called by `BuildDirectoryTree`, if that is how it is intended to be used.

    • Patch Set #5, Line 88: nested_directories

      Surround `nested_directories_` with backticks "`" and add underscore at the end.

    • Patch Set #5, Line 90: DidBuildDirectory

      Maybe something like `DidBuildChildDirectory` or `DidBuildNestedDirectory`?

    • Patch Set #5, Line 102: nested_files and nested_directories

      Use backticks and match variable name `nested_files_` `nested_directories_`.

    • Patch Set #5, Line 106: storage_key_

      const?

    • Patch Set #5, Line 107: String

      const?

    • Patch Set #5, Line 107: name_

      How about something like `directory_name_` or `base_directory_name_`?

  • File third_party/blink/renderer/modules/file_system_access/bucket_file_system_builder.h:

    • Patch Set #4, Line 69: Better to call `BuildDirectory` than to manually instantiate.

      I don't think I can make it private since it's the `std::make_unique` library that is invoking the c […]

      Acknowledged

  • File third_party/blink/renderer/modules/file_system_access/bucket_file_system_builder.cc:

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

Gerrit-MessageType: comment
Gerrit-Project: chromium/src
Gerrit-Branch: main
Gerrit-Change-Id: Ia4a512e4c1d0b1cb44be785598df082b9aef5865
Gerrit-Change-Number: 4970306
Gerrit-PatchSet: 5
Gerrit-Owner: Etienne Noël <etien...@chromium.org>
Gerrit-Reviewer: Ayu Ishii <ay...@chromium.org>
Gerrit-Reviewer: Etienne Noël <etien...@chromium.org>
Gerrit-CC: Code Review Nudger <android-build...@prod.google.com>
Gerrit-Attention: Etienne Noël <etien...@chromium.org>
Gerrit-Comment-Date: Fri, 17 Nov 2023 22:05:52 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
Comment-In-Reply-To: Ayu Ishii <ay...@chromium.org>
Comment-In-Reply-To: Etienne Noël <etien...@chromium.org>

Etienne Noël (Gerrit)

unread,
May 20, 2024, 5:24:43 PMMay 20
to Code Review Nudger, Ayu Ishii, Chromium LUCI CQ, Tricium, chromium...@chromium.org, devtools...@chromium.org, blink-re...@chromium.org, blink-...@chromium.org, devtools-re...@chromium.org, headless...@chromium.org
Attention needed from Ayu Ishii

Etienne Noël added 30 comments

Patchset-level comments
File-level comment, Patchset 8 (Latest):
Etienne Noël . resolved

I know it's been a long while, thank you so much for the thorough review. I've cleared most of the nits, will finish the rest soon.

I will experiment with removing the recursion using a stack and see if that makes sense, then we can decide which approach works best.

File third_party/blink/renderer/modules/file_system_access/bucket_file_system_agent.h
Line 71, Patchset 5: // This private method returns the root directory handle of the OPFS for a

// specific storage key and bucket.
Ayu Ishii . resolved

Some details can be omitted here.
```
This method retrieves the root directory handle for the OPFS.
```

Etienne Noël

Done

Line 8, Patchset 5:#include <unordered_map>
Ayu Ishii . resolved

Separate different include groups by adding a blank line below.

go/cstyle#Names_and_Order_of_Includes

Etienne Noël

Done

File third_party/blink/renderer/modules/file_system_access/bucket_file_system_agent.cc
Line 73, Patchset 5:// The path_components contains the path of the directory that must be build and
Ayu Ishii . resolved

Use backticks "\`" to surround `path_components`. Ditto with comment below.

Etienne Noël

Done

Line 78, Patchset 5: String name,
Ayu Ishii . resolved

Can we update to `directory_name`?

Etienne Noël

Done

Line 126, Patchset 5: // Recursively call this method until path_components becomes
Ayu Ishii . resolved

Surround with backticks.

Etienne Noël

Done

Line 185, Patchset 5: storage_key, root, std::move(path_components),
Ayu Ishii . unresolved

I think we can remove the variable. Maybe just...
`/*directory_name=*/""`

Etienne Noël

It needs to be in a variable to compile.

Line 189, Patchset 5:ScriptState* BucketFileSystemAgent::GetScriptState(String storageKey) {
Ayu Ishii . resolved

`storage_key`, we use snake case instead of camel case for variable names. Ditto for all below.

go/cstyle#Variable_Names

Etienne Noël

Done

Line 189, Patchset 5:ScriptState* BucketFileSystemAgent::GetScriptState(String storageKey) {
Ayu Ishii . resolved

const ref? here and other storage key parameters

Etienne Noël

Done

Line 223, Patchset 5: String storage_key = file_system_locator->getStorageKey();
Ayu Ishii . resolved

const?

Etienne Noël

Done

File third_party/blink/renderer/modules/file_system_access/bucket_file_system_builder.h
Line 107, Patchset 5: String name_;
Ayu Ishii . resolved

How about something like `directory_name_` or `base_directory_name_`?

Etienne Noël

Done

Line 107, Patchset 5: String name_;
Ayu Ishii . resolved

const?

Etienne Noël

Done

Line 102, Patchset 5: // nested_files and nested_directories are fully created. It builds the
Ayu Ishii . resolved

Use backticks and match variable name `nested_files_` `nested_directories_`.

Etienne Noël

Done

Line 88, Patchset 5: // nested_directories encountered. It's passed as a callback to
Ayu Ishii . resolved

Surround `nested_directories_` with backticks "`" and add underscore at the end.

Etienne Noël

Done

Line 69, Patchset 5: // Better to call `BuildDirectoryTree` than to manually instantiate.
Ayu Ishii . resolved

I think it's better to be decisive here, and say that this should only be called by `BuildDirectoryTree`, if that is how it is intended to be used.

Etienne Noël

Done

Line 48, Patchset 5:// FileSystemAccessDirectoryEntriesListener. This means that for each entry in

// the directory, the `DidReadDirectory` method is being called.
Ayu Ishii . resolved

This too, the override method comments helps see this.

Etienne Noël

Done

Line 48, Patchset 5:// FileSystemAccessDirectoryEntriesListener. This means that for each entry in
Ayu Ishii . resolved

I think you can remove this detail, since we can see that right below.

Etienne Noël

Done

Line 39, Patchset 5:// `protocol::FileSystem::Directory` from a `FileSystemDirectoryHandle`
Ayu Ishii . resolved

End sentence with period.

Etienne Noël

Done

Line 33, Patchset 5:// `protocol::FileSystem::File` from a `FileSystemFileHandle`
Ayu Ishii . resolved

End sentence with period.

Etienne Noël

Done

Line 7, Patchset 5:#include <deque>
Ayu Ishii . resolved

Separate and group includes by includes types.

go/cstyle#Names_and_Order_of_Includes

Etienne Noël

Done

Line 6, Patchset 5:#define THIRD_PARTY_BLINK_RENDERER_MODULES_FILE_SYSTEM_ACCESS_BUCKET_FILE_SYSTEM_BUILDER_H_
Ayu Ishii . resolved

Space below.

Etienne Noël

Done

File third_party/blink/renderer/modules/file_system_access/bucket_file_system_builder.cc
Line 6, Patchset 5:#include <memory>
Ayu Ishii . resolved

Separate and group includes by includes types.

go/cstyle#Names_and_Order_of_Includes

Etienne Noël

Done

Line 20, Patchset 5: String storage_key,
String name,
Ayu Ishii . resolved

const?

Etienne Noël

Done

Line 29, Patchset 5: nullptr);
Ayu Ishii . resolved

`/*directory=*/nullptr` for here, and others.

Etienne Noël

Done

Line 46, Patchset 5: // Some need info is only available via the blob. Retrieve it and build the
Ayu Ishii . resolved

`needed`? or remove

Etienne Noël

Done

Line 79, Patchset 5: String storage_key,
String name,
Ayu Ishii . resolved

const?

Etienne Noël

Done

Line 117, Patchset 5: // is more are expected, return and wait for a signal that no more entries
Ayu Ishii . resolved

`if`

Etienne Noël

Done

Line 114, Patchset 5: // This method only starts mapping the entries into

// `protocol::FileSystem::File` and `protocol::FileSystem::Directory` once the
// directory has been iterated over and the entries saved in here. Therefore,
// is more are expected, return and wait for a signal that no more entries
Ayu Ishii . resolved

How about...
```
Wait until all entries are iterated over and saved before converting entries
into `protocol::FileSystem::File` and `protocol::FileSystem::Directory`.
```

Etienne Noël

Done

Line 171, Patchset 5: nullptr);
Ayu Ishii . resolved

`/*directory=*/nullptr` here and others below.

Etienne Noël

Done

Line 212, Patchset 5: ""),
Ayu Ishii . resolved

`/*message=*/""`

Etienne Noël

Done

Open in Gerrit

Related details

Attention is currently required from:
  • Ayu Ishii
Submit Requirements:
  • requirement satisfiedCode-Coverage
  • requirement is not 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: Ia4a512e4c1d0b1cb44be785598df082b9aef5865
Gerrit-Change-Number: 4970306
Gerrit-PatchSet: 8
Gerrit-Owner: Etienne Noël <etien...@chromium.org>
Gerrit-Reviewer: Ayu Ishii <ay...@chromium.org>
Gerrit-Reviewer: Etienne Noël <etien...@chromium.org>
Gerrit-CC: Code Review Nudger <android-build...@prod.google.com>
Gerrit-Attention: Ayu Ishii <ay...@chromium.org>
Gerrit-Comment-Date: Mon, 20 May 2024 21:24:32 +0000
satisfied_requirement
unsatisfied_requirement
open
diffy

Etienne Noël (Gerrit)

unread,
May 20, 2024, 6:53:36 PMMay 20
to Code Review Nudger, Ayu Ishii, Chromium LUCI CQ, Tricium, chromium...@chromium.org, devtools...@chromium.org, blink-re...@chromium.org, blink-...@chromium.org, devtools-re...@chromium.org, headless...@chromium.org
Attention needed from Ayu Ishii

Etienne Noël added 9 comments

File third_party/blink/renderer/modules/file_system_access/bucket_file_system_agent.cc
Line 173, Patchset 4: std::unique_ptr<std::deque<String>> path_components =
Ayu Ishii . resolved

Curious when this might be called with a path? Seems like we build the entire directory tree anyway. Or is it used to refresh parts of the directory tree when files are created?

Etienne Noël

Yes, it's used to refresh parts of the directory tree. Eventually, this method will support a parameter that specifies how many nesting levels should be returned to avoid building the entire tree.

Etienne Noël

Done

Line 225, Patchset 5: auto it = handles_.find(storage_key);
Ayu Ishii . unresolved

I notice this doesn't take into account bucket info. What happens if this is called with the same storage key but different bucket name?

Etienne Noël

Very good point. Since the lifecycle of the `BucketFileSystemAgent` is tied to a DevToolsSession, it's very probable that this list will contain the handles of multiple buckets. I have updated the hash key to be `${storage_key}:${bucket_name}`. If you have a better format for a key, please don't hesitate to tell me!

File third_party/blink/renderer/modules/file_system_access/bucket_file_system_builder.h
Line 106, Patchset 5: String storage_key_;
Ayu Ishii . resolved

const?

Etienne Noël

Done

Line 90, Patchset 5: void DidBuildDirectory(
Ayu Ishii . resolved

Maybe something like `DidBuildChildDirectory` or `DidBuildNestedDirectory`?

Etienne Noël

Great idea, thank you!

Line 14, Patchset 5:#include "third_party/blink/renderer/bindings/core/v8/async_iterable.h"
#include "third_party/blink/renderer/bindings/core/v8/iterable.h"
Ayu Ishii . resolved

Lets clean up some includes we're not using, here and others.

Etienne Noël

Done

Line 67, Patchset 4: static void BuildFile(FileSystemFileHandle* handle, FileCallback callback);
Ayu Ishii . resolved

Curious if you think this needs to be a `static` method or anticipate this needing to be called like `BuildDirectory`? It seems like all the files will be created already with `BuildDirectory`.

Etienne Noël

This will eventually be used to refresh a file so I think it makes sense to leave it as is.

Etienne Noël

Done

File third_party/blink/renderer/modules/file_system_access/bucket_file_system_builder.cc
Line 163, Patchset 5: base::RepeatingClosure barrier_callback,
Ayu Ishii . resolved

`base::OnceClosure` as this should only be called once at this point.

Etienne Noël

Done

Line 166, Patchset 5: if (!result || !directory) {
Ayu Ishii . unresolved

What scenario would you expect `result` to be empty?

Etienne Noël

I don't think the way this code is written that it can receive a null. However, it feels unintuitive for me to assume a `nullptr` will never be passed? Should I still trust that it will never be and not do the check?

Line 186, Patchset 5: base::RepeatingClosure barrier_callback,
Ayu Ishii . resolved

`base::OnceClosure` as this should only be called once at this point.

Etienne Noël

Done

Open in Gerrit

Related details

Attention is currently required from:
  • Ayu Ishii
Submit Requirements:
  • requirement satisfiedCode-Coverage
  • requirement is not 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: Ia4a512e4c1d0b1cb44be785598df082b9aef5865
Gerrit-Change-Number: 4970306
Gerrit-PatchSet: 9
Gerrit-Owner: Etienne Noël <etien...@chromium.org>
Gerrit-Reviewer: Ayu Ishii <ay...@chromium.org>
Gerrit-Reviewer: Etienne Noël <etien...@chromium.org>
Gerrit-CC: Code Review Nudger <android-build...@prod.google.com>
Gerrit-Attention: Ayu Ishii <ay...@chromium.org>
Gerrit-Comment-Date: Mon, 20 May 2024 22:53:25 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
Comment-In-Reply-To: Ayu Ishii <ay...@chromium.org>
Comment-In-Reply-To: Etienne Noël <etien...@chromium.org>
satisfied_requirement
unsatisfied_requirement
open
diffy

Etienne Noël (Gerrit)

unread,
May 20, 2024, 11:15:13 PMMay 20
to Code Review Nudger, Ayu Ishii, Chromium LUCI CQ, Tricium, chromium...@chromium.org, devtools...@chromium.org, blink-re...@chromium.org, blink-...@chromium.org, devtools-re...@chromium.org, headless...@chromium.org
Attention needed from Ayu Ishii

Etienne Noël added 1 comment

File third_party/blink/renderer/modules/file_system_access/bucket_file_system_agent.cc
Line 93, Patchset 4: // If there are still path_components in the array, it means we haven't yet

// reached the requested directory and must continue to recursively retrieve
// the handle for it.
Ayu Ishii . unresolved

It does stink to have to go the browser process every time just to ignore irrelevant paths. Have we considered creating a special mojo method just for DevTools so we don't have to do this?

Etienne Noël

I've tried something here: https://chromium-review.googlesource.com/c/chromium/src/+/5552231

The relevant files:
- This file implements the logic in `FileSystemAccessManagerImpl` to retrieve a nested path on retrieval of the sandbox FileSystem.
- https://chromium-review.googlesource.com/c/chromium/src/+/5552231/4/content/browser/file_system_access/file_system_access_manager_impl.cc
  • In these, a new method to retrieve a nested path is added to the `.mojom` files
    - https://chromium-review.googlesource.com/c/chromium/src/+/5552231/4/third_party/blink/public/mojom/buckets/bucket_manager_host.mojom
- https://chromium-review.googlesource.com/c/chromium/src/+/5552231/4/third_party/blink/public/mojom/file_system_access/file_system_access_manager.mojom

The rest of the files are mainly just making sure everything compiles.

Let me know if you think this is a better way, if it's in line with what you had in mind and if that's better than what I'm doing in this CL.

Gerrit-Comment-Date: Tue, 21 May 2024 03:15:02 +0000
satisfied_requirement
unsatisfied_requirement
open
diffy

Etienne Noël (Gerrit)

unread,
Jun 10, 2024, 1:14:17 PMJun 10
to Code Review Nudger, Ayu Ishii, Chromium LUCI CQ, Tricium, chromium...@chromium.org, devtools...@chromium.org, blink-re...@chromium.org, blink-...@chromium.org, devtools-re...@chromium.org, headless...@chromium.org
Attention needed from Ayu Ishii

Etienne Noël added 6 comments

Patchset-level comments
File-level comment, Patchset 17 (Latest):
Etienne Noël . resolved

@ay...@chromium.org This is ready for a second round of review. I'm missing tests on the `BucketFileSystemBuilder`. Since this will be mainly used for DevTools and never anything else, I wonder if it would be better (read here much easier to do) to cover this class using DevTools tests (testing that the devtools feature actually works).

The issue that I see with unit testing this class, is the complexity around the setup. We need to setup a bucket, OPFS, create nested files and folders to then test that the tree is properly built. This is doable but wonder if it's worth it and wanted to hear your thoughts!

File third_party/blink/renderer/modules/file_system_access/bucket_file_system_agent.cc
Line 93, Patchset 4: // If there are still path_components in the array, it means we haven't yet
// reached the requested directory and must continue to recursively retrieve
// the handle for it.
Ayu Ishii . resolved

It does stink to have to go the browser process every time just to ignore irrelevant paths. Have we considered creating a special mojo method just for DevTools so we don't have to do this?

Etienne Noël

I've tried something here: https://chromium-review.googlesource.com/c/chromium/src/+/5552231

The relevant files:
- This file implements the logic in `FileSystemAccessManagerImpl` to retrieve a nested path on retrieval of the sandbox FileSystem.
- https://chromium-review.googlesource.com/c/chromium/src/+/5552231/4/content/browser/file_system_access/file_system_access_manager_impl.cc
  • In these, a new method to retrieve a nested path is added to the `.mojom` files
    - https://chromium-review.googlesource.com/c/chromium/src/+/5552231/4/third_party/blink/public/mojom/buckets/bucket_manager_host.mojom
- https://chromium-review.googlesource.com/c/chromium/src/+/5552231/4/third_party/blink/public/mojom/file_system_access/file_system_access_manager.mojom

The rest of the files are mainly just making sure everything compiles.

Let me know if you think this is a better way, if it's in line with what you had in mind and if that's better than what I'm doing in this CL.

Etienne Noël

Done, we no longer iterate from the root just to get the requested directory.

Line 142, Patchset 4: BucketFileSystemBuilder::BuildDirectory(
Ayu Ishii . resolved

Can you add back the comment about lifecycle? I think that was useful here.

Etienne Noël

With this refactor, the instantiation of the BucketFileSystemBuilder is hidden to anyone else calling it. Is it useful to still mention that the BuildDirectory instantiates the Builder using `MakeGarbageCollected`?

Etienne Noël

With the latest refactor, this is no longer needed.

Line 185, Patchset 5: storage_key, root, std::move(path_components),
Ayu Ishii . resolved

I think we can remove the variable. Maybe just...
`/*directory_name=*/""`

Etienne Noël

It needs to be in a variable to compile.

Etienne Noël

Done

Line 225, Patchset 5: auto it = handles_.find(storage_key);
Ayu Ishii . resolved

I notice this doesn't take into account bucket info. What happens if this is called with the same storage key but different bucket name?

Etienne Noël

Very good point. Since the lifecycle of the `BucketFileSystemAgent` is tied to a DevToolsSession, it's very probable that this list will contain the handles of multiple buckets. I have updated the hash key to be `${storage_key}:${bucket_name}`. If you have a better format for a key, please don't hesitate to tell me!

Etienne Noël

No longer relevant since we don't cache handles (for now).

File third_party/blink/renderer/modules/file_system_access/bucket_file_system_builder.cc
Line 135, Patchset 4: BucketFileSystemBuilder::BuildDirectory(
Ayu Ishii . unresolved

Do you think we can do this without recursion? Recursion is often hard to follow and can lead to scary bugs.

Etienne Noël

As discussed, I've removed the recursion and am only retrieving one level at a time.

Open in Gerrit

Related details

Attention is currently required from:
  • Ayu Ishii
Submit Requirements:
  • requirement satisfiedCode-Coverage
  • requirement is not 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: Ia4a512e4c1d0b1cb44be785598df082b9aef5865
Gerrit-Change-Number: 4970306
Gerrit-PatchSet: 17
Gerrit-Owner: Etienne Noël <etien...@chromium.org>
Gerrit-Reviewer: Ayu Ishii <ay...@chromium.org>
Gerrit-Reviewer: Etienne Noël <etien...@chromium.org>
Gerrit-CC: Code Review Nudger <android-build...@prod.google.com>
Gerrit-Attention: Ayu Ishii <ay...@chromium.org>
Gerrit-Comment-Date: Mon, 10 Jun 2024 17:14:07 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
Comment-In-Reply-To: Ayu Ishii <ay...@chromium.org>
Comment-In-Reply-To: Etienne Noël <etien...@chromium.org>
satisfied_requirement
unsatisfied_requirement
open
diffy

Ayu Ishii (Gerrit)

unread,
Jun 10, 2024, 7:46:15 PMJun 10
to Etienne Noël, Code Review Nudger, Chromium LUCI CQ, Tricium, chromium...@chromium.org, devtools...@chromium.org, blink-re...@chromium.org, blink-...@chromium.org, devtools-re...@chromium.org, headless...@chromium.org
Attention needed from Etienne Noël

Ayu Ishii added 18 comments

Patchset-level comments
Ayu Ishii . resolved

Thanks for the updates, this looks great! Mostly minor comments, and suggestion on testing. Let me know if you have any question!

Etienne Noël . unresolved

@ay...@chromium.org This is ready for a second round of review. I'm missing tests on the `BucketFileSystemBuilder`. Since this will be mainly used for DevTools and never anything else, I wonder if it would be better (read here much easier to do) to cover this class using DevTools tests (testing that the devtools feature actually works).

The issue that I see with unit testing this class, is the complexity around the setup. We need to setup a bucket, OPFS, create nested files and folders to then test that the tree is properly built. This is doable but wonder if it's worth it and wanted to hear your thoughts!

Ayu Ishii

Looks like folks typically write web_tests for inspector agent changes. I presume you can use the js APIs to setup which hopefully would be easier, but I haven't looked into this deeply. WDYT?

https://crsrc.org/c/third_party/blink/web_tests/http/tests/inspector-protocol/

File third_party/blink/public/devtools_protocol/browser_protocol.pdl
Line 4571, Patchset 17 (Latest): # Files that are directly nested under this directory
Ayu Ishii . unresolved

nit: Terminate with period. Ditto for other comments that are sentences.

go/cstyle#Punctuation,_Spelling_and_Grammar

File third_party/blink/renderer/modules/file_system_access/bucket_file_system_agent.h
Line 1, Patchset 9:// Copyright 2023 The Chromium Authors
Ayu Ishii . unresolved

nit: 2024 😜 ditto for others

File third_party/blink/renderer/modules/file_system_access/bucket_file_system_agent.cc
Line 36, Patchset 9: if (!error) {
Ayu Ishii . unresolved

Maybe this error null check should come first, so you don't have to check twice?

```
if (!error) {
return crdtp::DispatchResponse::InternalError();
}
if (error->status == mojom::blink::FileSystemAccessStatus::kOk) {
return crdtp::DispatchResponse::Success();
}
return crdtp::DispatchResponse::ServerError(error->message.Utf8());
```
Line 46, Patchset 17 (Latest):
Ayu Ishii . unresolved

nit: Lets remove some of these blank lines for readability. Maybe something like...
go/cstyle#Vertical_Whitespace

```

String storage_key = file_system_locator->getStorageKey();
  StorageBucket* storage_bucket =
GetStorageBucket(storage_key, file_system_locator->getBucketName());
if (storage_bucket == nullptr) {
callback->sendFailure(
protocol::Response::InvalidRequest("Storage Bucket not found."));
return;
}
  WTF::Vector<WTF::String> path_components = WTF::Vector<WTF::String>();
for (const auto& component : *file_system_locator->getPathComponents()) {
path_components.push_back(component);
}
  String directory_name = path_components.empty() ? "" : path_components.back();
storage_bucket->GetDirectoryForDevTools(
GetExecutionContext(storage_key), path_components,
WTF::BindOnce(&BucketFileSystemAgent::DidGetDirectoryHandle,
WrapPersistent(this),
WrapWeakPersistent(GetExecutionContext(storage_key)),
storage_key, directory_name, std::move(callback)));
```
Line 127, Patchset 17 (Latest): CHECK(storage_bucket_manager);
Ayu Ishii . unresolved

Can this be nullptr? Looks like it just create one if it there isn't one already?

Line 134, Patchset 17 (Latest):ScriptState* BucketFileSystemAgent::GetScriptState(const String& storage_key) {
Ayu Ishii . unresolved

This is only called in once place, maybe we can inline? Also should we be checking for nullptr here?

Line 142, Patchset 17 (Latest):
Ayu Ishii . unresolved

nit: I think we can return the these white spaces before `return` in these methods.

go/cstyle#Vertical_Whitespace

Line 148, Patchset 17 (Latest): CHECK(frame);
Ayu Ishii . unresolved

Should this be crashing if they fail? I think there might be edge case that are valid scenarios of when a document might go away, but wouldn't necessarily want to crash. May want to fail/error gracefully.

File third_party/blink/renderer/modules/file_system_access/bucket_file_system_builder.h
Line 20, Patchset 17 (Latest):typedef base::OnceCallback<void(
Ayu Ishii . unresolved

Can we use `using` here?
go/cstyle#Aliases

File third_party/blink/renderer/modules/file_system_access/bucket_file_system_builder.cc
Line 20, Patchset 17 (Latest): if (!handle) {
Ayu Ishii . unresolved

I feel like we should do this before it gets here, maybe right after its been retrieve. WDYT about doing this in `DidGetDirectoryHandle`? And `CHECK(handle)` here.

Line 62, Patchset 17 (Latest): return;
Ayu Ishii . unresolved

Should the callback still return here? Can the caller still be waiting?

Line 96, Patchset 17 (Latest): ((FileSystemFileHandle*)entry)
Ayu Ishii . unresolved
Line 135, Patchset 4: BucketFileSystemBuilder::BuildDirectory(
Ayu Ishii . resolved

Do you think we can do this without recursion? Recursion is often hard to follow and can lead to scary bugs.

Etienne Noël

As discussed, I've removed the recursion and am only retrieving one level at a time.

Ayu Ishii

Done

Line 166, Patchset 5: if (!result || !directory) {
Ayu Ishii . resolved

What scenario would you expect `result` to be empty?

Etienne Noël

I don't think the way this code is written that it can receive a null. However, it feels unintuitive for me to assume a `nullptr` will never be passed? Should I still trust that it will never be and not do the check?

Ayu Ishii

Done

Line 170, Patchset 17 (Latest):
Ayu Ishii . unresolved

nit: Remove vertical line, ditto for other applicable areas.

Open in Gerrit

Related details

Attention is currently required from:
  • Etienne Noël
Submit Requirements:
  • requirement satisfiedCode-Coverage
  • requirement is not 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: Ia4a512e4c1d0b1cb44be785598df082b9aef5865
Gerrit-Change-Number: 4970306
Gerrit-PatchSet: 17
Gerrit-Owner: Etienne Noël <etien...@chromium.org>
Gerrit-Reviewer: Ayu Ishii <ay...@chromium.org>
Gerrit-Reviewer: Etienne Noël <etien...@chromium.org>
Gerrit-CC: Code Review Nudger <android-build...@prod.google.com>
Gerrit-Attention: Etienne Noël <etien...@chromium.org>
Gerrit-Comment-Date: Mon, 10 Jun 2024 23:46:03 +0000
satisfied_requirement
unsatisfied_requirement
open
diffy

Etienne Noël (Gerrit)

unread,
Jun 11, 2024, 2:12:03 PMJun 11
to Code Review Nudger, Ayu Ishii, Chromium LUCI CQ, Tricium, chromium...@chromium.org, devtools...@chromium.org, blink-re...@chromium.org, blink-...@chromium.org, devtools-re...@chromium.org, headless...@chromium.org
Attention needed from Ayu Ishii

Etienne Noël added 16 comments

Patchset-level comments
Etienne Noël . unresolved

@ay...@chromium.org This is ready for a second round of review. I'm missing tests on the `BucketFileSystemBuilder`. Since this will be mainly used for DevTools and never anything else, I wonder if it would be better (read here much easier to do) to cover this class using DevTools tests (testing that the devtools feature actually works).

The issue that I see with unit testing this class, is the complexity around the setup. We need to setup a bucket, OPFS, create nested files and folders to then test that the tree is properly built. This is doable but wonder if it's worth it and wanted to hear your thoughts!

Ayu Ishii

Looks like folks typically write web_tests for inspector agent changes. I presume you can use the js APIs to setup which hopefully would be easier, but I haven't looked into this deeply. WDYT?

https://crsrc.org/c/third_party/blink/web_tests/http/tests/inspector-protocol/

Etienne Noël

That's exactly what I was looking for. I will add those. I feel this will be much easier, thanks!

File third_party/blink/public/devtools_protocol/browser_protocol.pdl
Line 4571, Patchset 17: # Files that are directly nested under this directory
Ayu Ishii . resolved

nit: Terminate with period. Ditto for other comments that are sentences.

go/cstyle#Punctuation,_Spelling_and_Grammar

Etienne Noël

Sorry, it doesn't stick in my head. I'm adding this to the list of things to triple check when submitting a CL. Thanks.

File third_party/blink/renderer/modules/file_system_access/bucket_file_system_agent.h
Line 1, Patchset 9:// Copyright 2023 The Chromium Authors
Ayu Ishii . resolved

nit: 2024 😜 ditto for others

Etienne Noël

LOL thanks haha

File third_party/blink/renderer/modules/file_system_access/bucket_file_system_agent.cc
Line 36, Patchset 9: if (!error) {
Ayu Ishii . resolved

Maybe this error null check should come first, so you don't have to check twice?

```
if (!error) {
return crdtp::DispatchResponse::InternalError();
}
if (error->status == mojom::blink::FileSystemAccessStatus::kOk) {
return crdtp::DispatchResponse::Success();
}
return crdtp::DispatchResponse::ServerError(error->message.Utf8());
```
Etienne Noël

Done

Line 46, Patchset 17:
Ayu Ishii . resolved

nit: Lets remove some of these blank lines for readability. Maybe something like...
go/cstyle#Vertical_Whitespace

```
String storage_key = file_system_locator->getStorageKey();
StorageBucket* storage_bucket =
GetStorageBucket(storage_key, file_system_locator->getBucketName());
if (storage_bucket == nullptr) {
callback->sendFailure(
protocol::Response::InvalidRequest("Storage Bucket not found."));
return;
}
  WTF::Vector<WTF::String> path_components = WTF::Vector<WTF::String>();
for (const auto& component : *file_system_locator->getPathComponents()) {
path_components.push_back(component);
}
  String directory_name = path_components.empty() ? "" : path_components.back();
storage_bucket->GetDirectoryForDevTools(
GetExecutionContext(storage_key), path_components,
WTF::BindOnce(&BucketFileSystemAgent::DidGetDirectoryHandle,
WrapPersistent(this),
WrapWeakPersistent(GetExecutionContext(storage_key)),
storage_key, directory_name, std::move(callback)));
```
Etienne Noël

Done

Line 127, Patchset 17: CHECK(storage_bucket_manager);
Ayu Ishii . unresolved

Can this be nullptr? Looks like it just create one if it there isn't one already?

Etienne Noël

How should I think about such scenarios. My thinking is that if this code changes in the future, I prefer to put a check to ensure that this doesn't turn into a `nullptr`. However, we can also say that this is the responsibility of the person that will modify `StorageBucketManager::storageBuckets(*navigator)`.

In chromium's codebase, how should I balance these two things? I always prefer to be cautious but also want to follow chromium's mentality.

Line 134, Patchset 17:ScriptState* BucketFileSystemAgent::GetScriptState(const String& storage_key) {
Ayu Ishii . resolved

This is only called in once place, maybe we can inline? Also should we be checking for nullptr here?

Etienne Noël

Done

Line 142, Patchset 17:
Ayu Ishii . resolved

nit: I think we can return the these white spaces before `return` in these methods.

go/cstyle#Vertical_Whitespace

Etienne Noël

Done

Line 148, Patchset 17: CHECK(frame);
Ayu Ishii . resolved

Should this be crashing if they fail? I think there might be edge case that are valid scenarios of when a document might go away, but wouldn't necessarily want to crash. May want to fail/error gracefully.

Etienne Noël

I've removed the methods. I retrieving these elements, checking for nullptr and gracefully returning an error.

File third_party/blink/renderer/modules/file_system_access/bucket_file_system_builder.h
Line 20, Patchset 17:typedef base::OnceCallback<void(
Ayu Ishii . resolved

Can we use `using` here?
go/cstyle#Aliases

Etienne Noël

Done

Line 7, Patchset 17:#include <deque>
Ayu Ishii . resolved
Etienne Noël

Done

File third_party/blink/renderer/modules/file_system_access/bucket_file_system_builder.cc
Line 20, Patchset 17: if (!handle) {
Ayu Ishii . resolved

I feel like we should do this before it gets here, maybe right after its been retrieve. WDYT about doing this in `DidGetDirectoryHandle`? And `CHECK(handle)` here.

Etienne Noël

Nice yes that's clean I like it.

Ayu Ishii . unresolved

Should the callback still return here? Can the caller still be waiting?

Etienne Noël

For my own understanding, can you trigger a callback when the execution context is destroyed? I thought this would mean that the callback would no longer be executable.

Line 96, Patchset 17: ((FileSystemFileHandle*)entry)
Ayu Ishii . resolved
Etienne Noël

Done

Line 135, Patchset 4: BucketFileSystemBuilder::BuildDirectory(
Ayu Ishii . resolved

Do you think we can do this without recursion? Recursion is often hard to follow and can lead to scary bugs.

Etienne Noël

As discussed, I've removed the recursion and am only retrieving one level at a time.

Etienne Noël

Done

Line 170, Patchset 17:
Ayu Ishii . resolved

nit: Remove vertical line, ditto for other applicable areas.

Etienne Noël

I think I've found them all. Is there a link to the code styling for new lines?

Open in Gerrit

Related details

Attention is currently required from:
  • Ayu Ishii
Submit Requirements:
  • requirement satisfiedCode-Coverage
  • requirement is not 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: Ia4a512e4c1d0b1cb44be785598df082b9aef5865
Gerrit-Change-Number: 4970306
Gerrit-PatchSet: 18
Gerrit-Owner: Etienne Noël <etien...@chromium.org>
Gerrit-Reviewer: Ayu Ishii <ay...@chromium.org>
Gerrit-Reviewer: Etienne Noël <etien...@chromium.org>
Gerrit-CC: Code Review Nudger <android-build...@prod.google.com>
Gerrit-Attention: Ayu Ishii <ay...@chromium.org>
Gerrit-Comment-Date: Tue, 11 Jun 2024 18:11:49 +0000
satisfied_requirement
unsatisfied_requirement
open
diffy

Ayu Ishii (Gerrit)

unread,
Jun 12, 2024, 5:02:33 PMJun 12
to Etienne Noël, Code Review Nudger, Chromium LUCI CQ, Tricium, chromium...@chromium.org, devtools...@chromium.org, blink-re...@chromium.org, blink-...@chromium.org, devtools-re...@chromium.org, headless...@chromium.org
Attention needed from Etienne Noël

Ayu Ishii added 3 comments

File third_party/blink/renderer/modules/file_system_access/bucket_file_system_agent.cc
Line 127, Patchset 17: CHECK(storage_bucket_manager);
Ayu Ishii . unresolved

Can this be nullptr? Looks like it just create one if it there isn't one already?

Etienne Noël

How should I think about such scenarios. My thinking is that if this code changes in the future, I prefer to put a check to ensure that this doesn't turn into a `nullptr`. However, we can also say that this is the responsibility of the person that will modify `StorageBucketManager::storageBuckets(*navigator)`.

In chromium's codebase, how should I balance these two things? I always prefer to be cautious but also want to follow chromium's mentality.

Ayu Ishii

Good question. Specifically `storageBuckets` needs to operate in a way that it will always return because it is web exposed. Otherwise there could be a scenario where a StorageBucket object won't return when the JS API is called.

Not very helpful, but for me I think of this case by case. I don't think it is very reasonable to need to check every return value, so I typically look into the method and see how it is implemented, and evaluate if it should CHECK or fail gracefully and return. Others might have other better methods though.

File third_party/blink/renderer/modules/file_system_access/bucket_file_system_builder.cc
Ayu Ishii . unresolved

Should the callback still return here? Can the caller still be waiting?

Etienne Noël

For my own understanding, can you trigger a callback when the execution context is destroyed? I thought this would mean that the callback would no longer be executable.

Ayu Ishii

Yeah, good question. I'm not sure about the answer. But the execution context is for the frame for the StorageKey, and the callback is from the DevTools protocol which I assume wouldn't have the same exact context as the StorageKey (not sure) so I'm not sure if those would be destroyed at the same time.

Ayu Ishii . resolved

nit: Remove vertical line, ditto for other applicable areas.

Etienne Noël

I think I've found them all. Is there a link to the code styling for new lines?

Ayu Ishii

go/cstyle#Vertical_Whitespace

Open in Gerrit

Related details

Attention is currently required from:
  • Etienne Noël
Submit Requirements:
  • requirement satisfiedCode-Coverage
  • requirement is not 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: Ia4a512e4c1d0b1cb44be785598df082b9aef5865
Gerrit-Change-Number: 4970306
Gerrit-PatchSet: 18
Gerrit-Owner: Etienne Noël <etien...@chromium.org>
Gerrit-Reviewer: Ayu Ishii <ay...@chromium.org>
Gerrit-Reviewer: Etienne Noël <etien...@chromium.org>
Gerrit-CC: Code Review Nudger <android-build...@prod.google.com>
Gerrit-Attention: Etienne Noël <etien...@chromium.org>
Gerrit-Comment-Date: Wed, 12 Jun 2024 21:02:24 +0000
satisfied_requirement
unsatisfied_requirement
open
diffy

Etienne Noël (Gerrit)

unread,
Jun 20, 2024, 10:55:07 PM (9 days ago) Jun 20
to Daseul Lee, Code Review Nudger, Ayu Ishii, Chromium LUCI CQ, Tricium, chromium...@chromium.org, devtools...@chromium.org, blink-re...@chromium.org, blink-...@chromium.org, devtools-re...@chromium.org, headless...@chromium.org
Attention needed from Ayu Ishii and Daseul Lee

Etienne Noël added 4 comments

Patchset-level comments
File-level comment, Patchset 17:
Etienne Noël . resolved

@ay...@chromium.org This is ready for a second round of review. I'm missing tests on the `BucketFileSystemBuilder`. Since this will be mainly used for DevTools and never anything else, I wonder if it would be better (read here much easier to do) to cover this class using DevTools tests (testing that the devtools feature actually works).

The issue that I see with unit testing this class, is the complexity around the setup. We need to setup a bucket, OPFS, create nested files and folders to then test that the tree is properly built. This is doable but wonder if it's worth it and wanted to hear your thoughts!

Ayu Ishii

Looks like folks typically write web_tests for inspector agent changes. I presume you can use the js APIs to setup which hopefully would be easier, but I haven't looked into this deeply. WDYT?

https://crsrc.org/c/third_party/blink/web_tests/http/tests/inspector-protocol/

Etienne Noël

That's exactly what I was looking for. I will add those. I feel this will be much easier, thanks!

Etienne Noël

Done

File-level comment, Patchset 19:
Etienne Noël . resolved

@ds...@chromium.org When you get a moment, can you review some of the file system files please? Ayu is OOO

File third_party/blink/renderer/modules/file_system_access/bucket_file_system_agent.cc
Line 127, Patchset 17: CHECK(storage_bucket_manager);
Ayu Ishii . resolved

Can this be nullptr? Looks like it just create one if it there isn't one already?

Etienne Noël

How should I think about such scenarios. My thinking is that if this code changes in the future, I prefer to put a check to ensure that this doesn't turn into a `nullptr`. However, we can also say that this is the responsibility of the person that will modify `StorageBucketManager::storageBuckets(*navigator)`.

In chromium's codebase, how should I balance these two things? I always prefer to be cautious but also want to follow chromium's mentality.

Ayu Ishii

Good question. Specifically `storageBuckets` needs to operate in a way that it will always return because it is web exposed. Otherwise there could be a scenario where a StorageBucket object won't return when the JS API is called.

Not very helpful, but for me I think of this case by case. I don't think it is very reasonable to need to check every return value, so I typically look into the method and see how it is implemented, and evaluate if it should CHECK or fail gracefully and return. Others might have other better methods though.

Etienne Noël

Done

File third_party/blink/renderer/modules/file_system_access/bucket_file_system_builder.cc
Ayu Ishii . resolved

Should the callback still return here? Can the caller still be waiting?

Etienne Noël

For my own understanding, can you trigger a callback when the execution context is destroyed? I thought this would mean that the callback would no longer be executable.

Ayu Ishii

Yeah, good question. I'm not sure about the answer. But the execution context is for the frame for the StorageKey, and the callback is from the DevTools protocol which I assume wouldn't have the same exact context as the StorageKey (not sure) so I'm not sure if those would be destroyed at the same time.

Etienne Noël

Makes sense.

Open in Gerrit

Related details

Attention is currently required from:
  • Ayu Ishii
  • Daseul Lee
Submit Requirements:
  • requirement satisfiedCode-Coverage
  • 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: Ia4a512e4c1d0b1cb44be785598df082b9aef5865
Gerrit-Change-Number: 4970306
Gerrit-PatchSet: 20
Gerrit-Owner: Etienne Noël <etien...@chromium.org>
Gerrit-Reviewer: Ayu Ishii <ay...@chromium.org>
Gerrit-Reviewer: Daseul Lee <ds...@chromium.org>
Gerrit-Reviewer: Etienne Noël <etien...@chromium.org>
Gerrit-CC: Code Review Nudger <android-build...@prod.google.com>
Gerrit-Attention: Ayu Ishii <ay...@chromium.org>
Gerrit-Attention: Daseul Lee <ds...@chromium.org>
Gerrit-Comment-Date: Fri, 21 Jun 2024 02:54:57 +0000
satisfied_requirement
unsatisfied_requirement
open
diffy

Etienne Noël (Gerrit)

unread,
Jun 20, 2024, 10:59:56 PM (9 days ago) Jun 20
to Andrey Kosyakov, Daseul Lee, Code Review Nudger, Ayu Ishii, Chromium LUCI CQ, Tricium, chromium...@chromium.org, devtools...@chromium.org, blink-re...@chromium.org, blink-...@chromium.org, devtools-re...@chromium.org, headless...@chromium.org
Attention needed from Andrey Kosyakov, Ayu Ishii and Daseul Lee

Etienne Noël added 1 comment

Patchset-level comments
File-level comment, Patchset 20 (Latest):
Etienne Noël . resolved

@ca...@chromium.org I've finally had some time to continue the work on this (previous CL that you reviewed was this one: https://chromium-review.googlesource.com/c/chromium/src/+/4860661).

If you can review this one and let me know what you think, that would be great! Thank you.

Open in Gerrit

Related details

Attention is currently required from:
  • Andrey Kosyakov
  • Ayu Ishii
  • Daseul Lee
Submit Requirements:
  • requirement satisfiedCode-Coverage
  • 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: Ia4a512e4c1d0b1cb44be785598df082b9aef5865
Gerrit-Change-Number: 4970306
Gerrit-PatchSet: 20
Gerrit-Owner: Etienne Noël <etien...@chromium.org>
Gerrit-Reviewer: Andrey Kosyakov <ca...@chromium.org>
Gerrit-Reviewer: Ayu Ishii <ay...@chromium.org>
Gerrit-Reviewer: Daseul Lee <ds...@chromium.org>
Gerrit-Reviewer: Etienne Noël <etien...@chromium.org>
Gerrit-CC: Code Review Nudger <android-build...@prod.google.com>
Gerrit-Attention: Ayu Ishii <ay...@chromium.org>
Gerrit-Attention: Andrey Kosyakov <ca...@chromium.org>
Gerrit-Attention: Daseul Lee <ds...@chromium.org>
Gerrit-Comment-Date: Fri, 21 Jun 2024 02:59:44 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
satisfied_requirement
unsatisfied_requirement
open
diffy

Etienne Noël (Gerrit)

unread,
Jun 21, 2024, 12:47:53 PM (9 days ago) Jun 21
to Andrey Kosyakov, Daseul Lee, Code Review Nudger, Ayu Ishii, Chromium LUCI CQ, Tricium, chromium...@chromium.org, devtools...@chromium.org, blink-re...@chromium.org, blink-...@chromium.org, devtools-re...@chromium.org, headless...@chromium.org
Attention needed from Andrey Kosyakov, Ayu Ishii and Daseul Lee

Etienne Noël added 1 comment

Patchset-level comments
Etienne Noël . resolved

@ca...@chromium.org I've finally had some time to continue the work on this (previous CL that you reviewed was this one: https://chromium-review.googlesource.com/c/chromium/src/+/4860661).

If you can review this one and let me know what you think, that would be great! Thank you.

Etienne Noël

Forgot to add: This is doing less back and forth (between renderer and browser) and directly calling the Mojo endpoint (which makes more sense).

Gerrit-Comment-Date: Fri, 21 Jun 2024 16:47:43 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
Comment-In-Reply-To: Etienne Noël <etien...@chromium.org>
satisfied_requirement
unsatisfied_requirement
open
diffy

Daseul Lee (Gerrit)

unread,
Jun 21, 2024, 3:32:53 PM (9 days ago) Jun 21
to Etienne Noël, Andrey Kosyakov, Code Review Nudger, Ayu Ishii, Chromium LUCI CQ, Tricium, chromium...@chromium.org, devtools...@chromium.org, blink-re...@chromium.org, blink-...@chromium.org, devtools-re...@chromium.org, headless...@chromium.org
Attention needed from Andrey Kosyakov, Ayu Ishii and Etienne Noël

Daseul Lee added 6 comments

File third_party/blink/renderer/modules/file_system_access/bucket_file_system_agent.cc
Line 54, Patchset 20 (Latest): WTF::Vector<WTF::String> path_components = WTF::Vector<WTF::String>();

for (const auto& component : *file_system_locator->getPathComponents()) {
path_components.push_back(component);
}
Daseul Lee . unresolved

Shall we move this below all the failure handling code? so that we don't have to construct the vector until it's necessary

Also, just curious - we cannot just return `file_system_locator->getPathComponents()` because it's different data types?

Line 107, Patchset 20 (Latest): callback->sendFailure(protocol::Response::ServerError("No handle."));
Daseul Lee . unresolved

nit: is this for failing to retrieve the root directory handle? if so, would be useful to specify something like "No root handle", to differentiate this from failing to retrieve child directories or files (below).

File third_party/blink/renderer/modules/file_system_access/bucket_file_system_builder.h
Line 74, Patchset 20 (Latest): DirectoryCallback completion_callback_;
Daseul Lee . unresolved

Is `completion_callback_` expected to be invoked only once? If so, I wonder if this class's constructor should be made private, or provide other way to prevent re-using the object state.

File third_party/blink/renderer/modules/file_system_access/bucket_file_system_builder.cc
Line 119, Patchset 20 (Latest): }
Daseul Lee . unresolved

The `else` case shouldn't really happen, but wonder if it's worth putting a CHECK() here since the barrier callback will hang for not executing `file_system_handle_queue_->size()` times otherwise.

Line 145, Patchset 20 (Latest): base::File::Error::FILE_ERROR_FAILED, "Invalid state Error."),
Daseul Lee . unresolved

nit: provide a specific error message, or omit it since it's the same name as the FileSystemAccessStatus anyways

Line 141, Patchset 20 (Latest): if (!result || !file) {
std::move(completion_callback_)
.Run(mojom::blink::FileSystemAccessError::New(
mojom::blink::FileSystemAccessStatus::kInvalidState,
base::File::Error::FILE_ERROR_FAILED, "Invalid state Error."),
/*std::unique_ptr<protocol::FileSystem::Directory>*/ nullptr);
return;
}

if (result->status != mojom::blink::FileSystemAccessStatus::kOk) {
std::move(completion_callback_)
.Run(std::move(result),
/*std::unique_ptr<protocol::FileSystem::Directory>*/ nullptr);
return;
}
Daseul Lee . unresolved

In either case, should the barrier_callback be cancelled, since it would continue waiting?

Open in Gerrit

Related details

Attention is currently required from:
  • Andrey Kosyakov
  • Ayu Ishii
  • Etienne Noël
Submit Requirements:
    • requirement satisfiedCode-Coverage
    • requirement is not 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: Ia4a512e4c1d0b1cb44be785598df082b9aef5865
    Gerrit-Change-Number: 4970306
    Gerrit-PatchSet: 20
    Gerrit-Owner: Etienne Noël <etien...@chromium.org>
    Gerrit-Reviewer: Andrey Kosyakov <ca...@chromium.org>
    Gerrit-Reviewer: Ayu Ishii <ay...@chromium.org>
    Gerrit-Reviewer: Daseul Lee <ds...@chromium.org>
    Gerrit-Reviewer: Etienne Noël <etien...@chromium.org>
    Gerrit-CC: Code Review Nudger <android-build...@prod.google.com>
    Gerrit-Attention: Ayu Ishii <ay...@chromium.org>
    Gerrit-Attention: Andrey Kosyakov <ca...@chromium.org>
    Gerrit-Attention: Etienne Noël <etien...@chromium.org>
    Gerrit-Comment-Date: Fri, 21 Jun 2024 19:32:43 +0000
    Gerrit-HasComments: Yes
    Gerrit-Has-Labels: No
    satisfied_requirement
    unsatisfied_requirement
    open
    diffy

    Etienne Noël (Gerrit)

    unread,
    Jun 24, 2024, 9:03:52 PM (5 days ago) Jun 24
    to Andrey Kosyakov, Daseul Lee, Code Review Nudger, Ayu Ishii, Chromium LUCI CQ, Tricium, chromium...@chromium.org, devtools...@chromium.org, blink-re...@chromium.org, blink-...@chromium.org, devtools-re...@chromium.org, headless...@chromium.org
    Attention needed from Andrey Kosyakov, Ayu Ishii and Daseul Lee

    Etienne Noël voted and added 6 comments

    Votes added by Etienne Noël

    Commit-Queue+1

    6 comments

    File third_party/blink/renderer/modules/file_system_access/bucket_file_system_agent.cc
    Line 54, Patchset 20: WTF::Vector<WTF::String> path_components = WTF::Vector<WTF::String>();

    for (const auto& component : *file_system_locator->getPathComponents()) {
    path_components.push_back(component);
    }
    Daseul Lee . resolved

    Shall we move this below all the failure handling code? so that we don't have to construct the vector until it's necessary

    Also, just curious - we cannot just return `file_system_locator->getPathComponents()` because it's different data types?

    Etienne Noël

    `getPathComponents` is of type `protocol::Array<String>`which is `std::vector<WTF:String>` and I haven't seen an automatic conversion to `WTF::Vector`.

    Good catch on the doing it later on part. Thanks!

    Line 107, Patchset 20: callback->sendFailure(protocol::Response::ServerError("No handle."));
    Daseul Lee . resolved

    nit: is this for failing to retrieve the root directory handle? if so, would be useful to specify something like "No root handle", to differentiate this from failing to retrieve child directories or files (below).

    Etienne Noël

    Not necessarily. It can be for either the root handle or a nested handle.

    File third_party/blink/renderer/modules/file_system_access/bucket_file_system_builder.h
    Line 74, Patchset 20: DirectoryCallback completion_callback_;
    Daseul Lee . unresolved

    Is `completion_callback_` expected to be invoked only once? If so, I wonder if this class's constructor should be made private, or provide other way to prevent re-using the object state.

    Etienne Noël

    I don't know how to make the constructor private since I'm creating the `BucketFileSystemBuilder` using `MakeGarbageCollected`, this needs to be a friend of `BucketFileSystemBuilder`, but that would defeat the purpose of making the constructor private.

    The idea of this class is that you use the static method `BuildDirectoryTree` every time you need to retrieve something. Since this is a once callback, it will fail trying to use it again so I wonder if I should actually do anything more to prevent using it? WDYT?

    File third_party/blink/renderer/modules/file_system_access/bucket_file_system_builder.cc
    Line 119, Patchset 20: }
    Daseul Lee . resolved

    The `else` case shouldn't really happen, but wonder if it's worth putting a CHECK() here since the barrier callback will hang for not executing `file_system_handle_queue_->size()` times otherwise.

    Etienne Noël

    If we ever introduce another type, you are right that this would suddenly start failing. I agree with adding a `CHECK`.

    Line 145, Patchset 20: base::File::Error::FILE_ERROR_FAILED, "Invalid state Error."),
    Daseul Lee . unresolved

    nit: provide a specific error message, or omit it since it's the same name as the FileSystemAccessStatus anyways

    Etienne Noël

    I've added something, let me know if you think this is clear enough.

    Line 141, Patchset 20: if (!result || !file) {

    std::move(completion_callback_)
    .Run(mojom::blink::FileSystemAccessError::New(
    mojom::blink::FileSystemAccessStatus::kInvalidState,
    base::File::Error::FILE_ERROR_FAILED, "Invalid state Error."),
    /*std::unique_ptr<protocol::FileSystem::Directory>*/ nullptr);
    return;
    }

    if (result->status != mojom::blink::FileSystemAccessStatus::kOk) {
    std::move(completion_callback_)
    .Run(std::move(result),
    /*std::unique_ptr<protocol::FileSystem::Directory>*/ nullptr);
    return;
    }
    Daseul Lee . unresolved

    In either case, should the barrier_callback be cancelled, since it would continue waiting?

    Etienne Noël

    I was under the impression that because this `barrier_callback` is held by the `BucketFileSystemBuilder`, which gets garbage collected after the `completion_callback` is executed, that the `barrier_callback` would be automatically canceled. Is there something I'm not seeing?

    Open in Gerrit

    Related details

    Attention is currently required from:
    • Andrey Kosyakov
    • Ayu Ishii
    • Daseul Lee
    Submit Requirements:
    • requirement satisfiedCode-Coverage
    • requirement is not 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: Ia4a512e4c1d0b1cb44be785598df082b9aef5865
    Gerrit-Change-Number: 4970306
    Gerrit-PatchSet: 21
    Gerrit-Owner: Etienne Noël <etien...@chromium.org>
    Gerrit-Reviewer: Andrey Kosyakov <ca...@chromium.org>
    Gerrit-Reviewer: Ayu Ishii <ay...@chromium.org>
    Gerrit-Reviewer: Daseul Lee <ds...@chromium.org>
    Gerrit-Reviewer: Etienne Noël <etien...@chromium.org>
    Gerrit-CC: Code Review Nudger <android-build...@prod.google.com>
    Gerrit-Attention: Ayu Ishii <ay...@chromium.org>
    Gerrit-Attention: Andrey Kosyakov <ca...@chromium.org>
    Gerrit-Attention: Daseul Lee <ds...@chromium.org>
    Gerrit-Comment-Date: Tue, 25 Jun 2024 01:03:38 +0000
    Gerrit-HasComments: Yes
    Gerrit-Has-Labels: Yes
    Comment-In-Reply-To: Daseul Lee <ds...@chromium.org>
    satisfied_requirement
    unsatisfied_requirement
    open
    diffy

    Daseul Lee (Gerrit)

    unread,
    Jun 26, 2024, 10:40:29 AM (4 days ago) Jun 26
    to Etienne Noël, Andrey Kosyakov, Code Review Nudger, Ayu Ishii, Chromium LUCI CQ, Tricium, chromium...@chromium.org, devtools...@chromium.org, blink-re...@chromium.org, blink-...@chromium.org, devtools-re...@chromium.org, headless...@chromium.org
    Attention needed from Andrey Kosyakov, Ayu Ishii and Etienne Noël

    Daseul Lee voted and added 5 comments

    Votes added by Daseul Lee

    Code-Review+1

    5 comments

    Patchset-level comments
    File-level comment, Patchset 21 (Latest):
    Daseul Lee . resolved

    LGTM with a couple of nits. Thanks!

    File third_party/blink/renderer/modules/file_system_access/bucket_file_system_builder.h
    Line 74, Patchset 20: DirectoryCallback completion_callback_;
    Daseul Lee . resolved

    Is `completion_callback_` expected to be invoked only once? If so, I wonder if this class's constructor should be made private, or provide other way to prevent re-using the object state.

    Etienne Noël

    I don't know how to make the constructor private since I'm creating the `BucketFileSystemBuilder` using `MakeGarbageCollected`, this needs to be a friend of `BucketFileSystemBuilder`, but that would defeat the purpose of making the constructor private.

    The idea of this class is that you use the static method `BuildDirectoryTree` every time you need to retrieve something. Since this is a once callback, it will fail trying to use it again so I wonder if I should actually do anything more to prevent using it? WDYT?

    Daseul Lee

    Gotcha. It seems okay to leave as then.

    File third_party/blink/renderer/modules/file_system_access/bucket_file_system_builder.cc
    Line 119, Patchset 20: }
    Daseul Lee . unresolved

    The `else` case shouldn't really happen, but wonder if it's worth putting a CHECK() here since the barrier callback will hang for not executing `file_system_handle_queue_->size()` times otherwise.

    Etienne Noël

    If we ever introduce another type, you are right that this would suddenly start failing. I agree with adding a `CHECK`.

    Daseul Lee

    Sorry, I should have said `NOTREACHED_NORETURN();`

    Line 145, Patchset 20: base::File::Error::FILE_ERROR_FAILED, "Invalid state Error."),
    Daseul Lee . unresolved

    nit: provide a specific error message, or omit it since it's the same name as the FileSystemAccessStatus anyways

    Etienne Noël

    I've added something, let me know if you think this is clear enough.

    Daseul Lee

    Hmm, what about "Failed to retrieve blob info"?

    Line 141, Patchset 20: if (!result || !file) {
    std::move(completion_callback_)
    .Run(mojom::blink::FileSystemAccessError::New(
    mojom::blink::FileSystemAccessStatus::kInvalidState,
    base::File::Error::FILE_ERROR_FAILED, "Invalid state Error."),
    /*std::unique_ptr<protocol::FileSystem::Directory>*/ nullptr);
    return;
    }

    if (result->status != mojom::blink::FileSystemAccessStatus::kOk) {
    std::move(completion_callback_)
    .Run(std::move(result),
    /*std::unique_ptr<protocol::FileSystem::Directory>*/ nullptr);
    return;
    }
    Daseul Lee . resolved

    In either case, should the barrier_callback be cancelled, since it would continue waiting?

    Etienne Noël

    I was under the impression that because this `barrier_callback` is held by the `BucketFileSystemBuilder`, which gets garbage collected after the `completion_callback` is executed, that the `barrier_callback` would be automatically canceled. Is there something I'm not seeing?

    Daseul Lee

    Oh I think you're right! Thanks for the explanation.

    Open in Gerrit

    Related details

    Attention is currently required from:
    • Andrey Kosyakov
    • Ayu Ishii
    • Etienne Noël
    Submit Requirements:
    • requirement satisfiedCode-Coverage
    • requirement is not 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: Ia4a512e4c1d0b1cb44be785598df082b9aef5865
    Gerrit-Change-Number: 4970306
    Gerrit-PatchSet: 21
    Gerrit-Owner: Etienne Noël <etien...@chromium.org>
    Gerrit-Reviewer: Andrey Kosyakov <ca...@chromium.org>
    Gerrit-Reviewer: Ayu Ishii <ay...@chromium.org>
    Gerrit-Reviewer: Daseul Lee <ds...@chromium.org>
    Gerrit-Reviewer: Etienne Noël <etien...@chromium.org>
    Gerrit-CC: Code Review Nudger <android-build...@prod.google.com>
    Gerrit-Attention: Ayu Ishii <ay...@chromium.org>
    Gerrit-Attention: Andrey Kosyakov <ca...@chromium.org>
    Gerrit-Attention: Etienne Noël <etien...@chromium.org>
    Gerrit-Comment-Date: Wed, 26 Jun 2024 14:40:15 +0000
    Gerrit-HasComments: Yes
    Gerrit-Has-Labels: Yes
    Comment-In-Reply-To: Etienne Noël <etien...@chromium.org>
    Comment-In-Reply-To: Daseul Lee <ds...@chromium.org>
    satisfied_requirement
    unsatisfied_requirement
    open
    diffy

    Etienne Noël (Gerrit)

    unread,
    Jun 26, 2024, 12:17:57 PM (4 days ago) Jun 26
    to Daseul Lee, Andrey Kosyakov, Code Review Nudger, Ayu Ishii, Chromium LUCI CQ, Tricium, chromium...@chromium.org, devtools...@chromium.org, blink-re...@chromium.org, blink-...@chromium.org, devtools-re...@chromium.org, headless...@chromium.org
    Attention needed from Andrey Kosyakov and Ayu Ishii

    Etienne Noël added 2 comments

    File third_party/blink/renderer/modules/file_system_access/bucket_file_system_builder.cc
    Line 119, Patchset 20: }
    Daseul Lee . resolved

    The `else` case shouldn't really happen, but wonder if it's worth putting a CHECK() here since the barrier callback will hang for not executing `file_system_handle_queue_->size()` times otherwise.

    Etienne Noël

    If we ever introduce another type, you are right that this would suddenly start failing. I agree with adding a `CHECK`.

    Daseul Lee

    Sorry, I should have said `NOTREACHED_NORETURN();`

    Etienne Noël

    Done

    Line 145, Patchset 20: base::File::Error::FILE_ERROR_FAILED, "Invalid state Error."),
    Daseul Lee . resolved

    nit: provide a specific error message, or omit it since it's the same name as the FileSystemAccessStatus anyways

    Etienne Noël

    I've added something, let me know if you think this is clear enough.

    Daseul Lee

    Hmm, what about "Failed to retrieve blob info"?

    Etienne Noël

    Done

    Open in Gerrit

    Related details

    Attention is currently required from:
    • Andrey Kosyakov
    • Ayu Ishii
    Submit Requirements:
    • requirement satisfiedCode-Coverage
    • 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: Ia4a512e4c1d0b1cb44be785598df082b9aef5865
    Gerrit-Change-Number: 4970306
    Gerrit-PatchSet: 22
    Gerrit-Owner: Etienne Noël <etien...@chromium.org>
    Gerrit-Reviewer: Andrey Kosyakov <ca...@chromium.org>
    Gerrit-Reviewer: Ayu Ishii <ay...@chromium.org>
    Gerrit-Reviewer: Daseul Lee <ds...@chromium.org>
    Gerrit-Reviewer: Etienne Noël <etien...@chromium.org>
    Gerrit-CC: Code Review Nudger <android-build...@prod.google.com>
    Gerrit-Attention: Ayu Ishii <ay...@chromium.org>
    Gerrit-Attention: Andrey Kosyakov <ca...@chromium.org>
    Gerrit-Comment-Date: Wed, 26 Jun 2024 16:17:43 +0000
    Gerrit-HasComments: Yes
    Gerrit-Has-Labels: No
    satisfied_requirement
    unsatisfied_requirement
    open
    diffy

    Etienne Noël (Gerrit)

    unread,
    Jun 26, 2024, 12:19:01 PM (4 days ago) Jun 26
    to Daseul Lee, Andrey Kosyakov, Code Review Nudger, Ayu Ishii, Chromium LUCI CQ, Tricium, chromium...@chromium.org, devtools...@chromium.org, blink-re...@chromium.org, blink-...@chromium.org, devtools-re...@chromium.org, headless...@chromium.org
    Attention needed from Andrey Kosyakov and Ayu Ishii

    Etienne Noël added 1 comment

    Patchset-level comments
    File-level comment, Patchset 22 (Latest):
    Etienne Noël . resolved

    @ca...@chromium.org Can I have you take a look please? Thank you!

    Gerrit-Comment-Date: Wed, 26 Jun 2024 16:18:48 +0000
    Gerrit-HasComments: Yes
    Gerrit-Has-Labels: No
    satisfied_requirement
    unsatisfied_requirement
    open
    diffy

    Alex Rudenko (Gerrit)

    unread,
    Jun 27, 2024, 8:30:39 AM (3 days ago) Jun 27
    to Etienne Noël, Daseul Lee, Andrey Kosyakov, Code Review Nudger, Ayu Ishii, Chromium LUCI CQ, Tricium, chromium...@chromium.org, devtools...@chromium.org, blink-re...@chromium.org, blink-...@chromium.org, devtools-re...@chromium.org, headless...@chromium.org
    Attention needed from Andrey Kosyakov, Ayu Ishii and Etienne Noël

    Alex Rudenko added 1 comment

    Commit Message
    Line 14, Patchset 22 (Latest):Bug:1258806
    Alex Rudenko . unresolved

    is the bug number wrong? it links to https://g-issues.chromium.org/issues/40797264 for me

    Open in Gerrit

    Related details

    Attention is currently required from:
    • Andrey Kosyakov
    • Ayu Ishii
    • Etienne Noël
    Submit Requirements:
      • requirement satisfiedCode-Coverage
      • requirement is not 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: Ia4a512e4c1d0b1cb44be785598df082b9aef5865
      Gerrit-Change-Number: 4970306
      Gerrit-PatchSet: 22
      Gerrit-Owner: Etienne Noël <etien...@chromium.org>
      Gerrit-Reviewer: Andrey Kosyakov <ca...@chromium.org>
      Gerrit-Reviewer: Ayu Ishii <ay...@chromium.org>
      Gerrit-Reviewer: Daseul Lee <ds...@chromium.org>
      Gerrit-Reviewer: Etienne Noël <etien...@chromium.org>
      Gerrit-CC: Alex Rudenko <alexr...@chromium.org>
      Gerrit-CC: Code Review Nudger <android-build...@prod.google.com>
      Gerrit-Attention: Ayu Ishii <ay...@chromium.org>
      Gerrit-Attention: Andrey Kosyakov <ca...@chromium.org>
      Gerrit-Attention: Etienne Noël <etien...@chromium.org>
      Gerrit-Comment-Date: Thu, 27 Jun 2024 12:30:26 +0000
      Gerrit-HasComments: Yes
      Gerrit-Has-Labels: No
      satisfied_requirement
      unsatisfied_requirement
      open
      diffy

      Alex Rudenko (Gerrit)

      unread,
      Jun 27, 2024, 9:51:49 AM (3 days ago) Jun 27
      to Etienne Noël, Daseul Lee, Andrey Kosyakov, Code Review Nudger, Ayu Ishii, Chromium LUCI CQ, Tricium, chromium...@chromium.org, devtools...@chromium.org, blink-re...@chromium.org, blink-...@chromium.org, devtools-re...@chromium.org, headless...@chromium.org
      Attention needed from Andrey Kosyakov, Ayu Ishii and Etienne Noël

      Alex Rudenko added 5 comments

      Patchset-level comments
      Alex Rudenko . resolved

      sorry for the unsolicited review, saw a notification in the mailbox and it looked interesting (left some suggestions).

      File third_party/blink/public/devtools_protocol/browser_protocol.pdl
      Line 4564, Patchset 22 (Latest): number size
      Alex Rudenko . unresolved

      Could you please add a comment about the units for the size (bytes?)?

      Line 4565, Patchset 22 (Latest): string mimeType
      Alex Rudenko . unresolved

      nit: mimeTypes has been renamed to mediaTypes in https://www.iana.org/assignments/media-types/media-types.xhtml so we might prefer a new name, I wonder if mime types is used in the filesystem spec?

      Line 4578, Patchset 22 (Latest): # Bucket Name
      Alex Rudenko . unresolved

      nit: could you please add some information about what a bucket is and how to find one to call this API?

      Gerrit-Comment-Date: Thu, 27 Jun 2024 13:51:35 +0000
      Gerrit-HasComments: Yes
      Gerrit-Has-Labels: No
      satisfied_requirement
      unsatisfied_requirement
      open
      diffy

      Etienne Noël (Gerrit)

      unread,
      Jun 27, 2024, 12:18:03 PM (3 days ago) Jun 27
      to Alex Rudenko, Daseul Lee, Andrey Kosyakov, Code Review Nudger, Ayu Ishii, Chromium LUCI CQ, Tricium, chromium...@chromium.org, devtools...@chromium.org, blink-re...@chromium.org, blink-...@chromium.org, devtools-re...@chromium.org, headless...@chromium.org
      Attention needed from Alex Rudenko, Andrey Kosyakov and Ayu Ishii

      Etienne Noël added 6 comments

      Patchset-level comments
      File-level comment, Patchset 24 (Latest):
      Etienne Noël . resolved

      @alexr...@chromium.org thanks for the review!

      Commit Message
      Line 14, Patchset 22:Bug:1258806
      Alex Rudenko . resolved

      is the bug number wrong? it links to https://g-issues.chromium.org/issues/40797264 for me

      Etienne Noël

      Thanks, fixed it.

      File third_party/blink/public/devtools_protocol/browser_protocol.pdl
      Line 4564, Patchset 22: number size
      Alex Rudenko . resolved

      Could you please add a comment about the units for the size (bytes?)?

      Etienne Noël

      Done

      Line 4565, Patchset 22: string mimeType
      Alex Rudenko . unresolved

      nit: mimeTypes has been renamed to mediaTypes in https://www.iana.org/assignments/media-types/media-types.xhtml so we might prefer a new name, I wonder if mime types is used in the filesystem spec?

      Etienne Noël

      In the spec, the attribute is "type" and MIME Type is mentioned. I can put `type` to align with the existing naming?

      Line 4577, Patchset 22: string storageKey
      Alex Rudenko . resolved
      Etienne Noël

      Oh yes good catch!

      Alex Rudenko . unresolved

      nit: could you please add some information about what a bucket is and how to find one to call this API?

      Etienne Noël

      I'm not sure I get this question. The latest name of this API, is the Bucket File System, meaning that you kind of need to know what a bucket is to use it. I'm not sure exactly what I should be describing aside from linking to the API. Should I describe that if you don't pass anything, you will retrieve the default bucket automatically?

      Open in Gerrit

      Related details

      Attention is currently required from:
      • Alex Rudenko
      • Andrey Kosyakov
      • Ayu Ishii
      Submit Requirements:
      • requirement satisfiedCode-Coverage
      • requirement is not 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: Ia4a512e4c1d0b1cb44be785598df082b9aef5865
      Gerrit-Change-Number: 4970306
      Gerrit-PatchSet: 24
      Gerrit-Owner: Etienne Noël <etien...@chromium.org>
      Gerrit-Reviewer: Andrey Kosyakov <ca...@chromium.org>
      Gerrit-Reviewer: Ayu Ishii <ay...@chromium.org>
      Gerrit-Reviewer: Daseul Lee <ds...@chromium.org>
      Gerrit-Reviewer: Etienne Noël <etien...@chromium.org>
      Gerrit-CC: Alex Rudenko <alexr...@chromium.org>
      Gerrit-CC: Code Review Nudger <android-build...@prod.google.com>
      Gerrit-Attention: Ayu Ishii <ay...@chromium.org>
      Gerrit-Attention: Alex Rudenko <alexr...@chromium.org>
      Gerrit-Attention: Andrey Kosyakov <ca...@chromium.org>
      Gerrit-Comment-Date: Thu, 27 Jun 2024 16:17:49 +0000
      Gerrit-HasComments: Yes
      Gerrit-Has-Labels: No
      Comment-In-Reply-To: Alex Rudenko <alexr...@chromium.org>
      satisfied_requirement
      unsatisfied_requirement
      open
      diffy

      Alex Rudenko (Gerrit)

      unread,
      Jun 28, 2024, 2:18:03 AM (2 days ago) Jun 28
      to Etienne Noël, Daseul Lee, Andrey Kosyakov, Code Review Nudger, Ayu Ishii, Chromium LUCI CQ, Tricium, chromium...@chromium.org, devtools...@chromium.org, blink-re...@chromium.org, blink-...@chromium.org, devtools-re...@chromium.org, headless...@chromium.org
      Attention needed from Andrey Kosyakov, Ayu Ishii and Etienne Noël

      Alex Rudenko added 3 comments

      Commit Message
      Alex Rudenko . unresolved

      is the bug number wrong? it links to https://g-issues.chromium.org/issues/40797264 for me

      Etienne Noël

      Thanks, fixed it.

      Alex Rudenko

      I think the bug link still does not work for me, still links to the bindOnce issue.

      File third_party/blink/public/devtools_protocol/browser_protocol.pdl
      Line 4565, Patchset 22: string mimeType
      Alex Rudenko . unresolved

      nit: mimeTypes has been renamed to mediaTypes in https://www.iana.org/assignments/media-types/media-types.xhtml so we might prefer a new name, I wonder if mime types is used in the filesystem spec?

      Etienne Noël

      In the spec, the attribute is "type" and MIME Type is mentioned. I can put `type` to align with the existing naming?

      Alex Rudenko

      aligning with the spec terms sounds good to me!

      Alex Rudenko . unresolved

      nit: could you please add some information about what a bucket is and how to find one to call this API?

      Etienne Noël

      I'm not sure I get this question. The latest name of this API, is the Bucket File System, meaning that you kind of need to know what a bucket is to use it. I'm not sure exactly what I should be describing aside from linking to the API. Should I describe that if you don't pass anything, you will retrieve the default bucket automatically?

      Alex Rudenko

      My question comes from my unfamiliarity with the API, is it this spec that defines this https://fs.spec.whatwg.org/#sandboxed-filesystem (I see that getDirectory does not accept a bucket name in the web-facing API)? In general, users will discover the filesystem domain through the documentation generated from this definition (e.g., PWA domain https://chromedevtools.github.io/devtools-protocol/tot/PWA/) so it'd be nice to include links to the concepts that might be unknown.

      Open in Gerrit

      Related details

      Attention is currently required from:
      • Andrey Kosyakov
      • Ayu Ishii
      • Etienne Noël
      Submit Requirements:
      • requirement satisfiedCode-Coverage
      • requirement is not 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: Ia4a512e4c1d0b1cb44be785598df082b9aef5865
      Gerrit-Change-Number: 4970306
      Gerrit-PatchSet: 24
      Gerrit-Owner: Etienne Noël <etien...@chromium.org>
      Gerrit-Reviewer: Alex Rudenko <alexr...@chromium.org>
      Gerrit-Reviewer: Andrey Kosyakov <ca...@chromium.org>
      Gerrit-Reviewer: Ayu Ishii <ay...@chromium.org>
      Gerrit-Reviewer: Daseul Lee <ds...@chromium.org>
      Gerrit-Reviewer: Etienne Noël <etien...@chromium.org>
      Gerrit-CC: Code Review Nudger <android-build...@prod.google.com>
      Gerrit-Attention: Ayu Ishii <ay...@chromium.org>
      Gerrit-Attention: Andrey Kosyakov <ca...@chromium.org>
      Gerrit-Attention: Etienne Noël <etien...@chromium.org>
      Gerrit-Comment-Date: Fri, 28 Jun 2024 06:17:44 +0000
      Gerrit-HasComments: Yes
      Gerrit-Has-Labels: No
      Comment-In-Reply-To: Alex Rudenko <alexr...@chromium.org>
      Comment-In-Reply-To: Etienne Noël <etien...@chromium.org>
      satisfied_requirement
      unsatisfied_requirement
      open
      diffy

      Alex Rudenko (Gerrit)

      unread,
      Jun 28, 2024, 6:50:04 AM (2 days ago) Jun 28
      to Etienne Noël, Daseul Lee, Andrey Kosyakov, Code Review Nudger, Ayu Ishii, Chromium LUCI CQ, Tricium, chromium...@chromium.org, devtools...@chromium.org, blink-re...@chromium.org, blink-...@chromium.org, devtools-re...@chromium.org, headless...@chromium.org
      Attention needed from Andrey Kosyakov, Ayu Ishii and Etienne Noël

      Alex Rudenko added 2 comments

      Patchset-level comments
      Alex Rudenko . resolved

      protocol LGTM % comments

      File third_party/blink/web_tests/http/tests/inspector-protocol/filesystem/read-directory-response.js
      Line 5, Patchset 24 (Latest): await dp.Runtime.enable();
      dp.Runtime.onConsoleAPICalled(e => { testRunner.log(e.params.args[0].value); });
      Alex Rudenko . unresolved

      it looks like these two lines are not needed for the test?

      Gerrit-Comment-Date: Fri, 28 Jun 2024 10:49:49 +0000
      Gerrit-HasComments: Yes
      Gerrit-Has-Labels: No
      satisfied_requirement
      unsatisfied_requirement
      open
      diffy
      Reply all
      Reply to author
      Forward
      0 new messages