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

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

Issue 2706923003: Add UMA for how long service workers run for. (Closed)
Patch Set: tweaks, fmt Created 3 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 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 807 matching lines...) Expand 10 before | Expand all | Expand 10 after
818 } 818 }
819 819
820 void EmbeddedWorkerInstance::AddListener(Listener* listener) { 820 void EmbeddedWorkerInstance::AddListener(Listener* listener) {
821 listener_list_.AddObserver(listener); 821 listener_list_.AddObserver(listener);
822 } 822 }
823 823
824 void EmbeddedWorkerInstance::RemoveListener(Listener* listener) { 824 void EmbeddedWorkerInstance::RemoveListener(Listener* listener) {
825 listener_list_.RemoveObserver(listener); 825 listener_list_.RemoveObserver(listener);
826 } 826 }
827 827
828 void EmbeddedWorkerInstance::SetDevToolsAttached(bool attached) {
829 devtools_attached_ = attached;
830 if (attached)
831 registry_->OnDevToolsAttached(embedded_worker_id_);
832 }
833
828 void EmbeddedWorkerInstance::OnNetworkAccessedForScriptLoad() { 834 void EmbeddedWorkerInstance::OnNetworkAccessedForScriptLoad() {
829 starting_phase_ = SCRIPT_DOWNLOADING; 835 starting_phase_ = SCRIPT_DOWNLOADING;
830 network_accessed_for_script_ = true; 836 network_accessed_for_script_ = true;
831 } 837 }
832 838
833 void EmbeddedWorkerInstance::ReleaseProcess() { 839 void EmbeddedWorkerInstance::ReleaseProcess() {
834 // Abort an inflight start task. 840 // Abort an inflight start task.
835 inflight_start_task_.reset(); 841 inflight_start_task_.reset();
836 842
837 client_.reset(); 843 client_.reset();
(...skipping 75 matching lines...) Expand 10 before | Expand all | Expand 10 after
913 case SCRIPT_READ_FINISHED: 919 case SCRIPT_READ_FINISHED:
914 return "Script read finished"; 920 return "Script read finished";
915 case STARTING_PHASE_MAX_VALUE: 921 case STARTING_PHASE_MAX_VALUE:
916 NOTREACHED(); 922 NOTREACHED();
917 } 923 }
918 NOTREACHED() << phase; 924 NOTREACHED() << phase;
919 return std::string(); 925 return std::string();
920 } 926 }
921 927
922 } // namespace content 928 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698