| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "chrome/browser/chromeos/gdata/gdata_sync_client.h" | 5 #include "chrome/browser/chromeos/gdata/gdata_sync_client.h" |
| 6 | 6 |
| 7 #include <sys/types.h> | 7 #include <sys/types.h> |
| 8 #include <sys/stat.h> | 8 #include <sys/stat.h> |
| 9 #include <unistd.h> | 9 #include <unistd.h> |
| 10 | 10 |
| (...skipping 165 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 176 } | 176 } |
| 177 | 177 |
| 178 queue_.pop_front(); | 178 queue_.pop_front(); |
| 179 if (sync_task.sync_type == FETCH) { | 179 if (sync_task.sync_type == FETCH) { |
| 180 DVLOG(1) << "Fetching " << sync_task.resource_id; | 180 DVLOG(1) << "Fetching " << sync_task.resource_id; |
| 181 file_system_->GetFileByResourceId( | 181 file_system_->GetFileByResourceId( |
| 182 sync_task.resource_id, | 182 sync_task.resource_id, |
| 183 base::Bind(&GDataSyncClient::OnFetchFileComplete, | 183 base::Bind(&GDataSyncClient::OnFetchFileComplete, |
| 184 weak_ptr_factory_.GetWeakPtr(), | 184 weak_ptr_factory_.GetWeakPtr(), |
| 185 sync_task), | 185 sync_task), |
| 186 GetDownloadDataCallback()); | 186 GetContentCallback()); |
| 187 } else if (sync_task.sync_type == UPLOAD) { | 187 } else if (sync_task.sync_type == UPLOAD) { |
| 188 DVLOG(1) << "Uploading " << sync_task.resource_id; | 188 DVLOG(1) << "Uploading " << sync_task.resource_id; |
| 189 file_system_->UpdateFileByResourceId( | 189 file_system_->UpdateFileByResourceId( |
| 190 sync_task.resource_id, | 190 sync_task.resource_id, |
| 191 base::Bind(&GDataSyncClient::OnUploadFileComplete, | 191 base::Bind(&GDataSyncClient::OnUploadFileComplete, |
| 192 weak_ptr_factory_.GetWeakPtr(), | 192 weak_ptr_factory_.GetWeakPtr(), |
| 193 sync_task.resource_id)); | 193 sync_task.resource_id)); |
| 194 } else { | 194 } else { |
| 195 NOTREACHED() << ": Unexpected sync type: " << sync_task.sync_type; | 195 NOTREACHED() << ": Unexpected sync type: " << sync_task.sync_type; |
| 196 } | 196 } |
| (...skipping 260 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 457 const content::NotificationDetails& details) { | 457 const content::NotificationDetails& details) { |
| 458 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); | 458 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); |
| 459 | 459 |
| 460 // Resume the sync loop if gdata preferences are changed. Note that we | 460 // Resume the sync loop if gdata preferences are changed. Note that we |
| 461 // don't need to check the new values here as these will be checked in | 461 // don't need to check the new values here as these will be checked in |
| 462 // ShouldStopSyncLoop() as soon as the loop is resumed. | 462 // ShouldStopSyncLoop() as soon as the loop is resumed. |
| 463 StartSyncLoop(); | 463 StartSyncLoop(); |
| 464 } | 464 } |
| 465 | 465 |
| 466 } // namespace gdata | 466 } // namespace gdata |
| OLD | NEW |