DescriptionFiles.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. #Messages
Total messages: 16 (5 generated)
|