Index: content/browser/service_worker/service_worker_dispatcher_host.cc |
diff --git a/content/browser/service_worker/service_worker_dispatcher_host.cc b/content/browser/service_worker/service_worker_dispatcher_host.cc |
index 61e00876ff90acfedd5b76e23e8af7dc4d2835ca..22d97f608d2fe1441d16e16668e4cf55ce7d907a 100644 |
--- a/content/browser/service_worker/service_worker_dispatcher_host.cc |
+++ b/content/browser/service_worker/service_worker_dispatcher_host.cc |
@@ -4,6 +4,7 @@ |
#include "content/browser/service_worker/service_worker_dispatcher_host.h" |
+#include "base/command_line.h" |
#include "base/logging.h" |
#include "base/profiler/scoped_tracker.h" |
#include "base/strings/utf_string_conversions.h" |
@@ -23,6 +24,7 @@ |
#include "content/common/service_worker/service_worker_utils.h" |
#include "content/public/browser/content_browser_client.h" |
#include "content/public/common/content_client.h" |
+#include "content/public/common/content_switches.h" |
#include "content/public/common/origin_util.h" |
#include "ipc/ipc_message_macros.h" |
#include "net/base/net_util.h" |
@@ -732,6 +734,24 @@ void ServiceWorkerDispatcherHost::OnProviderCreated( |
bad_message::SWDH_PROVIDER_CREATED_NO_HOST); |
return; |
} |
+ |
+ // PlzNavigate: |
+ if (provider_id < kInvalidServiceWorkerProviderId) { |
kinuko
2015/08/21 14:00:44
nit: Could we have a small helper function to chec
Fabrice (no longer in Chrome)
2015/08/26 13:23:24
Done.
|
+ CHECK(base::CommandLine::ForCurrentProcess()->HasSwitch( |
+ switches::kEnableBrowserSideNavigation)); |
+ DCHECK_EQ(SERVICE_WORKER_PROVIDER_FOR_WINDOW, provider_type); |
+ scoped_ptr<ServiceWorkerProviderHost> navigation_provider_host( |
+ GetContext()->TakeBrowserProviderHost(provider_id)); |
michaeln
2015/09/01 01:15:23
If anything should prevent navigation from proceed
|
+ if (navigation_provider_host == nullptr) { |
+ bad_message::ReceivedBadMessage(this, bad_message::SWDH_NOT_HANDLED); |
+ return; |
+ } |
+ navigation_provider_host->CompleteCrossSiteTransfer( |
nasko
2015/08/20 16:49:50
There are no cross-site transfers in PlzNavigate.
kinuko
2015/08/21 14:00:44
This method is used to complete the NavigationProv
Fabrice (no longer in Chrome)
2015/08/26 13:23:24
Agreed, bad name for PlzNavigate. I'm not sure we
|
+ render_process_id_, route_id, provider_id, provider_type, this); |
+ GetContext()->AddProviderHost(navigation_provider_host.Pass()); |
+ return; |
+ } |
+ |
scoped_ptr<ServiceWorkerProviderHost> provider_host( |
new ServiceWorkerProviderHost(render_process_id_, route_id, provider_id, |
provider_type, GetContext()->AsWeakPtr(), |