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 108 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
119 | 119 |
120 background_sync_controller->GetParameterOverrides(parameters.get()); | 120 background_sync_controller->GetParameterOverrides(parameters.get()); |
121 return parameters; | 121 return parameters; |
122 } | 122 } |
123 | 123 |
124 void OnSyncEventFinished( | 124 void OnSyncEventFinished( |
125 const scoped_refptr<ServiceWorkerVersion>& active_version, | 125 const scoped_refptr<ServiceWorkerVersion>& active_version, |
126 int request_id, | 126 int request_id, |
127 const ServiceWorkerVersion::StatusCallback& callback, | 127 const ServiceWorkerVersion::StatusCallback& callback, |
128 ServiceWorkerEventStatus status) { | 128 ServiceWorkerEventStatus status) { |
129 TRACE_EVENT1("ServiceWorker", "BackgroundSyncManager::OnSyncEventFinished", | |
130 "Request id", request_id); | |
131 if (!active_version->FinishRequest(request_id)) | 129 if (!active_version->FinishRequest(request_id)) |
132 return; | 130 return; |
133 callback.Run(mojo::ConvertTo<ServiceWorkerStatusCode>(status)); | 131 callback.Run(mojo::ConvertTo<ServiceWorkerStatusCode>(status)); |
134 } | 132 } |
135 | 133 |
136 } // namespace | 134 } // namespace |
137 | 135 |
138 BackgroundSyncManager::BackgroundSyncRegistrations:: | 136 BackgroundSyncManager::BackgroundSyncRegistrations:: |
139 BackgroundSyncRegistrations() | 137 BackgroundSyncRegistrations() |
140 : next_id(BackgroundSyncRegistration::kInitialId) { | 138 : next_id(BackgroundSyncRegistration::kInitialId) { |
(...skipping 1387 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1528 BackgroundSyncManager::MakeStatusCompletion(const StatusCallback& callback) { | 1526 BackgroundSyncManager::MakeStatusCompletion(const StatusCallback& callback) { |
1529 DCHECK_CURRENTLY_ON(BrowserThread::IO); | 1527 DCHECK_CURRENTLY_ON(BrowserThread::IO); |
1530 | 1528 |
1531 return base::Bind( | 1529 return base::Bind( |
1532 &BackgroundSyncManager::CompleteOperationCallback<StatusCallback, | 1530 &BackgroundSyncManager::CompleteOperationCallback<StatusCallback, |
1533 BackgroundSyncStatus>, | 1531 BackgroundSyncStatus>, |
1534 weak_ptr_factory_.GetWeakPtr(), callback); | 1532 weak_ptr_factory_.GetWeakPtr(), callback); |
1535 } | 1533 } |
1536 | 1534 |
1537 } // namespace content | 1535 } // namespace content |
OLD | NEW |