summaryrefslogtreecommitdiffstats
path: root/chrome/browser/chromeos
diff options
context:
space:
mode:
authorgspencer@chromium.org <gspencer@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-06-27 21:28:57 +0000
committergspencer@chromium.org <gspencer@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-06-27 21:28:57 +0000
commit228ae2823ce88e53e95c885659c67f5fa309cb40 (patch)
tree2b9eeb0174d4aa2e30c7badb4e5e1d41502047d7 /chrome/browser/chromeos
parent79827b11bd3bd360496227700060408cae0f15e2 (diff)
downloadchromium_src-228ae2823ce88e53e95c885659c67f5fa309cb40.zip
chromium_src-228ae2823ce88e53e95c885659c67f5fa309cb40.tar.gz
chromium_src-228ae2823ce88e53e95c885659c67f5fa309cb40.tar.bz2
Merge 143949 - gdata: Fix error handling in GDataUploader when file is not present.
This was a regression caused by crrev.com/143796 BUG=127080 TEST=Saving to Drive works as before Review URL: https://chromiumcodereview.appspot.com/10636029 TBR=satorux@chromium.org Review URL: https://chromiumcodereview.appspot.com/10698020 git-svn-id: svn://svn.chromium.org/chrome/branches/1180/src@144562 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/chromeos')
-rw-r--r--chrome/browser/chromeos/gdata/gdata_uploader.cc31
1 files changed, 17 insertions, 14 deletions
diff --git a/chrome/browser/chromeos/gdata/gdata_uploader.cc b/chrome/browser/chromeos/gdata/gdata_uploader.cc
index 6c8b49d..f449095 100644
--- a/chrome/browser/chromeos/gdata/gdata_uploader.cc
+++ b/chrome/browser/chromeos/gdata/gdata_uploader.cc
@@ -220,23 +220,26 @@ void GDataUploader::OpenCompletionCallback(int upload_id, int result) {
// The file may actually not exist yet, as the downloads system downloads
// to a temp location and then renames the file. If this is the case, we
// just retry opening the file later.
- if (result != net::OK && upload_file_info->should_retry_file_open) {
+ if (result != net::OK) {
DCHECK_EQ(result, net::ERR_FILE_NOT_FOUND);
- // File open failed. Try again later.
- upload_file_info->num_file_open_tries++;
-
- DVLOG(1) << "Error opening \"" << upload_file_info->file_path.value()
- << "\" for reading: " << net::ErrorToString(result)
- << ", tries=" << upload_file_info->num_file_open_tries;
-
- // Stop trying to open this file if we exceed kMaxFileOpenTries.
- const bool exceeded_max_attempts =
- upload_file_info->num_file_open_tries >= kMaxFileOpenTries;
- upload_file_info->should_retry_file_open = !exceeded_max_attempts;
- if (exceeded_max_attempts)
+
+ if (upload_file_info->should_retry_file_open) {
+ // File open failed. Try again later.
+ upload_file_info->num_file_open_tries++;
+
+ DVLOG(1) << "Error opening \"" << upload_file_info->file_path.value()
+ << "\" for reading: " << net::ErrorToString(result)
+ << ", tries=" << upload_file_info->num_file_open_tries;
+
+ // Stop trying to open this file if we exceed kMaxFileOpenTries.
+ const bool exceeded_max_attempts =
+ upload_file_info->num_file_open_tries >= kMaxFileOpenTries;
+ upload_file_info->should_retry_file_open = !exceeded_max_attempts;
+ }
+ if (!upload_file_info->should_retry_file_open) {
UploadFailed(scoped_ptr<UploadFileInfo>(upload_file_info),
base::PLATFORM_FILE_ERROR_NOT_FOUND);
-
+ }
return;
}