| OLD | NEW |
| 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 896 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 907 | 907 |
| 908 void ServiceWorkerVersion::OnDetached(EmbeddedWorkerStatus old_status) { | 908 void ServiceWorkerVersion::OnDetached(EmbeddedWorkerStatus old_status) { |
| 909 if (IsInstalled(status())) { | 909 if (IsInstalled(status())) { |
| 910 ServiceWorkerMetrics::RecordWorkerStopped( | 910 ServiceWorkerMetrics::RecordWorkerStopped( |
| 911 ServiceWorkerMetrics::StopStatus::DETACH_BY_REGISTRY); | 911 ServiceWorkerMetrics::StopStatus::DETACH_BY_REGISTRY); |
| 912 } | 912 } |
| 913 OnStoppedInternal(old_status); | 913 OnStoppedInternal(old_status); |
| 914 } | 914 } |
| 915 | 915 |
| 916 void ServiceWorkerVersion::OnScriptLoaded() { | 916 void ServiceWorkerVersion::OnScriptLoaded() { |
| 917 DCHECK(GetMainScriptHttpResponseInfo() || | 917 DCHECK(GetMainScriptHttpResponseInfo()); |
| 918 // TODO(scottmg|falken): This DCHECK is currently triggered in | |
| 919 // --network-service because ServiceWorkerReadFromCacheJob isn't being | |
| 920 // used to retrieve the service worker js. This should be removed once | |
| 921 // that's done. | |
| 922 (IsBrowserSideNavigationEnabled() && | |
| 923 base::CommandLine::ForCurrentProcess()->HasSwitch( | |
| 924 switches::kEnableNetworkService))); | |
| 925 if (IsInstalled(status())) | 918 if (IsInstalled(status())) |
| 926 UMA_HISTOGRAM_BOOLEAN("ServiceWorker.ScriptLoadSuccess", true); | 919 UMA_HISTOGRAM_BOOLEAN("ServiceWorker.ScriptLoadSuccess", true); |
| 927 } | 920 } |
| 928 | 921 |
| 929 void ServiceWorkerVersion::OnScriptLoadFailed() { | 922 void ServiceWorkerVersion::OnScriptLoadFailed() { |
| 930 if (IsInstalled(status())) | 923 if (IsInstalled(status())) |
| 931 UMA_HISTOGRAM_BOOLEAN("ServiceWorker.ScriptLoadSuccess", false); | 924 UMA_HISTOGRAM_BOOLEAN("ServiceWorker.ScriptLoadSuccess", false); |
| 932 } | 925 } |
| 933 | 926 |
| 934 void ServiceWorkerVersion::OnRegisteredToDevToolsManager() { | 927 void ServiceWorkerVersion::OnRegisteredToDevToolsManager() { |
| (...skipping 926 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1861 | 1854 |
| 1862 void ServiceWorkerVersion::CleanUpExternalRequest( | 1855 void ServiceWorkerVersion::CleanUpExternalRequest( |
| 1863 const std::string& request_uuid, | 1856 const std::string& request_uuid, |
| 1864 ServiceWorkerStatusCode status) { | 1857 ServiceWorkerStatusCode status) { |
| 1865 if (status == SERVICE_WORKER_OK) | 1858 if (status == SERVICE_WORKER_OK) |
| 1866 return; | 1859 return; |
| 1867 external_request_uuid_to_request_id_.erase(request_uuid); | 1860 external_request_uuid_to_request_id_.erase(request_uuid); |
| 1868 } | 1861 } |
| 1869 | 1862 |
| 1870 } // namespace content | 1863 } // namespace content |
| OLD | NEW |