Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(79)

Issue 1923003002: Clear Resource::m_loader in Resource::finish() and Resource::error() (Closed)

Created:
4 years, 8 months ago by Nate Chapin
Modified:
4 years, 7 months ago
Reviewers:
hiroshige, yhirano
CC:
chromium-reviews, caseq+blink_chromium.org, Yoav Weiss, tyoshino+watch_chromium.org, lushnikov+blink_chromium.org, pfeldman+blink_chromium.org, apavlov+blink_chromium.org, gavinp+loader_chromium.org, devtools-reviews_chromium.org, blink-reviews, loading-reviews+fetch_chromium.org, sergeyv+blink_chromium.org, kozyatinskiy+blink_chromium.org
Base URL:
https://chromium.googlesource.com/chromium/src.git@master
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

Clear Resource::m_loader in Resource::finish() and Resource::error() Ensure that m_loader is cleared at the same time Resource starts return false for isLoading(). This allows for the removal of a hack in ResourceFetcher::determineRevalidationPolicy. It also allows us to remove all cases of reentrancy during ResourceLoader completion, greatly simplifying its logic. This requires rewriting a couple of tests that baked invalid assumptions into how Resource load completion works. One of those assumptions is related to removing a Resource from MemoryCache when it is cancelled during completion, which is strange and unnecessary outside of a couple of tests. This also changes failure notification behavior for multipart responses. Multipart responses have historically sent a finish notification when the first payload part completes, then no notification when the final part completes. This ensures that end-of-request bookkeeping happens when the load fails after the first part completes, which may be a visible changes in the inspector. BUG= Committed: https://crrev.com/33d4038b62d5b15b216d34ee42e1e03c49e2ef99 Cr-Commit-Position: refs/heads/master@{#393042}

Patch Set 1 #

Patch Set 2 : #

Patch Set 3 : #

Patch Set 4 : #

Patch Set 5 : #

Total comments: 13

Patch Set 6 : Fix ResourceFetchertest.RevalidateWhileFinishingLoading memory leak #

Total comments: 21

Patch Set 7 : Address comments #

Total comments: 4

Patch Set 8 : ASSERT clenaup in releaseResources() #

Patch Set 9 : Rebase #

Patch Set 10 : Rebase, comment in background.js #

Total comments: 2
Unified diffs Side-by-side diffs Delta from patch set Stats (+89 lines, -113 lines) Patch
M chrome/test/data/extensions/extension_throttle/background.js View 1 2 3 4 5 6 7 8 9 1 chunk +3 lines, -0 lines 0 comments Download
M third_party/WebKit/LayoutTests/http/tests/inspector/network/network-xhr-same-url-as-main-resource.html View 1 chunk +15 lines, -1 line 0 comments Download
M third_party/WebKit/LayoutTests/http/tests/inspector/network/network-xhr-same-url-as-main-resource-expected.txt View 1 chunk +2 lines, -1 line 0 comments Download
M third_party/WebKit/Source/core/fetch/ImageResourceTest.cpp View 1 2 3 4 5 6 7 8 2 chunks +4 lines, -4 lines 0 comments Download
M third_party/WebKit/Source/core/fetch/Resource.h View 1 2 3 4 5 6 7 8 9 1 chunk +0 lines, -2 lines 0 comments Download
M third_party/WebKit/Source/core/fetch/Resource.cpp View 1 2 3 4 5 6 7 8 9 4 chunks +4 lines, -9 lines 2 comments Download
M third_party/WebKit/Source/core/fetch/ResourceFetcher.cpp View 1 2 3 4 5 6 7 8 9 1 chunk +1 line, -11 lines 0 comments Download
M third_party/WebKit/Source/core/fetch/ResourceFetcherTest.cpp View 1 2 3 4 5 6 1 chunk +41 lines, -19 lines 0 comments Download
M third_party/WebKit/Source/core/fetch/ResourceLoader.h View 2 chunks +0 lines, -4 lines 0 comments Download
M third_party/WebKit/Source/core/fetch/ResourceLoader.cpp View 1 2 3 4 5 6 7 8 7 chunks +14 lines, -60 lines 0 comments Download
M third_party/WebKit/Source/core/fetch/ResourceLoaderSet.cpp View 1 2 3 4 1 chunk +5 lines, -2 lines 0 comments Download

Dependent Patchsets:

Messages

Total messages: 31 (11 generated)
Nate Chapin
PTAL! https://codereview.chromium.org/1923003002/diff/80001/chrome/test/data/extensions/extension_throttle/background.js File chrome/test/data/extensions/extension_throttle/background.js (right): https://codereview.chromium.org/1923003002/diff/80001/chrome/test/data/extensions/extension_throttle/background.js#newcode9 chrome/test/data/extensions/extension_throttle/background.js:9: xhr.setRequestHeader("X-Bust-Blink-MemoryCache", Math.random()); This test depends on the memoryCache()->remove() ...
4 years, 7 months ago (2016-04-27 19:48:30 UTC) #3
Nate Chapin
On 2016/04/27 19:48:30, Nate Chapin wrote: > PTAL! > > https://codereview.chromium.org/1923003002/diff/80001/chrome/test/data/extensions/extension_throttle/background.js > File chrome/test/data/extensions/extension_throttle/background.js (right): ...
4 years, 7 months ago (2016-04-29 23:39:30 UTC) #4
hiroshige
https://codereview.chromium.org/1923003002/diff/80001/chrome/test/data/extensions/extension_throttle/background.js File chrome/test/data/extensions/extension_throttle/background.js (right): https://codereview.chromium.org/1923003002/diff/80001/chrome/test/data/extensions/extension_throttle/background.js#newcode9 chrome/test/data/extensions/extension_throttle/background.js:9: xhr.setRequestHeader("X-Bust-Blink-MemoryCache", Math.random()); On 2016/04/27 19:48:30, Nate Chapin wrote: > ...
4 years, 7 months ago (2016-05-02 06:39:27 UTC) #5
yhirano
https://codereview.chromium.org/1923003002/diff/100001/third_party/WebKit/Source/core/fetch/ResourceFetcherTest.cpp File third_party/WebKit/Source/core/fetch/ResourceFetcherTest.cpp (right): https://codereview.chromium.org/1923003002/diff/100001/third_party/WebKit/Source/core/fetch/ResourceFetcherTest.cpp#newcode220 third_party/WebKit/Source/core/fetch/ResourceFetcherTest.cpp:220: RequestSameResourceOnComplete(Resource* resource) +explicit https://codereview.chromium.org/1923003002/diff/100001/third_party/WebKit/Source/core/fetch/ResourceFetcherTest.cpp#newcode258 third_party/WebKit/Source/core/fetch/ResourceFetcherTest.cpp:258: Platform::current()->getURLLoaderMockFactory()->serveAsynchronousRequests(); +resource1->removeClient(&client); https://codereview.chromium.org/1923003002/diff/100001/third_party/WebKit/Source/core/fetch/ResourceFetcherTest.cpp#newcode258 third_party/WebKit/Source/core/fetch/ResourceFetcherTest.cpp:258: ...
4 years, 7 months ago (2016-05-02 12:38:45 UTC) #6
Nate Chapin
https://codereview.chromium.org/1923003002/diff/100001/third_party/WebKit/Source/core/fetch/ResourceFetcherTest.cpp File third_party/WebKit/Source/core/fetch/ResourceFetcherTest.cpp (right): https://codereview.chromium.org/1923003002/diff/100001/third_party/WebKit/Source/core/fetch/ResourceFetcherTest.cpp#newcode220 third_party/WebKit/Source/core/fetch/ResourceFetcherTest.cpp:220: RequestSameResourceOnComplete(Resource* resource) On 2016/05/02 12:38:45, yhirano (ooo until May ...
4 years, 7 months ago (2016-05-02 20:07:37 UTC) #7
yhirano
https://codereview.chromium.org/1923003002/diff/120001/third_party/WebKit/Source/core/fetch/ResourceLoader.cpp File third_party/WebKit/Source/core/fetch/ResourceLoader.cpp (right): https://codereview.chromium.org/1923003002/diff/120001/third_party/WebKit/Source/core/fetch/ResourceLoader.cpp#newcode81 third_party/WebKit/Source/core/fetch/ResourceLoader.cpp:81: if (m_state == ConnectionStateReleased) Can we replace this branch ...
4 years, 7 months ago (2016-05-06 10:20:09 UTC) #8
Nate Chapin
https://codereview.chromium.org/1923003002/diff/120001/third_party/WebKit/Source/core/fetch/ResourceLoader.cpp File third_party/WebKit/Source/core/fetch/ResourceLoader.cpp (right): https://codereview.chromium.org/1923003002/diff/120001/third_party/WebKit/Source/core/fetch/ResourceLoader.cpp#newcode81 third_party/WebKit/Source/core/fetch/ResourceLoader.cpp:81: if (m_state == ConnectionStateReleased) On 2016/05/06 10:20:09, yhirano wrote: ...
4 years, 7 months ago (2016-05-06 21:18:54 UTC) #9
commit-bot: I haz the power
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1923003002/160001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1923003002/160001
4 years, 7 months ago (2016-05-06 23:59:16 UTC) #11
commit-bot: I haz the power
Dry run: Try jobs failed on following builders: mac_chromium_rel_ng on tryserver.chromium.mac (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.mac/builders/mac_chromium_rel_ng/builds/223727)
4 years, 7 months ago (2016-05-07 00:36:08 UTC) #13
commit-bot: I haz the power
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1923003002/160001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1923003002/160001
4 years, 7 months ago (2016-05-09 17:56:25 UTC) #15
commit-bot: I haz the power
Dry run: Try jobs failed on following builders: ios-simulator-gn on tryserver.chromium.mac (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.mac/builders/ios-simulator-gn/builds/2498)
4 years, 7 months ago (2016-05-09 17:59:54 UTC) #17
hiroshige
https://codereview.chromium.org/1923003002/diff/100001/third_party/WebKit/Source/core/fetch/ResourceLoader.cpp File third_party/WebKit/Source/core/fetch/ResourceLoader.cpp (right): https://codereview.chromium.org/1923003002/diff/100001/third_party/WebKit/Source/core/fetch/ResourceLoader.cpp#newcode297 third_party/WebKit/Source/core/fetch/ResourceLoader.cpp:297: m_resource->finish(); On 2016/05/02 20:07:37, Nate Chapin wrote: > On ...
4 years, 7 months ago (2016-05-10 10:22:48 UTC) #18
hiroshige
Could you also address my comment here? https://codereview.chromium.org/1923003002/diff/80001/chrome/test/data/extensions/extension_throttle/background.js#newcode9
4 years, 7 months ago (2016-05-10 10:23:23 UTC) #19
Nate Chapin
https://codereview.chromium.org/1923003002/diff/80001/chrome/test/data/extensions/extension_throttle/background.js File chrome/test/data/extensions/extension_throttle/background.js (right): https://codereview.chromium.org/1923003002/diff/80001/chrome/test/data/extensions/extension_throttle/background.js#newcode9 chrome/test/data/extensions/extension_throttle/background.js:9: xhr.setRequestHeader("X-Bust-Blink-MemoryCache", Math.random()); On 2016/05/02 06:39:27, hiroshige wrote: > On ...
4 years, 7 months ago (2016-05-10 18:26:17 UTC) #20
yhirano
lgtm
4 years, 7 months ago (2016-05-11 03:24:35 UTC) #21
hiroshige
lgtm with comments about CL description. https://codereview.chromium.org/1923003002/diff/100001/third_party/WebKit/Source/core/fetch/ResourceLoader.cpp File third_party/WebKit/Source/core/fetch/ResourceLoader.cpp (right): https://codereview.chromium.org/1923003002/diff/100001/third_party/WebKit/Source/core/fetch/ResourceLoader.cpp#newcode307 third_party/WebKit/Source/core/fetch/ResourceLoader.cpp:307: m_notifiedLoadComplete = true; ...
4 years, 7 months ago (2016-05-11 09:28:38 UTC) #22
Nate Chapin
https://codereview.chromium.org/1923003002/diff/100001/third_party/WebKit/Source/core/fetch/ResourceLoader.cpp File third_party/WebKit/Source/core/fetch/ResourceLoader.cpp (right): https://codereview.chromium.org/1923003002/diff/100001/third_party/WebKit/Source/core/fetch/ResourceLoader.cpp#newcode307 third_party/WebKit/Source/core/fetch/ResourceLoader.cpp:307: m_notifiedLoadComplete = true; On 2016/05/11 09:28:38, hiroshige wrote: > ...
4 years, 7 months ago (2016-05-11 18:49:53 UTC) #25
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1923003002/170001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1923003002/170001
4 years, 7 months ago (2016-05-11 18:50:35 UTC) #27
commit-bot: I haz the power
Committed patchset #10 (id:170001)
4 years, 7 months ago (2016-05-11 20:16:41 UTC) #29
commit-bot: I haz the power
4 years, 7 months ago (2016-05-11 20:18:31 UTC) #31
Message was sent while issue was closed.
Patchset 10 (id:??) landed as
https://crrev.com/33d4038b62d5b15b216d34ee42e1e03c49e2ef99
Cr-Commit-Position: refs/heads/master@{#393042}

Powered by Google App Engine
This is Rietveld 408576698