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

Side by Side Diff: content/browser/background_sync/background_sync_manager.cc

Issue 1391893003: NOT FOR REVIEW: Aura on Android (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 2 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
OLDNEW
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
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
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
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698