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

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

Issue 2906163002: [network service][SW] Rework browser-side SW on top of URL loader chaining (Closed)
Patch Set: rebase and fix debug component 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 24 matching lines...) Expand all
35 #include "content/browser/service_worker/service_worker_metrics.h" 35 #include "content/browser/service_worker/service_worker_metrics.h"
36 #include "content/browser/service_worker/service_worker_registration.h" 36 #include "content/browser/service_worker/service_worker_registration.h"
37 #include "content/common/origin_trials/trial_token_validator.h" 37 #include "content/common/origin_trials/trial_token_validator.h"
38 #include "content/common/service_worker/embedded_worker_messages.h" 38 #include "content/common/service_worker/embedded_worker_messages.h"
39 #include "content/common/service_worker/embedded_worker_start_params.h" 39 #include "content/common/service_worker/embedded_worker_start_params.h"
40 #include "content/common/service_worker/service_worker_messages.h" 40 #include "content/common/service_worker/service_worker_messages.h"
41 #include "content/common/service_worker/service_worker_utils.h" 41 #include "content/common/service_worker/service_worker_utils.h"
42 #include "content/public/browser/browser_thread.h" 42 #include "content/public/browser/browser_thread.h"
43 #include "content/public/browser/content_browser_client.h" 43 #include "content/public/browser/content_browser_client.h"
44 #include "content/public/browser/render_process_host.h" 44 #include "content/public/browser/render_process_host.h"
45 #include "content/public/common/browser_side_navigation_policy.h"
45 #include "content/public/common/content_client.h" 46 #include "content/public/common/content_client.h"
46 #include "content/public/common/content_switches.h" 47 #include "content/public/common/content_switches.h"
47 #include "content/public/common/result_codes.h" 48 #include "content/public/common/result_codes.h"
48 #include "net/http/http_response_headers.h" 49 #include "net/http/http_response_headers.h"
49 #include "net/http/http_response_info.h" 50 #include "net/http/http_response_info.h"
50 #include "third_party/WebKit/public/web/WebConsoleMessage.h" 51 #include "third_party/WebKit/public/web/WebConsoleMessage.h"
51 52
52 namespace content { 53 namespace content {
53 54
54 using StatusCallback = ServiceWorkerVersion::StatusCallback; 55 using StatusCallback = ServiceWorkerVersion::StatusCallback;
(...skipping 841 matching lines...) Expand 10 before | Expand all | Expand 10 after
896 897
897 void ServiceWorkerVersion::OnDetached(EmbeddedWorkerStatus old_status) { 898 void ServiceWorkerVersion::OnDetached(EmbeddedWorkerStatus old_status) {
898 if (IsInstalled(status())) { 899 if (IsInstalled(status())) {
899 ServiceWorkerMetrics::RecordWorkerStopped( 900 ServiceWorkerMetrics::RecordWorkerStopped(
900 ServiceWorkerMetrics::StopStatus::DETACH_BY_REGISTRY); 901 ServiceWorkerMetrics::StopStatus::DETACH_BY_REGISTRY);
901 } 902 }
902 OnStoppedInternal(old_status); 903 OnStoppedInternal(old_status);
903 } 904 }
904 905
905 void ServiceWorkerVersion::OnScriptLoaded() { 906 void ServiceWorkerVersion::OnScriptLoaded() {
906 DCHECK(GetMainScriptHttpResponseInfo()); 907 DCHECK(GetMainScriptHttpResponseInfo() ||
908 // TODO(scottmg|falken): This DCHECK is currently triggered in
909 // --network-service because subresources haven't been implemented yet.
falken 2017/06/06 13:20:23 In the non-servicifiied path, ServiceWorkerReadFr
scottmg 2017/06/06 16:50:09 I see. OK, I updated the comment. I think I got co
910 // This should be removed once that is complete.
911 (IsBrowserSideNavigationEnabled() &&
912 base::CommandLine::ForCurrentProcess()->HasSwitch(
913 switches::kEnableNetworkService)));
907 if (IsInstalled(status())) 914 if (IsInstalled(status()))
908 UMA_HISTOGRAM_BOOLEAN("ServiceWorker.ScriptLoadSuccess", true); 915 UMA_HISTOGRAM_BOOLEAN("ServiceWorker.ScriptLoadSuccess", true);
909 } 916 }
910 917
911 void ServiceWorkerVersion::OnScriptLoadFailed() { 918 void ServiceWorkerVersion::OnScriptLoadFailed() {
912 if (IsInstalled(status())) 919 if (IsInstalled(status()))
913 UMA_HISTOGRAM_BOOLEAN("ServiceWorker.ScriptLoadSuccess", false); 920 UMA_HISTOGRAM_BOOLEAN("ServiceWorker.ScriptLoadSuccess", false);
914 } 921 }
915 922
916 void ServiceWorkerVersion::OnRegisteredToDevToolsManager() { 923 void ServiceWorkerVersion::OnRegisteredToDevToolsManager() {
(...skipping 924 matching lines...) Expand 10 before | Expand all | Expand 10 after
1841 1848
1842 void ServiceWorkerVersion::CleanUpExternalRequest( 1849 void ServiceWorkerVersion::CleanUpExternalRequest(
1843 const std::string& request_uuid, 1850 const std::string& request_uuid,
1844 ServiceWorkerStatusCode status) { 1851 ServiceWorkerStatusCode status) {
1845 if (status == SERVICE_WORKER_OK) 1852 if (status == SERVICE_WORKER_OK)
1846 return; 1853 return;
1847 external_request_uuid_to_request_id_.erase(request_uuid); 1854 external_request_uuid_to_request_id_.erase(request_uuid);
1848 } 1855 }
1849 1856
1850 } // namespace content 1857 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698