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

Issue 891263002: Prevent calling didReceiveData()/didFinishLoading() after didFailAccessControlCheck() (Closed)

Created:
5 years, 10 months ago by hiroshige
Modified:
5 years, 10 months ago
CC:
tyoshino+watch_chromium.org, Nate Chapin, gavinp+loader_chromium.org
Base URL:
https://chromium.googlesource.com/chromium/blink.git@master
Target Ref:
refs/heads/master
Project:
blink
Visibility:
Public.

Description

Prevent calling didReceiveData()/didFinishLoading() after didFailAccessControlCheck() In some cases DocumentThreadableLoader calls m_client->didReceiveData() or didFinishLoading() after m_client->didFailAccessControlCheck(). WorkerLoaderClientBridgeSyncHelper assumes no calls are made to ThreadableLoaderClient after didFailAccessControlCheck(), and this mismatch results in a race condition. This CL fixes this by omitting calls to didReceiveData()/didFinishLoading() after didFailAccessControlCheck() using |m_accessControlCheckFailed| flag. handlePreflightFailure() is called instead of didFailAccessControlCheck() to ensure |m_accessControlCheckFailed| and |m_actualRequest| are properly managed. This CL also makes WorkerLoaderClientBridgeSyncHelper to ASSERT/ignore did*() calls after any of didFail*() or didFinishLoading() is called. This explicitly states the assumptions of WorkerLoaderClientBridgeSyncHelper, and prevents possible race conditions as defensive programming. BUG=421627 Committed: https://src.chromium.org/viewvc/blink?view=rev&revision=189418

Patch Set 1 #

Patch Set 2 : fix expectation. #

Patch Set 3 : More assert. #

Total comments: 8

Patch Set 4 : Rename, comment fix. #

Patch Set 5 : Add FIXME. Use RELEASE_ASSERT. #

Total comments: 2

Patch Set 6 : Comment fix. #

Unified diffs Side-by-side diffs Delta from patch set Stats (+42 lines, -12 lines) Patch
M Source/core/loader/DocumentThreadableLoader.h View 1 2 3 4 5 2 chunks +5 lines, -1 line 0 comments Download
M Source/core/loader/DocumentThreadableLoader.cpp View 1 2 3 4 9 chunks +18 lines, -10 lines 0 comments Download
M Source/core/loader/WorkerLoaderClientBridgeSyncHelper.cpp View 1 2 3 4 9 chunks +18 lines, -0 lines 0 comments Download
M Source/web/tests/AssociatedURLLoaderTest.cpp View 1 1 chunk +1 line, -1 line 0 comments Download

Messages

Total messages: 15 (2 generated)
hiroshige
Could you take a look?
5 years, 10 months ago (2015-02-02 15:44:24 UTC) #2
kinuko
lgtm https://codereview.chromium.org/891263002/diff/40001/Source/core/loader/DocumentThreadableLoader.cpp File Source/core/loader/DocumentThreadableLoader.cpp (right): https://codereview.chromium.org/891263002/diff/40001/Source/core/loader/DocumentThreadableLoader.cpp#newcode533 Source/core/loader/DocumentThreadableLoader.cpp:533: // from other places in DocumentThreadableLoader. nit: putting ...
5 years, 10 months ago (2015-02-03 02:35:36 UTC) #3
tyoshino (SeeGerritForStatus)
https://codereview.chromium.org/891263002/diff/40001/Source/core/loader/DocumentThreadableLoader.cpp File Source/core/loader/DocumentThreadableLoader.cpp (right): https://codereview.chromium.org/891263002/diff/40001/Source/core/loader/DocumentThreadableLoader.cpp#newcode534 Source/core/loader/DocumentThreadableLoader.cpp:534: void DocumentThreadableLoader::handlePreflightFailure(const String& url, const String& errorDescription) rename this ...
5 years, 10 months ago (2015-02-03 06:22:03 UTC) #4
tyoshino (SeeGerritForStatus)
This CL looks ok but could you also consider adding clearResource() call to places where ...
5 years, 10 months ago (2015-02-03 06:22:49 UTC) #5
hiroshige
> clearResource() I'm also testing that, but currently my CLs are failing. Partially because in ...
5 years, 10 months ago (2015-02-03 08:19:44 UTC) #6
kinuko
https://codereview.chromium.org/891263002/diff/40001/Source/core/loader/WorkerLoaderClientBridgeSyncHelper.cpp File Source/core/loader/WorkerLoaderClientBridgeSyncHelper.cpp (right): https://codereview.chromium.org/891263002/diff/40001/Source/core/loader/WorkerLoaderClientBridgeSyncHelper.cpp#newcode71 Source/core/loader/WorkerLoaderClientBridgeSyncHelper.cpp:71: return; On 2015/02/03 08:19:44, hiroshige wrote: > On 2015/02/03 ...
5 years, 10 months ago (2015-02-03 08:51:22 UTC) #7
Mike West
On 2015/02/03 at 08:51:22, kinuko wrote: > https://codereview.chromium.org/891263002/diff/40001/Source/core/loader/WorkerLoaderClientBridgeSyncHelper.cpp > File Source/core/loader/WorkerLoaderClientBridgeSyncHelper.cpp (right): > > https://codereview.chromium.org/891263002/diff/40001/Source/core/loader/WorkerLoaderClientBridgeSyncHelper.cpp#newcode71 ...
5 years, 10 months ago (2015-02-03 09:04:31 UTC) #8
hiroshige
> This CL looks ok but could you also consider adding clearResource() call to > ...
5 years, 10 months ago (2015-02-03 09:21:14 UTC) #9
tyoshino (SeeGerritForStatus)
lgtm https://codereview.chromium.org/891263002/diff/80001/Source/core/loader/DocumentThreadableLoader.h File Source/core/loader/DocumentThreadableLoader.h (right): https://codereview.chromium.org/891263002/diff/80001/Source/core/loader/DocumentThreadableLoader.h#newcode108 Source/core/loader/DocumentThreadableLoader.h:108: // m_client->didFailAccessControlCheck() from other places in what does ...
5 years, 10 months ago (2015-02-03 13:06:36 UTC) #10
hiroshige
Thanks! https://codereview.chromium.org/891263002/diff/80001/Source/core/loader/DocumentThreadableLoader.h File Source/core/loader/DocumentThreadableLoader.h (right): https://codereview.chromium.org/891263002/diff/80001/Source/core/loader/DocumentThreadableLoader.h#newcode108 Source/core/loader/DocumentThreadableLoader.h:108: // m_client->didFailAccessControlCheck() from other places in On 2015/02/03 ...
5 years, 10 months ago (2015-02-03 13:11:39 UTC) #12
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/891263002/100001
5 years, 10 months ago (2015-02-03 13:12:25 UTC) #13
commit-bot: I haz the power
Committed patchset #6 (id:100001) as https://src.chromium.org/viewvc/blink?view=rev&revision=189418
5 years, 10 months ago (2015-02-03 14:58:00 UTC) #14
Nate Chapin
5 years, 10 months ago (2015-02-03 22:04:59 UTC) #15
Message was sent while issue was closed.
A revert of this CL (patchset #6 id:100001) has been created in
https://codereview.chromium.org/902453002/ by japhet@chromium.org.

The reason for reverting is: Broke some nacl browser_tests:
http://test-results.appspot.com/dashboards/flakiness_dashboard.html#testType=....

Powered by Google App Engine
This is Rietveld 408576698