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

Issue 10827211: Replace GDataDirectory::TakeEntry with GDataDirectoryService::AddEntryToDirectory. (Closed)

Created:
8 years, 4 months ago by achuithb
Modified:
8 years, 4 months ago
Reviewers:
satorux1
CC:
chromium-reviews, achuith+watch_chromium.org, oshima+watch_chromium.org, stevenjb+watch_chromium.org, nkostylev+watch_chromium.org, davemoore+watch_chromium.org
Visibility:
Public.

Description

Replace GDataDirectory::TakeEntry with GDataDirectoryService::MoveEntryToDirectory. * Replace FilePathUpdateCallback with FileMoveCallback, and move this typedef to gdata_files.h * GDataDirectoryService::AddEntryToDirectory has been renamed to MoveEntryToDirectory, and now takes FileMoveCallback, and calls RemoveChild on the parent, as TakeEntry used to do. Also add a ui thread DCHECK and fix tests. * Get rid of GDataDirectory::TakeEntry, replacing all invocations with GDataDirectoryService::MoveEntryToDirectory. * Introduce callbacks OnMoveEntryToDirectoryWithFileMoveCallback, and OnMoveEntryToDirectoryWithFileOperationCallback to call OnDirectoryChanged and run callbacks. * Replace GDataFileSystem callbacks OnRenameResourceCompleted and OnRemoveEntryFromDirectoryCompleted with RenameFileOnFilesystem and RemoveEntryFromDirectoryOnFilesystem. * Get rid of GDataFilesystem::AddEntryToDirectoryOnFilesystem. * Make RemoveChildren, RemoveChildFiles, RemoveChildDirectories private. * FromDocumentEntry should take parent NULL, as should GDataDirectory/GDataFile ctors. This will be more comprehensively fixed in a future patch. The fixes in this patch are necessary for unit tests. * Replace FOR_EACH_OBSERVER(Observers OnDirectoryChanged) with OnDirectoryChanged, for brevity. * Add gdata::test_util::CopyErrorCodeFromFileMoveCallback for gdata_files_unittest. BUG=137725 TEST=unit tests, manual test moving files in the same directory and between directories. Committed: https://src.chromium.org/viewvc/chrome?view=rev&revision=150684

Patch Set 1 #

Patch Set 2 : #

Patch Set 3 : #

Total comments: 15

Patch Set 4 : satorux feedback #

Patch Set 5 : minor #

Patch Set 6 : CopyErrorCodeFromFilePathUpdateCallback #

Patch Set 7 : expect/assert after RunBlockingTask #

Total comments: 23

Patch Set 8 : rebase #

Patch Set 9 : renames as per feedback #

Total comments: 8

Patch Set 10 : better tests #

Total comments: 1
Unified diffs Side-by-side diffs Delta from patch set Stats (+221 lines, -202 lines) Patch
M chrome/browser/chromeos/gdata/gdata_file_system.h View 1 2 3 4 5 6 7 8 9 7 chunks +39 lines, -41 lines 0 comments Download
M chrome/browser/chromeos/gdata/gdata_file_system.cc View 1 2 3 4 5 6 7 8 9 17 chunks +91 lines, -114 lines 1 comment Download
M chrome/browser/chromeos/gdata/gdata_files.h View 1 2 3 4 5 6 7 8 8 chunks +20 lines, -17 lines 0 comments Download
M chrome/browser/chromeos/gdata/gdata_files.cc View 1 2 3 4 5 6 7 8 9 5 chunks +13 lines, -15 lines 0 comments Download
M chrome/browser/chromeos/gdata/gdata_files_unittest.cc View 1 2 3 4 5 6 7 8 9 4 chunks +35 lines, -13 lines 0 comments Download
M chrome/browser/chromeos/gdata/gdata_test_util.h View 1 2 3 4 5 6 7 8 9 2 chunks +11 lines, -2 lines 0 comments Download
M chrome/browser/chromeos/gdata/gdata_test_util.cc View 1 2 3 4 5 6 7 8 9 1 chunk +12 lines, -0 lines 0 comments Download

Messages

Total messages: 12 (0 generated)
achuithb
Satoru-san, please review.
8 years, 4 months ago (2012-08-08 02:35:18 UTC) #1
satorux1
Took a quick first look. I'll take a closer look. http://codereview.chromium.org/10827211/diff/9002/chrome/browser/chromeos/gdata/gdata_files.cc File chrome/browser/chromeos/gdata/gdata_files.cc (right): http://codereview.chromium.org/10827211/diff/9002/chrome/browser/chromeos/gdata/gdata_files.cc#newcode957 ...
8 years, 4 months ago (2012-08-08 14:09:06 UTC) #2
satorux1
http://codereview.chromium.org/10827211/diff/9002/chrome/browser/chromeos/gdata/gdata_file_system.cc File chrome/browser/chromeos/gdata/gdata_file_system.cc (right): http://codereview.chromium.org/10827211/diff/9002/chrome/browser/chromeos/gdata/gdata_file_system.cc#newcode2416 chrome/browser/chromeos/gdata/gdata_file_system.cc:2416: if (util::GDataToGDataFileError(status) == GDATA_FILE_OK) Previously, |callback| was called if ...
8 years, 4 months ago (2012-08-08 16:04:10 UTC) #3
achuithb
Please take a look http://codereview.chromium.org/10827211/diff/9002/chrome/browser/chromeos/gdata/gdata_file_system.cc File chrome/browser/chromeos/gdata/gdata_file_system.cc (right): http://codereview.chromium.org/10827211/diff/9002/chrome/browser/chromeos/gdata/gdata_file_system.cc#newcode2416 chrome/browser/chromeos/gdata/gdata_file_system.cc:2416: if (util::GDataToGDataFileError(status) == GDATA_FILE_OK) On ...
8 years, 4 months ago (2012-08-08 22:08:41 UTC) #4
achuithb
http://codereview.chromium.org/10827211/diff/9002/chrome/browser/chromeos/gdata/gdata_files_unittest.cc File chrome/browser/chromeos/gdata/gdata_files_unittest.cc (right): http://codereview.chromium.org/10827211/diff/9002/chrome/browser/chromeos/gdata/gdata_files_unittest.cc#newcode49 chrome/browser/chromeos/gdata/gdata_files_unittest.cc:49: base::Bind(&OnAddEntryToDirectory, GDATA_FILE_OK)); On 2012/08/08 22:08:41, achuith.bhandarkar wrote: > On ...
8 years, 4 months ago (2012-08-08 22:38:00 UTC) #5
satorux1
looking at the code, you were modifying the most complicated code in gdata_file_system.cc. Thank you ...
8 years, 4 months ago (2012-08-08 23:25:01 UTC) #6
satorux1
http://codereview.chromium.org/10827211/diff/10/chrome/browser/chromeos/gdata/gdata_files.h File chrome/browser/chromeos/gdata/gdata_files.h (right): http://codereview.chromium.org/10827211/diff/10/chrome/browser/chromeos/gdata/gdata_files.h#newcode80 chrome/browser/chromeos/gdata/gdata_files.h:80: FilePathUpdateCallback; On 2012/08/08 23:25:01, satorux1 wrote: > Maybe FilePathChangeCallback? ...
8 years, 4 months ago (2012-08-08 23:40:57 UTC) #7
achuithb
I didn't change any code in the rebase, so you can ignore it. Also updated ...
8 years, 4 months ago (2012-08-09 00:12:50 UTC) #8
satorux1
Could you also update the TEST= line? This change is big so I'd like you ...
8 years, 4 months ago (2012-08-09 00:26:24 UTC) #9
achuithb
Thanks for the review! http://codereview.chromium.org/10827211/diff/3004/chrome/browser/chromeos/gdata/gdata_files_unittest.cc File chrome/browser/chromeos/gdata/gdata_files_unittest.cc (right): http://codereview.chromium.org/10827211/diff/3004/chrome/browser/chromeos/gdata/gdata_files_unittest.cc#newcode47 chrome/browser/chromeos/gdata/gdata_files_unittest.cc:47: EXPECT_EQ(GDATA_FILE_OK, error); On 2012/08/09 00:26:24, ...
8 years, 4 months ago (2012-08-09 01:41:32 UTC) #10
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/achuith@chromium.org/10827211/15
8 years, 4 months ago (2012-08-09 01:42:14 UTC) #11
satorux1
8 years, 4 months ago (2012-08-10 21:04:15 UTC) #12
https://chromiumcodereview.appspot.com/10827211/diff/15/chrome/browser/chrome...
File chrome/browser/chromeos/gdata/gdata_file_system.cc (left):

https://chromiumcodereview.appspot.com/10827211/diff/15/chrome/browser/chrome...
chrome/browser/chromeos/gdata/gdata_file_system.cc:2685: GDataEntry* dir =
directory_service_->FindEntryByPathSync(dir_path);
The two callers of FindEntryByPathSync() were removed. This is nice!

Powered by Google App Engine
This is Rietveld 408576698