Index: content/browser/service_worker/service_worker_version.cc |
diff --git a/content/browser/service_worker/service_worker_version.cc b/content/browser/service_worker/service_worker_version.cc |
index cb79637f758036a12b2f217f3197150e7b74f4aa..9c886ea41567b29f3f6cc083a68624e5af61cbc6 100644 |
--- a/content/browser/service_worker/service_worker_version.cc |
+++ b/content/browser/service_worker/service_worker_version.cc |
@@ -42,6 +42,7 @@ |
#include "content/public/browser/browser_thread.h" |
#include "content/public/browser/content_browser_client.h" |
#include "content/public/browser/render_process_host.h" |
+#include "content/public/common/browser_side_navigation_policy.h" |
#include "content/public/common/content_client.h" |
#include "content/public/common/content_switches.h" |
#include "content/public/common/result_codes.h" |
@@ -903,7 +904,14 @@ void ServiceWorkerVersion::OnDetached(EmbeddedWorkerStatus old_status) { |
} |
void ServiceWorkerVersion::OnScriptLoaded() { |
- DCHECK(GetMainScriptHttpResponseInfo()); |
+ DCHECK(GetMainScriptHttpResponseInfo() || |
+ // TODO(scottmg|falken): This DCHECK is currently triggered in |
+ // --network-service because ServiceWorkerReadFromCacheJob isn't being |
+ // used to retrieve the service worker js. This should be removed once |
+ // that's done. |
+ (IsBrowserSideNavigationEnabled() && |
+ base::CommandLine::ForCurrentProcess()->HasSwitch( |
+ switches::kEnableNetworkService))); |
if (IsInstalled(status())) |
UMA_HISTOGRAM_BOOLEAN("ServiceWorker.ScriptLoadSuccess", true); |
} |