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

Issue 1802693002: Fix triggered RELEASE_ASSERT in ResourceLoader::didReceiveResponse() (Closed)

Created:
4 years, 9 months ago by Nate Chapin
Modified:
4 years, 9 months ago
Reviewers:
hiroshige
CC:
chromium-reviews, blink-reviews, loading-reviews+fetch_chromium.org, tyoshino+watch_chromium.org, gavinp+loader_chromium.org
Base URL:
https://chromium.googlesource.com/chromium/src.git@master
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

Fix triggered RELEASE_ASSERT in ResourceLoader::didReceiveResponse() This was regressed in https://codereview.chromium.org/1751203003, which removed an early-clear of ResourceLoader::m_loader in ResourceLoader::cancel(). If m_resource->error() triggers a JS event handler that contains an alert(), we will run a nested event loop. Normally, we call setDefersLoading() on all ResourceLoaders to ensure no resource loading messages are processed. However, before calling m_resource->error(), we call m_fetcher->didFailLoading(), which removes the ResourceLoader from ResourceFetcher::m_loaders, which means ResourceFetcher has no way to call setDefersLoading() on it. When we enter the nested event loop, the response IPC for the ResourceLoader that is being cancelled is processed, and we call didReceiveResponse() in an invalid state. Add back the early clear of ResourceLoader::m_loader to ensure it can't send messages while completing the cancellation, and add a comment to document why it's necessary. BUG=594072 Committed: https://crrev.com/c9b6287c3a354def3608e67621eb609612eb7e5d Cr-Commit-Position: refs/heads/master@{#381086}

Patch Set 1 #

Unified diffs Side-by-side diffs Delta from patch set Stats (+12 lines, -0 lines) Patch
M third_party/WebKit/Source/core/fetch/ResourceLoader.cpp View 1 chunk +12 lines, -0 lines 0 comments Download

Messages

Total messages: 14 (7 generated)
Nate Chapin
I can't find a test to reproduce this. Writing a unit test would require add ...
4 years, 9 months ago (2016-03-14 20:45:02 UTC) #5
dcheng
On 2016/03/14 at 20:45:02, japhet wrote: > I can't find a test to reproduce this. ...
4 years, 9 months ago (2016-03-14 21:15:05 UTC) #6
Nate Chapin
On 2016/03/14 21:15:05, dcheng wrote: > On 2016/03/14 at 20:45:02, japhet wrote: > > I ...
4 years, 9 months ago (2016-03-14 21:19:42 UTC) #7
hiroshige
lgtm.
4 years, 9 months ago (2016-03-14 21:52:01 UTC) #8
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1802693002/1 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1802693002/1
4 years, 9 months ago (2016-03-14 21:54:43 UTC) #10
commit-bot: I haz the power
Committed patchset #1 (id:1)
4 years, 9 months ago (2016-03-14 22:11:04 UTC) #12
commit-bot: I haz the power
4 years, 9 months ago (2016-03-14 22:13:13 UTC) #14
Message was sent while issue was closed.
Patchset 1 (id:??) landed as
https://crrev.com/c9b6287c3a354def3608e67621eb609612eb7e5d
Cr-Commit-Position: refs/heads/master@{#381086}

Powered by Google App Engine
This is Rietveld 408576698