| 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 327 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 338 base::Bind(&GDataSyncClient::OnGetCacheEntry, | 338 base::Bind(&GDataSyncClient::OnGetCacheEntry, |
| 339 weak_ptr_factory_.GetWeakPtr(), | 339 weak_ptr_factory_.GetWeakPtr(), |
| 340 resource_id, | 340 resource_id, |
| 341 file_proto->file_md5())); | 341 file_proto->file_md5())); |
| 342 } | 342 } |
| 343 | 343 |
| 344 void GDataSyncClient::OnGetCacheEntry( | 344 void GDataSyncClient::OnGetCacheEntry( |
| 345 const std::string& resource_id, | 345 const std::string& resource_id, |
| 346 const std::string& latest_md5, | 346 const std::string& latest_md5, |
| 347 bool success, | 347 bool success, |
| 348 const GDataCache::CacheEntry& cache_entry) { | 348 const GDataCacheEntry& cache_entry) { |
| 349 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); | 349 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); |
| 350 | 350 |
| 351 if (!success) { | 351 if (!success) { |
| 352 LOG(WARNING) << "Cache entry not found: " << resource_id; | 352 LOG(WARNING) << "Cache entry not found: " << resource_id; |
| 353 return; | 353 return; |
| 354 } | 354 } |
| 355 | 355 |
| 356 // If MD5s don't match, it indicates the local cache file is stale, unless | 356 // If MD5s don't match, it indicates the local cache file is stale, unless |
| 357 // the file is dirty (the MD5 is "local"). We should never re-fetch the | 357 // the file is dirty (the MD5 is "local"). We should never re-fetch the |
| 358 // file when we have a locally modified version. | 358 // file when we have a locally modified version. |
| (...skipping 88 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 447 const content::NotificationDetails& details) { | 447 const content::NotificationDetails& details) { |
| 448 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); | 448 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); |
| 449 | 449 |
| 450 // Resume the sync loop if gdata preferences are changed. Note that we | 450 // Resume the sync loop if gdata preferences are changed. Note that we |
| 451 // don't need to check the new values here as these will be checked in | 451 // don't need to check the new values here as these will be checked in |
| 452 // ShouldStopSyncLoop() as soon as the loop is resumed. | 452 // ShouldStopSyncLoop() as soon as the loop is resumed. |
| 453 StartSyncLoop(); | 453 StartSyncLoop(); |
| 454 } | 454 } |
| 455 | 455 |
| 456 } // namespace gdata | 456 } // namespace gdata |
| OLD | NEW |