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

Issue 15653004: Picasa import: Make NativeMediaFileUtil an AsyncFileUtil (Closed)

Created:
7 years, 6 months ago by tommycli
Modified:
7 years, 6 months ago
CC:
Greg Billock, chromium-reviews, joi+watch-content_chromium.org, tzik+watch_chromium.org, kinuko+watch, jam, darin-cc_chromium.org, kinuko
Base URL:
https://chromium.googlesource.com/chromium/src.git@master
Visibility:
Public.

Description

Picasa import: Make NativeMediaFileUtil an AsyncFileUtil. Removes some write ops. NativeMediaFileUtil is now: - An AsyncFileUtil - Supports a smaller subset of the write ops. BUG=151701

Patch Set 1 #

Patch Set 2 : Self review fixes. #

Patch Set 3 : #

Patch Set 4 : #

Total comments: 18

Patch Set 5 : Move AsyncFileUtilTestHelper into chrome/browser/media_galleries/fileapi #

Patch Set 6 : Address vandebo comments. #

Patch Set 7 : #

Patch Set 8 : #

Patch Set 9 : Win fix #

Total comments: 16

Patch Set 10 : Add post tasks. #

Patch Set 11 : thestig comments. Post IO tasks to task_runner / other fixes. #

Total comments: 4

Patch Set 12 : #

Patch Set 13 : #

Patch Set 14 : Restore a test #

Total comments: 10

Patch Set 15 : Remove AsyncFileUtilTestHelper #

Patch Set 16 : Address vandebo comments. #

Total comments: 8
Unified diffs Side-by-side diffs Delta from patch set Stats (+618 lines, -545 lines) Patch
M chrome/browser/media_galleries/fileapi/device_media_async_file_util.cc View 1 chunk +0 lines, -1 line 0 comments Download
D chrome/browser/media_galleries/fileapi/filtering_file_enumerator.h View 1 chunk +0 lines, -41 lines 0 comments Download
D chrome/browser/media_galleries/fileapi/filtering_file_enumerator.cc View 1 chunk +0 lines, -107 lines 0 comments Download
M chrome/browser/media_galleries/fileapi/itunes/itunes_file_util.h View 1 2 3 4 5 6 7 8 9 10 1 chunk +6 lines, -7 lines 0 comments Download
M chrome/browser/media_galleries/fileapi/itunes/itunes_file_util.cc View 2 chunks +7 lines, -6 lines 0 comments Download
M chrome/browser/media_galleries/fileapi/media_file_system_mount_point_provider.h View 1 chunk +1 line, -1 line 0 comments Download
M chrome/browser/media_galleries/fileapi/media_file_system_mount_point_provider.cc View 1 2 3 4 2 chunks +4 lines, -12 lines 0 comments Download
M chrome/browser/media_galleries/fileapi/native_media_file_util.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 2 chunks +106 lines, -28 lines 3 comments Download
M chrome/browser/media_galleries/fileapi/native_media_file_util.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 7 chunks +373 lines, -90 lines 3 comments Download
M chrome/browser/media_galleries/fileapi/native_media_file_util_unittest.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 8 chunks +5 lines, -103 lines 0 comments Download
M chrome/browser/media_galleries/fileapi/picasa/picasa_data_provider.cc View 1 chunk +0 lines, -1 line 0 comments Download
M chrome/browser/media_galleries/fileapi/picasa/picasa_file_util.h View 1 2 3 4 5 6 7 8 9 10 1 chunk +8 lines, -8 lines 1 comment Download
M chrome/browser/media_galleries/fileapi/picasa/picasa_file_util.cc View 7 chunks +57 lines, -113 lines 0 comments Download
M chrome/browser/media_galleries/fileapi/picasa/picasa_file_util_unittest.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 8 chunks +51 lines, -25 lines 1 comment Download
M chrome/chrome_browser.gypi View 1 2 3 4 1 chunk +0 lines, -2 lines 0 comments Download

Messages

Total messages: 14 (0 generated)
tommycli
kinuko/vandebo: Here is a version that just makes NativeMediaFileUtil an AsyncFileUtil. This completely divorces the ...
7 years, 6 months ago (2013-05-29 21:53:28 UTC) #1
tommycli
+cc thestig, gbillock
7 years, 6 months ago (2013-05-30 01:16:57 UTC) #2
vandebo (ex-Chrome)
https://codereview.chromium.org/15653004/diff/8001/chrome/browser/media_galleries/fileapi/media_path_filter.cc File chrome/browser/media_galleries/fileapi/media_path_filter.cc (left): https://codereview.chromium.org/15653004/diff/8001/chrome/browser/media_galleries/fileapi/media_path_filter.cc#oldcode83 chrome/browser/media_galleries/fileapi/media_path_filter.cc:83: StringToLowerASCII(path.Extension())); I think we want to ensure that the ...
7 years, 6 months ago (2013-05-30 18:39:18 UTC) #3
tommycli
Also moved AsyncFileUtilTestHelper from webkit/fileapi to chrome/browser. https://codereview.chromium.org/15653004/diff/8001/chrome/browser/media_galleries/fileapi/media_path_filter.cc File chrome/browser/media_galleries/fileapi/media_path_filter.cc (left): https://codereview.chromium.org/15653004/diff/8001/chrome/browser/media_galleries/fileapi/media_path_filter.cc#oldcode83 chrome/browser/media_galleries/fileapi/media_path_filter.cc:83: StringToLowerASCII(path.Extension())); On ...
7 years, 6 months ago (2013-05-30 19:35:20 UTC) #4
vandebo (ex-Chrome)
Seems good. Over to Lei for a second look since it's kind of a big ...
7 years, 6 months ago (2013-05-30 19:49:15 UTC) #5
Lei Zhang
Can we make the remove write ups (a big change) a separate CL from async ...
7 years, 6 months ago (2013-05-30 21:17:58 UTC) #6
Lei Zhang
Either I'm out of the loop on The Plan (TM) or this is not going ...
7 years, 6 months ago (2013-05-30 21:27:17 UTC) #7
tommycli
Hi thestig, Yes, combining two changes is pretty confusing. The reason we did it in ...
7 years, 6 months ago (2013-05-30 21:52:32 UTC) #8
kinuko
https://codereview.chromium.org/15653004/diff/23002/chrome/browser/media_galleries/fileapi/async_file_util_test_helper.h File chrome/browser/media_galleries/fileapi/async_file_util_test_helper.h (right): https://codereview.chromium.org/15653004/diff/23002/chrome/browser/media_galleries/fileapi/async_file_util_test_helper.h#newcode12 chrome/browser/media_galleries/fileapi/async_file_util_test_helper.h:12: namespace fileapi { namespace chrome? If you keep this ...
7 years, 6 months ago (2013-05-31 03:58:55 UTC) #9
tommycli
hi: ready for a second round of reviews. https://codereview.chromium.org/15653004/diff/23002/chrome/browser/media_galleries/fileapi/async_file_util_test_helper.h File chrome/browser/media_galleries/fileapi/async_file_util_test_helper.h (right): https://codereview.chromium.org/15653004/diff/23002/chrome/browser/media_galleries/fileapi/async_file_util_test_helper.h#newcode12 chrome/browser/media_galleries/fileapi/async_file_util_test_helper.h:12: namespace ...
7 years, 6 months ago (2013-05-31 20:57:24 UTC) #10
vandebo (ex-Chrome)
https://codereview.chromium.org/15653004/diff/36003/chrome/browser/media_galleries/fileapi/async_file_util_test_helper.h File chrome/browser/media_galleries/fileapi/async_file_util_test_helper.h (right): https://codereview.chromium.org/15653004/diff/36003/chrome/browser/media_galleries/fileapi/async_file_util_test_helper.h#newcode18 chrome/browser/media_galleries/fileapi/async_file_util_test_helper.h:18: class AsyncFileUtilTestHelper : public FileSystemFileUtil { Since this no ...
7 years, 6 months ago (2013-05-31 23:22:17 UTC) #11
tommycli
vandebo: This version removes the dirty memory allocs, removes AsyncFileUtilTestHelper, preserves the purely synchronous overriding ...
7 years, 6 months ago (2013-06-01 01:40:54 UTC) #12
tommycli
vandebo: Actually I thought about it, and the callback-passing interface you suggested might be better, ...
7 years, 6 months ago (2013-06-01 03:33:45 UTC) #13
vandebo (ex-Chrome)
7 years, 6 months ago (2013-06-02 04:30:24 UTC) #14
On 2013/06/01 03:33:45, tommycli wrote:
> vandebo: Actually I thought about it, and the callback-passing interface you
> suggested might be better, esp. for chaining calls.
> 
> Whatever we do, I'm sure we'll end up refactoring it when we actually try to
use
> it for the Picasa/ITunes subclasses.

We can change our mind later, this seems fine for now.

https://codereview.chromium.org/15653004/diff/71001/chrome/browser/media_gall...
File chrome/browser/media_galleries/fileapi/native_media_file_util.cc (right):

https://codereview.chromium.org/15653004/diff/71001/chrome/browser/media_gall...
chrome/browser/media_galleries/fileapi/native_media_file_util.cc:102: void
FinishStatusCallback(
You don't need this callback.

https://codereview.chromium.org/15653004/diff/71001/chrome/browser/media_gall...
chrome/browser/media_galleries/fileapi/native_media_file_util.cc:146:
Bind(&NativeMediaFileUtil::CreateDirectorySync, Unretained(this),
I don't think Unretained(this) is safe, use a weak pointer.

https://codereview.chromium.org/15653004/diff/71001/chrome/browser/media_gall...
chrome/browser/media_galleries/fileapi/native_media_file_util.cc:148:
Bind(&FinishStatusCallback, callback));
No Bind, just callback

https://codereview.chromium.org/15653004/diff/71001/chrome/browser/media_gall...
File chrome/browser/media_galleries/fileapi/native_media_file_util.h (right):

https://codereview.chromium.org/15653004/diff/71001/chrome/browser/media_gall...
chrome/browser/media_galleries/fileapi/native_media_file_util.h:106: //
Synchronous for convenience reasons. Call only on the task runner thread.
All these methods should only called on the task runner right?  Maybe a comment
at the top of the block instead?

https://codereview.chromium.org/15653004/diff/71001/chrome/browser/media_gall...
chrome/browser/media_galleries/fileapi/native_media_file_util.h:118: // Posted
by ReadDirectory onto the task runner thread.
Comments should be about what the methods does, not who calls it.

https://codereview.chromium.org/15653004/diff/71001/chrome/browser/media_gall...
chrome/browser/media_galleries/fileapi/native_media_file_util.h:155: // Methods
to perform asynchronous methods without heap allocations.
nit: this comment isn't helpful to the future reader.

https://codereview.chromium.org/15653004/diff/71001/chrome/browser/media_gall...
File chrome/browser/media_galleries/fileapi/picasa/picasa_file_util.h (right):

https://codereview.chromium.org/15653004/diff/71001/chrome/browser/media_gall...
chrome/browser/media_galleries/fileapi/picasa/picasa_file_util.h:23: //
TODO(tommycli): Eventually, all of the below methods will have to be
I'm not sure this is true, but that'll be addressed later either way.

https://codereview.chromium.org/15653004/diff/71001/chrome/browser/media_gall...
File chrome/browser/media_galleries/fileapi/picasa/picasa_file_util_unittest.cc
(right):

https://codereview.chromium.org/15653004/diff/71001/chrome/browser/media_gall...
chrome/browser/media_galleries/fileapi/picasa/picasa_file_util_unittest.cc:410:
base::RunLoop run_loop;
Probably should pull this into a helper function, it might be reusable.

Powered by Google App Engine
This is Rietveld 408576698