OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 <stddef.h> | 5 #include <stddef.h> |
6 #include <stdint.h> | 6 #include <stdint.h> |
7 | 7 |
8 #include <map> | 8 #include <map> |
9 #include <memory> | 9 #include <memory> |
10 #include <utility> | 10 #include <utility> |
(...skipping 651 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
662 request_id, base::Bind(&self::ReceiveInstallEventOnIOThread, | 662 request_id, base::Bind(&self::ReceiveInstallEventOnIOThread, |
663 base::Unretained(this), done, result)); | 663 base::Unretained(this), done, result)); |
664 version_->DispatchEvent({request_id}, | 664 version_->DispatchEvent({request_id}, |
665 ServiceWorkerMsg_InstallEvent(request_id)); | 665 ServiceWorkerMsg_InstallEvent(request_id)); |
666 } | 666 } |
667 | 667 |
668 void ReceiveInstallEventOnIOThread(const base::Closure& done, | 668 void ReceiveInstallEventOnIOThread(const base::Closure& done, |
669 ServiceWorkerStatusCode* out_result, | 669 ServiceWorkerStatusCode* out_result, |
670 int request_id, | 670 int request_id, |
671 blink::WebServiceWorkerEventResult result, | 671 blink::WebServiceWorkerEventResult result, |
672 bool has_fetch_handler) { | 672 bool has_fetch_handler, |
| 673 base::Time dispatch_event_time) { |
673 version_->FinishRequest( | 674 version_->FinishRequest( |
674 request_id, result == blink::WebServiceWorkerEventResultCompleted); | 675 request_id, result == blink::WebServiceWorkerEventResultCompleted, |
| 676 dispatch_event_time); |
675 version_->set_fetch_handler_existence( | 677 version_->set_fetch_handler_existence( |
676 has_fetch_handler | 678 has_fetch_handler |
677 ? ServiceWorkerVersion::FetchHandlerExistence::EXISTS | 679 ? ServiceWorkerVersion::FetchHandlerExistence::EXISTS |
678 : ServiceWorkerVersion::FetchHandlerExistence::DOES_NOT_EXIST); | 680 : ServiceWorkerVersion::FetchHandlerExistence::DOES_NOT_EXIST); |
679 | 681 |
680 ServiceWorkerStatusCode status = SERVICE_WORKER_OK; | 682 ServiceWorkerStatusCode status = SERVICE_WORKER_OK; |
681 if (result == blink::WebServiceWorkerEventResultRejected) | 683 if (result == blink::WebServiceWorkerEventResultRejected) |
682 status = SERVICE_WORKER_ERROR_EVENT_WAITUNTIL_REJECTED; | 684 status = SERVICE_WORKER_ERROR_EVENT_WAITUNTIL_REJECTED; |
683 | 685 |
684 *out_result = status; | 686 *out_result = status; |
(...skipping 1338 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2023 | 2025 |
2024 IN_PROC_BROWSER_TEST_F(ServiceWorkerDisableWebSecurityTest, UpdateNoCrash) { | 2026 IN_PROC_BROWSER_TEST_F(ServiceWorkerDisableWebSecurityTest, UpdateNoCrash) { |
2025 const char kPageUrl[] = "/service_worker/disable_web_security_update.html"; | 2027 const char kPageUrl[] = "/service_worker/disable_web_security_update.html"; |
2026 const char kScopeUrl[] = "/service_worker/scope/"; | 2028 const char kScopeUrl[] = "/service_worker/scope/"; |
2027 const char kWorkerUrl[] = "/service_worker/fetch_event_blob.js"; | 2029 const char kWorkerUrl[] = "/service_worker/fetch_event_blob.js"; |
2028 RegisterServiceWorkerOnCrossOriginServer(kScopeUrl, kWorkerUrl); | 2030 RegisterServiceWorkerOnCrossOriginServer(kScopeUrl, kWorkerUrl); |
2029 RunTestWithCrossOriginURL(kPageUrl, kScopeUrl); | 2031 RunTestWithCrossOriginURL(kPageUrl, kScopeUrl); |
2030 } | 2032 } |
2031 | 2033 |
2032 } // namespace content | 2034 } // namespace content |
OLD | NEW |