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))); |
918 if (IsInstalled(status())) | 925 if (IsInstalled(status())) |
919 UMA_HISTOGRAM_BOOLEAN("ServiceWorker.ScriptLoadSuccess", true); | 926 UMA_HISTOGRAM_BOOLEAN("ServiceWorker.ScriptLoadSuccess", true); |
920 } | 927 } |
921 | 928 |
922 void ServiceWorkerVersion::OnScriptLoadFailed() { | 929 void ServiceWorkerVersion::OnScriptLoadFailed() { |
923 if (IsInstalled(status())) | 930 if (IsInstalled(status())) |
924 UMA_HISTOGRAM_BOOLEAN("ServiceWorker.ScriptLoadSuccess", false); | 931 UMA_HISTOGRAM_BOOLEAN("ServiceWorker.ScriptLoadSuccess", false); |
925 } | 932 } |
926 | 933 |
927 void ServiceWorkerVersion::OnRegisteredToDevToolsManager() { | 934 void ServiceWorkerVersion::OnRegisteredToDevToolsManager() { |
(...skipping 938 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1866 | 1873 |
1867 void ServiceWorkerVersion::CleanUpExternalRequest( | 1874 void ServiceWorkerVersion::CleanUpExternalRequest( |
1868 const std::string& request_uuid, | 1875 const std::string& request_uuid, |
1869 ServiceWorkerStatusCode status) { | 1876 ServiceWorkerStatusCode status) { |
1870 if (status == SERVICE_WORKER_OK) | 1877 if (status == SERVICE_WORKER_OK) |
1871 return; | 1878 return; |
1872 external_request_uuid_to_request_id_.erase(request_uuid); | 1879 external_request_uuid_to_request_id_.erase(request_uuid); |
1873 } | 1880 } |
1874 | 1881 |
1875 } // namespace content | 1882 } // namespace content |
OLD | NEW |