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

Issue 6646051: Fix DCHECK, memory leak, and refactor PasswordStore to use CancelableRequest (Closed)

Created:
9 years, 9 months ago by Sheridan Rawlins
Modified:
9 years, 6 months ago
CC:
chromium-reviews, ncarter (slow), idana, Raghu Simha, kkania, Paweł Hajdan Jr.
Visibility:
Public.

Description

When looking at this bug, I found at least the following issues: 1) PasswordManagerHandler was not canceling requests if new requests were made (by double-clicking the "Manage Saved Passwords..." button with a slow database - simulated with long Sleep). 2) PasswordStore starts its handle numbering at 0 meaning that the very first request is non-true and could hit DCHECK(s). 3) PasswordManagerHandler doesn't free the results. When talking with the DOMUI TL (jhawkins) and an author of PasswordStore (stuartmorgan), I learned that it was modeled after HistoryService, which had since been refactored into a reusable suite of classes in content/browser/cancelable_request.h So the CL will include fixes for the 3 issues, as well as a refactor to use the shared code in cancelable_requst.h BUG=71466 TEST=chrome://settings/personal, then click "Manage Saved Passwords". Put PlatformThread::Sleep(10000), then try double-clicking the button to see no error. Committed: http://src.chromium.org/viewvc/chrome?view=rev&revision=79625

Patch Set 1 #

Patch Set 2 : Don't change vector to typedef #

Patch Set 3 : don't rename PasswordStoreConsumer either. #

Patch Set 4 : Added ScopedVector::reset(vec), unittests, use ScopedVector. #

Patch Set 5 : mac,win + CancelRequest before population. #

Patch Set 6 : updates for mac/win + nits. #

Patch Set 7 : fix sync_integration_tests #

Patch Set 8 : git try works all platforms now. #

Total comments: 55

Patch Set 9 : Responding to review comments. #

Total comments: 43

Patch Set 10 : Address most of James' comments. #

Patch Set 11 : Fix ~ListPopulator ordering. #

Total comments: 13

Patch Set 12 : Move PasswordStoreConsumer to its own header; moved handle to CancelableRequestProvider. #

Patch Set 13 : Moved Handle methods to CancelableRequestProvider. #

Patch Set 14 : webkit_glue::PasswordForm is struct; not class. #

Patch Set 15 : Include password_store_consumer.h in mac/win unittests. #

Total comments: 8

Patch Set 16 : fix spacing. #

Total comments: 2

Patch Set 17 : Made constants private. #

Patch Set 18 : use non-zero tests until http://crbug.com/77650 is addressed. #

Unified diffs Side-by-side diffs Delta from patch set Stats (+429 lines, -235 lines) Patch
M base/base.gyp View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 1 chunk +1 line, -0 lines 0 comments Download
M base/memory/scoped_vector.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 1 chunk +6 lines, -0 lines 0 comments Download
A base/memory/scoped_vector_unittest.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 1 chunk +156 lines, -0 lines 0 comments Download
M chrome/browser/automation/automation_provider_observers.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 3 chunks +4 lines, -4 lines 0 comments Download
M chrome/browser/automation/automation_provider_observers.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 1 chunk +2 lines, -1 line 0 comments Download
M chrome/browser/automation/testing_automation_provider.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 1 chunk +1 line, -0 lines 0 comments Download
M chrome/browser/password_manager/password_form_manager.h View 1 2 3 4 5 6 7 8 9 10 11 4 chunks +5 lines, -7 lines 0 comments Download
M chrome/browser/password_manager/password_form_manager.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 5 chunks +4 lines, -12 lines 0 comments Download
M chrome/browser/password_manager/password_store.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 6 chunks +53 lines, -62 lines 0 comments Download
chrome/browser/password_manager/password_store.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 3 chunks +49 lines, -68 lines 0 comments Download
A chrome/browser/password_manager/password_store_consumer.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 1 chunk +43 lines, -0 lines 0 comments Download
A chrome/browser/password_manager/password_store_consumer.cc View 1 2 3 4 5 6 7 8 9 10 11 1 chunk +8 lines, -0 lines 0 comments Download
M chrome/browser/password_manager/password_store_default.cc View 1 2 3 4 5 6 7 8 1 chunk +6 lines, -9 lines 0 comments Download
M chrome/browser/password_manager/password_store_default_unittest.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 2 chunks +3 lines, -1 line 0 comments Download
M chrome/browser/password_manager/password_store_mac.cc View 1 2 3 4 5 6 7 8 2 chunks +6 lines, -8 lines 0 comments Download
M chrome/browser/password_manager/password_store_mac_unittest.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 2 chunks +3 lines, -1 line 0 comments Download
M chrome/browser/password_manager/password_store_win.h View 1 2 3 4 5 6 7 8 2 chunks +2 lines, -4 lines 0 comments Download
M chrome/browser/password_manager/password_store_win.cc View 1 2 3 4 5 6 7 8 3 chunks +9 lines, -11 lines 0 comments Download
M chrome/browser/password_manager/password_store_win_unittest.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 2 chunks +3 lines, -1 line 0 comments Download
M chrome/browser/password_manager/password_store_x.cc View 1 2 3 4 1 chunk +12 lines, -13 lines 0 comments Download
M chrome/browser/password_manager/password_store_x_unittest.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 1 chunk +2 lines, -1 line 0 comments Download
M chrome/browser/ui/webui/options/password_manager_handler.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 4 chunks +11 lines, -6 lines 0 comments Download
M chrome/browser/ui/webui/options/password_manager_handler.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 7 chunks +30 lines, -23 lines 0 comments Download
M chrome/chrome_browser.gypi View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 1 chunk +2 lines, -0 lines 0 comments Download
M chrome/test/live_sync/live_passwords_sync_test.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 3 chunks +4 lines, -2 lines 0 comments Download
M content/browser/cancelable_request.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 2 chunks +4 lines, -1 line 0 comments Download

Messages

Total messages: 26 (0 generated)
tim (not reviewing)
Is there an overview / could one be provided as to why this is necessary? ...
9 years, 9 months ago (2011-03-16 00:09:57 UTC) #1
Sheridan Rawlins
On 2011/03/16 00:09:57, timsteele wrote: > Is there an overview / could one be provided ...
9 years, 9 months ago (2011-03-16 00:20:24 UTC) #2
Sheridan Rawlins
Ok, after wrestling a broken python_26 dir on my windows, and our shared mac which ...
9 years, 9 months ago (2011-03-16 21:58:12 UTC) #3
James Hawkins
http://codereview.chromium.org/6646051/diff/12001/base/scoped_vector.h File base/scoped_vector.h (right): http://codereview.chromium.org/6646051/diff/12001/base/scoped_vector.h#newcode57 base/scoped_vector.h:57: void reset(const std::vector<T*>& vec) { You're essentially adding operator= ...
9 years, 9 months ago (2011-03-16 22:39:34 UTC) #4
stuartmorgan
It would be good to loop in someone who is familiar with CancelableRequest to review ...
9 years, 9 months ago (2011-03-16 23:25:20 UTC) #5
brettw
http://codereview.chromium.org/6646051/diff/12001/chrome/browser/password_manager/password_store.h File chrome/browser/password_manager/password_store.h (right): http://codereview.chromium.org/6646051/diff/12001/chrome/browser/password_manager/password_store.h#newcode55 chrome/browser/password_manager/password_store.h:55: class GetLoginsRequest Why do you do this at all ...
9 years, 9 months ago (2011-03-17 21:40:34 UTC) #6
Sheridan Rawlins
I wanted to get some responses out before tackling some of this, so I didn't ...
9 years, 9 months ago (2011-03-18 15:45:48 UTC) #7
James Hawkins
On 2011/03/18 15:45:48, Sheridan Rawlins wrote: > I wanted to get some responses out before ...
9 years, 9 months ago (2011-03-20 01:17:47 UTC) #8
Sheridan Rawlins
Nico, can you eyeball the changes to add ScopedVector::insert(position, first, last)? It makes it slightly ...
9 years, 9 months ago (2011-03-20 08:13:11 UTC) #9
James Hawkins
http://codereview.chromium.org/6646051/diff/14002/base/scoped_vector_unittest.cc File base/scoped_vector_unittest.cc (right): http://codereview.chromium.org/6646051/diff/14002/base/scoped_vector_unittest.cc#newcode12 base/scoped_vector_unittest.cc:12: // only really need one observer, but use the ...
9 years, 9 months ago (2011-03-21 01:45:05 UTC) #10
Sheridan Rawlins
Fixed most comments, save moving PasswordStoreConsumer to its own file. I will need to think ...
9 years, 9 months ago (2011-03-21 05:20:17 UTC) #11
James Hawkins
This is looking much better. http://codereview.chromium.org/6646051/diff/20003/base/scoped_vector_unittest.cc File base/scoped_vector_unittest.cc (right): http://codereview.chromium.org/6646051/diff/20003/base/scoped_vector_unittest.cc#newcode18 base/scoped_vector_unittest.cc:18: protected: nit: Blank line ...
9 years, 9 months ago (2011-03-21 17:53:11 UTC) #12
Sheridan Rawlins
How's this - I moved Handle methods to CancelableRequestProvider (where Handle's type is defined) and ...
9 years, 9 months ago (2011-03-21 18:36:41 UTC) #13
Sheridan Rawlins
Nico's on vacation - Brett would you mind reviewing the newly-added ScopedVector::insert? Jam, can you ...
9 years, 9 months ago (2011-03-21 22:12:30 UTC) #14
brettw
I'm fine with the ScopedVector changes. http://codereview.chromium.org/6646051/diff/22030/content/browser/cancelable_request.cc File content/browser/cancelable_request.cc (right): http://codereview.chromium.org/6646051/diff/22030/content/browser/cancelable_request.cc#newcode13 content/browser/cancelable_request.cc:13: : next_handle_(CancelableRequestProvider::kFirstHandle) { ...
9 years, 9 months ago (2011-03-22 21:43:41 UTC) #15
Sheridan Rawlins
http://codereview.chromium.org/6646051/diff/22030/content/browser/cancelable_request.cc File content/browser/cancelable_request.cc (right): http://codereview.chromium.org/6646051/diff/22030/content/browser/cancelable_request.cc#newcode13 content/browser/cancelable_request.cc:13: : next_handle_(CancelableRequestProvider::kFirstHandle) { On 2011/03/22 21:43:41, brettw wrote: > ...
9 years, 9 months ago (2011-03-22 22:04:08 UTC) #16
brettw
http://codereview.chromium.org/6646051/diff/22030/content/browser/cancelable_request.h File content/browser/cancelable_request.h (right): http://codereview.chromium.org/6646051/diff/22030/content/browser/cancelable_request.h#newcode134 content/browser/cancelable_request.h:134: static bool HandleIsValid(Handle handle); I'm not sure what you're ...
9 years, 9 months ago (2011-03-22 22:11:08 UTC) #17
stuartmorgan
LGTM Good luck on not awakening PasswordStore's infamous Curse of the Reliability Bot!
9 years, 9 months ago (2011-03-22 22:50:03 UTC) #18
James Hawkins
http://codereview.chromium.org/6646051/diff/30001/content/browser/cancelable_request.h File content/browser/cancelable_request.h (right): http://codereview.chromium.org/6646051/diff/30001/content/browser/cancelable_request.h#newcode137 content/browser/cancelable_request.h:137: static const Handle kFirstHandle; Can these be private?
9 years, 9 months ago (2011-03-22 22:59:48 UTC) #19
Sheridan Rawlins
http://codereview.chromium.org/6646051/diff/22030/content/browser/cancelable_request.h File content/browser/cancelable_request.h (right): http://codereview.chromium.org/6646051/diff/22030/content/browser/cancelable_request.h#newcode134 content/browser/cancelable_request.h:134: static bool HandleIsValid(Handle handle); On 2011/03/22 22:11:08, brettw wrote: ...
9 years, 9 months ago (2011-03-23 00:39:52 UTC) #20
brettw
http://codereview.chromium.org/6646051/diff/22030/content/browser/cancelable_request.h File content/browser/cancelable_request.h (right): http://codereview.chromium.org/6646051/diff/22030/content/browser/cancelable_request.h#newcode134 content/browser/cancelable_request.h:134: static bool HandleIsValid(Handle handle); On 2011/03/23 00:39:52, Sheridan Rawlins ...
9 years, 9 months ago (2011-03-23 01:49:00 UTC) #21
Sheridan Rawlins
http://codereview.chromium.org/6646051/diff/22030/content/browser/cancelable_request.h File content/browser/cancelable_request.h (right): http://codereview.chromium.org/6646051/diff/22030/content/browser/cancelable_request.h#newcode134 content/browser/cancelable_request.h:134: static bool HandleIsValid(Handle handle); On 2011/03/23 01:49:00, brettw wrote: ...
9 years, 9 months ago (2011-03-23 03:16:50 UTC) #22
Sheridan Rawlins
FYI, http://codereview.chromium.org/6665029/ shows a recent review of some code which has typedef int Handle and ...
9 years, 9 months ago (2011-03-25 20:12:56 UTC) #23
brettw
I think I prefer the 0. Introducing the checking code makes the existing code that ...
9 years, 9 months ago (2011-03-28 16:17:09 UTC) #24
Sheridan Rawlins
Filed http://crbug.com/77650 to address the opacity and making it used by all clients. Rolled back ...
9 years, 9 months ago (2011-03-28 17:32:03 UTC) #25
brettw
9 years, 9 months ago (2011-03-28 20:27:24 UTC) #26
LGTM (I only checked the other stuff briefly)

Powered by Google App Engine
This is Rietveld 408576698