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

Issue 1743783002: Use WeakPtr and do not use pointer equality in WebURLLoaderMockFactory (Closed)

Created:
4 years, 10 months ago by hiroshige
Modified:
4 years, 9 months ago
Reviewers:
jam
CC:
chromium-reviews, darin-cc_chromium.org, jam
Base URL:
https://chromium.googlesource.com/chromium/src.git@Loader_URLTestHelpers
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

Use 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. #

Unified diffs Side-by-side diffs Delta from patch set Stats (+19 lines, -16 lines) Patch
M content/test/weburl_loader_mock.h View 1 2 1 chunk +4 lines, -2 lines 0 comments Download
M content/test/weburl_loader_mock.cc View 4 chunks +7 lines, -2 lines 0 comments Download
M content/test/weburl_loader_mock_factory.h View 2 chunks +2 lines, -1 line 0 comments Download
M content/test/weburl_loader_mock_factory.cc View 1 2 3 chunks +6 lines, -11 lines 0 comments Download

Messages

Total messages: 25 (13 generated)
commit-bot: I haz the power
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1743783002/1 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1743783002/1
4 years, 10 months ago (2016-02-26 23:09:58 UTC) #2
commit-bot: I haz the power
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1743783002/20001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1743783002/20001
4 years, 9 months ago (2016-02-29 16:33:51 UTC) #7
hiroshige
PTAL.
4 years, 9 months ago (2016-02-29 16:35:01 UTC) #8
jam
lgtm https://codereview.chromium.org/1743783002/diff/20001/content/test/weburl_loader_mock.h File content/test/weburl_loader_mock.h (right): https://codereview.chromium.org/1743783002/diff/20001/content/test/weburl_loader_mock.h#newcode57 content/test/weburl_loader_mock.h:57: bool isCancelled() { return !client_; } nit: these ...
4 years, 9 months ago (2016-02-29 16:41:09 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/1743783002/40001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1743783002/40001
4 years, 9 months ago (2016-02-29 18:12:36 UTC) #11
commit-bot: I haz the power
Dry run: Try jobs failed on following builders: win_chromium_compile_dbg_ng on tryserver.chromium.win (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.win/builders/win_chromium_compile_dbg_ng/builds/152568) win_chromium_x64_rel_ng on ...
4 years, 9 months ago (2016-02-29 18:22:49 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/1743783002/40001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1743783002/40001
4 years, 9 months ago (2016-02-29 19:48:34 UTC) #15
commit-bot: I haz the power
Dry run: This issue passed the CQ dry run.
4 years, 9 months ago (2016-02-29 21:04:45 UTC) #17
hiroshige
https://codereview.chromium.org/1743783002/diff/20001/content/test/weburl_loader_mock.h File content/test/weburl_loader_mock.h (right): https://codereview.chromium.org/1743783002/diff/20001/content/test/weburl_loader_mock.h#newcode57 content/test/weburl_loader_mock.h:57: bool isCancelled() { return !client_; } On 2016/02/29 16:41:09, ...
4 years, 9 months ago (2016-02-29 21:21:55 UTC) #18
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1743783002/60001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1743783002/60001
4 years, 9 months ago (2016-03-03 22:42:45 UTC) #21
commit-bot: I haz the power
Committed patchset #4 (id:60001)
4 years, 9 months ago (2016-03-04 00:27:55 UTC) #23
commit-bot: I haz the power
4 years, 9 months ago (2016-03-04 00:29:06 UTC) #25
Message was sent while issue was closed.
Patchset 4 (id:??) landed as
https://crrev.com/30ab97a4b8acb0fa9752956e68c68a3d7d75ee81
Cr-Commit-Position: refs/heads/master@{#379152}

Powered by Google App Engine
This is Rietveld 408576698