0
Commit Graph

407 Commits

Author SHA1 Message Date
Rahul Singh
4c4b20aed1 FSA Observer: Rename FSA ChangeType kUnsupported to kUnknown
This change renames the kUnsupported ChangeType enum entry to kUnknown.
In an upcoming CL we will use this renamed entry to fire an event when
the page resumes from BFCache.

Bug: 330500720
Change-Id: I9cd5093686ddac99f0941099572b4c3527476500
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5491834
Reviewed-by: Nico Weber <thakis@chromium.org>
Commit-Queue: Rahul Singh <rahsin@microsoft.com>
Reviewed-by: Nathan Memmott <memmott@chromium.org>
Reviewed-by: Will Harris <wfh@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1299448}
2024-05-10 19:48:09 +00:00
Alison Gale
770f3fce37 Migrate TODOs referencing old crbug IDs to the new issue tracker IDs
The canonical bug format is TODO(crbug.com/<id>). TODOs of the
following forms will all be migrated to the new format:

- TODO(crbug.com/<old id>)
- TODO(https://crbug.com/<old id>)
- TODO(crbug/<old id>)
- TODO(crbug/monorail/<old id>)
- TODO(<old id>)
- TODO(issues.chromium.org/<old id>)
- TODO(https://issues.chromium.org/<old id>)
- TODO(https://issues.chromium.org/u/1/issues/<old id>)
- TODO(bugs.chromium.org/<old id>)

Bug id mapping is sourced from go/chrome-on-buganizer-prod-issues.
See go/crbug-todo-migration for details.

#crbug-todo-migration

Bug: b/321899722
Change-Id: Ibc66b8c440e4bcdef414e77fef4d9874d2ea9951
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5493800
Auto-Submit: Alison Gale <agale@chromium.org>
Commit-Queue: Alison Gale <agale@chromium.org>
Reviewed-by: Peter Boström <pbos@chromium.org>
Owners-Override: Alison Gale <agale@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1293330}
2024-04-27 00:39:58 +00:00
Alison Gale
923a33e9d5 Migrate TODOs referencing old crbug IDs to the new issue tracker IDs
The canonical bug format is TODO(crbug.com/<id>). TODOs of the
following forms will all be migrated to the new format:

- TODO(crbug.com/<old id>)
- TODO(https://crbug.com/<old id>)
- TODO(crbug/<old id>)
- TODO(crbug/monorail/<old id>)
- TODO(<old id>)
- TODO(issues.chromium.org/<old id>)
- TODO(https://issues.chromium.org/<old id>)
- TODO(https://issues.chromium.org/u/1/issues/<old id>)
- TODO(bugs.chromium.org/<old id>)

Bug id mapping is sourced from go/chrome-on-buganizer-prod-issues.
See go/crbug-todo-migration for details.

#crbug-todo-migration

Bug: b/321899722
Change-Id: Ib028de8bb63c99e5a81d90e24e422cf88061ad05
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5469583
Owners-Override: Alison Gale <agale@chromium.org>
Reviewed-by: Darryl James <dljames@chromium.org>
Commit-Queue: Alison Gale <agale@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1290952}
2024-04-22 23:34:28 +00:00
Alison Gale
81f4f2c793 Migrate TODOs referencing old crbug IDs to the new issue tracker IDs
The canonical bug format is TODO(crbug.com/<id>). TODOs of the
following forms will all be migrated to the new format:

- TODO(crbug.com/<old id>)
- TODO(https://crbug.com/<old id>)
- TODO(crbug/<old id>)
- TODO(crbug/monorail/<old id>)
- TODO(<old id>)
- TODO(issues.chromium.org/<old id>)
- TODO(https://issues.chromium.org/<old id>)
- TODO(https://issues.chromium.org/u/1/issues/<old id>)
- TODO(bugs.chromium.org/<old id>)

Bug id mapping is sourced from go/chrome-on-buganizer-prod-issues.
See go/crbug-todo-migration for details.

#crbug-todo-migration

Bug: b/321899722
Change-Id: Iee14d10d544e9f0ec046117cc4ec8a55c427adc0
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5469947
Reviewed-by: Darryl James <dljames@chromium.org>
Owners-Override: Alison Gale <agale@chromium.org>
Commit-Queue: Alison Gale <agale@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1290838}
2024-04-22 19:33:31 +00:00
Alison Gale
53c77f6b62 Migrate TODOs referencing old crbug IDs to the new issue tracker IDs
The canonical bug format is TODO(crbug.com/<id>). TODOs of the
following forms will all be migrated to the new format:

- TODO(crbug.com/<old id>)
- TODO(https://crbug.com/<old id>)
- TODO(crbug/<old id>)
- TODO(crbug/monorail/<old id>)
- TODO(<old id>)
- TODO(issues.chromium.org/<old id>)
- TODO(https://issues.chromium.org/<old id>)
- TODO(https://issues.chromium.org/u/1/issues/<old id>)
- TODO(bugs.chromium.org/<old id>)

Bug id mapping is sourced from go/chrome-on-buganizer-prod-issues.
See go/crbug-todo-migration for details.

#crbug-todo-migration

Bug: b/321899722
Change-Id: Iabdfea2fd5393d6bbc54390ca0c995eb2c55bbaa
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5469882
Reviewed-by: Darryl James <dljames@chromium.org>
Owners-Override: Alison Gale <agale@chromium.org>
Commit-Queue: Alison Gale <agale@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1290673}
2024-04-22 15:16:27 +00:00
Alison Gale
59c007a7ad Migrate TODOs referencing old crbug IDs to the new issue tracker IDs
The canonical bug format is TODO(crbug.com/<id>). TODOs of the
following forms will all be migrated to the new format:

- TODO(crbug.com/<old id>)
- TODO(https://crbug.com/<old id>)
- TODO(crbug/<old id>)
- TODO(crbug/monorail/<old id>)
- TODO(<old id>)
- TODO(issues.chromium.org/<old id>)
- TODO(https://issues.chromium.org/<old id>)
- TODO(https://issues.chromium.org/u/1/issues/<old id>)
- TODO(bugs.chromium.org/<old id>)

Bug id mapping is sourced from go/chrome-on-buganizer-prod-issues.
See go/crbug-todo-migration for details.

#crbug-todo-migration

Bug: b/321899722
Change-Id: Ifd155bbeff882ea939f74cf8b8f847f42847940b
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5468156
Reviewed-by: Darryl James <dljames@chromium.org>
Owners-Override: Alison Gale <agale@chromium.org>
Commit-Queue: Alison Gale <agale@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1290297}
2024-04-20 03:05:40 +00:00
Alison Gale
47d1537de7 Migrate TODOs referencing old crbug IDs to the new issue tracker IDs
The canonical bug format is TODO(crbug.com/<id>). TODOs of the
following forms will all be migrated to the new format:

- TODO(crbug.com/<old id>)
- TODO(https://crbug.com/<old id>)
- TODO(crbug/<old id>)
- TODO(crbug/monorail/<old id>)
- TODO(<old id>)
- TODO(issues.chromium.org/<old id>)
- TODO(https://issues.chromium.org/<old id>)
- TODO(https://issues.chromium.org/u/1/issues/<old id>)
- TODO(bugs.chromium.org/<old id>)

Bug id mapping is sourced from go/chrome-on-buganizer-prod-issues.
See go/crbug-todo-migration for details.

#crbug-todo-migration

Bug: b/321899722
Change-Id: Ieeb461e2d489e86fd50b87a2a0721a2be34520c3
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5467317
Owners-Override: Alison Gale <agale@chromium.org>
Commit-Queue: Darryl James <dljames@chromium.org>
Commit-Queue: Alison Gale <agale@chromium.org>
Reviewed-by: Darryl James <dljames@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1290198}
2024-04-19 21:31:46 +00:00
Nathan Memmott
2ae0eb450a Reland "FSA: Fix edge cases in Lock Manager"
This is a reland of commit a07bd1c23b.

It was reverted because `child_locks_.end()` was being accessed after
`child_locks_` was destroyed.

This reland fixes that and moves the logic to iterate
`pending_callbacks_` of a Pending subtree into a single function.

Patchset 1 is the original reverted commit. Patchset 2 is the fix.

Bug: 332173158
Change-Id: Ibe6613a7a463b636f7f82029491d03a87c0606a7
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5455255
Reviewed-by: Daseul Lee <dslee@chromium.org>
Commit-Queue: Nathan Memmott <memmott@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1288090}
2024-04-16 16:22:30 +00:00
Sébastien Lalancette
4a58315024 Revert "FSA: Fix edge cases in Lock Manager"
This reverts commit a07bd1c23b.

Reason for revert: Likely culprit of the numerous FileSystemAccessLockManagerTest  test failures that started occurring in https://ci.chromium.org/ui/p/chromium/builders/ci/linux-ubsan-vptr/29443/overview

Original change's description:
> FSA: Fix edge cases in Lock Manager
>
> The Lock Manager had some edge cases where Locks were not being cleaned
> up properly. This fixes them and adds tests for each of them.
>
> Bug: 332173158
> Change-Id: Ia3bad2ed65254a2a85d55a415e7681d17762a990
> Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5448348
> Reviewed-by: Daseul Lee <dslee@chromium.org>
> Commit-Queue: Nathan Memmott <memmott@chromium.org>
> Cr-Commit-Position: refs/heads/main@{#1286777}

Bug: 332173158
Change-Id: I7d9a8ac16fe9304865b6ba634a65cf0476e9227f
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5454492
Commit-Queue: Sébastien Lalancette <seblalancette@chromium.org>
Reviewed-by: Ramin Halavati <rhalavati@chromium.org>
Owners-Override: Sébastien Lalancette <seblalancette@chromium.org>
Bot-Commit: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com>
Cr-Commit-Position: refs/heads/main@{#1287388}
2024-04-15 16:08:18 +00:00
Nathan Memmott
a07bd1c23b FSA: Fix edge cases in Lock Manager
The Lock Manager had some edge cases where Locks were not being cleaned
up properly. This fixes them and adds tests for each of them.

Bug: 332173158
Change-Id: Ia3bad2ed65254a2a85d55a415e7681d17762a990
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5448348
Reviewed-by: Daseul Lee <dslee@chromium.org>
Commit-Queue: Nathan Memmott <memmott@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1286777}
2024-04-12 21:46:17 +00:00
Christine Hollingsworth
181c98765b Revert "Reland "FilePathWatcher: Synchronously start watching on Mac""
This reverts commit ecb96d59c4.

Reason for revert: This change is unfortunately causing test flakes again, so need to revert and find the true cause of the flakiness before re-landing again. (crbug.com/332592798)

Original change's description:
> Reland "FilePathWatcher: Synchronously start watching on Mac"
>
> This is a reland of commit b8bf2ad060
>
> The original CL was reverted due to a failing browsertest
> (https://ci.chromium.org/ui/p/chromium/builders/findit/test-single-revision/3436/overview).
>
> It was later determined that this specific test was flaky (https://crbug.com/40939929).
>
> This flake has been resolved as a result of CL: crrev.com/c/5205950
>
> Now that the failing / flaky test has been fixed, this change is ready to re-land in order to unblock FSA Change Observers implementation on Mac.
>
> Original change's description:
> > FilePathWatcher: Synchronously start watching on Mac
> >
> > This CL includes two key changes:
> >
> > 1) Moves all manipulation of the event stream (start, stop, etc)
> >    to the sequence the FilePathWatcher lives on
> >
> > Prior to this CL, the event stream was manipulated on the dispatch
> > queue. This does not appear to have been necessary. Moving the stream
> > manipulation to the sequence the FilePathWatcher lives on allows the
> > event stream to be started synchronously, from the Watch() method
> >
> > 2) Use kFSEventStreamEventIdSinceNow
> >
> > Prior to this CL, the event stream was started via async dispatch in
> > the Watch() method. FSEventsGetCurrentEventId() was used to
> > synchronously get the ID of the most recent (system-wide) event, to
> > ensure that any changes between when Watch() returned and when the
> > stream asynchronously started would be played back as historical
> > events. See the documentation of the sinceWhen field here:
> > https://developer.apple.com/documentation/coreservices/1443980-fseventstreamcreate
> >
> > Since the stream is now started synchronously,
> > kFSEventStreamEventIdSinceNow is sufficient for ensuring that all
> > changes after Watch() returns are noticed
> >
> > Note that creating a stream with kFSEventStreamEventIdSinceNow will
> > no longer fire a "history done" event shortly after stream creation.
> > Any callers which relied on the this behavior may break.
> > See the documentation here:
> > https://developer.apple.com/documentation/coreservices/kfseventstreameventflaghistorydone
> >
> > Bug: 1019297
> > Change-Id: Ib720f8b19d0309714d153de974404fab25b16894
> > Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4814677
> > Reviewed-by: Wez <wez@chromium.org>
> > Commit-Queue: Austin Sullivan <asully@chromium.org>
> > Reviewed-by: Robert Sesek <rsesek@chromium.org>
> > Cr-Commit-Position: refs/heads/main@{#1218981}
>
> Bug: 1019297
> Change-Id: I5d9297c7b3e187bcfdaeaaaf5946984f082b1877
> Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5274142
> Commit-Queue: Christine Hollingsworth <christinesm@chromium.org>
> Reviewed-by: Daseul Lee <dslee@chromium.org>
> Reviewed-by: Wez <wez@chromium.org>
> Cr-Commit-Position: refs/heads/main@{#1281149}

Bug: 1019297
Change-Id: I93b57f4e248fdd79132d6b0e9d92d4aa6b15e1e1
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5424818
Commit-Queue: Mark Mentovai <mark@chromium.org>
Bot-Commit: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com>
Reviewed-by: Daseul Lee <dslee@chromium.org>
Reviewed-by: Mark Mentovai <mark@chromium.org>
Auto-Submit: Christine Hollingsworth <christinesm@chromium.org>
Reviewed-by: Christine Hollingsworth <christinesm@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1283981}
2024-04-08 18:49:02 +00:00
Irem Uguz
39b06e0c36 gardener: Disable FileSystemAccessWatcherManagerTest.WatchLocalDirectoryRecursive
List of failed builders:

Builder: Mac ASan 64 Tests (1) https://ci.chromium.org/p/chromium/builders/ci/Mac%20ASan%2064%20Tests%20%281%29
First failing build: https://ci.chromium.org/p/chromium/builders/ci/Mac%20ASan%2064%20Tests%20%281%29/b8751503229280377377

Bug: chromium:333048551
Change-Id: I51b73933eca19bab4a600b540d02ceff7f5e61f5
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5424957
Auto-Submit: Irem Uguz <iremuguz@google.com>
Commit-Queue: Oleg Davydov <burunduk@chromium.org>
Owners-Override: Irem Uguz <iremuguz@google.com>
Reviewed-by: Oleg Davydov <burunduk@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1283102}
2024-04-05 13:52:21 +00:00
Austin Sullivan
1699c5746e FSA: Retain permissions when renaming a file in the BucketFS
Our move() implementation always checked the permissions of the parent
directory - creating a synthetic FileSystemHandle in the process - even
for renames where the parent is not relevant. This CL instead checks
permissions of the sibling file without creating a synthetic handle

Since the characteristics of this permission check are still not
specified - which resulted in DCHECK crashes when renaming files in a
BucketFS - this CL also adds a temporary hack to ensure that permission
is always granted for files in a BucketFS. See the comment in the
implementation of GetSharedHandleStateForSandboxedPath() for details

Bug: 40270249, 40198034
Change-Id: I877d12624936fcb46e63924ea5844d5b00db6b25
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4655623
Reviewed-by: Nathan Memmott <memmott@chromium.org>
Commit-Queue: Austin Sullivan <asully@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1282858}
2024-04-05 00:22:23 +00:00
Christine Smith
ecb96d59c4 Reland "FilePathWatcher: Synchronously start watching on Mac"
This is a reland of commit b8bf2ad060

The original CL was reverted due to a failing browsertest
(https://ci.chromium.org/ui/p/chromium/builders/findit/test-single-revision/3436/overview).

It was later determined that this specific test was flaky (https://crbug.com/40939929).

This flake has been resolved as a result of CL: crrev.com/c/5205950

Now that the failing / flaky test has been fixed, this change is ready to re-land in order to unblock FSA Change Observers implementation on Mac.

Original change's description:
> FilePathWatcher: Synchronously start watching on Mac
>
> This CL includes two key changes:
>
> 1) Moves all manipulation of the event stream (start, stop, etc)
>    to the sequence the FilePathWatcher lives on
>
> Prior to this CL, the event stream was manipulated on the dispatch
> queue. This does not appear to have been necessary. Moving the stream
> manipulation to the sequence the FilePathWatcher lives on allows the
> event stream to be started synchronously, from the Watch() method
>
> 2) Use kFSEventStreamEventIdSinceNow
>
> Prior to this CL, the event stream was started via async dispatch in
> the Watch() method. FSEventsGetCurrentEventId() was used to
> synchronously get the ID of the most recent (system-wide) event, to
> ensure that any changes between when Watch() returned and when the
> stream asynchronously started would be played back as historical
> events. See the documentation of the sinceWhen field here:
> https://developer.apple.com/documentation/coreservices/1443980-fseventstreamcreate
>
> Since the stream is now started synchronously,
> kFSEventStreamEventIdSinceNow is sufficient for ensuring that all
> changes after Watch() returns are noticed
>
> Note that creating a stream with kFSEventStreamEventIdSinceNow will
> no longer fire a "history done" event shortly after stream creation.
> Any callers which relied on the this behavior may break.
> See the documentation here:
> https://developer.apple.com/documentation/coreservices/kfseventstreameventflaghistorydone
>
> Bug: 1019297
> Change-Id: Ib720f8b19d0309714d153de974404fab25b16894
> Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4814677
> Reviewed-by: Wez <wez@chromium.org>
> Commit-Queue: Austin Sullivan <asully@chromium.org>
> Reviewed-by: Robert Sesek <rsesek@chromium.org>
> Cr-Commit-Position: refs/heads/main@{#1218981}

Bug: 1019297
Change-Id: I5d9297c7b3e187bcfdaeaaaf5946984f082b1877
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5274142
Commit-Queue: Christine Hollingsworth <christinesm@chromium.org>
Reviewed-by: Daseul Lee <dslee@chromium.org>
Reviewed-by: Wez <wez@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1281149}
2024-04-02 14:17:01 +00:00
Rahul Singh
fa8c5cab73 Reland: "FSA Observer: Discard change notifications to non-fully active
pages"

This is a reland of 65d2c48aaf

Reason for revert: The test was failing on linux-bfcache-rel
Revert CL: https://crrev.com/c/5386731

Original change's description:
> FSA Observer: Discard change notifications to non-fully active pages
>
> This change adds a check for the current
> RenderFrameHost::LifecycleState in the Browser process. File system
> change notifications are now sent to the Renderer only for fully
> active pages.
>
> Bug: 40283779
> Change-Id: I90f6aa52e3a7d1513a286fc61ff0921c948518b5
> Reviewed-on: https://crrev.com/c/5350591
> Reviewed-by: Rahul Singh <rahsin@microsoft.com>
> Commit-Queue: Rahul Singh <rahsin@microsoft.com>
> Reviewed-by: Austin Sullivan <asully@chromium.org>
> Reviewed-by: Christine Hollingsworth <christinesm@chromium.org>
> Cr-Commit-Position: refs/heads/main@{#1276479}

Bug: 40283779
Change-Id: I0f47aa417992d9e02708020e5188ad16348c3f14
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5387021
Commit-Queue: Rahul Singh <rahsin@microsoft.com>
Reviewed-by: Austin Sullivan <asully@chromium.org>
Reviewed-by: Christine Hollingsworth <christinesm@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1277087}
2024-03-22 21:06:30 +00:00
Khalid Peer
41a7b14528 Revert "FSA Observer: Discard change notifications to non-fully active pages"
This reverts commit 65d2c48aaf.

Reason for revert: The original CL is causing failures on the linux-bfcache-rel builder.

Original change's description:
> FSA Observer: Discard change notifications to non-fully active pages
>
> This change adds a check for the current RenderFrameHost::LifecycleState
> in the Browser process. File system change
> notifications are now sent to the Renderer only for fully active pages.
>
> Bug: 40283779
> Change-Id: I90f6aa52e3a7d1513a286fc61ff0921c948518b5
> Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5350591
> Reviewed-by: Rahul Singh <rahsin@microsoft.com>
> Commit-Queue: Rahul Singh <rahsin@microsoft.com>
> Reviewed-by: Austin Sullivan <asully@chromium.org>
> Reviewed-by: Christine Hollingsworth <christinesm@chromium.org>
> Cr-Commit-Position: refs/heads/main@{#1276479}

Bug: 40283779
Change-Id: Id9053e8bc77e40288f0092d97d65635037c69bf1
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5386731
Commit-Queue: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com>
Owners-Override: Khalid Peer <khalidpeer@chromium.org>
Bot-Commit: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com>
Auto-Submit: Khalid Peer <khalidpeer@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1276580}
2024-03-21 23:13:19 +00:00
Rahul Singh
65d2c48aaf FSA Observer: Discard change notifications to non-fully active pages
This change adds a check for the current RenderFrameHost::LifecycleState
in the Browser process. File system change
notifications are now sent to the Renderer only for fully active pages.

Bug: 40283779
Change-Id: I90f6aa52e3a7d1513a286fc61ff0921c948518b5
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5350591
Reviewed-by: Rahul Singh <rahsin@microsoft.com>
Commit-Queue: Rahul Singh <rahsin@microsoft.com>
Reviewed-by: Austin Sullivan <asully@chromium.org>
Reviewed-by: Christine Hollingsworth <christinesm@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1276479}
2024-03-21 20:46:48 +00:00
Roger Tawa
b454f91489 Add content analysis to File System Access Javascript API.
Bug: b:306616323
Change-Id: Ia6cdd89523a26f6b0902a28cfd3f305a8be009dc
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5301485
Reviewed-by: Daseul Lee <dslee@chromium.org>
Reviewed-by: Austin Sullivan <asully@chromium.org>
Commit-Queue: Roger Tawa <rogerta@chromium.org>
Reviewed-by: Avi Drissman <avi@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1271526}
2024-03-12 13:51:05 +00:00
Daseul Lee
ec28470410 [FSA] Disable the path that checks the blocklist when getting entries()
Different values are returned for each run, likely due to race
condition.

Bug: 328115444
Change-Id: I4655046684a44b254f5cbf02bfcf09994a5ad280
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5354890
Reviewed-by: Christine Hollingsworth <christinesm@chromium.org>
Commit-Queue: Daseul Lee <dslee@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1270330}
2024-03-08 19:21:02 +00:00
Rahul Singh
b694dcb617 FileSystemAccess: Rename FileSystemAccessCapacityAllocationHost
This change renames FileSystemAccessCapacityAllocationHost to
FileSystemAccessFileModificationHost.

As part of this, all variables and filenames containing references to
*capacity_allocation* have been updated to *file_modification*.

Bug: 40284828
Change-Id: Ifdf4327adddaa02e0fb6c0398474d87f850e5fe1
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5322681
Reviewed-by: Daniel Cheng <dcheng@chromium.org>
Commit-Queue: Daniel Cheng <dcheng@chromium.org>
Reviewed-by: Christine Hollingsworth <christinesm@chromium.org>
Reviewed-by: Austin Sullivan <asully@chromium.org>
Auto-Submit: Rahul Singh <rahsin@microsoft.com>
Reviewed-by: Kent Tamura <tkent@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1266851}
2024-02-29 06:51:32 +00:00
Nathan Memmott
5229c6ab98 FSA: Fix crash when Pending Lock is destroyed on promotion
When a Pending Lock is being promoted to a Taken Lock and none of its
pending_callbacks_ keep their LockHandle alive, the Pending Lock will be
destroyed before the pending_callbacks_ have been cleared.

Fixed: 41494615
Change-Id: I5e9f8c1e5a9a6820dc57178ee00cf5d1d56113dc
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5313923
Reviewed-by: Austin Sullivan <asully@chromium.org>
Commit-Queue: Nathan Memmott <memmott@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1263668}
2024-02-22 00:06:40 +00:00
Weizhong Xia
8f0a38f9ca Use --user-data-dir to specify data dir for Content Shell
Chromedriver will provide '--user-data-dir' and read the active port
from there. Using "--user-data-dir" to replace previous "--data-path".

Bug: 1295373
Change-Id: I42766b2d7999b5e33e2dff0be4f54c08cf2a0e78
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5226609
Commit-Queue: Weizhong Xia <weizhong@google.com>
Reviewed-by: danakj <danakj@chromium.org>
Reviewed-by: Dmitry Gozman <dgozman@chromium.org>
Reviewed-by: Reilly Grant <reillyg@chromium.org>
Reviewed-by: Scott Violet <sky@chromium.org>
Reviewed-by: Daseul Lee <dslee@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1263050}
2024-02-21 00:50:32 +00:00
Takuto Ikuta
a47d7859c4 autofill: remove unnecessary include from browser_test_base.h
This is extracted from https://crrev.com/c/5280997 to reduce compile
time of some test files.

content/public/test/browser_test_base.h is the file removing
unnecessary header.

Bug: b/324519459
Change-Id: Ic6b8e4328f6be3161dd3f09711451c8578032ef4
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5300036
Owners-Override: John Abd-El-Malek <jam@chromium.org>
Commit-Queue: Takuto Ikuta <tikuta@chromium.org>
Reviewed-by: John Abd-El-Malek <jam@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1262233}
2024-02-19 03:46:58 +00:00
Jeff Yoon
d1328c4408 [buganizer] Migrate DIR_METADATA in content/browser/
Migrate all metadata files for content/browser.

Verify components with http://b/components/{id} or at
go/chrome-on-buganizer-prod-components.

Bug: chromium:1518875
Change-Id: I555b9fe40952a5707e167b3dcbaf2858bbdf1f34
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5284095
Reviewed-by: Avi Drissman <avi@chromium.org>
Commit-Queue: Avi Drissman <avi@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1258966}
2024-02-11 19:24:26 +00:00
Daseul Lee
2e331803aa [FSA] Fix locking failure when child name is the same as parent.
Currently, taking a lock on a file path fails if the components of the
file path contains any same name amongst themselves. For example,
"/foo/foo" or "/foo/bar/foo" fails. This is due to `child_locks_` map
is keyed on a component name (i.e. "foo", "bar"); instead, it should use
a unique key, such as a full file path.

Bug: 1523851
Change-Id: If1dd17401ababa5a82589eec3170ea1f9bf165c6
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5262943
Commit-Queue: Daseul Lee <dslee@chromium.org>
Reviewed-by: Christine Hollingsworth <christinesm@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1256302}
2024-02-05 18:38:11 +00:00
Nathan Memmott
035e7abb45 FSA: Prevent showing FilePicker if one is already active
This prevents more than one file picker being shown at a time.

Bug: 1501407
Change-Id: If2ee1560d0785f4d8bab8f03621c95112ec02cf6
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5190708
Reviewed-by: Mustaq Ahmed <mustaq@chromium.org>
Commit-Queue: Nathan Memmott <memmott@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1256276}
2024-02-05 18:23:29 +00:00
Christine Smith
d634a20cfa [FSA] Extend timeout for Change Observers browsertests
Updates the timeout value used in Change Observers
browsertests to use `action_timeout()` instead of
`tiny_timeout()` to help resolve test flakiness issue.

Bug: 1499075
Change-Id: I4703d419f3bb1a92ab9f373f7266bd61219cd5c0
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5205950
Commit-Queue: Christine Hollingsworth <christinesm@chromium.org>
Reviewed-by: Daseul Lee <dslee@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1249052}
2024-01-18 21:35:01 +00:00
Daseul Lee
982f9dd7d8 Disable a failing test case on FileSystemAccessWatcherManagerTest.
Bug: 1517278
Change-Id: I2f664ccdbcbb71ce9aa6f8c5da9709db104d034a
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5191127
Auto-Submit: Daseul Lee <dslee@chromium.org>
Commit-Queue: Nathan Memmott <memmott@chromium.org>
Reviewed-by: Nathan Memmott <memmott@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1246504}
2024-01-12 17:08:36 +00:00
Arthur Sonzogni
c686e8f4fd Rename {absl => std}::optional in //content/
Automated patch, intended to be effectively a no-op.

Context:
https://groups.google.com/a/chromium.org/g/cxx/c/nBD_1LaanTc/m/ghh-ZZhWAwAJ?utm_medium=email&utm_source=footer

As of https://crrev.com/1204351, absl::optional is now a type alias for
std::optional. We should migrate toward it.

Script:
```
function replace {
  echo "Replacing $1 by $2"
  git grep -l "$1" \
    | cut -f1 -d: \
    | grep \
      -e "^content" \
    | sort \
    | uniq \
    | grep \
      -e "\.h" \
      -e "\.cc" \
      -e "\.mm" \
      -e "\.py" \
    | xargs sed -i "s/$1/$2/g"
}
replace "absl::make_optional" "std::make_optional"
replace "absl::optional" "std::optional"
replace "absl::nullopt" "std::nullopt"
replace "absl::in_place" "std::in_place"
replace "absl::in_place_t" "std::in_place_t"
replace "\"third_party\/abseil-cpp\/absl\/types\/optional.h\"" "<optional>"
git cl format
```

# Skipping unrelated "check_network_annotation" errors.
NOTRY=True

Bug: chromium:1500249
Change-Id: Icfd31a71d8faf63a2e8d5401127e7ee74cc1c413
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5185537
Auto-Submit: Arthur Sonzogni <arthursonzogni@chromium.org>
Commit-Queue: Arthur Sonzogni <arthursonzogni@chromium.org>
Owners-Override: Avi Drissman <avi@chromium.org>
Reviewed-by: Avi Drissman <avi@chromium.org>
Reviewed-by: danakj <danakj@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1245739}
2024-01-11 08:36:37 +00:00
Daseul Lee
296626af45 [FSA] Enable blocklist check on symbolic links on POSIX.
Resolving symbolic links via `base::MakeAbsoluteFilePath()` only
works on POSIX, but not on Windows. Enable the partial fix on
POSIX only for now.

Bug: 1378484
Change-Id: I3a590153c320717f5a57cc777f8f50dec38d3b1b
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5165788
Commit-Queue: Daseul Lee <dslee@chromium.org>
Reviewed-by: Ayu Ishii <ayui@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1243601}
2024-01-05 21:04:12 +00:00
Nathan Memmott
0dce112ae2 FSA: Prevent repeated calls to FileSystemAccessAccessHandleHost.Close
In production code, a compromised renderer can call the mojo function
FileSystemAccessAccessHandleHost.Close multiple times on the same
access handle. This puts chrome in an invalid state. This fixes it by
killing the renderer if it attempts to do this.

Fixed: 1514301
Change-Id: I0b148fd908d5caeab223514efe0e9cd5eb0aa933
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5160388
Reviewed-by: Daseul Lee <dslee@chromium.org>
Commit-Queue: Daseul Lee <dslee@chromium.org>
Auto-Submit: Nathan Memmott <memmott@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1242153}
2024-01-02 21:56:31 +00:00
Avi Drissman
d0b88a2bb4 Simplify SelectFileDialog::Listener
SelectFileDialog::Listener has two variants for each type of
selection. Consolidate each of those two variants into one.

Fixed: 1514382
Low-Coverage-Reason: LARGE_SCALE_REFACTOR This is a refactor of how a specific interface works
Change-Id: I6cf8c2ebb36ba30b351c0108dd7cad848ace9380
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5148579
Commit-Queue: Avi Drissman <avi@chromium.org>
Owners-Override: Avi Drissman <avi@chromium.org>
Reviewed-by: Yuwei Huang <yuweih@chromium.org>
Reviewed-by: Peter Kasting <pkasting@chromium.org>
Reviewed-by: Jimmy Gong <jimmyxgong@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1241424}
2023-12-28 22:49:38 +00:00
David Black
ec2f7a64dc Notify subscribers of file creation via window.showSaveFilePicker().
This CL notifies subscribers of file creation events originating from
`window.showSaveFilePicker()`. This will be used by Holding Space to
conditionally add items to the user's Tote when files are created from
certain domains.

Bug: b:310708275
Change-Id: I3f05c6994a10cce136a51e82d22d3572a8393cbd
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5026500
Commit-Queue: David Black <dmblack@google.com>
Reviewed-by: Avi Drissman <avi@chromium.org>
Reviewed-by: Evan Stade <estade@chromium.org>
Reviewed-by: Ayu Ishii <ayui@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1240361}
2023-12-21 22:56:16 +00:00
Austin Sullivan
172be04aac Code Health: Spanification of //storage part 1/x
Bug: 1513004
Change-Id: Idb422a5f3bfc9923da5aea5d90451544458c2df0
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5132571
Commit-Queue: Yury Khmel <khmel@chromium.org>
Auto-Submit: Austin Sullivan <asully@chromium.org>
Reviewed-by: Yury Khmel <khmel@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1239871}
2023-12-20 22:51:33 +00:00
Daseul Lee
c678024944 [FSA] Handle symbolic links when checking blocklists.
(1) When checking blocklists, use a resolved path returned from
`base::MakeAbsoluteFilePath()`, which is expected to resolve any
symbolic link.

(2) Additionally, check for blocklist when getting a file handle or
entries (that are files) from a directory handle. With (1), this check
will make sure any new symlink created after the initial check on the
parent directory is caught and re-run with blocklist check on fully
resolved path.

Previously, crrev.com/c/4005144 attempted to handle case (2) partially
on POSIX, using `base::IsLink()` and `base::ReadSymbolicLink()`, causing
some potential bugs. This CL re-attempts to fix the issue using
`base::MakeAbsoluteFilePath()`, which is available on both POSIX and
Windows.

Both features are disabled and will be enabled after testing.

Bug: 1378484
Change-Id: If319359492c08dd829b42262918ad208bbc351c8
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5068377
Reviewed-by: Ayu Ishii <ayui@chromium.org>
Commit-Queue: Daseul Lee <dslee@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1234657}
2023-12-07 19:52:52 +00:00
Nathan Memmott
15f458be5a [FSA] Fix a crash in the destruction of SAHs in incognito
SAHs hold locks on their file. When we attempt to create another SAH on
that file, we will evict the current lock if we need to and we can.
Until the lock is destroyed, the new SAH is waiting to be created. The
destruction of the old SAH triggers the destruction of the lock which
then triggers the creation of the new SAH.

In the FileSystemAccessManagerImpl, this means
`access_handle_host_receivers_`'s `erase` could call into its `insert`
which is undefined behavior. This separates the erasing from that set
and the destruction of the SAH.

This bug only happened in incognito because of some checks that are
skipped in incognito which allows all of this to happen synchronously.

Bug: 1382215
Change-Id: Ib92d6de2843710472450def0453d63db6756464c
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5081251
Reviewed-by: Daseul Lee <dslee@chromium.org>
Commit-Queue: Nathan Memmott <memmott@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1233015}
2023-12-04 22:35:56 +00:00
Nigel Tao
aa2cf6a4fd [storage] add FileSystemOperation::GetMetadataFieldSet
This EnumSet is more strongly typed than the previously-used int. For
example, prior to this commit, async_file_util.h had "void
GetFileInfo(..., int fields, ...)" and it was not obvious what enum the
int was supposed to represent.

The storage/browser/file_system/file_system_operation.h change is the
essential edit. Everything else follows from that.

Bug: None
Test: CQ
Change-Id: Ide8e37c1d9ebe65c69e59cfa2915e303973b0ba4
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5075244
Reviewed-by: Derek Schuff <dschuff@chromium.org>
Reviewed-by: Austin Sullivan <asully@chromium.org>
Commit-Queue: Nigel Tao <nigeltao@chromium.org>
Code-Coverage: findit-for-me@appspot.gserviceaccount.com <findit-for-me@appspot.gserviceaccount.com>
Reviewed-by: Sergey Poromov <poromov@chromium.org>
Reviewed-by: Alan Ding <alanding@chromium.org>
Reviewed-by: Dominique Fauteux-Chapleau <domfc@chromium.org>
Reviewed-by: Mitsuru Oshima <oshima@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1232516}
2023-12-03 23:07:14 +00:00
Nathan Memmott
b8ced9cb9e FSA: Add separate flag for FSA BFCache changes
Currently the BFCache changes are enabled by the same flag that the
locking scheme feature is. This separates them so that we can kill just
the BFCache changes if needed.

Is enabled by default but the changes are only enabled if both the
BFCache flag and the locking scheme flag are enabled. That way by
default the BFCache changes are controlled by the locking scheme flag.

Bug: 1382215, 1241174
Change-Id: Ibe88c3f87f9564eeb3e80e11c1b00487d306277c
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5050409
Reviewed-by: Daseul Lee <dslee@chromium.org>
Commit-Queue: Daseul Lee <dslee@chromium.org>
Auto-Submit: Nathan Memmott <memmott@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1228092}
2023-11-22 18:14:14 +00:00
Andrew Rayskiy
be08b98b11 [base] Remove base::Erase()/base::EraseIf() overloads for std::list
They're now replaced with C++20 std::erase()/std::erase_if().

Bug: 1414639
Change-Id: I2f38a845f132bb4115563547f3669f79b7b6c7ba
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5049925
Commit-Queue: Andrew Rayskiy <greengrape@google.com>
Reviewed-by: Kyle Charbonneau <kylechar@chromium.org>
Owners-Override: Kyle Charbonneau <kylechar@chromium.org>
Code-Coverage: findit-for-me@appspot.gserviceaccount.com <findit-for-me@appspot.gserviceaccount.com>
Cr-Commit-Position: refs/heads/main@{#1228003}
2023-11-22 15:39:56 +00:00
Nathan Memmott
455da0a0a6 FSA: Return LockHandle after eviction
This is the final changes needed to implement BFCache logic for the File
System Access API. This change makes it so that when we attempt to take
a Lock on file with an existing contentious Lock, we can evict the Lock
if it is held by only inactive pages, and return the new Lock after
eviction.

When we evict a Lock to take a new Lock, the new Lock is pending until
the evicting Lock has been evicted. The pending Lock is not given to the
TakeLock caller until it is no longer pending.

While it is pending though, it is still considered an active Lock, and
all further calls to TakeLock will assume it exists.

If we attempt to take a Lock that is a child of a pending Lock, then it
will also be pending and the caller will not receive the Lock until the
ancestor pending Lock's evicting Lock has been evicted.

If we attempt to take a Lock that is in contention with a pending Lock,
then we can also evict the pending Lock if it is held only by inactive
pages. The callers for the evicting pending Lock will never receive it.
And the new pending Lock waits for the eviction of the original evicting
Lock that the evicting pending Lock was waiting on.

If we evict a Lock that has multiple pending Lock children, then the new
Lock must wait for the eviction of all the child pending Locks' evicting
locks.

Bug: 1382215, 1241174
Change-Id: Iabd602a6ae37bfb69f10e13f08cfb3c1c77bdbd2
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4994423
Reviewed-by: Austin Sullivan <asully@chromium.org>
Commit-Queue: Nathan Memmott <memmott@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1226460}
2023-11-18 01:11:15 +00:00
Austin Sullivan
38ce1a5b3d Remove asully@ from most Storage OWNERS files
Also adds some other folks as owners. More files will be updated to
remove asully@ in follow-up CLs

Change-Id: Iab67fa6a55ed2891e9333a8fb41a659dc2255f8d
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5019014
Commit-Queue: Austin Sullivan <asully@chromium.org>
Reviewed-by: Evan Stade <estade@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1223873}
2023-11-13 21:41:36 +00:00
Daseul Lee
579fa0d3d5 Disable ObserveDirectoryRecursively test case.
This test case is disabled for now while the issue is debugged.

Bug: 1499075
Change-Id: I9192710114736e9249aa22b1ed4d9516454f2834
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5017628
Commit-Queue: Daseul Lee <dslee@chromium.org>
Reviewed-by: Christine Smith <christinesm@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1222940}
2023-11-10 15:41:19 +00:00
luci-bisection@appspot.gserviceaccount.com
e83bee8d5d Revert "FilePathWatcher: Synchronously start watching on Mac"
This reverts commit b8bf2ad060.

Reason for revert:
LUCI Bisection has identified this change as the cause of a test failure. See the analysis: https://ci.chromium.org/ui/p/chromium/bisection/test-analysis/b/5713759915999232

Sample build with failed test: https://ci.chromium.org/b/8765511037820635393
Affected test(s):
[ninja://content/test:content_browsertests/FileSystemAccessObserverBrowserTest.ObserveDirectoryRecursively/1](https://ci.chromium.org/ui/test/chromium/ninja:%2F%2Fcontent%2Ftest:content_browsertests%2FFileSystemAccessObserverBrowserTest.ObserveDirectoryRecursively%2F1?q=VHash%3A3c1b07ee95842fb1)

If this is a false positive, please report it at http://b.corp.google.com/createIssue?component=1199205&description=Analysis%3A+https%3A%2F%2Fci.chromium.org%2Fui%2Fp%2Fchromium%2Fbisection%2Ftest-analysis%2Fb%2F5713759915999232&format=PLAIN&priority=P3&title=Wrongly+blamed+https%3A%2F%2Fchromium-review.googlesource.com%2Fc%2Fchromium%2Fsrc%2F%2B%2F4814677&type=BUG

Original change's description:
> FilePathWatcher: Synchronously start watching on Mac
>
> This CL includes two key changes:
>
> 1) Moves all manipulation of the event stream (start, stop, etc)
>    to the sequence the FilePathWatcher lives on
>
> Prior to this CL, the event stream was manipulated on the dispatch
> queue. This does not appear to have been necessary. Moving the stream
> manipulation to the sequence the FilePathWatcher lives on allows the
> event stream to be started synchronously, from the Watch() method
>
> 2) Use kFSEventStreamEventIdSinceNow
>
> Prior to this CL, the event stream was started via async dispatch in
> the Watch() method. FSEventsGetCurrentEventId() was used to
> synchronously get the ID of the most recent (system-wide) event, to
> ensure that any changes between when Watch() returned and when the
> stream asynchronously started would be played back as historical
> events. See the documentation of the sinceWhen field here:
> https://developer.apple.com/documentation/coreservices/1443980-fseventstreamcreate
>
> Since the stream is now started synchronously,
> kFSEventStreamEventIdSinceNow is sufficient for ensuring that all
> changes after Watch() returns are noticed
>
> Note that creating a stream with kFSEventStreamEventIdSinceNow will
> no longer fire a "history done" event shortly after stream creation.
> Any callers which relied on the this behavior may break.
> See the documentation here:
> https://developer.apple.com/documentation/coreservices/kfseventstreameventflaghistorydone
>
> Bug: 1019297
> Change-Id: Ib720f8b19d0309714d153de974404fab25b16894
> Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4814677
> Reviewed-by: Wez <wez@chromium.org>
> Commit-Queue: Austin Sullivan <asully@chromium.org>
> Reviewed-by: Robert Sesek <rsesek@chromium.org>
> Cr-Commit-Position: refs/heads/main@{#1218981}
>

Bug: 1019297
Change-Id: I8a2efb510358994db3cc908022c6ad2ff49f7189
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5001660
Owners-Override: Giovanni Ortuno Urquidi <ortuno@chromium.org>
Reviewed-by: Giovanni Ortuno Urquidi <ortuno@chromium.org>
Commit-Queue: Giovanni Ortuno Urquidi <ortuno@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1219234}
2023-11-03 00:39:30 +00:00
Austin Sullivan
b8bf2ad060 FilePathWatcher: Synchronously start watching on Mac
This CL includes two key changes:

1) Moves all manipulation of the event stream (start, stop, etc)
   to the sequence the FilePathWatcher lives on

Prior to this CL, the event stream was manipulated on the dispatch
queue. This does not appear to have been necessary. Moving the stream
manipulation to the sequence the FilePathWatcher lives on allows the
event stream to be started synchronously, from the Watch() method

2) Use kFSEventStreamEventIdSinceNow

Prior to this CL, the event stream was started via async dispatch in
the Watch() method. FSEventsGetCurrentEventId() was used to
synchronously get the ID of the most recent (system-wide) event, to
ensure that any changes between when Watch() returned and when the
stream asynchronously started would be played back as historical
events. See the documentation of the sinceWhen field here:
https://developer.apple.com/documentation/coreservices/1443980-fseventstreamcreate

Since the stream is now started synchronously,
kFSEventStreamEventIdSinceNow is sufficient for ensuring that all
changes after Watch() returns are noticed

Note that creating a stream with kFSEventStreamEventIdSinceNow will
no longer fire a "history done" event shortly after stream creation.
Any callers which relied on the this behavior may break.
See the documentation here:
https://developer.apple.com/documentation/coreservices/kfseventstreameventflaghistorydone

Bug: 1019297
Change-Id: Ib720f8b19d0309714d153de974404fab25b16894
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4814677
Reviewed-by: Wez <wez@chromium.org>
Commit-Queue: Austin Sullivan <asully@chromium.org>
Reviewed-by: Robert Sesek <rsesek@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1218981}
2023-11-02 18:23:57 +00:00
Austin Sullivan
29dade55d2 FSA: Remove flag guarding skipping after write checks
Bug: 1247850
Change-Id: If8c14cb306c94569e9a6f4964f088660d4cc9a7e
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4998490
Reviewed-by: Christine Smith <christinesm@chromium.org>
Commit-Queue: Austin Sullivan <asully@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1218953}
2023-11-02 17:54:04 +00:00
Austin Sullivan
09227f72af FSA: Remove flag guarding the remove() self method
Bug: 1114923
Change-Id: I2c219e7013a3ff5927b737bb922f4c351204d0c5
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4999266
Reviewed-by: Christine Smith <christinesm@chromium.org>
Commit-Queue: Austin Sullivan <asully@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1218951}
2023-11-02 17:49:05 +00:00
Austin Sullivan
9d46c0737d FSA: Remove flag guarding a user gesture requirement for move()
Bug: 1394837
Change-Id: Ie49c4c682d044e204d5d3e5773c6ad55685cd96e
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4998576
Reviewed-by: Christine Smith <christinesm@chromium.org>
Auto-Submit: Austin Sullivan <asully@chromium.org>
Commit-Queue: Christine Smith <christinesm@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1218948}
2023-11-02 17:43:05 +00:00
Austin Sullivan
be7e1b23ea FSA: Remove flag guarding move() of local files
Bug: 1140805
Change-Id: I259c25a5c16fc2f08a7a4f800367fc02425e5737
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4999041
Reviewed-by: Christine Smith <christinesm@chromium.org>
Auto-Submit: Austin Sullivan <asully@chromium.org>
Commit-Queue: Christine Smith <christinesm@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1218909}
2023-11-02 17:06:02 +00:00
Austin Sullivan
f0b2e422ce FSA: Remove flag guarding the clonefile optimization on Mac
Bug: 1413443
Change-Id: I3d612824f6e81a1ece12f63ee7ea6c5af8efc2c9
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4998916
Reviewed-by: Christine Smith <christinesm@chromium.org>
Auto-Submit: Austin Sullivan <asully@chromium.org>
Commit-Queue: Christine Smith <christinesm@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1218856}
2023-11-02 16:05:41 +00:00
Austin Sullivan
302c15e260 FSA: Remove flag guarding whether move() can overwrite a file
Bug: 1381621
Change-Id: I3b4082b72e4579c98cea4a1e6bb351a58420e48d
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4999107
Auto-Submit: Austin Sullivan <asully@chromium.org>
Reviewed-by: Christine Smith <christinesm@chromium.org>
Commit-Queue: Christine Smith <christinesm@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1218854}
2023-11-02 16:04:33 +00:00