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

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

Issue 2943463002: Implement dumb URLLoader{Factory} for ServiceWorker script loading (Closed)
Patch Set: . Created 3 years, 6 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/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 893 matching lines...) Expand 10 before | Expand all | Expand 10 after
904 904
905 void ServiceWorkerVersion::OnDetached(EmbeddedWorkerStatus old_status) { 905 void ServiceWorkerVersion::OnDetached(EmbeddedWorkerStatus old_status) {
906 if (IsInstalled(status())) { 906 if (IsInstalled(status())) {
907 ServiceWorkerMetrics::RecordWorkerStopped( 907 ServiceWorkerMetrics::RecordWorkerStopped(
908 ServiceWorkerMetrics::StopStatus::DETACH_BY_REGISTRY); 908 ServiceWorkerMetrics::StopStatus::DETACH_BY_REGISTRY);
909 } 909 }
910 OnStoppedInternal(old_status); 910 OnStoppedInternal(old_status);
911 } 911 }
912 912
913 void ServiceWorkerVersion::OnScriptLoaded() { 913 void ServiceWorkerVersion::OnScriptLoaded() {
914 DCHECK(GetMainScriptHttpResponseInfo() || 914 DCHECK(GetMainScriptHttpResponseInfo());
915 // TODO(scottmg|falken): This DCHECK is currently triggered in
916 // --network-service because ServiceWorkerReadFromCacheJob isn't being
917 // used to retrieve the service worker js. This should be removed once
918 // that's done.
919 (IsBrowserSideNavigationEnabled() &&
920 base::CommandLine::ForCurrentProcess()->HasSwitch(
921 switches::kEnableNetworkService)));
922 if (IsInstalled(status())) 915 if (IsInstalled(status()))
923 UMA_HISTOGRAM_BOOLEAN("ServiceWorker.ScriptLoadSuccess", true); 916 UMA_HISTOGRAM_BOOLEAN("ServiceWorker.ScriptLoadSuccess", true);
924 } 917 }
925 918
926 void ServiceWorkerVersion::OnScriptLoadFailed() { 919 void ServiceWorkerVersion::OnScriptLoadFailed() {
927 if (IsInstalled(status())) 920 if (IsInstalled(status()))
928 UMA_HISTOGRAM_BOOLEAN("ServiceWorker.ScriptLoadSuccess", false); 921 UMA_HISTOGRAM_BOOLEAN("ServiceWorker.ScriptLoadSuccess", false);
929 } 922 }
930 923
931 void ServiceWorkerVersion::OnRegisteredToDevToolsManager() { 924 void ServiceWorkerVersion::OnRegisteredToDevToolsManager() {
(...skipping 929 matching lines...) Expand 10 before | Expand all | Expand 10 after
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
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698