DescriptionUse WeakPtr and do not use pointer equality in WebURLLoaderMockFactory
WebURLLoaderMockFactory determines whether WebURLLoaderMock is still pending
using WebURLLoaderMock's raw pointer value, but this is not correct when:
1. WebURLLoaderMock A is destructed and removed from |pending_loaders_|,
2. and then a new WebURLLoaderMock B is created at the same address as
WebURLLoaderMock A, and added to |pending_loaders_|.
In this case, IsPending() returns true for WebURLLoaderMock A, but what is
actually pending is WebURLLoaderMock B.
This actually occurs when testing CORS redirects by
https://codereview.chromium.org/1257343003/ on mac.
This CL removes checks by WebURLLoaderMock pointer equality, and instead uses
WeakPtr and |WebURLLoaderMock::client_| to determine whether WebURLLoaderMock
is destructed or cancelled.
BUG=532364
Committed: https://crrev.com/30ab97a4b8acb0fa9752956e68c68a3d7d75ee81
Cr-Commit-Position: refs/heads/master@{#379152}
Patch Set 1 #Patch Set 2 : Rebase. #
Total comments: 2
Patch Set 3 : Rename. #Patch Set 4 : Rebase. #
Messages
Total messages: 25 (13 generated)
|