Chromium Code Reviews| 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 ac715540893d8faa1012dba205e30c1e5403d2e5..5cd9299e835f7bcc71f52d4abc3c93fca415bc6b 100644 |
| --- a/content/browser/service_worker/service_worker_version.cc |
| +++ b/content/browser/service_worker/service_worker_version.cc |
| @@ -1306,7 +1306,8 @@ void ServiceWorkerVersion::OnPongFromWorker() { |
| } |
| void ServiceWorkerVersion::OnRegisterForeignFetchScopes( |
| - const std::vector<GURL>& sub_scopes) { |
| + const std::vector<GURL>& sub_scopes, |
| + const std::vector<GURL>& origins) { |
| DCHECK(status() == INSTALLING || status() == REDUNDANT) << status(); |
| // Renderer should have already verified all these urls are inside the |
| // worker's scope, but verify again here on the browser process side. |
| @@ -1324,8 +1325,18 @@ void ServiceWorkerVersion::OnRegisterForeignFetchScopes( |
| return; |
| } |
| } |
| - foreign_fetch_scopes_.insert(foreign_fetch_scopes_.end(), sub_scopes.begin(), |
| - sub_scopes.end()); |
| + for (const GURL& url : origins) { |
| + if (!url.is_valid()) { |
| + DVLOG(1) << "Received unexpected invalid URL from renderer process."; |
| + BrowserThread::PostTask( |
| + BrowserThread::UI, FROM_HERE, |
| + base::Bind(&KillEmbeddedWorkerProcess, embedded_worker_->process_id(), |
| + RESULT_CODE_KILLED_BAD_MESSAGE)); |
| + return; |
| + } |
| + } |
| + set_foreign_fetch_scopes(sub_scopes); |
|
falken
2016/02/03 02:17:31
The previous code appended the scopes to the end,
Marijn Kruisselbrink
2016/02/03 17:53:30
Yes, this change is intentional. The spec always s
|
| + set_foreign_fetch_origins(origins); |
| } |
| void ServiceWorkerVersion::DidEnsureLiveRegistrationForStartWorker( |