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

Side by Side Diff: content/browser/service_worker/service_worker_registration.cc

Issue 2039743003: Introduce ServiceWorker.ActivatedWorkerPreparationForMainFrame.Time UMA. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: move GetWorkerPreparationSuffix Created 4 years, 6 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 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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/service_worker/service_worker_registration.h" 5 #include "content/browser/service_worker/service_worker_registration.h"
6 6
7 #include <vector> 7 #include <vector>
8 8
9 #include "content/browser/service_worker/service_worker_context_core.h" 9 #include "content/browser/service_worker/service_worker_context_core.h"
10 #include "content/browser/service_worker/service_worker_context_wrapper.h" 10 #include "content/browser/service_worker/service_worker_context_wrapper.h"
(...skipping 362 matching lines...) Expand 10 before | Expand all | Expand 10 after
373 } 373 }
374 374
375 void ServiceWorkerRegistration::DispatchActivateEvent( 375 void ServiceWorkerRegistration::DispatchActivateEvent(
376 scoped_refptr<ServiceWorkerVersion> activating_version) { 376 scoped_refptr<ServiceWorkerVersion> activating_version) {
377 if (activating_version != active_version()) { 377 if (activating_version != active_version()) {
378 OnActivateEventFinished(activating_version, SERVICE_WORKER_ERROR_FAILED); 378 OnActivateEventFinished(activating_version, SERVICE_WORKER_ERROR_FAILED);
379 return; 379 return;
380 } 380 }
381 381
382 DCHECK_EQ(ServiceWorkerVersion::ACTIVATING, activating_version->status()); 382 DCHECK_EQ(ServiceWorkerVersion::ACTIVATING, activating_version->status());
383 DCHECK_EQ(ServiceWorkerVersion::RUNNING, activating_version->running_status()) 383 DCHECK_EQ(ServiceWorkerVersion::RunningStatus::RUNNING,
384 activating_version->running_status())
384 << "Worker stopped too soon after it was started."; 385 << "Worker stopped too soon after it was started.";
385 int request_id = activating_version->StartRequest( 386 int request_id = activating_version->StartRequest(
386 ServiceWorkerMetrics::EventType::ACTIVATE, 387 ServiceWorkerMetrics::EventType::ACTIVATE,
387 base::Bind(&ServiceWorkerRegistration::OnActivateEventFinished, this, 388 base::Bind(&ServiceWorkerRegistration::OnActivateEventFinished, this,
388 activating_version)); 389 activating_version));
389 activating_version 390 activating_version
390 ->DispatchSimpleEvent<ServiceWorkerHostMsg_ActivateEventFinished>( 391 ->DispatchSimpleEvent<ServiceWorkerHostMsg_ActivateEventFinished>(
391 request_id, ServiceWorkerMsg_ActivateEvent(request_id)); 392 request_id, ServiceWorkerMsg_ActivateEvent(request_id));
392 } 393 }
393 394
(...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after
472 if (!context_) { 473 if (!context_) {
473 callback.Run(SERVICE_WORKER_ERROR_ABORT); 474 callback.Run(SERVICE_WORKER_ERROR_ABORT);
474 return; 475 return;
475 } 476 }
476 context_->storage()->NotifyDoneInstallingRegistration( 477 context_->storage()->NotifyDoneInstallingRegistration(
477 this, version.get(), status); 478 this, version.get(), status);
478 callback.Run(status); 479 callback.Run(status);
479 } 480 }
480 481
481 } // namespace content 482 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698