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

Unified Diff: chrome/browser/sync_file_system/drive_backend/folder_creator.cc

Issue 99383004: [SyncFS] Refine network error handling (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: buildfix Created 7 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | chrome/browser/sync_file_system/drive_backend/list_changes_task.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/sync_file_system/drive_backend/folder_creator.cc
diff --git a/chrome/browser/sync_file_system/drive_backend/folder_creator.cc b/chrome/browser/sync_file_system/drive_backend/folder_creator.cc
index b5beb1a8649a5c037f2a84e27bdcfa3cd73ca338..42b90e3fe43e806d6b6378b5bebacd3fa8956543 100644
--- a/chrome/browser/sync_file_system/drive_backend/folder_creator.cc
+++ b/chrome/browser/sync_file_system/drive_backend/folder_creator.cc
@@ -51,9 +51,9 @@ void FolderCreator::DidCreateFolder(
const FileIDCallback& callback,
google_apis::GDataErrorCode error,
scoped_ptr<google_apis::ResourceEntry> entry) {
- if (error != google_apis::HTTP_SUCCESS &&
- error != google_apis::HTTP_CREATED) {
- callback.Run(std::string(), GDataErrorCodeToSyncStatusCode(error));
+ SyncStatusCode status = GDataErrorCodeToSyncStatusCode(error);
+ if (status != SYNC_STATUS_OK) {
+ callback.Run(std::string(), status);
return;
}
@@ -69,8 +69,15 @@ void FolderCreator::DidListFolders(
ScopedVector<google_apis::ResourceEntry> candidates,
google_apis::GDataErrorCode error,
scoped_ptr<google_apis::ResourceList> resource_list) {
- if (error != google_apis::HTTP_SUCCESS) {
- callback.Run(std::string(), GDataErrorCodeToSyncStatusCode(error));
+ SyncStatusCode status = GDataErrorCodeToSyncStatusCode(error);
+ if (status != SYNC_STATUS_OK) {
+ callback.Run(std::string(), status);
+ return;
+ }
+
+ if (!resource_list) {
+ NOTREACHED();
+ callback.Run(std::string(), SYNC_STATUS_FAILED);
return;
}
« no previous file with comments | « no previous file | chrome/browser/sync_file_system/drive_backend/list_changes_task.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698