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

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

Issue 1411503005: Aura on Android: content/browser (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@auraclank_upstream_select_file
Patch Set: Addressing remaining feedback, cleaning up build files. Created 5 years, 1 month 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/metrics/field_trial.h" 10 #include "base/metrics/field_trial.h"
(...skipping 955 matching lines...) Expand 10 before | Expand all | Expand 10 after
966 966
967 if (registration.sync_state() != BACKGROUND_SYNC_STATE_PENDING) 967 if (registration.sync_state() != BACKGROUND_SYNC_STATE_PENDING)
968 return false; 968 return false;
969 969
970 DCHECK_EQ(SYNC_ONE_SHOT, registration.options()->periodicity); 970 DCHECK_EQ(SYNC_ONE_SHOT, registration.options()->periodicity);
971 971
972 return AreOptionConditionsMet(*registration.options()); 972 return AreOptionConditionsMet(*registration.options());
973 } 973 }
974 974
975 void BackgroundSyncManager::SchedulePendingRegistrations() { 975 void BackgroundSyncManager::SchedulePendingRegistrations() {
976 #if defined(OS_ANDROID) 976 #if defined(OS_ANDROID) && !defined(USE_AURA)
mfomitchev 2015/11/03 22:23:20 Should we create a crbug for this functionality fo
no sievers 2015/11/04 01:59:32 If you want to (basically 'sync play services inte
mfomitchev 2015/11/04 20:49:31 Done.
977 bool keep_browser_alive_for_one_shot = false; 977 bool keep_browser_alive_for_one_shot = false;
978 978
979 for (const auto& sw_id_and_registrations : active_registrations_) { 979 for (const auto& sw_id_and_registrations : active_registrations_) {
980 for (const auto& key_and_registration : 980 for (const auto& key_and_registration :
981 sw_id_and_registrations.second.registration_map) { 981 sw_id_and_registrations.second.registration_map) {
982 const BackgroundSyncRegistration& registration = 982 const BackgroundSyncRegistration& registration =
983 *key_and_registration.second->value(); 983 *key_and_registration.second->value();
984 if (registration.sync_state() == BACKGROUND_SYNC_STATE_PENDING) { 984 if (registration.sync_state() == BACKGROUND_SYNC_STATE_PENDING) {
985 if (registration.options()->periodicity == SYNC_ONE_SHOT) { 985 if (registration.options()->periodicity == SYNC_ONE_SHOT) {
986 keep_browser_alive_for_one_shot = true; 986 keep_browser_alive_for_one_shot = true;
(...skipping 362 matching lines...) Expand 10 before | Expand all | Expand 10 after
1349 BackgroundSyncManager::MakeStatusCompletion(const StatusCallback& callback) { 1349 BackgroundSyncManager::MakeStatusCompletion(const StatusCallback& callback) {
1350 DCHECK_CURRENTLY_ON(BrowserThread::IO); 1350 DCHECK_CURRENTLY_ON(BrowserThread::IO);
1351 1351
1352 return base::Bind( 1352 return base::Bind(
1353 &BackgroundSyncManager::CompleteOperationCallback<StatusCallback, 1353 &BackgroundSyncManager::CompleteOperationCallback<StatusCallback,
1354 BackgroundSyncStatus>, 1354 BackgroundSyncStatus>,
1355 weak_ptr_factory_.GetWeakPtr(), callback); 1355 weak_ptr_factory_.GetWeakPtr(), callback);
1356 } 1356 }
1357 1357
1358 } // namespace content 1358 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698