| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "content/browser/service_worker/service_worker_version.h" | 5 #include "content/browser/service_worker/service_worker_version.h" |
| 6 | 6 |
| 7 #include <stddef.h> | 7 #include <stddef.h> |
| 8 | 8 |
| 9 #include <limits> | 9 #include <limits> |
| 10 #include <map> | 10 #include <map> |
| (...skipping 1351 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1362 ping_controller_->OnPongReceived(); | 1362 ping_controller_->OnPongReceived(); |
| 1363 } | 1363 } |
| 1364 | 1364 |
| 1365 void ServiceWorkerVersion::OnRegisterForeignFetchScopes( | 1365 void ServiceWorkerVersion::OnRegisterForeignFetchScopes( |
| 1366 const std::vector<GURL>& sub_scopes, | 1366 const std::vector<GURL>& sub_scopes, |
| 1367 const std::vector<url::Origin>& origins) { | 1367 const std::vector<url::Origin>& origins) { |
| 1368 DCHECK(status() == INSTALLING || status() == REDUNDANT) << status(); | 1368 DCHECK(status() == INSTALLING || status() == REDUNDANT) << status(); |
| 1369 // Renderer should have already verified all these urls are inside the | 1369 // Renderer should have already verified all these urls are inside the |
| 1370 // worker's scope, but verify again here on the browser process side. | 1370 // worker's scope, but verify again here on the browser process side. |
| 1371 GURL origin = scope_.GetOrigin(); | 1371 GURL origin = scope_.GetOrigin(); |
| 1372 std::string scope_path = scope_.path(); | 1372 base::StringPiece scope_path = scope_.path(); |
| 1373 for (const GURL& url : sub_scopes) { | 1373 for (const GURL& url : sub_scopes) { |
| 1374 if (!url.is_valid() || url.GetOrigin() != origin || | 1374 if (!url.is_valid() || url.GetOrigin() != origin || |
| 1375 !base::StartsWith(url.path(), scope_path, | 1375 !base::StartsWith(url.path(), scope_path, |
| 1376 base::CompareCase::SENSITIVE)) { | 1376 base::CompareCase::SENSITIVE)) { |
| 1377 DVLOG(1) << "Received unexpected invalid URL from renderer process."; | 1377 DVLOG(1) << "Received unexpected invalid URL from renderer process."; |
| 1378 BrowserThread::PostTask( | 1378 BrowserThread::PostTask( |
| 1379 BrowserThread::UI, FROM_HERE, | 1379 BrowserThread::UI, FROM_HERE, |
| 1380 base::Bind(&KillEmbeddedWorkerProcess, embedded_worker_->process_id(), | 1380 base::Bind(&KillEmbeddedWorkerProcess, embedded_worker_->process_id(), |
| 1381 RESULT_CODE_KILLED_BAD_MESSAGE)); | 1381 RESULT_CODE_KILLED_BAD_MESSAGE)); |
| 1382 return; | 1382 return; |
| (...skipping 495 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1878 | 1878 |
| 1879 void ServiceWorkerVersion::CleanUpExternalRequest( | 1879 void ServiceWorkerVersion::CleanUpExternalRequest( |
| 1880 const std::string& request_uuid, | 1880 const std::string& request_uuid, |
| 1881 ServiceWorkerStatusCode status) { | 1881 ServiceWorkerStatusCode status) { |
| 1882 if (status == SERVICE_WORKER_OK) | 1882 if (status == SERVICE_WORKER_OK) |
| 1883 return; | 1883 return; |
| 1884 external_request_uuid_to_request_id_.erase(request_uuid); | 1884 external_request_uuid_to_request_id_.erase(request_uuid); |
| 1885 } | 1885 } |
| 1886 | 1886 |
| 1887 } // namespace content | 1887 } // namespace content |
| OLD | NEW |