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

Issue 9844006: GData downloads cleanup (Closed)

Created:
8 years, 9 months ago by achuithb
Modified:
8 years, 8 months ago
Reviewers:
asanka, Ben Chan
CC:
chromium-reviews, achuith+watch_chromium.org, stevenjb+watch_chromium.org, nkostylev+watch_chromium.org, davemoore+watch_chromium.org
Visibility:
Public.

Description

GData downloads cleanup. * Fix a leak in GDataFileSystem::OnTransferCompleted. * UploadCompletionCallback's returns an UploadFileInfo* (to enable it to be deleted) instead of DocumentEntry* * Split GDataUploader::RemovePendingUpload into UploadFailed and DeleteUpload. Make DeleteUpload public for use by GDataFileSystem::OnTransferCompleted. * GDataUploader::UploadFile takes a scoped_ptr to make the transfer of ownership clearer. * Rename GDataUploader::UploadComplete to GDataUploader::MoveFileToCache. * Rename GDataDownloadObserver::temp_download_path_ to gdata_tmp_download_path_ for consistency with code elsewhere. * Rearrange args in GDataDownloadObserver::Initialize * Some other renames * Get rid of gdata:: in gdata_file_system.cc * pragma once in all header files. BUG=NONE TEST=NONE Committed: https://src.chromium.org/viewvc/chrome?view=rev&revision=129595

Patch Set 1 #

Patch Set 2 : #

Patch Set 3 : #

Patch Set 4 : #

Patch Set 5 : #

Total comments: 6

Patch Set 6 : benchan review feedback #

Total comments: 4

Patch Set 7 : asanka review feedback #

Unified diffs Side-by-side diffs Delta from patch set Stats (+148 lines, -118 lines) Patch
M chrome/browser/chromeos/gdata/gdata_download_observer.h View 1 2 3 4 5 6 3 chunks +12 lines, -9 lines 0 comments Download
M chrome/browser/chromeos/gdata/gdata_download_observer.cc View 1 2 3 4 5 6 5 chunks +22 lines, -17 lines 0 comments Download
M chrome/browser/chromeos/gdata/gdata_file_system.h View 1 2 3 4 5 6 2 chunks +2 lines, -3 lines 0 comments Download
M chrome/browser/chromeos/gdata/gdata_file_system.cc View 1 2 3 4 5 6 13 chunks +34 lines, -33 lines 0 comments Download
M chrome/browser/chromeos/gdata/gdata_file_system_proxy.h View 1 2 3 4 5 6 1 chunk +1 line, -0 lines 0 comments Download
M chrome/browser/chromeos/gdata/gdata_files.h View 1 2 3 4 5 6 1 chunk +1 line, -0 lines 0 comments Download
M chrome/browser/chromeos/gdata/gdata_system_service.cc View 1 2 3 4 5 6 1 chunk +2 lines, -3 lines 0 comments Download
M chrome/browser/chromeos/gdata/gdata_upload_file_info.h View 1 2 3 4 5 6 3 chunks +3 lines, -6 lines 0 comments Download
M chrome/browser/chromeos/gdata/gdata_uploader.h View 1 2 3 4 5 6 4 chunks +11 lines, -6 lines 0 comments Download
M chrome/browser/chromeos/gdata/gdata_uploader.cc View 1 2 3 4 5 6 8 chunks +60 lines, -41 lines 0 comments Download

Messages

Total messages: 5 (0 generated)
achuithb
Please take a look, Ben and Asanka!
8 years, 9 months ago (2012-03-27 23:08:55 UTC) #1
Ben Chan
http://chromiumcodereview.appspot.com/9844006/diff/1023/chrome/browser/chromeos/gdata/gdata_download_observer.cc File chrome/browser/chromeos/gdata/gdata_download_observer.cc (right): http://chromiumcodereview.appspot.com/9844006/diff/1023/chrome/browser/chromeos/gdata/gdata_download_observer.cc#newcode95 chrome/browser/chromeos/gdata/gdata_download_observer.cc:95: gdata_uploader_ = gdata_uploader; nit: Seems like |gdata_uploader_| is not ...
8 years, 9 months ago (2012-03-28 05:29:36 UTC) #2
achuithb
Fixed. PTAL. http://chromiumcodereview.appspot.com/9844006/diff/1023/chrome/browser/chromeos/gdata/gdata_download_observer.cc File chrome/browser/chromeos/gdata/gdata_download_observer.cc (right): http://chromiumcodereview.appspot.com/9844006/diff/1023/chrome/browser/chromeos/gdata/gdata_download_observer.cc#newcode95 chrome/browser/chromeos/gdata/gdata_download_observer.cc:95: gdata_uploader_ = gdata_uploader; On 2012/03/28 05:29:36, Ben ...
8 years, 9 months ago (2012-03-28 09:14:04 UTC) #3
asanka
LGTM with nits. Although some files have changed on trunk. http://codereview.chromium.org/9844006/diff/7006/chrome/browser/chromeos/gdata/gdata_file_system.cc File chrome/browser/chromeos/gdata/gdata_file_system.cc (right): http://codereview.chromium.org/9844006/diff/7006/chrome/browser/chromeos/gdata/gdata_file_system.cc#newcode721 ...
8 years, 9 months ago (2012-03-28 22:02:33 UTC) #4
achuithb
8 years, 9 months ago (2012-03-28 23:27:11 UTC) #5
Thanks for the reviews, Ben and Asanka!

http://codereview.chromium.org/9844006/diff/7006/chrome/browser/chromeos/gdat...
File chrome/browser/chromeos/gdata/gdata_file_system.cc (right):

http://codereview.chromium.org/9844006/diff/7006/chrome/browser/chromeos/gdat...
chrome/browser/chromeos/gdata/gdata_file_system.cc:721: UploadFileInfo*
upload_file_info) {
On 2012/03/28 22:02:33, asanka wrote:
> Nit: Might be clearer if this took a scoped_ptr<> as well. That way it would
be
> clear from the binding site in TransferRegularFile() that ownership is being
> transferred.

scoped_ptr can't be used with PostTaskAndReply properly, or couldn't be.

https://groups.google.com/a/chromium.org/group/chromium-dev/msg/ddd7942f93b8ed4b
Not sure if this is fixed now...

http://codereview.chromium.org/9844006/diff/7006/chrome/browser/chromeos/gdat...
File chrome/browser/chromeos/gdata/gdata_uploader.cc (right):

http://codereview.chromium.org/9844006/diff/7006/chrome/browser/chromeos/gdat...
chrome/browser/chromeos/gdata/gdata_uploader.cc:303: upload_file_info);
On 2012/03/28 22:02:33, asanka wrote:
> Minor Nit: Perhaps have a way to assert that we only invoke the callback once?

I've put the Reset back in.

Powered by Google App Engine
This is Rietveld 408576698