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

Side by Side Diff: chrome/browser/chromeos/gdata/gdata_sync_client.cc

Issue 10690149: gdata: Move GDataCache::CacheEntry out of GDataCache (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: removing the existing test Created 8 years, 5 months 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
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
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
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
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698