Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(340)

Issue 18565002: [FileSystem] Add another copy-or-move validation hook for post-write. (Closed)

Created:
7 years, 5 months ago by Greg Billock
Modified:
7 years, 4 months ago
CC:
tommycli, chromium-reviews, Lei Zhang, tzik+watch_chromium.org, darin-cc_chromium.org, kinuko+watch
Visibility:
Public.

Description

[FileSystem] Add another copy-or-move validation hook for post-write. This is because any AV trigger needs to happen after the file is in its final location. R=kinuko@chromium.org, vandebo@chromium.org BUG=None Committed: https://src.chromium.org/viewvc/chrome?view=rev&revision=213267

Patch Set 1 #

Total comments: 14

Patch Set 2 : Simplify dest validation callbacks and delete dest file on error #

Total comments: 14

Patch Set 3 : Pass file ref to validator #

Total comments: 6

Patch Set 4 : Use second callback in validator #

Patch Set 5 : Add test #

Total comments: 24

Patch Set 6 : Manage file_ref in calling code, remove from API. #

Total comments: 14

Patch Set 7 : Change validation method signature #

Patch Set 8 : Beginnings of test for post-write validation failure #

Patch Set 9 : Test fixes #

Total comments: 14

Patch Set 10 : Rebase #

Patch Set 11 : Rebase #

Patch Set 12 : Add test failure logging #

Patch Set 13 : Fix flakey test #

Unified diffs Side-by-side diffs Delta from patch set Stats (+310 lines, -30 lines) Patch
M chrome/browser/media_galleries/fileapi/media_file_validator_factory.cc View 1 2 3 4 5 6 2 chunks +9 lines, -1 line 0 comments Download
M chrome/browser/media_galleries/fileapi/supported_image_type_validator.h View 1 2 3 4 5 6 2 chunks +7 lines, -3 lines 0 comments Download
M chrome/browser/media_galleries/fileapi/supported_image_type_validator.cc View 1 2 3 4 5 6 2 chunks +15 lines, -2 lines 0 comments Download
M webkit/browser/fileapi/copy_or_move_file_validator.h View 1 2 3 4 5 6 1 chunk +10 lines, -1 line 0 comments Download
M webkit/browser/fileapi/copy_or_move_file_validator_unittest.cc View 1 2 3 4 5 6 7 8 9 10 6 chunks +43 lines, -13 lines 0 comments Download
M webkit/browser/fileapi/copy_or_move_operation_delegate.h View 1 2 3 4 5 6 1 chunk +21 lines, -1 line 0 comments Download
M webkit/browser/fileapi/copy_or_move_operation_delegate.cc View 1 2 3 4 5 6 7 8 7 chunks +99 lines, -8 lines 0 comments Download
M webkit/browser/fileapi/copy_or_move_operation_delegate_unittest.cc View 1 2 3 4 5 6 7 8 9 10 11 12 6 chunks +105 lines, -1 line 0 comments Download
M webkit/browser/fileapi/test_file_system_backend.cc View 1 2 3 4 5 6 7 8 9 1 chunk +1 line, -0 lines 0 comments Download

Messages

Total messages: 37 (0 generated)
Greg Billock
7 years, 5 months ago (2013-07-02 18:20:36 UTC) #1
vandebo (ex-Chrome)
https://codereview.chromium.org/18565002/diff/1/chrome/browser/media_galleries/fileapi/supported_image_type_validator.cc File chrome/browser/media_galleries/fileapi/supported_image_type_validator.cc (right): https://codereview.chromium.org/18565002/diff/1/chrome/browser/media_galleries/fileapi/supported_image_type_validator.cc#newcode134 chrome/browser/media_galleries/fileapi/supported_image_type_validator.cc:134: // TODO(gbillock): Insert AV call here. Since we will ...
7 years, 5 months ago (2013-07-02 18:43:05 UTC) #2
Greg Billock
https://codereview.chromium.org/18565002/diff/1/chrome/browser/media_galleries/fileapi/supported_image_type_validator.cc File chrome/browser/media_galleries/fileapi/supported_image_type_validator.cc (right): https://codereview.chromium.org/18565002/diff/1/chrome/browser/media_galleries/fileapi/supported_image_type_validator.cc#newcode134 chrome/browser/media_galleries/fileapi/supported_image_type_validator.cc:134: // TODO(gbillock): Insert AV call here. On 2013/07/02 18:43:05, ...
7 years, 5 months ago (2013-07-02 19:17:38 UTC) #3
vandebo (ex-Chrome)
https://codereview.chromium.org/18565002/diff/1/webkit/browser/fileapi/copy_or_move_operation_delegate.cc File webkit/browser/fileapi/copy_or_move_operation_delegate.cc (right): https://codereview.chromium.org/18565002/diff/1/webkit/browser/fileapi/copy_or_move_operation_delegate.cc#newcode236 webkit/browser/fileapi/copy_or_move_operation_delegate.cc:236: const scoped_refptr<webkit_blob::ShareableFileReference>& file_ref) { On 2013/07/02 19:17:39, Greg Billock ...
7 years, 5 months ago (2013-07-02 20:15:01 UTC) #4
kinuko
I'm a bit unclear about this check... at the time where we run the post-write ...
7 years, 5 months ago (2013-07-03 04:53:07 UTC) #5
vandebo (ex-Chrome)
On 2013/07/03 04:53:07, kinuko wrote: > I'm a bit unclear about this check... at the ...
7 years, 5 months ago (2013-07-03 05:00:29 UTC) #6
kinuko
On 2013/07/03 05:00:29, vandebo wrote: > On 2013/07/03 04:53:07, kinuko wrote: > > I'm a ...
7 years, 5 months ago (2013-07-03 10:11:28 UTC) #7
Greg Billock
On 2013/07/03 10:11:28, kinuko wrote: > On 2013/07/03 05:00:29, vandebo wrote: > > On 2013/07/03 ...
7 years, 5 months ago (2013-07-03 15:33:19 UTC) #8
Greg Billock
https://codereview.chromium.org/18565002/diff/5002/chrome/browser/media_galleries/fileapi/supported_image_type_validator.cc File chrome/browser/media_galleries/fileapi/supported_image_type_validator.cc (right): https://codereview.chromium.org/18565002/diff/5002/chrome/browser/media_galleries/fileapi/supported_image_type_validator.cc#newcode130 chrome/browser/media_galleries/fileapi/supported_image_type_validator.cc:130: const fileapi::CopyOrMoveFileValidator::ResultCallback& result_callback) { On 2013/07/03 04:53:08, kinuko wrote: ...
7 years, 5 months ago (2013-07-03 16:08:27 UTC) #9
kinuko
Thanks for the clarification. https://codereview.chromium.org/18565002/diff/15001/chrome/browser/media_galleries/fileapi/supported_image_type_validator.cc File chrome/browser/media_galleries/fileapi/supported_image_type_validator.cc (right): https://codereview.chromium.org/18565002/diff/15001/chrome/browser/media_galleries/fileapi/supported_image_type_validator.cc#newcode134 chrome/browser/media_galleries/fileapi/supported_image_type_validator.cc:134: callback_ = result_callback; Can we ...
7 years, 5 months ago (2013-07-04 03:10:12 UTC) #10
Greg Billock
https://codereview.chromium.org/18565002/diff/15001/chrome/browser/media_galleries/fileapi/supported_image_type_validator.cc File chrome/browser/media_galleries/fileapi/supported_image_type_validator.cc (right): https://codereview.chromium.org/18565002/diff/15001/chrome/browser/media_galleries/fileapi/supported_image_type_validator.cc#newcode134 chrome/browser/media_galleries/fileapi/supported_image_type_validator.cc:134: callback_ = result_callback; On 2013/07/04 03:10:12, kinuko wrote: > ...
7 years, 5 months ago (2013-07-08 20:01:52 UTC) #11
kinuko
webkit/ lgtm https://codereview.chromium.org/18565002/diff/24001/webkit/browser/fileapi/copy_or_move_file_validator_unittest.cc File webkit/browser/fileapi/copy_or_move_file_validator_unittest.cc (right): https://codereview.chromium.org/18565002/diff/24001/webkit/browser/fileapi/copy_or_move_file_validator_unittest.cc#newcode311 webkit/browser/fileapi/copy_or_move_file_validator_unittest.cc:311: new TestCopyOrMoveFileValidatorFactory(true, false)); nit: add comment for ...
7 years, 5 months ago (2013-07-10 04:42:19 UTC) #12
vandebo (ex-Chrome)
https://codereview.chromium.org/18565002/diff/24001/chrome/browser/media_galleries/fileapi/media_file_validator_factory.cc File chrome/browser/media_galleries/fileapi/media_file_validator_factory.cc (right): https://codereview.chromium.org/18565002/diff/24001/chrome/browser/media_galleries/fileapi/media_file_validator_factory.cc#newcode21 chrome/browser/media_galleries/fileapi/media_file_validator_factory.cc:21: virtual void StartValidation( Should we rename this to StartPreWriteValidation() ...
7 years, 5 months ago (2013-07-10 15:52:45 UTC) #13
Greg Billock
Kinuko, this changes the API a bit. Look again? https://codereview.chromium.org/18565002/diff/24001/chrome/browser/media_galleries/fileapi/media_file_validator_factory.cc File chrome/browser/media_galleries/fileapi/media_file_validator_factory.cc (right): https://codereview.chromium.org/18565002/diff/24001/chrome/browser/media_galleries/fileapi/media_file_validator_factory.cc#newcode21 chrome/browser/media_galleries/fileapi/media_file_validator_factory.cc:21: ...
7 years, 5 months ago (2013-07-11 22:54:35 UTC) #14
kinuko
https://codereview.chromium.org/18565002/diff/37001/webkit/browser/fileapi/copy_or_move_file_validator.h File webkit/browser/fileapi/copy_or_move_file_validator.h (right): https://codereview.chromium.org/18565002/diff/37001/webkit/browser/fileapi/copy_or_move_file_validator.h#newcode35 webkit/browser/fileapi/copy_or_move_file_validator.h:35: // may not be present. Implementations should maintain the ...
7 years, 5 months ago (2013-07-12 05:00:18 UTC) #15
vandebo (ex-Chrome)
+1 to adding a recursive copy/move test https://codereview.chromium.org/18565002/diff/24001/chrome/browser/media_galleries/fileapi/media_file_validator_factory.cc File chrome/browser/media_galleries/fileapi/media_file_validator_factory.cc (right): https://codereview.chromium.org/18565002/diff/24001/chrome/browser/media_galleries/fileapi/media_file_validator_factory.cc#newcode21 chrome/browser/media_galleries/fileapi/media_file_validator_factory.cc:21: virtual void ...
7 years, 5 months ago (2013-07-12 15:08:15 UTC) #16
Greg Billock
https://codereview.chromium.org/18565002/diff/24001/chrome/browser/media_galleries/fileapi/media_file_validator_factory.cc File chrome/browser/media_galleries/fileapi/media_file_validator_factory.cc (right): https://codereview.chromium.org/18565002/diff/24001/chrome/browser/media_galleries/fileapi/media_file_validator_factory.cc#newcode21 chrome/browser/media_galleries/fileapi/media_file_validator_factory.cc:21: virtual void StartValidation( On 2013/07/12 15:08:15, vandebo wrote: > ...
7 years, 5 months ago (2013-07-12 18:02:18 UTC) #17
vandebo (ex-Chrome)
https://codereview.chromium.org/18565002/diff/37001/webkit/browser/fileapi/copy_or_move_operation_delegate.cc File webkit/browser/fileapi/copy_or_move_operation_delegate.cc (right): https://codereview.chromium.org/18565002/diff/37001/webkit/browser/fileapi/copy_or_move_operation_delegate.cc#newcode113 webkit/browser/fileapi/copy_or_move_operation_delegate.cc:113: src_root_, base::Bind(&CopyOrMoveOperationDelegate::DidFinishCopy, On 2013/07/12 18:02:19, Greg Billock wrote: > ...
7 years, 5 months ago (2013-07-12 18:51:47 UTC) #18
Greg Billock
https://codereview.chromium.org/18565002/diff/37001/webkit/browser/fileapi/copy_or_move_operation_delegate.cc File webkit/browser/fileapi/copy_or_move_operation_delegate.cc (right): https://codereview.chromium.org/18565002/diff/37001/webkit/browser/fileapi/copy_or_move_operation_delegate.cc#newcode113 webkit/browser/fileapi/copy_or_move_operation_delegate.cc:113: src_root_, base::Bind(&CopyOrMoveOperationDelegate::DidFinishCopy, validation is per-file at present, so you'd ...
7 years, 5 months ago (2013-07-12 20:36:45 UTC) #19
vandebo (ex-Chrome)
https://codereview.chromium.org/18565002/diff/37001/webkit/browser/fileapi/copy_or_move_operation_delegate.cc File webkit/browser/fileapi/copy_or_move_operation_delegate.cc (right): https://codereview.chromium.org/18565002/diff/37001/webkit/browser/fileapi/copy_or_move_operation_delegate.cc#newcode113 webkit/browser/fileapi/copy_or_move_operation_delegate.cc:113: src_root_, base::Bind(&CopyOrMoveOperationDelegate::DidFinishCopy, On 2013/07/12 20:36:46, Greg Billock wrote: > ...
7 years, 5 months ago (2013-07-12 21:06:58 UTC) #20
Greg Billock
https://codereview.chromium.org/18565002/diff/37001/webkit/browser/fileapi/copy_or_move_operation_delegate.cc File webkit/browser/fileapi/copy_or_move_operation_delegate.cc (right): https://codereview.chromium.org/18565002/diff/37001/webkit/browser/fileapi/copy_or_move_operation_delegate.cc#newcode113 webkit/browser/fileapi/copy_or_move_operation_delegate.cc:113: src_root_, base::Bind(&CopyOrMoveOperationDelegate::DidFinishCopy, Yeah, the test shows this: it deletes ...
7 years, 5 months ago (2013-07-12 22:06:32 UTC) #21
Greg Billock
I've updated the test to work now. Kinuko, this has somewhat surprising behavior -- a ...
7 years, 5 months ago (2013-07-15 23:04:33 UTC) #22
kinuko
On 2013/07/15 23:04:33, Greg Billock wrote: > I've updated the test to work now. > ...
7 years, 5 months ago (2013-07-17 02:47:24 UTC) #23
Greg Billock
On 2013/07/17 02:47:24, kinuko wrote: > On 2013/07/15 23:04:33, Greg Billock wrote: > > I've ...
7 years, 5 months ago (2013-07-18 15:03:08 UTC) #24
vandebo (ex-Chrome)
LGTM - clicking CQ. Will send a follow up CL to resolve nits. https://codereview.chromium.org/18565002/diff/65001/chrome/browser/media_galleries/fileapi/media_file_validator_factory.cc File ...
7 years, 5 months ago (2013-07-18 17:35:13 UTC) #25
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/gbillock@chromium.org/18565002/65001
7 years, 5 months ago (2013-07-18 17:36:24 UTC) #26
commit-bot: I haz the power
Failed to apply patch for webkit/browser/fileapi/copy_or_move_operation_delegate_unittest.cc: While running patch -p1 --forward --force --no-backup-if-mismatch; patching file ...
7 years, 5 months ago (2013-07-18 17:36:27 UTC) #27
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/gbillock@chromium.org/18565002/80001
7 years, 5 months ago (2013-07-18 17:44:05 UTC) #28
commit-bot: I haz the power
Retried try job too often on mac_rel for step(s) content_unittests http://build.chromium.org/p/tryserver.chromium/buildstatus?builder=mac_rel&number=150370
7 years, 5 months ago (2013-07-18 18:57:47 UTC) #29
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/gbillock@chromium.org/18565002/80001
7 years, 5 months ago (2013-07-18 19:03:32 UTC) #30
commit-bot: I haz the power
Retried try job too often on mac_rel for step(s) content_unittests http://build.chromium.org/p/tryserver.chromium/buildstatus?builder=mac_rel&number=150400
7 years, 5 months ago (2013-07-18 19:58:49 UTC) #31
Greg Billock
On 2013/07/18 19:58:49, I haz the power (commit-bot) wrote: > Retried try job too often ...
7 years, 5 months ago (2013-07-18 20:47:20 UTC) #32
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/gbillock@chromium.org/18565002/102001
7 years, 5 months ago (2013-07-18 23:56:03 UTC) #33
commit-bot: I haz the power
Retried try job too often on mac_rel for step(s) content_unittests http://build.chromium.org/p/tryserver.chromium/buildstatus?builder=mac_rel&number=150536
7 years, 5 months ago (2013-07-19 01:23:32 UTC) #34
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/gbillock@chromium.org/18565002/145001
7 years, 5 months ago (2013-07-23 18:25:05 UTC) #35
commit-bot: I haz the power
Change committed as 213267
7 years, 5 months ago (2013-07-23 23:26:55 UTC) #36
Greg Billock
7 years, 4 months ago (2013-07-30 23:18:30 UTC) #37
Message was sent while issue was closed.
Sent you a new CL for this: 

https://codereview.chromium.org/21097005

https://codereview.chromium.org/18565002/diff/65001/chrome/browser/media_gall...
File chrome/browser/media_galleries/fileapi/media_file_validator_factory.cc
(right):

https://codereview.chromium.org/18565002/diff/65001/chrome/browser/media_gall...
chrome/browser/media_galleries/fileapi/media_file_validator_factory.cc:12:
#include "webkit/common/blob/shareable_file_reference.h"
On 2013/07/18 17:35:14, vandebo wrote:
> nit: remove

Done.

https://codereview.chromium.org/18565002/diff/65001/webkit/browser/fileapi/co...
File webkit/browser/fileapi/copy_or_move_file_validator_unittest.cc (right):

https://codereview.chromium.org/18565002/diff/65001/webkit/browser/fileapi/co...
webkit/browser/fileapi/copy_or_move_file_validator_unittest.cc:187: explicit
TestCopyOrMoveFileValidatorFactory(bool all_valid,
On 2013/07/18 17:35:14, vandebo wrote:
> nit: these args could use some help.  Maybe an enum.

Done.

https://codereview.chromium.org/18565002/diff/65001/webkit/browser/fileapi/co...
File webkit/browser/fileapi/copy_or_move_operation_delegate.cc (right):

https://codereview.chromium.org/18565002/diff/65001/webkit/browser/fileapi/co...
webkit/browser/fileapi/copy_or_move_operation_delegate.cc:193: void
CopyOrMoveOperationDelegate::DidFinishCopyDir(
On 2013/07/18 17:35:14, vandebo wrote:
> nit: What do you think of calling this DidFinishRecursiveCopyDir?

Done.

https://codereview.chromium.org/18565002/diff/65001/webkit/browser/fileapi/co...
webkit/browser/fileapi/copy_or_move_operation_delegate.cc:203:
DCHECK_EQ(operation_type_, OPERATION_MOVE);
On 2013/07/18 17:35:14, vandebo wrote:
> nit: expectation first

Done.

https://codereview.chromium.org/18565002/diff/65001/webkit/browser/fileapi/co...
webkit/browser/fileapi/copy_or_move_operation_delegate.cc:230:
DCHECK(!same_file_system_);
On 2013/07/18 17:35:14, vandebo wrote:
> nit: Move up and refine comment 221

I think this wants to remain after that clause -- validator will be not be null
only for non-same-filesystem. It can also be null if there's no validation, but
that doesn't make this assertion untrue.

https://codereview.chromium.org/18565002/diff/65001/webkit/browser/fileapi/co...
File webkit/browser/fileapi/copy_or_move_operation_delegate_unittest.cc (right):

https://codereview.chromium.org/18565002/diff/65001/webkit/browser/fileapi/co...
webkit/browser/fileapi/copy_or_move_operation_delegate_unittest.cc:49: return
new TestValidator(true, true, std::string("2"));
On 2013/07/18 17:35:14, vandebo wrote:
> nit: The args are all static, why not omit the functionality from
TestValidator

You mean contain it there?

https://codereview.chromium.org/18565002/diff/65001/webkit/browser/fileapi/te...
File webkit/browser/fileapi/test_file_system_backend.cc (right):

https://codereview.chromium.org/18565002/diff/65001/webkit/browser/fileapi/te...
webkit/browser/fileapi/test_file_system_backend.cc:185: // What purpose is this
check serving?
On 2013/07/18 17:35:14, vandebo wrote:
> nit: remove/resolve this question

removing it -- my guess is it is remnant test code

Powered by Google App Engine
This is Rietveld 408576698