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

Issue 10759007: gdata: Move GDataFileSystem::AddUploadedFile() call out of uploader and into GDataDownloadObserver. (Closed)

Created:
8 years, 5 months ago by hshi1
Modified:
8 years, 5 months ago
Reviewers:
asanka, achuithb, 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

gdata: Move GDataFileSystem::AddUploadedFile() call out of uploader and into GDataDownloadObserver class. The async GDataFileSystem::AddUploadedFile() call causes the file to be moved to the gdata cache. This must be invoked after DownloadObserver receives the COMPLETE status notification. BUG=136435 TEST=unit_tests, lumpy Committed: http://src.chromium.org/viewvc/chrome?view=rev&revision=146046

Patch Set 1 #

Total comments: 2

Patch Set 2 : Polish. Action should be MOVE, not COPY. #

Patch Set 3 : Move file to cache after DownloadComplete() and use final path. #

Total comments: 2

Patch Set 4 : Define an external data struct with information needed to move file to cache upon receiving COMPLET… #

Patch Set 5 : Indentation. #

Patch Set 6 : Add |move_started_| flag to handle duplicate COMPLETE notifications. #

Patch Set 7 : Avoiding making duplicate RemovePendingDownload() calls when we get duplicate COMPLETE notification. #

Total comments: 4

Patch Set 8 : Set the external data struct for MoveFileToCache prior to CompleteDownload() call to ensure the str… #

Patch Set 9 : Asanka's comments. #

Total comments: 6

Patch Set 10 : Achuit's comments. (This is rebased at revision 145980) #

Total comments: 4

Patch Set 11 : Comments for Patch #10. #

Total comments: 4
Unified diffs Side-by-side diffs Delta from patch set Stats (+74 lines, -42 lines) Patch
M chrome/browser/chromeos/gdata/gdata_download_observer.h View 1 2 3 4 5 6 7 8 9 10 3 chunks +13 lines, -6 lines 1 comment Download
M chrome/browser/chromeos/gdata/gdata_download_observer.cc View 1 2 3 4 5 6 7 8 9 10 9 chunks +60 lines, -8 lines 3 comments Download
M chrome/browser/chromeos/gdata/gdata_system_service.cc View 2 chunks +1 line, -2 lines 0 comments Download
M chrome/browser/chromeos/gdata/gdata_uploader.h View 1 chunk +0 lines, -3 lines 0 comments Download
M chrome/browser/chromeos/gdata/gdata_uploader.cc View 2 chunks +0 lines, -23 lines 0 comments Download

Messages

Total messages: 36 (0 generated)
hshi1
Explanation why I'm doing this: (1) This removes the GDataFileSystem::AddUploadedFile call from GDataUploader, thus partially ...
8 years, 5 months ago (2012-07-09 21:46:49 UTC) #1
satorux1
On 2012/07/09 21:46:49, hshi1 wrote: > Explanation why I'm doing this: > > (1) This ...
8 years, 5 months ago (2012-07-09 22:07:53 UTC) #2
satorux1
LGTM, but please wait for achuith.bhandarkar's comments http://codereview.chromium.org/10759007/diff/1/chrome/browser/chromeos/gdata/gdata_download_observer.cc File chrome/browser/chromeos/gdata/gdata_download_observer.cc (right): http://codereview.chromium.org/10759007/diff/1/chrome/browser/chromeos/gdata/gdata_download_observer.cc#newcode485 chrome/browser/chromeos/gdata/gdata_download_observer.cc:485: upload_file_info_ptr->gdata_path.DirName(), nit: ...
8 years, 5 months ago (2012-07-09 22:08:16 UTC) #3
hshi1
Patch Set #2 fixes the indentation and a typo (the action should be MOVE, not ...
8 years, 5 months ago (2012-07-09 22:11:48 UTC) #4
hshi1
Patch Set #2 fixes the indentation and a typo (the action should be MOVE, not ...
8 years, 5 months ago (2012-07-09 22:13:15 UTC) #5
hshi1
8 years, 5 months ago (2012-07-09 22:14:47 UTC) #6
achuithb
On 2012/07/09 22:08:16, satorux1 wrote: > LGTM, but please wait for achuith.bhandarkar's comments > > ...
8 years, 5 months ago (2012-07-09 22:28:44 UTC) #7
achuithb
On 2012/07/09 22:13:15, hshi1 wrote: > Patch Set #2 fixes the indentation and a typo ...
8 years, 5 months ago (2012-07-09 22:29:32 UTC) #8
achuithb
On 2012/07/09 22:13:15, hshi1 wrote: > Patch Set #2 fixes the indentation and a typo ...
8 years, 5 months ago (2012-07-09 22:30:12 UTC) #9
achuithb
On 2012/07/09 22:13:15, hshi1 wrote: > Patch Set #2 fixes the indentation and a typo ...
8 years, 5 months ago (2012-07-09 22:30:53 UTC) #10
hshi1
Filed bug 136435 which describes the problem. >> how does it get updated? Does the ...
8 years, 5 months ago (2012-07-09 22:32:50 UTC) #11
hshi1
Achuith can you review Patch #3 please? It takes care of a timing sensitive issue ...
8 years, 5 months ago (2012-07-10 00:18:54 UTC) #12
achuithb
Adding Asanka for review.
8 years, 5 months ago (2012-07-10 16:57:34 UTC) #13
achuithb
http://codereview.chromium.org/10759007/diff/4004/chrome/browser/chromeos/gdata/gdata_download_observer.cc File chrome/browser/chromeos/gdata/gdata_download_observer.cc (right): http://codereview.chromium.org/10759007/diff/4004/chrome/browser/chromeos/gdata/gdata_download_observer.cc#newcode498 chrome/browser/chromeos/gdata/gdata_download_observer.cc:498: const FilePath& file_content_path = download_item->GetTargetFilePath(); Are we sure that ...
8 years, 5 months ago (2012-07-10 16:58:43 UTC) #14
hshi1
Good point! Unfortunately it looks like neither Patch #2 nor #3 is safe. We basically ...
8 years, 5 months ago (2012-07-10 17:32:34 UTC) #15
asanka
On 2012/07/10 17:32:34, hshi1 wrote: > Good point! Unfortunately it looks like neither Patch #2 ...
8 years, 5 months ago (2012-07-10 17:43:25 UTC) #16
achuithb
On 2012/07/10 17:32:34, hshi1 wrote: > Good point! Unfortunately it looks like neither Patch #2 ...
8 years, 5 months ago (2012-07-10 18:45:43 UTC) #17
hshi1
I agree that it is only safe to move file to gdata cache when GDataDownloadObserver ...
8 years, 5 months ago (2012-07-10 18:55:23 UTC) #18
hshi1
Achuith - please review Patch #4: (1) In completion_callback, we cannot move the file to ...
8 years, 5 months ago (2012-07-10 19:02:12 UTC) #19
hshi1
Minor polish in Patch #5.
8 years, 5 months ago (2012-07-10 19:13:44 UTC) #20
hshi1
Made another revision in Patch #7. Sometimes the observer receives multiple COMPLETE notifications, thus we ...
8 years, 5 months ago (2012-07-10 20:20:32 UTC) #21
hshi1
Patch #8: for the case of "Save As" (to MHTML), it looks like the Download ...
8 years, 5 months ago (2012-07-10 21:08:33 UTC) #22
asanka
http://codereview.chromium.org/10759007/diff/27006/chrome/browser/chromeos/gdata/gdata_download_observer.cc File chrome/browser/chromeos/gdata/gdata_download_observer.cc (right): http://codereview.chromium.org/10759007/diff/27006/chrome/browser/chromeos/gdata/gdata_download_observer.cc#newcode538 chrome/browser/chromeos/gdata/gdata_download_observer.cc:538: download_item->GetTargetFilePath(), This doesn't affect GData uploads currently, but it ...
8 years, 5 months ago (2012-07-10 21:11:59 UTC) #23
hshi1
Thanks asanka for the suggestions. PTAL at patch #9. http://codereview.chromium.org/10759007/diff/27006/chrome/browser/chromeos/gdata/gdata_download_observer.cc File chrome/browser/chromeos/gdata/gdata_download_observer.cc (right): http://codereview.chromium.org/10759007/diff/27006/chrome/browser/chromeos/gdata/gdata_download_observer.cc#newcode538 chrome/browser/chromeos/gdata/gdata_download_observer.cc:538: ...
8 years, 5 months ago (2012-07-10 21:32:55 UTC) #24
hshi1
Forgot to reply to an earlier comment by Achuith. This should be addressed by the ...
8 years, 5 months ago (2012-07-10 22:43:35 UTC) #25
achuithb
http://codereview.chromium.org/10759007/diff/19013/chrome/browser/chromeos/gdata/gdata_download_observer.cc File chrome/browser/chromeos/gdata/gdata_download_observer.cc (right): http://codereview.chromium.org/10759007/diff/19013/chrome/browser/chromeos/gdata/gdata_download_observer.cc#newcode68 chrome/browser/chromeos/gdata/gdata_download_observer.cc:68: class GDataCacheExternalData : public DownloadItem::ExternalData { Why not add ...
8 years, 5 months ago (2012-07-10 23:04:35 UTC) #26
hshi1
PTAL Patch #10, thanks! http://codereview.chromium.org/10759007/diff/19013/chrome/browser/chromeos/gdata/gdata_download_observer.cc File chrome/browser/chromeos/gdata/gdata_download_observer.cc (right): http://codereview.chromium.org/10759007/diff/19013/chrome/browser/chromeos/gdata/gdata_download_observer.cc#newcode68 chrome/browser/chromeos/gdata/gdata_download_observer.cc:68: class GDataCacheExternalData : public DownloadItem::ExternalData ...
8 years, 5 months ago (2012-07-10 23:46:57 UTC) #27
achuithb
http://codereview.chromium.org/10759007/diff/28028/chrome/browser/chromeos/gdata/gdata_download_observer.cc File chrome/browser/chromeos/gdata/gdata_download_observer.cc (right): http://codereview.chromium.org/10759007/diff/28028/chrome/browser/chromeos/gdata/gdata_download_observer.cc#newcode50 chrome/browser/chromeos/gdata/gdata_download_observer.cc:50: void set_entry(DocumentEntry* entry) { entry_.reset(entry); } Why not void ...
8 years, 5 months ago (2012-07-11 00:06:11 UTC) #28
hshi1
PTAL @ Patch #11, thanks! http://codereview.chromium.org/10759007/diff/28028/chrome/browser/chromeos/gdata/gdata_download_observer.cc File chrome/browser/chromeos/gdata/gdata_download_observer.cc (right): http://codereview.chromium.org/10759007/diff/28028/chrome/browser/chromeos/gdata/gdata_download_observer.cc#newcode50 chrome/browser/chromeos/gdata/gdata_download_observer.cc:50: void set_entry(DocumentEntry* entry) { ...
8 years, 5 months ago (2012-07-11 00:13:48 UTC) #29
achuithb
lgtm. Not entirely sure if Asanka would like to review this as well. Perhaps you ...
8 years, 5 months ago (2012-07-11 00:16:19 UTC) #30
hshi1
@asanka, do you have more comments? I have addressed your earlier comments in diff Patch ...
8 years, 5 months ago (2012-07-11 00:18:43 UTC) #31
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/hshi@chromium.org/10759007/21014
8 years, 5 months ago (2012-07-11 01:02:09 UTC) #32
commit-bot: I haz the power
Change committed as 146046
8 years, 5 months ago (2012-07-11 03:31:25 UTC) #33
asanka
Sorry I had to run yesterday. Just a couple of post-commit comments. https://chromiumcodereview.appspot.com/10759007/diff/21014/chrome/browser/chromeos/gdata/gdata_download_observer.cc File chrome/browser/chromeos/gdata/gdata_download_observer.cc ...
8 years, 5 months ago (2012-07-11 15:56:52 UTC) #34
hshi1
https://chromiumcodereview.appspot.com/10759007/diff/21014/chrome/browser/chromeos/gdata/gdata_download_observer.cc File chrome/browser/chromeos/gdata/gdata_download_observer.cc (right): https://chromiumcodereview.appspot.com/10759007/diff/21014/chrome/browser/chromeos/gdata/gdata_download_observer.cc#newcode523 chrome/browser/chromeos/gdata/gdata_download_observer.cc:523: // completion of the AddUploadedFile() call below. On 2012/07/11 ...
8 years, 5 months ago (2012-07-11 16:17:39 UTC) #35
asanka
8 years, 5 months ago (2012-07-11 16:31:37 UTC) #36
https://chromiumcodereview.appspot.com/10759007/diff/21014/chrome/browser/chr...
File chrome/browser/chromeos/gdata/gdata_download_observer.cc (right):

https://chromiumcodereview.appspot.com/10759007/diff/21014/chrome/browser/chr...
chrome/browser/chromeos/gdata/gdata_download_observer.cc:523: // completion of
the AddUploadedFile() call below.
On 2012/07/11 16:17:40, hshi1 wrote:
> On 2012/07/11 15:56:52, asanka wrote:
> > Is it? It looks like |entry| will leak.
> 
> It won't leak. Upon completion of the AddUploadedFile() call below, the
callback
> specified at line 537 will be invoked to release the |entry|:
> base::Bind(&base::DeletePointer<DocumentEntry>, entry)

Ah. Sorry. You are right.

Powered by Google App Engine
This is Rietveld 408576698