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

Issue 838453003: Open the LoginDatabase on the DB thread, not the UI thread. (Closed)

Created:
5 years, 11 months ago by engedy
Modified:
5 years, 11 months ago
CC:
chromium-reviews, gcasto+watchlist_chromium.org, mkwst+watchlist-passwords_chromium.org
Base URL:
https://chromium.googlesource.com/chromium/src.git@master
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

Open the LoginDatabase on the DB thread, not the UI thread. PasswordStoreFactory::BuildServiceInstanceFor() used to open the LoginDatabase directly, on the UI thread. As the operation takes ~100 ms on average, this had led to significant UI jankiness. This CL now changes this behavior so that the DB is opened in a deferred manner by PasswordStoreDefault on the DB thread. Furthermore, this CL refactors LoginDatabase to take the path to the DB in the constructor, and starts using scoped_ptr-s when PasswordStore implementations take ownership of passed-in components. BUG=138903 Committed: https://crrev.com/41c91fbbdcfde75c9058d06ceae816f12699fc2f Cr-Commit-Position: refs/heads/master@{#312607}

Patch Set 1 #

Total comments: 2

Patch Set 2 : Added tests, attended to Mac and ChromeOS platforms. #

Patch Set 3 : Mac namespace fixes. #

Total comments: 4

Patch Set 4 : Addressed comments from gcasto@. #

Total comments: 4

Patch Set 5 : Fixed nits. Clang-format. #

Total comments: 1

Patch Set 6 : Fix one more typo. #

Patch Set 7 : Fix Mac tests, and add an extra one. #

Patch Set 8 : Rebase. #

Patch Set 9 : Fix Mac compile error. #

Patch Set 10 : Fix typo. Compiling on trybots is fun. #

Total comments: 4

Patch Set 11 : Fix nits, rework unittests. #

Total comments: 2

Patch Set 12 : Fix nits from vabr@. #

Unified diffs Side-by-side diffs Delta from patch set Stats (+637 lines, -319 lines) Patch
M chrome/browser/password_manager/password_store_factory.cc View 1 2 3 4 3 chunks +12 lines, -22 lines 0 comments Download
M chrome/browser/password_manager/password_store_mac.h View 1 2 3 4 3 chunks +20 lines, -4 lines 0 comments Download
M chrome/browser/password_manager/password_store_mac.cc View 1 2 3 4 5 13 chunks +53 lines, -30 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 14 chunks +211 lines, -56 lines 0 comments Download
M chrome/browser/password_manager/password_store_win.h View 1 2 3 4 1 chunk +4 lines, -2 lines 0 comments Download
M chrome/browser/password_manager/password_store_win.cc View 1 2 3 1 chunk +2 lines, -2 lines 0 comments Download
M chrome/browser/password_manager/password_store_win_unittest.cc View 1 2 3 3 chunks +5 lines, -5 lines 0 comments Download
M chrome/browser/password_manager/password_store_x.h View 1 2 3 1 chunk +1 line, -1 line 0 comments Download
M chrome/browser/password_manager/password_store_x.cc View 1 2 3 1 chunk +6 lines, -3 lines 0 comments Download
M chrome/browser/password_manager/password_store_x_unittest.cc View 1 2 3 4 7 chunks +20 lines, -19 lines 0 comments Download
M components/password_manager/core/browser/login_database.h View 1 2 3 4 5 6 7 1 chunk +4 lines, -4 lines 0 comments Download
M components/password_manager/core/browser/login_database.cc View 1 2 3 4 5 6 7 4 chunks +5 lines, -7 lines 0 comments Download
M components/password_manager/core/browser/login_database_unittest.cc View 1 2 3 4 5 6 7 43 chunks +126 lines, -121 lines 0 comments Download
M components/password_manager/core/browser/password_store.h View 1 2 3 4 5 6 7 1 chunk +5 lines, -0 lines 0 comments Download
M components/password_manager/core/browser/password_store_default.h View 1 2 3 4 2 chunks +15 lines, -2 lines 0 comments Download
M components/password_manager/core/browser/password_store_default.cc View 1 2 3 4 5 6 7 7 chunks +33 lines, -9 lines 0 comments Download
M components/password_manager/core/browser/password_store_default_unittest.cc View 1 2 3 4 5 6 7 5 chunks +107 lines, -22 lines 0 comments Download
M components/password_manager/core/browser/password_store_unittest.cc View 1 2 3 4 5 6 7 3 chunks +8 lines, -10 lines 0 comments Download

Messages

Total messages: 47 (19 generated)
engedy
@Vaclav, @Garrett, could you please take a look? An unfortunate side effect of this change ...
5 years, 11 months ago (2015-01-05 13:00:08 UTC) #2
engedy
On 2015/01/05 13:00:08, engedy wrote: > @Vaclav, @Garrett, could you please take a look? > ...
5 years, 11 months ago (2015-01-05 13:03:35 UTC) #3
vabr (Chromium)
LGTM with nits. As discussed offline, I do not see a better solution, and I ...
5 years, 11 months ago (2015-01-05 13:47:06 UTC) #4
Garrett Casto
I like this as well. The only thing that I would want are tests for ...
5 years, 11 months ago (2015-01-05 18:37:12 UTC) #5
engedy
On 2015/01/05 18:37:12, Garrett Casto wrote: > I like this as well. The only thing ...
5 years, 11 months ago (2015-01-05 22:43:29 UTC) #6
engedy
On 2015/01/05 22:43:29, engedy wrote: > On 2015/01/05 18:37:12, Garrett Casto wrote: > > I ...
5 years, 11 months ago (2015-01-13 21:07:37 UTC) #7
Garrett Casto
https://codereview.chromium.org/838453003/diff/40001/chrome/browser/password_manager/password_store_mac.cc File chrome/browser/password_manager/password_store_mac.cc (right): https://codereview.chromium.org/838453003/diff/40001/chrome/browser/password_manager/password_store_mac.cc#newcode1096 chrome/browser/password_manager/password_store_mac.cc:1096: login_metadata_db_->GetAutofillableLogins(&database_forms.get())) Shouldn't this be "!login_metadata_db_->GetAutofillableLogins()"? Hopefully one of the ...
5 years, 11 months ago (2015-01-14 08:50:22 UTC) #8
engedy
PTAL. I have also done some cosmetic changes, please read description. https://codereview.chromium.org/838453003/diff/40001/chrome/browser/password_manager/password_store_mac.cc File chrome/browser/password_manager/password_store_mac.cc (right): ...
5 years, 11 months ago (2015-01-14 14:36:54 UTC) #11
engedy
On 2015/01/14 14:36:54, engedy wrote: > PTAL. I have also done some cosmetic changes, please ...
5 years, 11 months ago (2015-01-14 14:39:23 UTC) #12
engedy
On 2015/01/14 14:39:23, engedy wrote: > On 2015/01/14 14:36:54, engedy wrote: > > PTAL. I ...
5 years, 11 months ago (2015-01-19 16:10:07 UTC) #13
Garrett Casto
Nice. I like the change to scoped_ptr<> for passing the LoginDatabase around. LGTM. https://codereview.chromium.org/838453003/diff/70019/chrome/browser/password_manager/password_store_factory.cc File ...
5 years, 11 months ago (2015-01-20 07:14:18 UTC) #14
engedy
https://codereview.chromium.org/838453003/diff/70019/chrome/browser/password_manager/password_store_factory.cc File chrome/browser/password_manager/password_store_factory.cc (right): https://codereview.chromium.org/838453003/diff/70019/chrome/browser/password_manager/password_store_factory.cc#newcode166 chrome/browser/password_manager/password_store_factory.cc:166: login_db.release(), On 2015/01/20 07:14:18, Garrett Casto wrote: > s/release()/Pass() ...
5 years, 11 months ago (2015-01-20 10:49:14 UTC) #16
engedy
@Vaclav, can you please take another look at the diff from Patch set 4?
5 years, 11 months ago (2015-01-20 15:02:37 UTC) #17
engedy
On 2015/01/20 15:02:37, engedy wrote: > @Vaclav, can you please take another look at the ...
5 years, 11 months ago (2015-01-20 15:03:53 UTC) #18
vabr (Chromium)
LGTM! https://codereview.chromium.org/838453003/diff/130001/chrome/browser/password_manager/password_store_mac.cc File chrome/browser/password_manager/password_store_mac.cc (right): https://codereview.chromium.org/838453003/diff/130001/chrome/browser/password_manager/password_store_mac.cc#newcode926 chrome/browser/password_manager/password_store_mac.cc:926: if (!login_metadata_db_ && AddToKeychainIfNecessary(form)) Good catch! :) https://codereview.chromium.org/838453003/diff/230001/chrome/browser/password_manager/password_store_mac_unittest.cc ...
5 years, 11 months ago (2015-01-20 15:41:36 UTC) #19
engedy
https://codereview.chromium.org/838453003/diff/230001/chrome/browser/password_manager/password_store_mac_unittest.cc File chrome/browser/password_manager/password_store_mac_unittest.cc (right): https://codereview.chromium.org/838453003/diff/230001/chrome/browser/password_manager/password_store_mac_unittest.cc#newcode1093 chrome/browser/password_manager/password_store_mac_unittest.cc:1093: EXPECT_FALSE(store_->GetBackgroundTaskRunner().get()); On 2015/01/20 15:41:35, vabr (Chromium) wrote: > optional ...
5 years, 11 months ago (2015-01-20 15:48:50 UTC) #21
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/838453003/270001
5 years, 11 months ago (2015-01-20 15:49:29 UTC) #23
commit-bot: I haz the power
Try jobs failed on following builders: linux_chromium_asan_rel on tryserver.chromium.linux (http://build.chromium.org/p/tryserver.chromium.linux/builders/linux_chromium_asan_rel/builds/26802) Try jobs failed on following ...
5 years, 11 months ago (2015-01-20 17:34:11 UTC) #25
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/838453003/270001
5 years, 11 months ago (2015-01-20 17:40:51 UTC) #27
commit-bot: I haz the power
Try jobs failed on following builders: linux_chromium_asan_rel on tryserver.chromium.linux (http://build.chromium.org/p/tryserver.chromium.linux/builders/linux_chromium_asan_rel/builds/26802)
5 years, 11 months ago (2015-01-20 17:41:32 UTC) #29
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/838453003/290001
5 years, 11 months ago (2015-01-20 18:25:18 UTC) #31
commit-bot: I haz the power
Try jobs failed on following builders: mac_chromium_rel_ng on tryserver.chromium.mac (http://build.chromium.org/p/tryserver.chromium.mac/builders/mac_chromium_rel_ng/builds/25000) Try jobs failed on following ...
5 years, 11 months ago (2015-01-20 20:08:44 UTC) #33
engedy
@Vaclav, could you please take another look? I had to rework the unit tests significantly.
5 years, 11 months ago (2015-01-22 12:14:25 UTC) #41
vabr (Chromium)
LGTM with a nit. Thanks! Vaclav https://codereview.chromium.org/838453003/diff/400001/chrome/browser/password_manager/password_store_mac_unittest.cc File chrome/browser/password_manager/password_store_mac_unittest.cc (right): https://codereview.chromium.org/838453003/diff/400001/chrome/browser/password_manager/password_store_mac_unittest.cc#newcode1539 chrome/browser/password_manager/password_store_mac_unittest.cc:1539: EXPECT_NE(nullptr, this->login_db()); nit: ...
5 years, 11 months ago (2015-01-22 13:00:31 UTC) #42
engedy
https://codereview.chromium.org/838453003/diff/400001/chrome/browser/password_manager/password_store_mac_unittest.cc File chrome/browser/password_manager/password_store_mac_unittest.cc (right): https://codereview.chromium.org/838453003/diff/400001/chrome/browser/password_manager/password_store_mac_unittest.cc#newcode1539 chrome/browser/password_manager/password_store_mac_unittest.cc:1539: EXPECT_NE(nullptr, this->login_db()); On 2015/01/22 13:00:30, vabr (Chromium) wrote: > ...
5 years, 11 months ago (2015-01-22 13:02:53 UTC) #43
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/838453003/420001
5 years, 11 months ago (2015-01-22 13:03:40 UTC) #45
commit-bot: I haz the power
Committed patchset #12 (id:420001)
5 years, 11 months ago (2015-01-22 13:58:24 UTC) #46
commit-bot: I haz the power
5 years, 11 months ago (2015-01-22 13:59:30 UTC) #47
Message was sent while issue was closed.
Patchset 12 (id:??) landed as
https://crrev.com/41c91fbbdcfde75c9058d06ceae816f12699fc2f
Cr-Commit-Position: refs/heads/master@{#312607}

Powered by Google App Engine
This is Rietveld 408576698