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

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

Issue 1903043005: service worker: Bump update time even when the script was identical (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: fix asan Created 4 years, 8 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
« no previous file with comments | « no previous file | content/browser/service_worker/service_worker_job_unittest.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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/embedded_worker_instance.h" 5 #include "content/browser/service_worker/embedded_worker_instance.h"
6 6
7 #include <utility> 7 #include <utility>
8 8
9 #include "base/bind_helpers.h" 9 #include "base/bind_helpers.h"
10 #include "base/macros.h" 10 #include "base/macros.h"
(...skipping 543 matching lines...) Expand 10 before | Expand all | Expand 10 after
554 "ServiceWorker", "EmbeddedWorkerInstance::Start", 554 "ServiceWorker", "EmbeddedWorkerInstance::Start",
555 inflight_start_task_.get(), "OnScriptLoaded", "Source", 555 inflight_start_task_.get(), "OnScriptLoaded", "Source",
556 ServiceWorkerMetrics::LoadSourceToString(source)); 556 ServiceWorkerMetrics::LoadSourceToString(source));
557 557
558 if (!step_time_.is_null()) { 558 if (!step_time_.is_null()) {
559 base::TimeDelta duration = UpdateStepTime(); 559 base::TimeDelta duration = UpdateStepTime();
560 ServiceWorkerMetrics::RecordTimeToLoad( 560 ServiceWorkerMetrics::RecordTimeToLoad(
561 duration, source, inflight_start_task_->start_situation()); 561 duration, source, inflight_start_task_->start_situation());
562 } 562 }
563 563
564 starting_phase_ = SCRIPT_LOADED;
564 FOR_EACH_OBSERVER(Listener, listener_list_, OnScriptLoaded()); 565 FOR_EACH_OBSERVER(Listener, listener_list_, OnScriptLoaded());
565 starting_phase_ = SCRIPT_LOADED; 566 // |this| may be destroyed by the callback.
566 } 567 }
567 568
568 void EmbeddedWorkerInstance::OnURLJobCreatedForMainScript() { 569 void EmbeddedWorkerInstance::OnURLJobCreatedForMainScript() {
569 if (!inflight_start_task_) 570 if (!inflight_start_task_)
570 return; 571 return;
571 TRACE_EVENT_ASYNC_STEP_PAST0("ServiceWorker", "EmbeddedWorkerInstance::Start", 572 TRACE_EVENT_ASYNC_STEP_PAST0("ServiceWorker", "EmbeddedWorkerInstance::Start",
572 inflight_start_task_.get(), "OnURLJobCreated"); 573 inflight_start_task_.get(), "OnURLJobCreated");
573 if (!step_time_.is_null()) { 574 if (!step_time_.is_null()) {
574 base::TimeDelta duration = UpdateStepTime(); 575 base::TimeDelta duration = UpdateStepTime();
575 if (inflight_start_task_->is_installed()) 576 if (inflight_start_task_->is_installed())
(...skipping 234 matching lines...) Expand 10 before | Expand all | Expand 10 after
810 case SCRIPT_READ_FINISHED: 811 case SCRIPT_READ_FINISHED:
811 return "Script read finished"; 812 return "Script read finished";
812 case STARTING_PHASE_MAX_VALUE: 813 case STARTING_PHASE_MAX_VALUE:
813 NOTREACHED(); 814 NOTREACHED();
814 } 815 }
815 NOTREACHED() << phase; 816 NOTREACHED() << phase;
816 return std::string(); 817 return std::string();
817 } 818 }
818 819
819 } // namespace content 820 } // namespace content
OLDNEW
« no previous file with comments | « no previous file | content/browser/service_worker/service_worker_job_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698