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

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

Issue 1623583003: Add async tracing to SWVersion::AddRequest. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 11 months 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 <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
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
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
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698