OLD | NEW |
1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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 "content/browser/background_sync/background_sync_manager.h" | 5 #include "content/browser/background_sync/background_sync_manager.h" |
6 | 6 |
7 #include "base/barrier_closure.h" | 7 #include "base/barrier_closure.h" |
8 #include "base/bind.h" | 8 #include "base/bind.h" |
9 #include "base/location.h" | 9 #include "base/location.h" |
10 #include "base/single_thread_task_runner.h" | 10 #include "base/single_thread_task_runner.h" |
(...skipping 737 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
748 | 748 |
749 if (registration.sync_state() != SYNC_STATE_PENDING) | 749 if (registration.sync_state() != SYNC_STATE_PENDING) |
750 return false; | 750 return false; |
751 | 751 |
752 DCHECK_EQ(SYNC_ONE_SHOT, registration.options()->periodicity); | 752 DCHECK_EQ(SYNC_ONE_SHOT, registration.options()->periodicity); |
753 | 753 |
754 return AreOptionConditionsMet(*registration.options()); | 754 return AreOptionConditionsMet(*registration.options()); |
755 } | 755 } |
756 | 756 |
757 void BackgroundSyncManager::SchedulePendingRegistrations() { | 757 void BackgroundSyncManager::SchedulePendingRegistrations() { |
758 #if defined(OS_ANDROID) | 758 #if defined(OS_ANDROID) && !defined(USE_AURA) |
759 bool keep_browser_alive_for_one_shot = false; | 759 bool keep_browser_alive_for_one_shot = false; |
760 | 760 |
761 for (const auto& sw_id_and_registrations : sw_to_registrations_map_) { | 761 for (const auto& sw_id_and_registrations : sw_to_registrations_map_) { |
762 for (const auto& key_and_registration : | 762 for (const auto& key_and_registration : |
763 sw_id_and_registrations.second.registration_map) { | 763 sw_id_and_registrations.second.registration_map) { |
764 const BackgroundSyncRegistration& registration = | 764 const BackgroundSyncRegistration& registration = |
765 key_and_registration.second; | 765 key_and_registration.second; |
766 if (registration.sync_state() == SYNC_STATE_PENDING) { | 766 if (registration.sync_state() == SYNC_STATE_PENDING) { |
767 if (registration.options()->periodicity == SYNC_ONE_SHOT) { | 767 if (registration.options()->periodicity == SYNC_ONE_SHOT) { |
768 keep_browser_alive_for_one_shot = true; | 768 keep_browser_alive_for_one_shot = true; |
(...skipping 304 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1073 BackgroundSyncManager::MakeStatusCompletion(const StatusCallback& callback) { | 1073 BackgroundSyncManager::MakeStatusCompletion(const StatusCallback& callback) { |
1074 DCHECK_CURRENTLY_ON(BrowserThread::IO); | 1074 DCHECK_CURRENTLY_ON(BrowserThread::IO); |
1075 | 1075 |
1076 return base::Bind( | 1076 return base::Bind( |
1077 &BackgroundSyncManager::CompleteOperationCallback<StatusCallback, | 1077 &BackgroundSyncManager::CompleteOperationCallback<StatusCallback, |
1078 BackgroundSyncStatus>, | 1078 BackgroundSyncStatus>, |
1079 weak_ptr_factory_.GetWeakPtr(), callback); | 1079 weak_ptr_factory_.GetWeakPtr(), callback); |
1080 } | 1080 } |
1081 | 1081 |
1082 } // namespace content | 1082 } // namespace content |
OLD | NEW |