diff options
author | jkarlin <jkarlin@chromium.org> | 2015-10-23 19:34:00 -0700 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2015-10-24 02:35:02 +0000 |
commit | 460ed7608b4b183c1021f01ebfbeed8ef6ffd282 (patch) | |
tree | 9a88eaf75b8101ce28e6215810c783d97f693023 /content/browser/background_sync/background_sync_registration.cc | |
parent | db1e89dfaf2194d5b95f17df6ad090bf25d9d1a5 (diff) | |
download | chromium_src-460ed7608b4b183c1021f01ebfbeed8ef6ffd282.zip chromium_src-460ed7608b4b183c1021f01ebfbeed8ef6ffd282.tar.gz chromium_src-460ed7608b4b183c1021f01ebfbeed8ef6ffd282.tar.bz2 |
[BackgroundSync] Replace SyncRegistration.done with SyncRegistration.finished
Replaces SyncRegistration.done with SyncRegistration.finished (and plumbs the rename all the way through for consistency). Also updates the SyncRegistration.finished promise to reject on failure.
See https://github.com/slightlyoff/BackgroundSync/issues/103
BUG=542438
Review URL: https://codereview.chromium.org/1398253003
Cr-Commit-Position: refs/heads/master@{#355955}
Diffstat (limited to 'content/browser/background_sync/background_sync_registration.cc')
-rw-r--r-- | content/browser/background_sync/background_sync_registration.cc | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/content/browser/background_sync/background_sync_registration.cc b/content/browser/background_sync/background_sync_registration.cc index d3da8e8..14bdc46a 100644 --- a/content/browser/background_sync/background_sync_registration.cc +++ b/content/browser/background_sync/background_sync_registration.cc @@ -30,21 +30,21 @@ bool BackgroundSyncRegistration::IsValid() const { return id_ != kInvalidRegistrationId; } -void BackgroundSyncRegistration::AddDoneCallback( +void BackgroundSyncRegistration::AddFinishedCallback( const StateCallback& callback) { DCHECK(!HasCompleted()); - notify_done_callbacks_.push_back(callback); + notify_finished_callbacks_.push_back(callback); } -void BackgroundSyncRegistration::RunDoneCallbacks() { +void BackgroundSyncRegistration::RunFinishedCallbacks() { DCHECK(HasCompleted()); - for (auto& callback : notify_done_callbacks_) { + for (auto& callback : notify_finished_callbacks_) { base::ThreadTaskRunnerHandle::Get()->PostTask( FROM_HERE, base::Bind(callback, sync_state_)); } - notify_done_callbacks_.clear(); + notify_finished_callbacks_.clear(); } bool BackgroundSyncRegistration::HasCompleted() const { @@ -72,9 +72,9 @@ void BackgroundSyncRegistration::SetUnregisteredState() { if (!firing) { // If the registration is currently firing then wait to run - // RunDoneCallbacks until after it has finished as it might + // RunFinishedCallbacks until after it has finished as it might // change state to SUCCESS first. - RunDoneCallbacks(); + RunFinishedCallbacks(); } } |