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

Unified 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: fixes 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « content/browser/service_worker/service_worker_url_job_wrapper.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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);
}
« no previous file with comments | « content/browser/service_worker/service_worker_url_job_wrapper.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698