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 109 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
120 | 120 |
121 background_sync_controller->GetParameterOverrides(parameters.get()); | 121 background_sync_controller->GetParameterOverrides(parameters.get()); |
122 return parameters; | 122 return parameters; |
123 } | 123 } |
124 | 124 |
125 void OnSyncEventFinished( | 125 void OnSyncEventFinished( |
126 const scoped_refptr<ServiceWorkerVersion>& active_version, | 126 const scoped_refptr<ServiceWorkerVersion>& active_version, |
127 int request_id, | 127 int request_id, |
128 const ServiceWorkerVersion::StatusCallback& callback, | 128 const ServiceWorkerVersion::StatusCallback& callback, |
129 ServiceWorkerEventStatus status) { | 129 ServiceWorkerEventStatus status) { |
130 TRACE_EVENT1("ServiceWorker", "BackgroundSyncManager::OnSyncEventFinished", | |
131 "Request id", request_id); | |
132 if (!active_version->FinishRequest(request_id)) | 130 if (!active_version->FinishRequest(request_id)) |
133 return; | 131 return; |
134 callback.Run(mojo::ConvertTo<ServiceWorkerStatusCode>(status)); | 132 callback.Run(mojo::ConvertTo<ServiceWorkerStatusCode>(status)); |
135 } | 133 } |
136 | 134 |
137 } // namespace | 135 } // namespace |
138 | 136 |
139 BackgroundSyncManager::BackgroundSyncRegistrations:: | 137 BackgroundSyncManager::BackgroundSyncRegistrations:: |
140 BackgroundSyncRegistrations() | 138 BackgroundSyncRegistrations() |
141 : next_id(BackgroundSyncRegistration::kInitialId) { | 139 : next_id(BackgroundSyncRegistration::kInitialId) { |
(...skipping 1398 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1540 BackgroundSyncManager::MakeStatusCompletion(const StatusCallback& callback) { | 1538 BackgroundSyncManager::MakeStatusCompletion(const StatusCallback& callback) { |
1541 DCHECK_CURRENTLY_ON(BrowserThread::IO); | 1539 DCHECK_CURRENTLY_ON(BrowserThread::IO); |
1542 | 1540 |
1543 return base::Bind( | 1541 return base::Bind( |
1544 &BackgroundSyncManager::CompleteOperationCallback<StatusCallback, | 1542 &BackgroundSyncManager::CompleteOperationCallback<StatusCallback, |
1545 BackgroundSyncStatus>, | 1543 BackgroundSyncStatus>, |
1546 weak_ptr_factory_.GetWeakPtr(), callback); | 1544 weak_ptr_factory_.GetWeakPtr(), callback); |
1547 } | 1545 } |
1548 | 1546 |
1549 } // namespace content | 1547 } // namespace content |
OLD | NEW |