| 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 <utility> | 7 #include <utility> |
| 8 | 8 |
| 9 #include "base/barrier_closure.h" | 9 #include "base/barrier_closure.h" |
| 10 #include "base/bind.h" | 10 #include "base/bind.h" |
| (...skipping 131 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 142 return parameters; | 142 return parameters; |
| 143 } | 143 } |
| 144 | 144 |
| 145 background_sync_controller->GetParameterOverrides(parameters.get()); | 145 background_sync_controller->GetParameterOverrides(parameters.get()); |
| 146 return parameters; | 146 return parameters; |
| 147 } | 147 } |
| 148 | 148 |
| 149 void OnSyncEventFinished(scoped_refptr<ServiceWorkerVersion> active_version, | 149 void OnSyncEventFinished(scoped_refptr<ServiceWorkerVersion> active_version, |
| 150 int request_id, | 150 int request_id, |
| 151 const ServiceWorkerVersion::StatusCallback& callback, | 151 const ServiceWorkerVersion::StatusCallback& callback, |
| 152 blink::mojom::ServiceWorkerEventStatus status) { | 152 ServiceWorkerStatusCode status) { |
| 153 if (!active_version->FinishRequest( | 153 if (!active_version->FinishRequest( |
| 154 request_id, | 154 request_id, |
| 155 status == blink::mojom::ServiceWorkerEventStatus::COMPLETED)) { | 155 status == SERVICE_WORKER_OK)) { |
| 156 return; | 156 return; |
| 157 } | 157 } |
| 158 callback.Run(mojo::ConvertTo<ServiceWorkerStatusCode>(status)); | 158 callback.Run(status); |
| 159 } | 159 } |
| 160 | 160 |
| 161 } // namespace | 161 } // namespace |
| 162 | 162 |
| 163 BackgroundSyncManager::BackgroundSyncRegistrations:: | 163 BackgroundSyncManager::BackgroundSyncRegistrations:: |
| 164 BackgroundSyncRegistrations() | 164 BackgroundSyncRegistrations() |
| 165 : next_id(BackgroundSyncRegistration::kInitialId) { | 165 : next_id(BackgroundSyncRegistration::kInitialId) { |
| 166 } | 166 } |
| 167 | 167 |
| 168 BackgroundSyncManager::BackgroundSyncRegistrations::BackgroundSyncRegistrations( | 168 BackgroundSyncManager::BackgroundSyncRegistrations::BackgroundSyncRegistrations( |
| (...skipping 1019 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1188 parameters_->max_sync_attempts = max_attempts; | 1188 parameters_->max_sync_attempts = max_attempts; |
| 1189 base::ThreadTaskRunnerHandle::Get()->PostTask(FROM_HERE, callback); | 1189 base::ThreadTaskRunnerHandle::Get()->PostTask(FROM_HERE, callback); |
| 1190 } | 1190 } |
| 1191 | 1191 |
| 1192 base::Closure BackgroundSyncManager::MakeEmptyCompletion() { | 1192 base::Closure BackgroundSyncManager::MakeEmptyCompletion() { |
| 1193 DCHECK_CURRENTLY_ON(BrowserThread::IO); | 1193 DCHECK_CURRENTLY_ON(BrowserThread::IO); |
| 1194 return op_scheduler_.WrapCallbackToRunNext(base::Bind(&base::DoNothing)); | 1194 return op_scheduler_.WrapCallbackToRunNext(base::Bind(&base::DoNothing)); |
| 1195 } | 1195 } |
| 1196 | 1196 |
| 1197 } // namespace content | 1197 } // namespace content |
| OLD | NEW |