Repository navigation
Commit 2172873
committed
A service worker task should be done when its NetworkResourceLoader is don
https://bugs.webkit.org/show_bug.cgi?id=327822
rdar://problem/190211445
Reviewed by NOBODY (OOPS!).
We want to align NetworkResourceLoader handling of m_serviceWorkerFetchTask with m_networkLoad.
For that reason, we are now cancelling/nullifying m_serviceWorkerFetchTask in NetworkResourceLoader::cleanup.
Given there are some async callbacks (content filtering for instance), to ensure that we do not restart either network loads or service worker tasks
after the NetworkResourceLoader has been cleaned up, we add NetworkResourceLoader::m_isDone and set it to true in NetworkResourceLoader::cleanup.
We use it in NetworkResourceLoader::continueWillSendRequest and NetworkResourceLoader::startWithServiceWorker to check at async return time whether we should continue.
As a strengthening, we update ServiceWorkerFetchTask to include more m_isDone checks so that we do not create reentrancy potential issues.
Covered by existing tests.
* Source/WebKit/NetworkProcess/NetworkResourceLoader.cpp:
(WebKit::NetworkResourceLoader::~NetworkResourceLoader):
(WebKit::NetworkResourceLoader::cleanup):
(WebKit::NetworkResourceLoader::convertToDownload):
(WebKit::NetworkResourceLoader::abort):
(WebKit::NetworkResourceLoader::continueWillSendRequest):
(WebKit::NetworkResourceLoader::startWithServiceWorker):
* Source/WebKit/NetworkProcess/NetworkResourceLoader.h:
* Source/WebKit/NetworkProcess/ServiceWorker/ServiceWorkerFetchTask.cpp:
(WebKit::ServiceWorkerFetchTask::didFinish):
(WebKit::ServiceWorkerFetchTask::didFail):1 parent e50b892 commit 2172873
3 files changed
Lines changed: 30 additions & 5 deletions
File tree
- Source/WebKit/NetworkProcess
- ServiceWorker
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
213 | 213 | | |
214 | 214 | | |
215 | 215 | | |
| 216 | + | |
216 | 217 | | |
217 | 218 | | |
218 | 219 | | |
| |||
680 | 681 | | |
681 | 682 | | |
682 | 683 | | |
| 684 | + | |
| 685 | + | |
683 | 686 | | |
684 | 687 | | |
685 | 688 | | |
| |||
706 | 709 | | |
707 | 710 | | |
708 | 711 | | |
| 712 | + | |
| 713 | + | |
| 714 | + | |
709 | 715 | | |
710 | 716 | | |
711 | 717 | | |
| |||
714 | 720 | | |
715 | 721 | | |
716 | 722 | | |
717 | | - | |
718 | | - | |
719 | | - | |
| 723 | + | |
| 724 | + | |
| 725 | + | |
| 726 | + | |
| 727 | + | |
720 | 728 | | |
721 | 729 | | |
722 | 730 | | |
| |||
750 | 758 | | |
751 | 759 | | |
752 | 760 | | |
753 | | - | |
| 761 | + | |
754 | 762 | | |
755 | 763 | | |
756 | 764 | | |
| |||
2102 | 2110 | | |
2103 | 2111 | | |
2104 | 2112 | | |
| 2113 | + | |
| 2114 | + | |
| 2115 | + | |
| 2116 | + | |
2105 | 2117 | | |
2106 | 2118 | | |
2107 | 2119 | | |
| |||
2874 | 2886 | | |
2875 | 2887 | | |
2876 | 2888 | | |
| 2889 | + | |
| 2890 | + | |
| 2891 | + | |
| 2892 | + | |
| 2893 | + | |
2877 | 2894 | | |
2878 | 2895 | | |
2879 | 2896 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
417 | 417 | | |
418 | 418 | | |
419 | 419 | | |
| 420 | + | |
420 | 421 | | |
421 | 422 | | |
422 | 423 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
382 | 382 | | |
383 | 383 | | |
384 | 384 | | |
385 | | - | |
| 385 | + | |
| 386 | + | |
| 387 | + | |
| 388 | + | |
386 | 389 | | |
387 | 390 | | |
388 | 391 | | |
| |||
399 | 402 | | |
400 | 403 | | |
401 | 404 | | |
| 405 | + | |
| 406 | + | |
| 407 | + | |
402 | 408 | | |
403 | 409 | | |
404 | 410 | | |
| |||
498 | 504 | | |
499 | 505 | | |
500 | 506 | | |
| 507 | + | |
501 | 508 | | |
502 | 509 | | |
503 | 510 | | |
| |||
0 commit comments