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

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

Issue 1931153002: service worker: Bump update time even when the script was identical (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@2704
Patch Set: Created 4 years, 7 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 542 matching lines...) Expand 10 before | Expand all | Expand 10 after
553 "ServiceWorker", "EmbeddedWorkerInstance::Start", 553 "ServiceWorker", "EmbeddedWorkerInstance::Start",
554 inflight_start_task_.get(), "OnScriptLoaded", "Source", 554 inflight_start_task_.get(), "OnScriptLoaded", "Source",
555 ServiceWorkerMetrics::LoadSourceToString(source)); 555 ServiceWorkerMetrics::LoadSourceToString(source));
556 556
557 if (!step_time_.is_null()) { 557 if (!step_time_.is_null()) {
558 base::TimeDelta duration = UpdateStepTime(); 558 base::TimeDelta duration = UpdateStepTime();
559 ServiceWorkerMetrics::RecordTimeToLoad( 559 ServiceWorkerMetrics::RecordTimeToLoad(
560 duration, source, inflight_start_task_->start_situation()); 560 duration, source, inflight_start_task_->start_situation());
561 } 561 }
562 562
563 starting_phase_ = SCRIPT_LOADED;
563 FOR_EACH_OBSERVER(Listener, listener_list_, OnScriptLoaded()); 564 FOR_EACH_OBSERVER(Listener, listener_list_, OnScriptLoaded());
564 starting_phase_ = SCRIPT_LOADED; 565 // |this| may be destroyed by the callback.
565 } 566 }
566 567
567 void EmbeddedWorkerInstance::OnURLJobCreatedForMainScript() { 568 void EmbeddedWorkerInstance::OnURLJobCreatedForMainScript() {
568 if (!inflight_start_task_) 569 if (!inflight_start_task_)
569 return; 570 return;
570 TRACE_EVENT_ASYNC_STEP_PAST0("ServiceWorker", "EmbeddedWorkerInstance::Start", 571 TRACE_EVENT_ASYNC_STEP_PAST0("ServiceWorker", "EmbeddedWorkerInstance::Start",
571 inflight_start_task_.get(), "OnURLJobCreated"); 572 inflight_start_task_.get(), "OnURLJobCreated");
572 if (!step_time_.is_null()) { 573 if (!step_time_.is_null()) {
573 base::TimeDelta duration = UpdateStepTime(); 574 base::TimeDelta duration = UpdateStepTime();
574 if (inflight_start_task_->is_installed()) 575 if (inflight_start_task_->is_installed())
(...skipping 235 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