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 433 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
444 void SyncFileSystemService::OnLocalChangeAvailable(int64 pending_changes) { | 444 void SyncFileSystemService::OnLocalChangeAvailable(int64 pending_changes) { |
445 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); | 445 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); |
446 DCHECK_GE(pending_changes, 0); | 446 DCHECK_GE(pending_changes, 0); |
447 DVLOG(1) << "OnLocalChangeAvailable: " << pending_changes; | 447 DVLOG(1) << "OnLocalChangeAvailable: " << pending_changes; |
448 pending_local_changes_ = pending_changes; | 448 pending_local_changes_ = pending_changes; |
449 base::MessageLoopProxy::current()->PostTask( | 449 base::MessageLoopProxy::current()->PostTask( |
450 FROM_HERE, base::Bind(&SyncFileSystemService::MaybeStartSync, | 450 FROM_HERE, base::Bind(&SyncFileSystemService::MaybeStartSync, |
451 AsWeakPtr())); | 451 AsWeakPtr())); |
452 } | 452 } |
453 | 453 |
454 void SyncFileSystemService::OnRemoteChangeAvailable(int64 pending_changes) { | 454 void SyncFileSystemService::OnRemoteChangeQueueUpdated(int64 pending_changes) { |
455 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); | 455 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); |
456 DCHECK_GE(pending_changes, 0); | 456 DCHECK_GE(pending_changes, 0); |
457 DVLOG(1) << "OnRemoteChangeAvailable: " << pending_changes; | 457 DVLOG(1) << "OnRemoteChangeAvailable: " << pending_changes; |
kinuko
2012/12/04 06:59:17
nit: can you also update this log msg?
tzik
2012/12/04 07:06:09
Done.
| |
458 pending_remote_changes_ = pending_changes; | 458 pending_remote_changes_ = pending_changes; |
459 if (pending_changes > 0) { | 459 if (pending_changes > 0) { |
460 // The smallest change available might have changed from the previous one. | 460 // The smallest change available might have changed from the previous one. |
461 // Reset the is_waiting_remote_sync_enabled_ flag so that we can retry. | 461 // Reset the is_waiting_remote_sync_enabled_ flag so that we can retry. |
462 is_waiting_remote_sync_enabled_ = false; | 462 is_waiting_remote_sync_enabled_ = false; |
463 } | 463 } |
464 base::MessageLoopProxy::current()->PostTask( | 464 base::MessageLoopProxy::current()->PostTask( |
465 FROM_HERE, base::Bind(&SyncFileSystemService::MaybeStartSync, | 465 FROM_HERE, base::Bind(&SyncFileSystemService::MaybeStartSync, |
466 AsWeakPtr())); | 466 AsWeakPtr())); |
467 } | 467 } |
(...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
523 remote_file_service = mock_remote_file_service_.Pass(); | 523 remote_file_service = mock_remote_file_service_.Pass(); |
524 else | 524 else |
525 remote_file_service.reset(new DriveFileSyncService(profile)); | 525 remote_file_service.reset(new DriveFileSyncService(profile)); |
526 | 526 |
527 service->Initialize(local_file_service.Pass(), | 527 service->Initialize(local_file_service.Pass(), |
528 remote_file_service.Pass()); | 528 remote_file_service.Pass()); |
529 return service; | 529 return service; |
530 } | 530 } |
531 | 531 |
532 } // namespace sync_file_system | 532 } // namespace sync_file_system |
OLD | NEW |