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

Issue 12952005: Delay bookmarks load while the profile is loading. (Closed)

Created:
7 years, 9 months ago by msarda
Modified:
7 years, 8 months ago
CC:
chromium-reviews, tfarina, rginda+watch_chromium.org, erikwright+watch_chromium.org, browser-components-watch_chromium.org, sail+watch_chromium.org
Base URL:
https://chromium.googlesource.com/chromium/src.git@master
Visibility:
Public.

Description

Delay bookmarks load while the profile is loading. This CL adds a new DeferredSequencedtaskRunner that queues up tasks until a first call to Start is issued. It creates such a task runner for the execution of bookmarks I/O operations. At profile creation, the bookmarks task runner is stopped and its execution is started after the profile has finished loading. BUG=NONE Committed: https://src.chromium.org/viewvc/chrome?view=rev&revision=194956

Patch Set 1 #

Patch Set 2 : Use DeferredSequencedTaskRunner instead of PausableSequencedTaskRunner. #

Patch Set 3 : Fix testing_profile.h #

Total comments: 3

Patch Set 4 : Move BookmarkTaskRunner to BookmarkModel. #

Patch Set 5 : Fix nits. #

Total comments: 5

Patch Set 6 : Address mirandac's comments: add BookmarkModel::StartLoading #

Total comments: 16

Patch Set 7 : Add startup_task_runner_service. #

Total comments: 4

Patch Set 8 : Add deferred_sequenced_task_runner_unittest #

Total comments: 40

Patch Set 9 : Address willchan's and jyasskin code reviews. #

Total comments: 12

Patch Set 10 : Fix deferred_sequenced_task_runner_unittest.cc nits. #

Patch Set 11 : Fix DeferredSequencedTaskRunnerTest.DeferredStartWithMultipleThreads #

Patch Set 12 : Erase the deferred task queue during iteration. #

Patch Set 13 : Add ObjectDestructionOrder unit test. #

Total comments: 58

Patch Set 14 : Address erikwright's code review. #

Patch Set 15 : Fix nits. #

Total comments: 2

Patch Set 16 : Fix erase #

Patch Set 17 : Fix sync_integration_tests #

Patch Set 18 : Add start_deferred_task_runners argument to RegisterTestingProfile #

Patch Set 19 : Fix comment. #

Unified diffs Side-by-side diffs Delta from patch set Stats (+558 lines, -13 lines) Patch
M base/base.gyp View 1 2 3 4 5 6 7 8 9 10 11 12 13 1 chunk +1 line, -0 lines 0 comments Download
M base/base.gypi View 1 2 3 4 5 6 7 8 9 10 11 12 13 1 chunk +2 lines, -0 lines 0 comments Download
A base/deferred_sequenced_task_runner.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 1 chunk +79 lines, -0 lines 0 comments Download
A base/deferred_sequenced_task_runner.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 1 chunk +99 lines, -0 lines 0 comments Download
A base/deferred_sequenced_task_runner_unittest.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 1 chunk +184 lines, -0 lines 0 comments Download
M chrome/browser/bookmarks/DEPS View 1 2 3 4 5 6 7 8 1 chunk +2 lines, -0 lines 0 comments Download
M chrome/browser/bookmarks/bookmark_model.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 2 chunks +6 lines, -1 line 0 comments Download
M chrome/browser/bookmarks/bookmark_model.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 2 chunks +3 lines, -2 lines 0 comments Download
M chrome/browser/bookmarks/bookmark_model_factory.cc View 1 2 3 4 5 6 2 chunks +5 lines, -1 line 0 comments Download
M chrome/browser/profiles/profile_manager.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 1 chunk +7 lines, -3 lines 0 comments Download
M chrome/browser/profiles/profile_manager.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 4 chunks +12 lines, -1 line 0 comments Download
A chrome/browser/profiles/startup_task_runner_service.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 1 chunk +45 lines, -0 lines 0 comments Download
A chrome/browser/profiles/startup_task_runner_service.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 1 chunk +30 lines, -0 lines 0 comments Download
A chrome/browser/profiles/startup_task_runner_service_factory.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 1 chunk +39 lines, -0 lines 0 comments Download
A chrome/browser/profiles/startup_task_runner_service_factory.cc View 1 2 3 4 5 6 1 chunk +33 lines, -0 lines 0 comments Download
M chrome/browser/sync/glue/bookmark_data_type_controller_unittest.cc View 1 2 3 4 5 6 2 chunks +2 lines, -2 lines 0 comments Download
M chrome/browser/sync/test/integration/sync_test.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 1 chunk +3 lines, -1 line 0 comments Download
M chrome/browser/ui/views/avatar_menu_button_browsertest.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 1 chunk +1 line, -1 line 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 1 chunk +4 lines, -0 lines 0 comments Download
M chrome/test/base/testing_profile.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 1 chunk +1 line, -1 line 0 comments Download

Messages

Total messages: 68 (0 generated)
msarda
Please take a look.
7 years, 9 months ago (2013-03-26 17:06:39 UTC) #1
sail
https://chromiumcodereview.appspot.com/12952005/diff/4005/chrome/browser/profiles/profile_impl.cc File chrome/browser/profiles/profile_impl.cc (right): https://chromiumcodereview.appspot.com/12952005/diff/4005/chrome/browser/profiles/profile_impl.cc#newcode144 chrome/browser/profiles/profile_impl.cc:144: COMPILE_ASSERT(sizeof(ProfileImpl) <= 744u, profile_impl_size_unexpected); Will your patch break this?
7 years, 9 months ago (2013-03-26 17:25:02 UTC) #2
msarda
https://chromiumcodereview.appspot.com/12952005/diff/4005/chrome/browser/profiles/profile_impl.cc File chrome/browser/profiles/profile_impl.cc (right): https://chromiumcodereview.appspot.com/12952005/diff/4005/chrome/browser/profiles/profile_impl.cc#newcode144 chrome/browser/profiles/profile_impl.cc:144: COMPILE_ASSERT(sizeof(ProfileImpl) <= 744u, profile_impl_size_unexpected); On 2013/03/26 17:25:02, sail wrote: ...
7 years, 9 months ago (2013-03-26 17:33:25 UTC) #3
sail
https://chromiumcodereview.appspot.com/12952005/diff/4005/chrome/browser/profiles/profile_impl.cc File chrome/browser/profiles/profile_impl.cc (right): https://chromiumcodereview.appspot.com/12952005/diff/4005/chrome/browser/profiles/profile_impl.cc#newcode144 chrome/browser/profiles/profile_impl.cc:144: COMPILE_ASSERT(sizeof(ProfileImpl) <= 744u, profile_impl_size_unexpected); On 2013/03/26 17:33:26, msarda wrote: ...
7 years, 9 months ago (2013-03-26 17:46:24 UTC) #4
Miranda Callahan
I believe that this assert will only fire on Linux -- it should pop up ...
7 years, 9 months ago (2013-03-26 17:51:12 UTC) #5
sail
On Tue, Mar 26, 2013 at 10:51 AM, <mirandac@chromium.org> wrote: > I believe that this ...
7 years, 9 months ago (2013-03-26 17:55:13 UTC) #6
msarda
The ninja build worked for me on mac. On 2013/03/26 17:55:13, sail wrote: > On ...
7 years, 9 months ago (2013-03-26 17:56:22 UTC) #7
sail
On 2013/03/26 17:56:22, msarda wrote: > The ninja build worked for me on mac. Ahh, ...
7 years, 9 months ago (2013-03-26 17:59:23 UTC) #8
Miranda Callahan
I think it only fires for Linux because the size is set specifically for the ...
7 years, 9 months ago (2013-03-26 18:18:47 UTC) #9
msarda
I took the BookmarkTaskRunner and moved it to the BookmarkModel. It is the bookmark model, ...
7 years, 9 months ago (2013-03-27 12:06:27 UTC) #10
Miranda Callahan
From the point of view of not increasing Profile size, this is much cleaner than ...
7 years, 9 months ago (2013-03-27 13:31:46 UTC) #11
msarda
https://chromiumcodereview.appspot.com/12952005/diff/20001/base/deferred_sequenced_task_runner.h File base/deferred_sequenced_task_runner.h (right): https://chromiumcodereview.appspot.com/12952005/diff/20001/base/deferred_sequenced_task_runner.h#newcode65 base/deferred_sequenced_task_runner.h:65: bool started_; On 2013/03/27 13:31:46, Miranda Callahan wrote: > ...
7 years, 9 months ago (2013-03-27 14:16:48 UTC) #12
Miranda Callahan
Thanks -- LGTM! Definitely wait for Erik's review, though -- I concentrated specifically on the ...
7 years, 9 months ago (2013-03-27 14:20:13 UTC) #13
tfarina
Please, put Scott (sky) on loop when you are done addressing other reviewer's review. Thanks! ...
7 years, 9 months ago (2013-03-27 14:32:58 UTC) #14
tfarina
Also, update your CL description. It's DeferredSequencedTaskRunner rather than PausableSequencedtaskRunner now. -- Thiago
7 years, 9 months ago (2013-03-27 14:34:36 UTC) #15
tfarina
https://chromiumcodereview.appspot.com/12952005/diff/20005/base/deferred_sequenced_task_runner.h File base/deferred_sequenced_task_runner.h (right): https://chromiumcodereview.appspot.com/12952005/diff/20005/base/deferred_sequenced_task_runner.h#newcode1 base/deferred_sequenced_task_runner.h:1: // Copyright (c) 2012 The Chromium Authors. All rights ...
7 years, 9 months ago (2013-03-27 14:35:11 UTC) #16
msarda
+ Scott
7 years, 9 months ago (2013-03-27 14:39:25 UTC) #17
sky
Remind me why are we doing this?
7 years, 9 months ago (2013-03-27 14:59:26 UTC) #18
msarda
On 2013/03/27 14:59:26, sky wrote: > Remind me why are we doing this? On iOS, ...
7 years, 9 months ago (2013-03-27 15:18:06 UTC) #19
sky
What does 'profile is loaded' mean? On Wed, Mar 27, 2013 at 8:18 AM, <msarda@chromium.org> ...
7 years, 9 months ago (2013-03-27 15:25:26 UTC) #20
tfarina
You mentioned in the thread that History creates its own thread for this. Have you ...
7 years, 9 months ago (2013-03-27 16:16:36 UTC) #21
msarda
On 2013/03/27 16:16:36, tfarina wrote: > You mentioned in the thread that History creates its ...
7 years, 9 months ago (2013-03-27 16:32:06 UTC) #22
msarda
Adding willchan for base.
7 years, 9 months ago (2013-03-27 16:33:29 UTC) #23
msarda
Adding Jeffrey Yasskin as he had a lot of comments on the chromium dev thread.
7 years, 9 months ago (2013-03-27 16:35:02 UTC) #24
sky
Is there a way to make the bookmarkmodel not track any of this? By that ...
7 years, 9 months ago (2013-03-27 17:26:32 UTC) #25
msarda
If you look at patch 3, that's exactly what I did. The problem is that ...
7 years, 9 months ago (2013-03-27 17:30:39 UTC) #26
Miranda Callahan
I'd like it to be a ProfileKeyedService instead of directly attached to the Profile if ...
7 years, 9 months ago (2013-03-27 17:30:57 UTC) #27
Miranda Callahan
(Whoops, Mihai's comment overlapped mine. :-) On 2013/03/27 17:30:57, Miranda Callahan wrote: > I'd like ...
7 years, 9 months ago (2013-03-27 17:33:38 UTC) #28
willchan no longer on Chromium
+akalin jyasskin's in transit to Munich today. Is there a hurry for this CL? I'd ...
7 years, 9 months ago (2013-03-27 17:36:24 UTC) #29
msarda
Let's wait for their review and then I can move forward and move the TaskRunner ...
7 years, 9 months ago (2013-03-27 17:41:21 UTC) #30
Jeffrey Yasskin
I'm only *mostly* dead^Win transit. +1 to putting this in a PKS. I'd probably call ...
7 years, 9 months ago (2013-03-27 18:07:37 UTC) #31
tfarina
https://chromiumcodereview.appspot.com/12952005/diff/20005/chrome/browser/bookmarks/bookmark_model.cc File chrome/browser/bookmarks/bookmark_model.cc (right): https://chromiumcodereview.appspot.com/12952005/diff/20005/chrome/browser/bookmarks/bookmark_model.cc#newcode974 chrome/browser/bookmarks/bookmark_model.cc:974: new base::DeferredSequencedTaskRunner(profile_->GetIOTaskRunner()); Can we do something similar to |blocking_task_runner_| ...
7 years, 9 months ago (2013-03-28 22:57:00 UTC) #32
msarda
https://chromiumcodereview.appspot.com/12952005/diff/20005/base/deferred_sequenced_task_runner.cc File base/deferred_sequenced_task_runner.cc (right): https://chromiumcodereview.appspot.com/12952005/diff/20005/base/deferred_sequenced_task_runner.cc#newcode81 base/deferred_sequenced_task_runner.cc:81: target_task_runner_->PostNonNestableDelayedTask(task.posted_from, With this design, can we guarantee that if ...
7 years, 8 months ago (2013-03-29 14:40:02 UTC) #33
Miranda Callahan
Thanks for all your work on this CL!! Getting very clean -- just one real ...
7 years, 8 months ago (2013-03-29 14:40:13 UTC) #34
msarda
Miranda: Thank you for you quick review! I'll wait for sky's review before addressing your ...
7 years, 8 months ago (2013-03-29 14:46:24 UTC) #35
tfarina
https://chromiumcodereview.appspot.com/12952005/diff/34002/chrome/browser/bookmarks/DEPS File chrome/browser/bookmarks/DEPS (right): https://chromiumcodereview.appspot.com/12952005/diff/34002/chrome/browser/bookmarks/DEPS#newcode7 chrome/browser/bookmarks/DEPS:7: "+chrome/browser/api", looks like you need to sync your checkout. ...
7 years, 8 months ago (2013-03-29 14:47:39 UTC) #36
sky
I like the injection route, less dependencies. bookmarks (and chrom/test and chrome/chrome_browser.gypi changes) LGTM
7 years, 8 months ago (2013-03-29 15:41:25 UTC) #37
msarda
On 2013/03/29 15:41:25, sky wrote: > I like the injection route, less dependencies. bookmarks (and ...
7 years, 8 months ago (2013-03-29 15:59:22 UTC) #38
Miranda Callahan
LGTM! On 2013/03/29 15:59:22, msarda wrote: > On 2013/03/29 15:41:25, sky wrote: > > I ...
7 years, 8 months ago (2013-03-29 16:12:48 UTC) #39
msarda
jyasskin, willchan: Ping
7 years, 8 months ago (2013-04-03 15:54:49 UTC) #40
Jeffrey Yasskin
Once the owners are happy, you don't need to wait for an l g t ...
7 years, 8 months ago (2013-04-03 16:25:35 UTC) #41
Jeffrey Yasskin
https://codereview.chromium.org/12952005/diff/34002/chrome/browser/profiles/startup_task_runner_service.h File chrome/browser/profiles/startup_task_runner_service.h (right): https://codereview.chromium.org/12952005/diff/34002/chrome/browser/profiles/startup_task_runner_service.h#newcode16 chrome/browser/profiles/startup_task_runner_service.h:16: class StartupTaskRunnerService : public ProfileKeyedService { On 2013/04/03 16:25:35, ...
7 years, 8 months ago (2013-04-04 15:26:48 UTC) #42
willchan_google.com
My bad, I have been out most of the week. I'll try to do this ...
7 years, 8 months ago (2013-04-04 15:47:56 UTC) #43
willchan no longer on Chromium
https://chromiumcodereview.appspot.com/12952005/diff/34002/base/deferred_sequenced_task_runner.cc File base/deferred_sequenced_task_runner.cc (right): https://chromiumcodereview.appspot.com/12952005/diff/34002/base/deferred_sequenced_task_runner.cc#newcode77 base/deferred_sequenced_task_runner.cc:77: for (std::vector<DeferredTask>::iterator i = deferred_tasks_queue_.begin(); There's a really subtle ...
7 years, 8 months ago (2013-04-05 02:56:41 UTC) #44
msarda
jyasskin, willchan: I addressed all your comments. Please take another look. https://chromiumcodereview.appspot.com/12952005/diff/34002/base/deferred_sequenced_task_runner.cc File base/deferred_sequenced_task_runner.cc (right): ...
7 years, 8 months ago (2013-04-08 17:37:18 UTC) #45
willchan no longer on Chromium
https://chromiumcodereview.appspot.com/12952005/diff/34002/base/deferred_sequenced_task_runner.cc File base/deferred_sequenced_task_runner.cc (right): https://chromiumcodereview.appspot.com/12952005/diff/34002/base/deferred_sequenced_task_runner.cc#newcode77 base/deferred_sequenced_task_runner.cc:77: for (std::vector<DeferredTask>::iterator i = deferred_tasks_queue_.begin(); On 2013/04/08 17:37:18, msarda ...
7 years, 8 months ago (2013-04-08 17:41:09 UTC) #46
Jeffrey Yasskin
lgtm. My comments are all nits. https://chromiumcodereview.appspot.com/12952005/diff/34002/chrome/browser/profiles/startup_task_runner_service.h File chrome/browser/profiles/startup_task_runner_service.h (right): https://chromiumcodereview.appspot.com/12952005/diff/34002/chrome/browser/profiles/startup_task_runner_service.h#newcode16 chrome/browser/profiles/startup_task_runner_service.h:16: class StartupTaskRunnerService : ...
7 years, 8 months ago (2013-04-08 19:58:30 UTC) #47
msarda
https://chromiumcodereview.appspot.com/12952005/diff/54001/base/deferred_sequenced_task_runner_unittest.cc File base/deferred_sequenced_task_runner_unittest.cc (right): https://chromiumcodereview.appspot.com/12952005/diff/54001/base/deferred_sequenced_task_runner_unittest.cc#newcode20 base/deferred_sequenced_task_runner_unittest.cc:20: public : On 2013/04/08 19:58:30, Jeffrey Yasskin wrote: > ...
7 years, 8 months ago (2013-04-09 07:20:11 UTC) #48
msarda
I have tried to put up a unit test for the destruction time of the ...
7 years, 8 months ago (2013-04-09 09:55:38 UTC) #49
willchan no longer on Chromium
I'm sorry I caused you to spend 2 hours on this :( I was hoping ...
7 years, 8 months ago (2013-04-09 18:07:24 UTC) #50
msarda
willchan: The unit test is ready. PTAL. On 2013/04/09 18:07:24, willchan wrote: > I'm sorry ...
7 years, 8 months ago (2013-04-12 11:51:40 UTC) #51
erikwright (departed)
https://codereview.chromium.org/12952005/diff/82001/base/deferred_sequenced_task_runner.cc File base/deferred_sequenced_task_runner.cc (right): https://codereview.chromium.org/12952005/diff/82001/base/deferred_sequenced_task_runner.cc#newcode8 base/deferred_sequenced_task_runner.cc:8: #include "base/threading/thread_checker.h" not needed? https://codereview.chromium.org/12952005/diff/82001/base/deferred_sequenced_task_runner.cc#newcode31 base/deferred_sequenced_task_runner.cc:31: AutoLock lock(lock_); presumably ...
7 years, 8 months ago (2013-04-15 17:56:25 UTC) #52
willchan no longer on Chromium
Nice way of testing the new functionality. Please address erikwright's comments too and I'll send ...
7 years, 8 months ago (2013-04-16 01:03:03 UTC) #53
msarda
I addressed your comments. willchan: PTAL PS: There are a lot of other diffs with ...
7 years, 8 months ago (2013-04-17 09:53:55 UTC) #54
erikwright (departed)
https://chromiumcodereview.appspot.com/12952005/diff/82001/base/deferred_sequenced_task_runner.cc File base/deferred_sequenced_task_runner.cc (right): https://chromiumcodereview.appspot.com/12952005/diff/82001/base/deferred_sequenced_task_runner.cc#newcode74 base/deferred_sequenced_task_runner.cc:74: DCHECK(!started_); On 2013/04/17 09:53:55, msarda wrote: > On 2013/04/15 ...
7 years, 8 months ago (2013-04-17 14:41:19 UTC) #55
msarda
I talked with Miranda. She said she'll review the profile bit again. I address all ...
7 years, 8 months ago (2013-04-17 15:29:10 UTC) #56
Miranda Callahan
LGTM with follow-up CL to perform Erik's suggested extraction of Profile, which is correct and ...
7 years, 8 months ago (2013-04-17 15:35:11 UTC) #57
willchan no longer on Chromium
Sorry for missing the loop implementation earlier. If I'm correct about the runtime complexity there, ...
7 years, 8 months ago (2013-04-17 15:40:18 UTC) #58
msarda
https://chromiumcodereview.appspot.com/12952005/diff/82001/base/deferred_sequenced_task_runner.cc File base/deferred_sequenced_task_runner.cc (right): https://chromiumcodereview.appspot.com/12952005/diff/82001/base/deferred_sequenced_task_runner.cc#newcode74 base/deferred_sequenced_task_runner.cc:74: DCHECK(!started_); I'll keep it as is then. On 2013/04/17 ...
7 years, 8 months ago (2013-04-17 16:24:39 UTC) #59
erikwright (departed)
LGTM. On 2013/04/17 15:35:11, Miranda Callahan wrote: > LGTM with follow-up CL to perform Erik's ...
7 years, 8 months ago (2013-04-17 17:10:58 UTC) #60
erikwright (departed)
https://chromiumcodereview.appspot.com/12952005/diff/82001/base/deferred_sequenced_task_runner.cc File base/deferred_sequenced_task_runner.cc (right): https://chromiumcodereview.appspot.com/12952005/diff/82001/base/deferred_sequenced_task_runner.cc#newcode74 base/deferred_sequenced_task_runner.cc:74: DCHECK(!started_); On 2013/04/17 15:29:10, msarda wrote: > On 2013/04/17 ...
7 years, 8 months ago (2013-04-17 17:21:17 UTC) #61
willchan no longer on Chromium
lgtm
7 years, 8 months ago (2013-04-17 17:56:55 UTC) #62
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/msarda@chromium.org/12952005/105003
7 years, 8 months ago (2013-04-18 07:54:56 UTC) #63
commit-bot: I haz the power
Retried try job too often on linux_rel for step(s) sync_integration_tests http://build.chromium.org/p/tryserver.chromium/buildstatus?builder=linux_rel&number=118042
7 years, 8 months ago (2013-04-18 09:38:43 UTC) #64
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/msarda@chromium.org/12952005/133001
7 years, 8 months ago (2013-04-18 12:35:19 UTC) #65
Miranda Callahan
On 2013/04/18 12:35:19, I haz the power (commit-bot) wrote: > CQ is trying da patch. ...
7 years, 8 months ago (2013-04-18 14:47:50 UTC) #66
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/msarda@chromium.org/12952005/145003
7 years, 8 months ago (2013-04-18 14:50:54 UTC) #67
commit-bot: I haz the power
7 years, 8 months ago (2013-04-18 17:17:38 UTC) #68
Message was sent while issue was closed.
Change committed as 194956

Powered by Google App Engine
This is Rietveld 408576698