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/sync_file_system/sync_file_system_service.h" | 5 #include "chrome/browser/sync_file_system/sync_file_system_service.h" |
6 | 6 |
7 #include "base/bind.h" | 7 #include "base/bind.h" |
8 #include "base/logging.h" | 8 #include "base/logging.h" |
9 #include "base/memory/ref_counted.h" | 9 #include "base/memory/ref_counted.h" |
10 #include "base/stl_util.h" | 10 #include "base/stl_util.h" |
(...skipping 429 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
440 void SyncFileSystemService::OnLocalChangeAvailable(int64 pending_changes) { | 440 void SyncFileSystemService::OnLocalChangeAvailable(int64 pending_changes) { |
441 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); | 441 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); |
442 DCHECK_GE(pending_changes, 0); | 442 DCHECK_GE(pending_changes, 0); |
443 DVLOG(1) << "OnLocalChangeAvailable: " << pending_changes; | 443 DVLOG(1) << "OnLocalChangeAvailable: " << pending_changes; |
444 pending_local_changes_ = pending_changes; | 444 pending_local_changes_ = pending_changes; |
445 base::MessageLoopProxy::current()->PostTask( | 445 base::MessageLoopProxy::current()->PostTask( |
446 FROM_HERE, base::Bind(&SyncFileSystemService::MaybeStartSync, | 446 FROM_HERE, base::Bind(&SyncFileSystemService::MaybeStartSync, |
447 AsWeakPtr())); | 447 AsWeakPtr())); |
448 } | 448 } |
449 | 449 |
450 void SyncFileSystemService::OnRemoteChangeAvailable(int64 pending_changes) { | 450 void SyncFileSystemService::OnRemoteChangeQueueUpdated(int64 pending_changes) { |
451 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); | 451 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); |
452 DCHECK_GE(pending_changes, 0); | 452 DCHECK_GE(pending_changes, 0); |
453 DVLOG(1) << "OnRemoteChangeAvailable: " << pending_changes; | 453 DVLOG(1) << "OnRemoteChangeQueueUpdated: " << pending_changes; |
454 pending_remote_changes_ = pending_changes; | 454 pending_remote_changes_ = pending_changes; |
455 if (pending_changes > 0) { | 455 if (pending_changes > 0) { |
456 // The smallest change available might have changed from the previous one. | 456 // The smallest change available might have changed from the previous one. |
457 // Reset the is_waiting_remote_sync_enabled_ flag so that we can retry. | 457 // Reset the is_waiting_remote_sync_enabled_ flag so that we can retry. |
458 is_waiting_remote_sync_enabled_ = false; | 458 is_waiting_remote_sync_enabled_ = false; |
459 } | 459 } |
460 base::MessageLoopProxy::current()->PostTask( | 460 base::MessageLoopProxy::current()->PostTask( |
461 FROM_HERE, base::Bind(&SyncFileSystemService::MaybeStartSync, | 461 FROM_HERE, base::Bind(&SyncFileSystemService::MaybeStartSync, |
462 AsWeakPtr())); | 462 AsWeakPtr())); |
463 } | 463 } |
(...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
519 remote_file_service = mock_remote_file_service_.Pass(); | 519 remote_file_service = mock_remote_file_service_.Pass(); |
520 else | 520 else |
521 remote_file_service.reset(new DriveFileSyncService(profile)); | 521 remote_file_service.reset(new DriveFileSyncService(profile)); |
522 | 522 |
523 service->Initialize(local_file_service.Pass(), | 523 service->Initialize(local_file_service.Pass(), |
524 remote_file_service.Pass()); | 524 remote_file_service.Pass()); |
525 return service; | 525 return service; |
526 } | 526 } |
527 | 527 |
528 } // namespace sync_file_system | 528 } // namespace sync_file_system |
OLD | NEW |