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

Side by Side Diff: content/browser/service_worker/service_worker_version.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
« no previous file with comments | « content/browser/service_worker/service_worker_metrics.cc ('k') | content/test/BUILD.gn » ('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/service_worker_version.h" 5 #include "content/browser/service_worker/service_worker_version.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 8
9 #include <limits> 9 #include <limits>
10 #include <map> 10 #include <map>
(...skipping 732 matching lines...) Expand 10 before | Expand all | Expand 10 after
743 context_->storage()->PurgeResources(resources); 743 context_->storage()->PurgeResources(resources);
744 } 744 }
745 745
746 void ServiceWorkerVersion::SetValidOriginTrialTokens( 746 void ServiceWorkerVersion::SetValidOriginTrialTokens(
747 const TrialTokenValidator::FeatureToTokensMap& tokens) { 747 const TrialTokenValidator::FeatureToTokensMap& tokens) {
748 origin_trial_tokens_ = 748 origin_trial_tokens_ =
749 TrialTokenValidator::GetValidTokens(url::Origin(scope()), tokens); 749 TrialTokenValidator::GetValidTokens(url::Origin(scope()), tokens);
750 } 750 }
751 751
752 void ServiceWorkerVersion::SetDevToolsAttached(bool attached) { 752 void ServiceWorkerVersion::SetDevToolsAttached(bool attached) {
753 embedded_worker()->set_devtools_attached(attached); 753 embedded_worker()->SetDevToolsAttached(attached);
754
754 if (stop_when_devtools_detached_ && !attached) { 755 if (stop_when_devtools_detached_ && !attached) {
755 DCHECK_EQ(REDUNDANT, status()); 756 DCHECK_EQ(REDUNDANT, status());
756 if (running_status() == EmbeddedWorkerStatus::STARTING || 757 if (running_status() == EmbeddedWorkerStatus::STARTING ||
757 running_status() == EmbeddedWorkerStatus::RUNNING) { 758 running_status() == EmbeddedWorkerStatus::RUNNING) {
758 embedded_worker_->Stop(); 759 embedded_worker_->Stop();
759 } 760 }
760 return; 761 return;
761 } 762 }
762 if (attached) { 763 if (attached) {
763 // TODO(falken): Canceling the timeouts when debugging could cause 764 // TODO(falken): Canceling the timeouts when debugging could cause
(...skipping 1135 matching lines...) Expand 10 before | Expand all | Expand 10 after
1899 1900
1900 void ServiceWorkerVersion::CleanUpExternalRequest( 1901 void ServiceWorkerVersion::CleanUpExternalRequest(
1901 const std::string& request_uuid, 1902 const std::string& request_uuid,
1902 ServiceWorkerStatusCode status) { 1903 ServiceWorkerStatusCode status) {
1903 if (status == SERVICE_WORKER_OK) 1904 if (status == SERVICE_WORKER_OK)
1904 return; 1905 return;
1905 external_request_uuid_to_request_id_.erase(request_uuid); 1906 external_request_uuid_to_request_id_.erase(request_uuid);
1906 } 1907 }
1907 1908
1908 } // namespace content 1909 } // namespace content
OLDNEW
« no previous file with comments | « content/browser/service_worker/service_worker_metrics.cc ('k') | content/test/BUILD.gn » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698