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

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: Getting rid of BrowserStartupController changes 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 944 matching lines...) Expand 10 before | Expand all | Expand 10 after
955 955
956 if (registration.sync_state() != BACKGROUND_SYNC_STATE_PENDING) 956 if (registration.sync_state() != BACKGROUND_SYNC_STATE_PENDING)
957 return false; 957 return false;
958 958
959 DCHECK_EQ(SYNC_ONE_SHOT, registration.options()->periodicity); 959 DCHECK_EQ(SYNC_ONE_SHOT, registration.options()->periodicity);
960 960
961 return AreOptionConditionsMet(*registration.options()); 961 return AreOptionConditionsMet(*registration.options());
962 } 962 }
963 963
964 void BackgroundSyncManager::SchedulePendingRegistrations() { 964 void BackgroundSyncManager::SchedulePendingRegistrations() {
965 #if defined(OS_ANDROID) 965 #if defined(OS_ANDROID) && !defined(USE_AURA)
966 bool keep_browser_alive_for_one_shot = false; 966 bool keep_browser_alive_for_one_shot = false;
967 967
968 for (const auto& sw_id_and_registrations : active_registrations_) { 968 for (const auto& sw_id_and_registrations : active_registrations_) {
969 for (const auto& key_and_registration : 969 for (const auto& key_and_registration :
970 sw_id_and_registrations.second.registration_map) { 970 sw_id_and_registrations.second.registration_map) {
971 const BackgroundSyncRegistration& registration = 971 const BackgroundSyncRegistration& registration =
972 *key_and_registration.second->value(); 972 *key_and_registration.second->value();
973 if (registration.sync_state() == BACKGROUND_SYNC_STATE_PENDING) { 973 if (registration.sync_state() == BACKGROUND_SYNC_STATE_PENDING) {
974 if (registration.options()->periodicity == SYNC_ONE_SHOT) { 974 if (registration.options()->periodicity == SYNC_ONE_SHOT) {
975 keep_browser_alive_for_one_shot = true; 975 keep_browser_alive_for_one_shot = true;
(...skipping 342 matching lines...) Expand 10 before | Expand all | Expand 10 after
1318 BackgroundSyncManager::MakeStatusCompletion(const StatusCallback& callback) { 1318 BackgroundSyncManager::MakeStatusCompletion(const StatusCallback& callback) {
1319 DCHECK_CURRENTLY_ON(BrowserThread::IO); 1319 DCHECK_CURRENTLY_ON(BrowserThread::IO);
1320 1320
1321 return base::Bind( 1321 return base::Bind(
1322 &BackgroundSyncManager::CompleteOperationCallback<StatusCallback, 1322 &BackgroundSyncManager::CompleteOperationCallback<StatusCallback,
1323 BackgroundSyncStatus>, 1323 BackgroundSyncStatus>,
1324 weak_ptr_factory_.GetWeakPtr(), callback); 1324 weak_ptr_factory_.GetWeakPtr(), callback);
1325 } 1325 }
1326 1326
1327 } // namespace content 1327 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698