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

Issue 947943002: Implement CopyFileFromLocal of MTPDeviceAsyncDelegate. (Closed)

Created:
5 years, 10 months ago by yawano
Modified:
5 years, 9 months ago
Reviewers:
Lei Zhang
CC:
chromium-reviews, vandebo (ex-Chrome), tzik, nhiroki, tommycli, Greg Billock, kinuko+fileapi
Base URL:
https://chromium.googlesource.com/chromium/src.git@master
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

Implement CopyFileFromLocal of MTPDeviceAsyncDelegate. CopyFileFromLocal is a method to copy a local file to the device. This method will be used in CopyInForeingFile of AsyncFileUtil. A CL to connect CopyFileFromLocal to CopyInForeingFile will come later when all other write operations (e.g. delete) are implemented. BUG=413541 TEST=none; manually tested with changing write_supported variable in volume_manager.cc to true. Committed: https://crrev.com/8cd28e349ab9605da7dbf97c8c85f8c541b3b59b Cr-Commit-Position: refs/heads/master@{#319205}

Patch Set 1 #

Patch Set 2 : Rebase. #

Patch Set 3 : Fix failed test case. #

Total comments: 8

Patch Set 4 : Add storage open mode. #

Patch Set 5 : Rebase. #

Patch Set 6 : Fix failed test case. #

Patch Set 7 : Implement delegates for win and mac. #

Patch Set 8 : Fix to pass the build on win. #

Patch Set 9 : Add comments. #

Patch Set 10 : Fix to pass compile on win. #

Patch Set 11 : Fix to pass compile on win. #

Patch Set 12 : Fix wrong function definition. #

Total comments: 9

Patch Set 13 : Address comments. #

Patch Set 14 : MTPDeviceTaskHelperMapService supports storage mode. #

Patch Set 15 : Address comments. #

Total comments: 8

Patch Set 16 : Address comments. #

Total comments: 2

Patch Set 17 : Open file descriptor without using pending task. #

Total comments: 3

Patch Set 18 : Add DCHECK_CURRENTLY_ON. #

Patch Set 19 : Rebase. #

Unified diffs Side-by-side diffs Delta from patch set Stats (+622 lines, -85 lines) Patch
M chrome/browser/chromeos/file_manager/volume_manager.cc View 1 2 3 1 chunk +10 lines, -5 lines 0 comments Download
M chrome/browser/media_galleries/fileapi/device_media_async_file_util.h View 1 2 3 1 chunk +4 lines, -0 lines 0 comments Download
M chrome/browser/media_galleries/fileapi/device_media_async_file_util.cc View 1 2 3 4 chunks +31 lines, -2 lines 0 comments Download
M chrome/browser/media_galleries/fileapi/mtp_device_async_delegate.h View 1 2 3 3 chunks +14 lines, -0 lines 0 comments Download
M chrome/browser/media_galleries/fileapi/mtp_device_map_service.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 2 chunks +19 lines, -12 lines 0 comments Download
M chrome/browser/media_galleries/fileapi/mtp_device_map_service.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 2 chunks +71 lines, -23 lines 0 comments Download
M chrome/browser/media_galleries/linux/mtp_device_delegate_impl_linux.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 6 chunks +27 lines, -1 line 0 comments Download
M chrome/browser/media_galleries/linux/mtp_device_delegate_impl_linux.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 21 chunks +189 lines, -20 lines 0 comments Download
M chrome/browser/media_galleries/linux/mtp_device_task_helper.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 4 chunks +19 lines, -0 lines 0 comments Download
M chrome/browser/media_galleries/linux/mtp_device_task_helper.cc View 1 2 3 4 chunks +38 lines, -4 lines 0 comments Download
M chrome/browser/media_galleries/linux/mtp_device_task_helper_map_service.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 1 chunk +16 lines, -5 lines 0 comments Download
M chrome/browser/media_galleries/linux/mtp_device_task_helper_map_service.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 2 chunks +25 lines, -7 lines 0 comments Download
M chrome/browser/media_galleries/mac/mtp_device_delegate_impl_mac.h View 1 2 3 4 5 6 1 chunk +6 lines, -0 lines 0 comments Download
M chrome/browser/media_galleries/mac/mtp_device_delegate_impl_mac.mm View 1 2 3 4 5 6 2 chunks +16 lines, -0 lines 0 comments Download
M chrome/browser/media_galleries/media_file_system_registry.cc View 1 2 3 1 chunk +5 lines, -4 lines 0 comments Download
M chrome/browser/media_galleries/win/mtp_device_delegate_impl_win.h View 1 2 3 4 5 6 1 chunk +6 lines, -0 lines 0 comments Download
M chrome/browser/media_galleries/win/mtp_device_delegate_impl_win.cc View 1 2 3 4 5 6 7 8 9 10 11 2 chunks +17 lines, -0 lines 0 comments Download
M components/storage_monitor/test_media_transfer_protocol_manager_linux.h View 1 2 3 4 5 1 chunk +5 lines, -0 lines 0 comments Download
M components/storage_monitor/test_media_transfer_protocol_manager_linux.cc View 1 2 3 4 5 1 chunk +9 lines, -0 lines 0 comments Download
M device/media_transfer_protocol/media_transfer_protocol_daemon_client.h View 1 2 3 2 chunks +15 lines, -0 lines 0 comments Download
M device/media_transfer_protocol/media_transfer_protocol_daemon_client.cc View 1 2 3 3 chunks +35 lines, -2 lines 0 comments Download
M device/media_transfer_protocol/media_transfer_protocol_manager.h View 1 2 3 2 chunks +12 lines, -0 lines 0 comments Download
M device/media_transfer_protocol/media_transfer_protocol_manager.cc View 1 2 3 4 chunks +33 lines, -0 lines 0 comments Download

Messages

Total messages: 24 (3 generated)
yawano
PTAL. Thank you!
5 years, 10 months ago (2015-02-23 12:43:55 UTC) #2
Lei Zhang
We need to open the MTP storage in read-write mode, and invalidate the relevant part ...
5 years, 10 months ago (2015-02-24 23:35:48 UTC) #3
yawano
Thank you for the review. I added read only flag to async delegate. Sorry for ...
5 years, 10 months ago (2015-02-26 07:27:54 UTC) #4
Lei Zhang
On 2015/02/26 07:27:54, yawano wrote: > Thank you for the review. I added read only ...
5 years, 10 months ago (2015-02-27 00:22:48 UTC) #5
yawano
On 2015/02/27 00:22:48, Lei Zhang wrote: > On 2015/02/26 07:27:54, yawano wrote: > > Thank ...
5 years, 10 months ago (2015-02-27 00:36:40 UTC) #6
yawano
> > For invalidating caching, async delegate does not cache content itself. It > only ...
5 years, 10 months ago (2015-02-27 01:11:03 UTC) #7
Lei Zhang
On 2015/02/27 01:11:03, yawano wrote: > Yes, we need to invalidate cache for delete and ...
5 years, 9 months ago (2015-02-27 03:54:15 UTC) #8
yawano
On 2015/02/27 03:54:15, Lei Zhang wrote: > On 2015/02/27 01:11:03, yawano wrote: > > Yes, ...
5 years, 9 months ago (2015-02-27 04:03:11 UTC) #9
yawano
Added a patch set to fix compile errors on other platforms. PTAL. Thank you!
5 years, 9 months ago (2015-02-27 10:05:55 UTC) #10
Lei Zhang
Tryjob failures look like you might need a cros_system_api DEPS roll. https://codereview.chromium.org/947943002/diff/220001/chrome/browser/media_galleries/fileapi/mtp_device_map_service.cc File chrome/browser/media_galleries/fileapi/mtp_device_map_service.cc (left): ...
5 years, 9 months ago (2015-03-02 23:41:39 UTC) #11
Lei Zhang
https://codereview.chromium.org/947943002/diff/220001/chrome/browser/media_galleries/fileapi/mtp_device_map_service.cc File chrome/browser/media_galleries/fileapi/mtp_device_map_service.cc (left): https://codereview.chromium.org/947943002/diff/220001/chrome/browser/media_galleries/fileapi/mtp_device_map_service.cc#oldcode88 chrome/browser/media_galleries/fileapi/mtp_device_map_service.cc:88: if (!storage::ExternalMountPoints::GetSystemInstance()->GetRegisteredPath( On 2015/03/02 23:41:38, Lei Zhang wrote: > ...
5 years, 9 months ago (2015-03-03 00:16:34 UTC) #12
yawano
We also needed to fix MTPDeviceTaskHelperMapService to support storage mode. I added a patch set ...
5 years, 9 months ago (2015-03-03 09:16:54 UTC) #13
Lei Zhang
https://codereview.chromium.org/947943002/diff/280001/chrome/browser/media_galleries/fileapi/mtp_device_map_service.cc File chrome/browser/media_galleries/fileapi/mtp_device_map_service.cc (right): https://codereview.chromium.org/947943002/diff/280001/chrome/browser/media_galleries/fileapi/mtp_device_map_service.cc#newcode103 chrome/browser/media_galleries/fileapi/mtp_device_map_service.cc:103: MTPDeviceMapService::AsyncDelegateKey MTPDeviceMapService::GetAsyncDelegateKey( Also static? https://codereview.chromium.org/947943002/diff/280001/chrome/browser/media_galleries/linux/mtp_device_delegate_impl_linux.cc File chrome/browser/media_galleries/linux/mtp_device_delegate_impl_linux.cc (right): https://codereview.chromium.org/947943002/diff/280001/chrome/browser/media_galleries/linux/mtp_device_delegate_impl_linux.cc#newcode667 ...
5 years, 9 months ago (2015-03-03 10:03:18 UTC) #14
yawano
Thank you for the review! PTAL. https://codereview.chromium.org/947943002/diff/280001/chrome/browser/media_galleries/fileapi/mtp_device_map_service.cc File chrome/browser/media_galleries/fileapi/mtp_device_map_service.cc (right): https://codereview.chromium.org/947943002/diff/280001/chrome/browser/media_galleries/fileapi/mtp_device_map_service.cc#newcode103 chrome/browser/media_galleries/fileapi/mtp_device_map_service.cc:103: MTPDeviceMapService::AsyncDelegateKey MTPDeviceMapService::GetAsyncDelegateKey( On ...
5 years, 9 months ago (2015-03-03 10:33:15 UTC) #15
Lei Zhang
https://codereview.chromium.org/947943002/diff/300001/chrome/browser/media_galleries/linux/mtp_device_delegate_impl_linux.cc File chrome/browser/media_galleries/linux/mtp_device_delegate_impl_linux.cc (right): https://codereview.chromium.org/947943002/diff/300001/chrome/browser/media_galleries/linux/mtp_device_delegate_impl_linux.cc#newcode679 chrome/browser/media_galleries/linux/mtp_device_delegate_impl_linux.cc:679: EnsureInitAndRunTask(PendingTaskInfo( Sorry I didn't point this out earlier, but ...
5 years, 9 months ago (2015-03-03 19:17:31 UTC) #16
yawano
Fixed to call open() without using PendingTaskInfo. It could make the code much simpler. I ...
5 years, 9 months ago (2015-03-04 02:29:07 UTC) #17
Lei Zhang
lgtm https://codereview.chromium.org/947943002/diff/320001/chrome/browser/media_galleries/linux/mtp_device_delegate_impl_linux.cc File chrome/browser/media_galleries/linux/mtp_device_delegate_impl_linux.cc (right): https://codereview.chromium.org/947943002/diff/320001/chrome/browser/media_galleries/linux/mtp_device_delegate_impl_linux.cc#newcode237 chrome/browser/media_galleries/linux/mtp_device_delegate_impl_linux.cc:237: return open(file_path, flags); Can you add DCHECK_CURRENTLY_ON(content::BrowserThread::FILE); just ...
5 years, 9 months ago (2015-03-04 02:37:00 UTC) #18
yawano
Thank you for the review! Added DCHECK_CURRENTLY_ON. After dependent CL is landed, I'm going to ...
5 years, 9 months ago (2015-03-04 04:11:27 UTC) #19
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/947943002/360001
5 years, 9 months ago (2015-03-05 01:59:43 UTC) #22
commit-bot: I haz the power
Committed patchset #19 (id:360001)
5 years, 9 months ago (2015-03-05 03:43:23 UTC) #23
commit-bot: I haz the power
5 years, 9 months ago (2015-03-05 03:44:00 UTC) #24
Message was sent while issue was closed.
Patchset 19 (id:??) landed as
https://crrev.com/8cd28e349ab9605da7dbf97c8c85f8c541b3b59b
Cr-Commit-Position: refs/heads/master@{#319205}

Powered by Google App Engine
This is Rietveld 408576698