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

Issue 10829277: GDataFileSystem is no longer a friend of GDataDirectory. (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

GDataFileSystem is no longer a friend of GDataDirectory. * Add public methods AddEntryToDirectory, RemoveEntryFromParent and RefreshDirectory to GDataDirectoryService, as well as private helper RefreshDirectoryInternal. Also make RefreshFileInternal private. All of these take FileMoveCallback. * Add OnDirectoryChangeFileMoveCallback to handle callbacks of RemoveEntryFromParent and RefreshDirectory. AddEntryToDirectory uses OnMoveEntryToDirectoryWithFileMoveCallback. * AddEntryToDirectory and RemoveEntryFromParent just call GDataDirectory's methods AddEntry and RemoveEntry. * Logic of GDataFileSystem::RequestDirectoryRefreshByEntry is now in GDataDirectoryService::RefreshDirectoryInternal. * AddUploadedFileOnUIThread has been broken up with new continuation functions ContinueAddUploadedFile and AddUploadedFileToCache, as well as AddUploadedFileParams, to ensure proper ordering of function invocations. * MoveEntryToDirectory no longer accepts null callbacks. * Ensure parent_ pointer is correct at all times. It needs to be reset in RemoveChild, and be NULL in AddEntry. BUG=137725 TEST=unit tests. Committed: https://src.chromium.org/viewvc/chrome?view=rev&revision=151605

Patch Set 1 #

Total comments: 27

Patch Set 2 : FileMoveCallback instead of base::Closure #

Patch Set 3 : comment #

Total comments: 7

Patch Set 4 : always call the callback #

Total comments: 4

Patch Set 5 : AddUploadedFileParams #

Patch Set 6 : MoveEntryToDirectory callback may not be null #

Patch Set 7 : rename #

Patch Set 8 : RemoveEntryFromParent callback may not be null #

Patch Set 9 : change comment verb tenses #

Total comments: 2

Patch Set 10 : vertical params #

Patch Set 11 : rebase #

Patch Set 12 : compile error #

Patch Set 13 : NotifyAndRunFileMoveCallback needs to accept null callback #

Unified diffs Side-by-side diffs Delta from patch set Stats (+279 lines, -107 lines) Patch
M chrome/browser/chromeos/gdata/gdata_file_system.h View 1 2 3 4 5 6 7 8 9 10 11 12 4 chunks +23 lines, -9 lines 0 comments Download
M chrome/browser/chromeos/gdata/gdata_file_system.cc View 1 2 3 4 5 6 7 8 9 10 11 12 11 chunks +129 lines, -79 lines 0 comments Download
M chrome/browser/chromeos/gdata/gdata_files.h View 1 2 3 4 5 6 7 8 9 10 9 chunks +41 lines, -11 lines 0 comments Download
M chrome/browser/chromeos/gdata/gdata_files.cc View 1 2 3 4 5 6 7 8 9 10 7 chunks +85 lines, -7 lines 0 comments Download
M chrome/browser/chromeos/gdata/gdata_wapi_feed_processor.h View 1 2 3 4 5 6 7 8 9 10 1 chunk +1 line, -1 line 0 comments Download

Messages

Total messages: 13 (0 generated)
achuithb
Please take a look, Satoru-san.
8 years, 4 months ago (2012-08-10 11:25:04 UTC) #1
satorux1
Cool. Things are getting untangled. :) http://codereview.chromium.org/10829277/diff/1/chrome/browser/chromeos/gdata/gdata_file_system.cc File chrome/browser/chromeos/gdata/gdata_file_system.cc (right): http://codereview.chromium.org/10829277/diff/1/chrome/browser/chromeos/gdata/gdata_file_system.cc#newcode395 chrome/browser/chromeos/gdata/gdata_file_system.cc:395: AddEntryToDirectoryCallback; nit: add ...
8 years, 4 months ago (2012-08-10 16:14:44 UTC) #2
satorux1
http://codereview.chromium.org/10829277/diff/1/chrome/browser/chromeos/gdata/gdata_file_system.cc File chrome/browser/chromeos/gdata/gdata_file_system.cc (right): http://codereview.chromium.org/10829277/diff/1/chrome/browser/chromeos/gdata/gdata_file_system.cc#newcode2458 chrome/browser/chromeos/gdata/gdata_file_system.cc:2458: GDataEntry* entry = directory_service_->FromDocumentEntry(doc_entry.get()); we might want to create ...
8 years, 4 months ago (2012-08-10 23:05:54 UTC) #3
satorux1
http://codereview.chromium.org/10829277/diff/1/chrome/browser/chromeos/gdata/gdata_file_system.cc File chrome/browser/chromeos/gdata/gdata_file_system.cc (right): http://codereview.chromium.org/10829277/diff/1/chrome/browser/chromeos/gdata/gdata_file_system.cc#newcode2469 chrome/browser/chromeos/gdata/gdata_file_system.cc:2469: entry, On 2012/08/10 23:05:55, satorux1 wrote: > would it ...
8 years, 4 months ago (2012-08-11 00:12:21 UTC) #4
achuithb
The major change is replacing base::Closure with FileMoveCallback. This was an excellent suggestion. PTAL, Satoru-san. ...
8 years, 4 months ago (2012-08-11 00:37:45 UTC) #5
satorux1
http://codereview.chromium.org/10829277/diff/10001/chrome/browser/chromeos/gdata/gdata_files.h File chrome/browser/chromeos/gdata/gdata_files.h (right): http://codereview.chromium.org/10829277/diff/10001/chrome/browser/chromeos/gdata/gdata_files.h#newcode494 chrome/browser/chromeos/gdata/gdata_files.h:494: // Note that |callback| is only called if the ...
8 years, 4 months ago (2012-08-11 11:48:16 UTC) #6
achuithb
PTAL, Satoru-san. http://codereview.chromium.org/10829277/diff/10001/chrome/browser/chromeos/gdata/gdata_files.h File chrome/browser/chromeos/gdata/gdata_files.h (right): http://codereview.chromium.org/10829277/diff/10001/chrome/browser/chromeos/gdata/gdata_files.h#newcode494 chrome/browser/chromeos/gdata/gdata_files.h:494: // Note that |callback| is only called ...
8 years, 4 months ago (2012-08-13 22:18:10 UTC) #7
satorux1
http://codereview.chromium.org/10829277/diff/5004/chrome/browser/chromeos/gdata/gdata_file_system.cc File chrome/browser/chromeos/gdata/gdata_file_system.cc (right): http://codereview.chromium.org/10829277/diff/5004/chrome/browser/chromeos/gdata/gdata_file_system.cc#newcode2941 chrome/browser/chromeos/gdata/gdata_file_system.cc:2941: parent_dir)); This code path is rather worrisome. I think ...
8 years, 4 months ago (2012-08-13 22:35:53 UTC) #8
achuithb
I've had to introduce AddUploadedFileParams and 2 more functions ContinueAddUploadedFile and AddUploadedFileToCache to ensure operations ...
8 years, 4 months ago (2012-08-14 00:18:43 UTC) #9
achuithb
PTAL
8 years, 4 months ago (2012-08-14 00:18:53 UTC) #10
satorux1
LGTM with a nit. Thanks! http://codereview.chromium.org/10829277/diff/1013/chrome/browser/chromeos/gdata/gdata_file_system.cc File chrome/browser/chromeos/gdata/gdata_file_system.cc (right): http://codereview.chromium.org/10829277/diff/1013/chrome/browser/chromeos/gdata/gdata_file_system.cc#newcode2965 chrome/browser/chromeos/gdata/gdata_file_system.cc:2965: cache_operation, callback_runner.Release()); nit: could ...
8 years, 4 months ago (2012-08-14 06:11:32 UTC) #11
satorux1
Less friendship is good. :)
8 years, 4 months ago (2012-08-14 06:11:51 UTC) #12
achuithb
8 years, 4 months ago (2012-08-14 23:33:59 UTC) #13
Thanks for the review!

http://codereview.chromium.org/10829277/diff/1013/chrome/browser/chromeos/gda...
File chrome/browser/chromeos/gdata/gdata_file_system.cc (right):

http://codereview.chromium.org/10829277/diff/1013/chrome/browser/chromeos/gda...
chrome/browser/chromeos/gdata/gdata_file_system.cc:2965: cache_operation,
callback_runner.Release());
On 2012/08/14 06:11:32, satorux1 wrote:
> nit: could you list parameters vertically?

Done.

Powered by Google App Engine
This is Rietveld 408576698