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

Issue 881463003: Files.app: Add a deduplication step to avoid importing duplicate media. (Closed)

Created:
5 years, 11 months ago by Ben Kwa
Modified:
5 years, 10 months ago
Reviewers:
mtomasz, Steve McKay
CC:
chromium-reviews, vitalyp+closure_chromium.org, rginda+watch_chromium.org, mtomasz+watch_chromium.org, tfarina, dbeam+watch-closure_chromium.org
Base URL:
https://chromium.googlesource.com/chromium/src.git@master
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

Files.app: Add a deduplication step to avoid importing duplicate media. Add a DuplicateFinder and introduce it into the cloud import pipeline. Note: Deduplication takes place in-place on the source files, which could be slow for MTP devices. Profiling will be necessary to test this. The duplicate check returns a simple yes/no answer. Non-duplicate media is then imported as before. Destination is now promoted to a top-level concept. MediaImportHandler has a new function which enables clients to register new import destinations. Each destination requires a DestinationFactory and an optional DuplicateFinder. The import destination is selected at import time by its ID. The Observer pattern on the ImportTask class was tweaked to support auxiliary data being passed with each observer call. This is to allow richer updates (e.g. an entry-changed update that informs observers when a file was copied, and sends along the source and new destination). A new importer.TestLogger had to be created and inserted into some tests in order to circumvent the running of the regular RunTimeLogger, which uses functionality that doesn't exist at test time (i.e. chrome.syncFileSystem.onFileStatusChanged) MockEntry et al. were augmented to do more "realistic" moves and copies, needed to test the new two-stage import. Unit tests were cleaned up. BUG=420680 TEST=browser_test: FileManagerJsTest.MediaImportHandlerTest Committed: https://crrev.com/1bdfe457d14248e3c23423feb470eafbcf984743 Cr-Commit-Position: refs/heads/master@{#313503}

Patch Set 1 #

Total comments: 18

Patch Set 2 : Address feedback. Simplify destination mechanism. #

Total comments: 8

Patch Set 3 : Address feedback. #

Patch Set 4 : Sync to master; fix Banners test. #

Unified diffs Side-by-side diffs Delta from patch set Stats (+384 lines, -181 lines) Patch
M ui/file_manager/file_manager/background/js/background.js View 1 2 1 chunk +2 lines, -1 line 0 comments Download
M ui/file_manager/file_manager/background/js/compiled_resources.gyp View 1 chunk +1 line, -0 lines 0 comments Download
A ui/file_manager/file_manager/background/js/duplicate_finder.js View 1 1 chunk +51 lines, -0 lines 0 comments Download
M ui/file_manager/file_manager/background/js/media_import_handler.js View 1 2 11 chunks +93 lines, -25 lines 0 comments Download
M ui/file_manager/file_manager/background/js/media_import_handler_unittest.html View 1 2 chunks +3 lines, -0 lines 0 comments Download
M ui/file_manager/file_manager/background/js/media_import_handler_unittest.js View 1 12 chunks +55 lines, -79 lines 0 comments Download
M ui/file_manager/file_manager/background/js/task_queue.js View 4 chunks +14 lines, -7 lines 0 comments Download
A ui/file_manager/file_manager/background/js/test_duplicate_finder.js View 1 1 chunk +22 lines, -0 lines 0 comments Download
M ui/file_manager/file_manager/common/js/importer_common.js View 1 1 chunk +1 line, -1 line 0 comments Download
M ui/file_manager/file_manager/common/js/mock_entry.js View 5 chunks +35 lines, -7 lines 0 comments Download
A ui/file_manager/file_manager/common/js/test_importer_common.js View 1 1 chunk +44 lines, -0 lines 0 comments Download
M ui/file_manager/file_manager/foreground/js/compiled_resources.gyp View 1 chunk +1 line, -0 lines 0 comments Download
M ui/file_manager/file_manager/foreground/js/import_controller_unittest.js View 1 2 3 2 chunks +12 lines, -14 lines 0 comments Download
M ui/file_manager/file_manager/foreground/js/metadata/metadata_cache_unittest.html View 1 chunk +1 line, -0 lines 0 comments Download
M ui/file_manager/file_manager/foreground/js/metadata/metadata_cache_unittest.js View 18 chunks +24 lines, -34 lines 0 comments Download
M ui/file_manager/file_manager/foreground/js/navigation_list_model_unittest.js View 4 chunks +22 lines, -12 lines 0 comments Download
M ui/file_manager/file_manager/foreground/js/ui/banners_unittest.js View 1 2 3 1 chunk +1 line, -1 line 0 comments Download
M ui/file_manager/file_manager/manifest.json View 1 chunk +1 line, -0 lines 0 comments Download
M ui/file_manager/file_manager_resources.grd View 1 chunk +1 line, -0 lines 0 comments Download

Messages

Total messages: 16 (5 generated)
Ben Kwa
After further discussion with smckay@, it was decided to skip the initial tmp-copy step. The ...
5 years, 11 months ago (2015-01-26 19:10:12 UTC) #2
mtomasz
lgtm with nits https://codereview.chromium.org/881463003/diff/1/ui/file_manager/file_manager/background/js/duplicate_finder.js File ui/file_manager/file_manager/background/js/duplicate_finder.js (right): https://codereview.chromium.org/881463003/diff/1/ui/file_manager/file_manager/background/js/duplicate_finder.js#newcode24 ui/file_manager/file_manager/background/js/duplicate_finder.js:24: * An duplicate finder that always ...
5 years, 11 months ago (2015-01-26 20:14:50 UTC) #3
Steve McKay
https://codereview.chromium.org/881463003/diff/1/ui/file_manager/file_manager/background/js/media_import_handler.js File ui/file_manager/file_manager/background/js/media_import_handler.js (right): https://codereview.chromium.org/881463003/diff/1/ui/file_manager/file_manager/background/js/media_import_handler.js#newcode21 ui/file_manager/file_manager/background/js/media_import_handler.js:21: * @typedef {{ There's a bit of sprawl here. ...
5 years, 11 months ago (2015-01-26 20:26:26 UTC) #4
Ben Kwa
Done. The destination stuff was much simplified. PTAL. Thanks! https://codereview.chromium.org/881463003/diff/1/ui/file_manager/file_manager/background/js/duplicate_finder.js File ui/file_manager/file_manager/background/js/duplicate_finder.js (right): https://codereview.chromium.org/881463003/diff/1/ui/file_manager/file_manager/background/js/duplicate_finder.js#newcode24 ui/file_manager/file_manager/background/js/duplicate_finder.js:24: ...
5 years, 10 months ago (2015-01-27 20:00:32 UTC) #6
Steve McKay
LGTM w/ nits. https://codereview.chromium.org/881463003/diff/40001/ui/file_manager/file_manager/background/js/media_import_handler.js File ui/file_manager/file_manager/background/js/media_import_handler.js (right): https://codereview.chromium.org/881463003/diff/40001/ui/file_manager/file_manager/background/js/media_import_handler.js#newcode40 ui/file_manager/file_manager/background/js/media_import_handler.js:40: */ Missing dupeFinder @param. https://codereview.chromium.org/881463003/diff/40001/ui/file_manager/file_manager/background/js/media_import_handler.js#newcode42 ui/file_manager/file_manager/background/js/media_import_handler.js:42: ...
5 years, 10 months ago (2015-01-27 20:27:51 UTC) #7
Ben Kwa
https://codereview.chromium.org/881463003/diff/40001/ui/file_manager/file_manager/background/js/media_import_handler.js File ui/file_manager/file_manager/background/js/media_import_handler.js (right): https://codereview.chromium.org/881463003/diff/40001/ui/file_manager/file_manager/background/js/media_import_handler.js#newcode40 ui/file_manager/file_manager/background/js/media_import_handler.js:40: */ On 2015/01/27 20:27:51, Steve McKay wrote: > Missing ...
5 years, 10 months ago (2015-01-28 00:43:28 UTC) #8
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/881463003/60001
5 years, 10 months ago (2015-01-28 00:44:56 UTC) #10
commit-bot: I haz the power
Try jobs failed on following builders: linux_chromium_chromeos_rel_ng on tryserver.chromium.linux (http://build.chromium.org/p/tryserver.chromium.linux/builders/linux_chromium_chromeos_rel_ng/builds/18942)
5 years, 10 months ago (2015-01-28 01:52:00 UTC) #12
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/881463003/80001
5 years, 10 months ago (2015-01-28 14:14:10 UTC) #14
commit-bot: I haz the power
Committed patchset #4 (id:80001)
5 years, 10 months ago (2015-01-28 14:18:15 UTC) #15
commit-bot: I haz the power
5 years, 10 months ago (2015-01-28 14:19:03 UTC) #16
Message was sent while issue was closed.
Patchset 4 (id:??) landed as
https://crrev.com/1bdfe457d14248e3c23423feb470eafbcf984743
Cr-Commit-Position: refs/heads/master@{#313503}

Powered by Google App Engine
This is Rietveld 408576698