| 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 20 matching lines...) Expand all Loading... |
| 31 #include "content/common/origin_trials/trial_token_validator.h" | 31 #include "content/common/origin_trials/trial_token_validator.h" |
| 32 #include "content/common/service_worker/embedded_worker_messages.h" | 32 #include "content/common/service_worker/embedded_worker_messages.h" |
| 33 #include "content/common/service_worker/embedded_worker_start_params.h" | 33 #include "content/common/service_worker/embedded_worker_start_params.h" |
| 34 #include "content/common/service_worker/service_worker_messages.h" | 34 #include "content/common/service_worker/service_worker_messages.h" |
| 35 #include "content/common/service_worker/service_worker_utils.h" | 35 #include "content/common/service_worker/service_worker_utils.h" |
| 36 #include "content/public/browser/browser_thread.h" | 36 #include "content/public/browser/browser_thread.h" |
| 37 #include "content/public/browser/content_browser_client.h" | 37 #include "content/public/browser/content_browser_client.h" |
| 38 #include "content/public/browser/render_process_host.h" | 38 #include "content/public/browser/render_process_host.h" |
| 39 #include "content/public/common/browser_side_navigation_policy.h" | 39 #include "content/public/common/browser_side_navigation_policy.h" |
| 40 #include "content/public/common/content_client.h" | 40 #include "content/public/common/content_client.h" |
| 41 #include "content/public/common/content_switches.h" | 41 #include "content/public/common/content_features.h" |
| 42 #include "content/public/common/result_codes.h" | 42 #include "content/public/common/result_codes.h" |
| 43 #include "net/http/http_response_headers.h" | 43 #include "net/http/http_response_headers.h" |
| 44 #include "net/http/http_response_info.h" | 44 #include "net/http/http_response_info.h" |
| 45 #include "third_party/WebKit/public/web/WebConsoleMessage.h" | 45 #include "third_party/WebKit/public/web/WebConsoleMessage.h" |
| 46 | 46 |
| 47 namespace content { | 47 namespace content { |
| 48 | 48 |
| 49 using StatusCallback = ServiceWorkerVersion::StatusCallback; | 49 using StatusCallback = ServiceWorkerVersion::StatusCallback; |
| 50 | 50 |
| 51 namespace { | 51 namespace { |
| (...skipping 843 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 895 OnStoppedInternal(old_status); | 895 OnStoppedInternal(old_status); |
| 896 } | 896 } |
| 897 | 897 |
| 898 void ServiceWorkerVersion::OnScriptLoaded() { | 898 void ServiceWorkerVersion::OnScriptLoaded() { |
| 899 DCHECK(GetMainScriptHttpResponseInfo() || | 899 DCHECK(GetMainScriptHttpResponseInfo() || |
| 900 // TODO(scottmg|falken): This DCHECK is currently triggered in | 900 // TODO(scottmg|falken): This DCHECK is currently triggered in |
| 901 // --network-service because ServiceWorkerReadFromCacheJob isn't being | 901 // --network-service because ServiceWorkerReadFromCacheJob isn't being |
| 902 // used to retrieve the service worker js. This should be removed once | 902 // used to retrieve the service worker js. This should be removed once |
| 903 // that's done. | 903 // that's done. |
| 904 (IsBrowserSideNavigationEnabled() && | 904 (IsBrowserSideNavigationEnabled() && |
| 905 base::CommandLine::ForCurrentProcess()->HasSwitch( | 905 base::FeatureList::IsEnabled(features::kNetworkService))); |
| 906 switches::kEnableNetworkService))); | |
| 907 if (IsInstalled(status())) | 906 if (IsInstalled(status())) |
| 908 UMA_HISTOGRAM_BOOLEAN("ServiceWorker.ScriptLoadSuccess", true); | 907 UMA_HISTOGRAM_BOOLEAN("ServiceWorker.ScriptLoadSuccess", true); |
| 909 } | 908 } |
| 910 | 909 |
| 911 void ServiceWorkerVersion::OnScriptLoadFailed() { | 910 void ServiceWorkerVersion::OnScriptLoadFailed() { |
| 912 if (IsInstalled(status())) | 911 if (IsInstalled(status())) |
| 913 UMA_HISTOGRAM_BOOLEAN("ServiceWorker.ScriptLoadSuccess", false); | 912 UMA_HISTOGRAM_BOOLEAN("ServiceWorker.ScriptLoadSuccess", false); |
| 914 } | 913 } |
| 915 | 914 |
| 916 void ServiceWorkerVersion::OnRegisteredToDevToolsManager() { | 915 void ServiceWorkerVersion::OnRegisteredToDevToolsManager() { |
| (...skipping 929 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1846 | 1845 |
| 1847 void ServiceWorkerVersion::CleanUpExternalRequest( | 1846 void ServiceWorkerVersion::CleanUpExternalRequest( |
| 1848 const std::string& request_uuid, | 1847 const std::string& request_uuid, |
| 1849 ServiceWorkerStatusCode status) { | 1848 ServiceWorkerStatusCode status) { |
| 1850 if (status == SERVICE_WORKER_OK) | 1849 if (status == SERVICE_WORKER_OK) |
| 1851 return; | 1850 return; |
| 1852 external_request_uuid_to_request_id_.erase(request_uuid); | 1851 external_request_uuid_to_request_id_.erase(request_uuid); |
| 1853 } | 1852 } |
| 1854 | 1853 |
| 1855 } // namespace content | 1854 } // namespace content |
| OLD | NEW |