Skip to content

Commit

Permalink
gdata: Minor clean up for ResumeUploadParams.
Browse files Browse the repository at this point in the history
The document title is unnecessary for resuming an upload.

BUG=none
TEST=compiles

Review URL: https://chromiumcodereview.appspot.com/10562045

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@142804 0039d316-1c4b-4281-b951-d872f2087c98
  • Loading branch information
satorux@chromium.org committed Jun 18, 2012
1 parent d14f0d7 commit 13846a5
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 11 deletions.
4 changes: 2 additions & 2 deletions chrome/browser/chromeos/gdata/gdata_operations.cc
Original file line number Diff line number Diff line change
Expand Up @@ -1021,7 +1021,7 @@ bool ResumeUploadOperation::ProcessURLFetchResults(
end_range_received = ranges[0].last_byte_position();
}
}
DVLOG(1) << "Got response for [" << params_.title
DVLOG(1) << "Got response for [" << params_.virtual_path.value()
<< "]: code=" << code
<< ", range_hdr=[" << range_received
<< "], range_parsed=" << start_range_received
Expand All @@ -1030,7 +1030,7 @@ bool ResumeUploadOperation::ProcessURLFetchResults(
// There might be explanation of unexpected error code in response.
std::string response_content;
source->GetResponseAsString(&response_content);
DVLOG(1) << "Got response for [" << params_.title
DVLOG(1) << "Got response for [" << params_.virtual_path.value()
<< "]: code=" << code
<< ", content=[\n" << response_content << "\n]";

Expand Down
4 changes: 1 addition & 3 deletions chrome/browser/chromeos/gdata/gdata_params.cc
Original file line number Diff line number Diff line change
Expand Up @@ -34,15 +34,13 @@ InitiateUploadParams::~InitiateUploadParams() {
}

ResumeUploadParams::ResumeUploadParams(
const std::string& title,
int64 start_range,
int64 end_range,
int64 content_length,
const std::string& content_type,
scoped_refptr<net::IOBuffer> buf,
const GURL& upload_location,
const FilePath& virtual_path) : title(title),
start_range(start_range),
const FilePath& virtual_path) : start_range(start_range),
end_range(end_range),
content_length(content_length),
content_type(content_type),
Expand Down
9 changes: 5 additions & 4 deletions chrome/browser/chromeos/gdata/gdata_params.h
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,7 @@ struct ResumeUploadResponse {

// Struct for passing params needed for DocumentsService::ResumeUpload() calls.
struct ResumeUploadParams {
ResumeUploadParams(const std::string& title,
int64 start_range,
ResumeUploadParams(int64 start_range,
int64 end_range,
int64 content_length,
const std::string& content_type,
Expand All @@ -50,14 +49,16 @@ struct ResumeUploadParams {
const FilePath& virtual_path);
~ResumeUploadParams();

std::string title; // Title to be used for file to be uploaded.
int64 start_range; // Start of range of contents currently stored in |buf|.
int64 end_range; // End of range of contents currently stored in |buf|.
int64 content_length; // File content-Length.
std::string content_type; // Content-Type of file.
scoped_refptr<net::IOBuffer> buf; // Holds current content to be uploaded.
GURL upload_location; // Url of where to upload the file to.
FilePath virtual_path; // Virtual GData path of the file seen in the UI.
// Virtual GData path of the file seen in the UI. Not necessary for
// resuming an upload, but used for adding an entry to
// GDataOperationRegistry.
FilePath virtual_path;
};

// Struct for passing params needed for DocumentsService::InitiateUpload()
Expand Down
3 changes: 1 addition & 2 deletions chrome/browser/chromeos/gdata/gdata_uploader.cc
Original file line number Diff line number Diff line change
Expand Up @@ -291,8 +291,7 @@ void GDataUploader::ReadCompletionCallback(
bytes_read - 1;

documents_service_->ResumeUpload(
ResumeUploadParams(upload_file_info->title,
upload_file_info->start_range,
ResumeUploadParams(upload_file_info->start_range,
upload_file_info->end_range,
upload_file_info->content_length,
upload_file_info->content_type,
Expand Down

0 comments on commit 13846a5

Please sign in to comment.