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

Issue 2571923002: Fix threading issues in WebDataRequestManager. (Closed)

Created:
4 years ago by Roger McFarlane (Chromium)
Modified:
4 years ago
CC:
chromium-reviews, rouslan+autofill_chromium.org, sebsg+autofillwatch_chromium.org, jdonnelly+autofillwatch_chromium.org, mathp+autofillwatch_chromium.org, vabr+watchlistautofill_chromium.org, estade+watch_chromium.org
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

Fix threading issues in WebDataRequestManager. This CL fixes a number of race conditions on request cancellation and completion. In particular: - Multiple cancellation calls on a request would DCHECK/crash. - A request could be cancelled concurrent to completion, resulting in a DCHECK/crash. - There was an ineffective lock internal to each request. Most of the critical code was already protected (though sometimes not properly) by the managers internal lock and the request lock wasn't adding any value. BUG=672823 Committed: https://crrev.com/95e2ecf771003012c97168343b58947e3ae93ef5 Cr-Commit-Position: refs/heads/master@{#438863}

Patch Set 1 #

Total comments: 23

Patch Set 2 : Address mathp's comments and check for cancellation before SetResult #

Patch Set 3 : Simplify handling of result and add request factory func #

Total comments: 20

Patch Set 4 : address pkasting's comments #

Total comments: 2

Patch Set 5 : fix a comment #

Unified diffs Side-by-side diffs Delta from patch set Stats (+144 lines, -119 lines) Patch
M components/webdata/common/web_data_request_manager.h View 1 2 3 3 chunks +38 lines, -41 lines 0 comments Download
M components/webdata/common/web_data_request_manager.cc View 1 2 3 4 3 chunks +97 lines, -69 lines 0 comments Download
M components/webdata/common/web_database_backend.cc View 1 2 chunks +5 lines, -5 lines 0 comments Download
M components/webdata/common/web_database_service.cc View 1 2 2 chunks +4 lines, -4 lines 0 comments Download

Messages

Total messages: 43 (28 generated)
Roger McFarlane (Chromium)
Hey Avi & Mathieu, Care to take a look before I send this for OWNERs ...
4 years ago (2016-12-13 22:33:55 UTC) #4
Mathieu
Small comments https://codereview.chromium.org/2571923002/diff/1/components/webdata/common/web_data_request_manager.cc File components/webdata/common/web_data_request_manager.cc (left): https://codereview.chromium.org/2571923002/diff/1/components/webdata/common/web_data_request_manager.cc#oldcode129 components/webdata/common/web_data_request_manager.cc:129: DCHECK(i != pending_requests_.end()); On 2016/12/13 22:33:55, Roger ...
4 years ago (2016-12-14 01:13:47 UTC) #7
Avi (use Gerrit)
https://codereview.chromium.org/2571923002/diff/1/components/webdata/common/web_data_request_manager.cc File components/webdata/common/web_data_request_manager.cc (right): https://codereview.chromium.org/2571923002/diff/1/components/webdata/common/web_data_request_manager.cc#newcode124 components/webdata/common/web_data_request_manager.cc:124: request->SetResult(std::move(result)); If we no longer have the WebDatabaseBackend call ...
4 years ago (2016-12-14 04:40:39 UTC) #12
Roger McFarlane (Chromium)
Thanks. An update suggested by Avi is pending, I'll ping you once it's uploaded. https://codereview.chromium.org/2571923002/diff/1/components/webdata/common/web_data_request_manager.cc ...
4 years ago (2016-12-14 14:02:49 UTC) #15
Roger McFarlane (Chromium)
+pkasting for OWNERS PTAL?
4 years ago (2016-12-14 19:02:38 UTC) #21
Roger McFarlane (Chromium)
https://codereview.chromium.org/2571923002/diff/1/components/webdata/common/web_data_request_manager.cc File components/webdata/common/web_data_request_manager.cc (right): https://codereview.chromium.org/2571923002/diff/1/components/webdata/common/web_data_request_manager.cc#newcode104 components/webdata/common/web_data_request_manager.cc:104: return ++next_request_handle_; On 2016/12/13 22:33:55, Roger McFarlane (Chromium) wrote: ...
4 years ago (2016-12-14 19:05:54 UTC) #22
Peter Kasting
I did not do a functional review for the actual thread-safety issues, I assume your ...
4 years ago (2016-12-15 01:05:34 UTC) #23
Roger McFarlane (Chromium)
Thanks. mathp@... ping? avi@... ping? https://codereview.chromium.org/2571923002/diff/40001/components/webdata/common/web_data_request_manager.cc File components/webdata/common/web_data_request_manager.cc (right): https://codereview.chromium.org/2571923002/diff/40001/components/webdata/common/web_data_request_manager.cc#newcode21 components/webdata/common/web_data_request_manager.cc:21: WebDataRequest::WebDataRequest(WebDataRequestManager* manager, On 2016/12/15 ...
4 years ago (2016-12-15 07:41:46 UTC) #29
Peter Kasting
https://codereview.chromium.org/2571923002/diff/80001/components/webdata/common/web_data_request_manager.cc File components/webdata/common/web_data_request_manager.cc (right): https://codereview.chromium.org/2571923002/diff/80001/components/webdata/common/web_data_request_manager.cc#newcode131 components/webdata/common/web_data_request_manager.cc:131: // Used to export the consumer from the locked ...
4 years ago (2016-12-15 07:50:17 UTC) #30
Avi (use Gerrit)
lgtm
4 years ago (2016-12-15 16:13:01 UTC) #33
Roger McFarlane (Chromium)
Thanks. https://codereview.chromium.org/2571923002/diff/80001/components/webdata/common/web_data_request_manager.cc File components/webdata/common/web_data_request_manager.cc (right): https://codereview.chromium.org/2571923002/diff/80001/components/webdata/common/web_data_request_manager.cc#newcode131 components/webdata/common/web_data_request_manager.cc:131: // Used to export the consumer from the ...
4 years ago (2016-12-15 16:30:47 UTC) #34
Mathieu
lgtm
4 years ago (2016-12-15 16:32:41 UTC) #35
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.org/2571923002/100001
4 years ago (2016-12-15 16:47:11 UTC) #38
commit-bot: I haz the power
Committed patchset #5 (id:100001)
4 years ago (2016-12-15 17:36:16 UTC) #41
commit-bot: I haz the power
4 years ago (2016-12-15 17:38:55 UTC) #43
Message was sent while issue was closed.
Patchset 5 (id:??) landed as
https://crrev.com/95e2ecf771003012c97168343b58947e3ae93ef5
Cr-Commit-Position: refs/heads/master@{#438863}

Powered by Google App Engine
This is Rietveld 408576698