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

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

Issue 1795863006: service worker: Attribute purpose to start worker attempts for UMA (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 9 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 733 matching lines...) Expand 10 before | Expand all | Expand 10 after
744 BackgroundSyncEventLastChance last_chance, 744 BackgroundSyncEventLastChance last_chance,
745 const ServiceWorkerVersion::StatusCallback& callback) { 745 const ServiceWorkerVersion::StatusCallback& callback) {
746 DCHECK_CURRENTLY_ON(BrowserThread::IO); 746 DCHECK_CURRENTLY_ON(BrowserThread::IO);
747 DCHECK(active_version); 747 DCHECK(active_version);
748 748
749 if (active_version->running_status() != ServiceWorkerVersion::RUNNING) { 749 if (active_version->running_status() != ServiceWorkerVersion::RUNNING) {
750 active_version->RunAfterStartWorker( 750 active_version->RunAfterStartWorker(
751 base::Bind(&BackgroundSyncManager::DispatchSyncEvent, 751 base::Bind(&BackgroundSyncManager::DispatchSyncEvent,
752 weak_ptr_factory_.GetWeakPtr(), handle_id, active_version, 752 weak_ptr_factory_.GetWeakPtr(), handle_id, active_version,
753 last_chance, callback), 753 last_chance, callback),
754 callback); 754 callback, ServiceWorkerMetrics::EventType::SYNC);
755 return; 755 return;
756 } 756 }
757 757
758 int request_id = active_version->StartRequestWithCustomTimeout( 758 int request_id = active_version->StartRequestWithCustomTimeout(
759 ServiceWorkerMetrics::EventType::SYNC, callback, 759 ServiceWorkerMetrics::EventType::SYNC, callback,
760 parameters_->max_sync_event_duration, 760 parameters_->max_sync_event_duration,
761 ServiceWorkerVersion::CONTINUE_ON_TIMEOUT); 761 ServiceWorkerVersion::CONTINUE_ON_TIMEOUT);
762 base::WeakPtr<BackgroundSyncServiceClient> client = 762 base::WeakPtr<BackgroundSyncServiceClient> client =
763 active_version->GetMojoServiceForRequest<BackgroundSyncServiceClient>( 763 active_version->GetMojoServiceForRequest<BackgroundSyncServiceClient>(
764 request_id); 764 request_id);
(...skipping 521 matching lines...) Expand 10 before | Expand all | Expand 10 after
1286 BackgroundSyncManager::MakeStatusCompletion(const StatusCallback& callback) { 1286 BackgroundSyncManager::MakeStatusCompletion(const StatusCallback& callback) {
1287 DCHECK_CURRENTLY_ON(BrowserThread::IO); 1287 DCHECK_CURRENTLY_ON(BrowserThread::IO);
1288 1288
1289 return base::Bind( 1289 return base::Bind(
1290 &BackgroundSyncManager::CompleteOperationCallback<StatusCallback, 1290 &BackgroundSyncManager::CompleteOperationCallback<StatusCallback,
1291 BackgroundSyncStatus>, 1291 BackgroundSyncStatus>,
1292 weak_ptr_factory_.GetWeakPtr(), callback); 1292 weak_ptr_factory_.GetWeakPtr(), callback);
1293 } 1293 }
1294 1294
1295 } // namespace content 1295 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698