| 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 e72bc88a66c8fa4c0c0fc0428b0c684a9fb9bc43..1983aaf624e067e91408cc79ebbfa9a06a5d0865 100644
|
| --- a/content/browser/service_worker/service_worker_version.cc
|
| +++ b/content/browser/service_worker/service_worker_version.cc
|
| @@ -1044,12 +1044,14 @@ void ServiceWorkerVersion::CountFeature(uint32_t feature) {
|
| provider_host_by_uuid.second->CountFeature(feature);
|
| }
|
|
|
| -void ServiceWorkerVersion::OnOpenWindow(int request_id, GURL url) {
|
| +void ServiceWorkerVersion::OnOpenWindow(int request_id,
|
| + GURL redirect_url,
|
| + GURL url_to_open) {
|
| // Just abort if we are shutting down.
|
| if (!context_)
|
| return;
|
|
|
| - if (!url.is_valid()) {
|
| + if (!url_to_open.is_valid()) {
|
| DVLOG(1) << "Received unexpected invalid URL from renderer process.";
|
| BrowserThread::PostTask(BrowserThread::UI, FROM_HERE,
|
| base::Bind(&KillEmbeddedWorkerProcess,
|
| @@ -1060,22 +1062,23 @@ void ServiceWorkerVersion::OnOpenWindow(int request_id, GURL url) {
|
|
|
| // The renderer treats all URLs in the about: scheme as being about:blank.
|
| // Canonicalize about: URLs to about:blank.
|
| - if (url.SchemeIs(url::kAboutScheme))
|
| - url = GURL(url::kAboutBlankURL);
|
| + if (url_to_open.SchemeIs(url::kAboutScheme))
|
| + url_to_open = GURL(url::kAboutBlankURL);
|
|
|
| // Reject requests for URLs that the process is not allowed to access. It's
|
| // possible to receive such requests since the renderer-side checks are
|
| // slightly different. For example, the view-source scheme will not be
|
| // filtered out by Blink.
|
| if (!ChildProcessSecurityPolicyImpl::GetInstance()->CanRequestURL(
|
| - embedded_worker_->process_id(), url)) {
|
| + embedded_worker_->process_id(), url_to_open)) {
|
| embedded_worker_->SendMessage(ServiceWorkerMsg_OpenWindowError(
|
| - request_id, url.spec() + " cannot be opened."));
|
| + request_id, url_to_open.spec() + " cannot be opened."));
|
| return;
|
| }
|
|
|
| service_worker_client_utils::OpenWindow(
|
| - url, script_url_, embedded_worker_->process_id(), context_,
|
| + redirect_url, url_to_open, script_url_, embedded_worker_->process_id(),
|
| + context_,
|
| base::Bind(&ServiceWorkerVersion::OnOpenWindowFinished,
|
| weak_factory_.GetWeakPtr(), request_id));
|
| }
|
|
|