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

Issue 12084058: sync/glue: Convert BookmarkDataTypeController to BaseBookmarkModelObserver. (Closed)

Created:
7 years, 10 months ago by tfarina
Modified:
7 years, 10 months ago
Reviewers:
Nicolas Zea, sky
CC:
chromium-reviews, Raghu Simha, haitaol1, tim (not reviewing)
Visibility:
Public.

Description

sync/glue: Convert BookmarkDataTypeController to BaseBookmarkModelObserver. This removes the last consumer of chrome::NOTIFICATION_BOOKMARK_MODEL_LOADED. BUG=144783 TEST=unit_tests --gtest_filter=SyncBookmarkDataTypeControllerTest* R=zea@chromium.org Committed: https://src.chromium.org/viewvc/chrome?view=rev&revision=184651

Patch Set 1 #

Total comments: 3

Patch Set 2 : add hack #

Patch Set 3 : remove all bookmark boilerplate #

Total comments: 7

Patch Set 4 : FakeBookmarkModel #

Patch Set 5 : override AddObserver/RemoveObserver #

Patch Set 6 : TriggerLoad #

Patch Set 7 : inherit from BaseBookmarkModelObserver #

Total comments: 2

Patch Set 8 : load_bookmark_model #

Patch Set 9 : unit_tests PASSES #

Total comments: 2

Patch Set 10 : check first #

Patch Set 11 : match the definition order with order of declaration in the header file #

Total comments: 4

Patch Set 12 : back with DependentsLoaded() - unit_tests still passes #

Patch Set 13 : revert more changes to make the diff easier to read #

Patch Set 14 : revert other bookmarks changes to make diff easier to read #

Total comments: 4

Patch Set 15 : rm them #

Total comments: 1

Patch Set 16 : ... #

Patch Set 17 : rm virtuals #

Total comments: 1

Patch Set 18 : other crash #

Patch Set 19 : Don't Crash #

Total comments: 1

Patch Set 20 : more changes #

Patch Set 21 : block and doesn't run #

Patch Set 22 : Load() #

Patch Set 23 : reuse ui_test_utils::WaitForBookmarkModelToLoad #

Patch Set 24 : Prepare() - all tests passes #

Total comments: 2

Patch Set 25 : CreateBookmarkModel() #

Patch Set 26 : rm debugging code #

Patch Set 27 : include bookmark_data_type_controller changes #

Total comments: 4

Patch Set 28 : BookmarkModelPolicy #

Unified diffs Side-by-side diffs Delta from patch set Stats (+85 lines, -51 lines) Patch
M chrome/browser/sync/glue/bookmark_data_type_controller.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 3 chunks +10 lines, -5 lines 0 comments Download
M chrome/browser/sync/glue/bookmark_data_type_controller.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 19 20 21 22 23 24 25 26 3 chunks +23 lines, -6 lines 0 comments Download
M chrome/browser/sync/glue/bookmark_data_type_controller_unittest.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 17 chunks +52 lines, -40 lines 0 comments Download

Messages

Total messages: 48 (0 generated)
tfarina
Hi Nicolas, this what I'm working on. This is not ready to be landed, but ...
7 years, 10 months ago (2013-01-30 04:40:29 UTC) #1
Nicolas Zea
https://codereview.chromium.org/12084058/diff/1/chrome/browser/sync/glue/bookmark_data_type_controller.cc File chrome/browser/sync/glue/bookmark_data_type_controller.cc (right): https://codereview.chromium.org/12084058/diff/1/chrome/browser/sync/glue/bookmark_data_type_controller.cc#newcode85 chrome/browser/sync/glue/bookmark_data_type_controller.cc:85: model->RemoveObserver(this); maybe DCHECK(model->IsLoaded()) here https://codereview.chromium.org/12084058/diff/1/chrome/browser/sync/glue/bookmark_data_type_controller_unittest.cc File chrome/browser/sync/glue/bookmark_data_type_controller_unittest.cc (left): https://codereview.chromium.org/12084058/diff/1/chrome/browser/sync/glue/bookmark_data_type_controller_unittest.cc#oldcode173 ...
7 years, 10 months ago (2013-01-30 19:02:20 UTC) #2
tfarina
I'm building locally to try to run this again. https://codereview.chromium.org/12084058/diff/1/chrome/browser/sync/glue/bookmark_data_type_controller_unittest.cc File chrome/browser/sync/glue/bookmark_data_type_controller_unittest.cc (left): https://codereview.chromium.org/12084058/diff/1/chrome/browser/sync/glue/bookmark_data_type_controller_unittest.cc#oldcode173 chrome/browser/sync/glue/bookmark_data_type_controller_unittest.cc:173: ...
7 years, 10 months ago (2013-01-30 19:16:41 UTC) #3
tfarina
I added a hack, but didn't make the test pass yet. It isn't still clear ...
7 years, 10 months ago (2013-01-30 22:34:17 UTC) #4
tfarina
https://codereview.chromium.org/12084058/diff/8001/chrome/browser/sync/glue/bookmark_data_type_controller.cc File chrome/browser/sync/glue/bookmark_data_type_controller.cc (right): https://codereview.chromium.org/12084058/diff/8001/chrome/browser/sync/glue/bookmark_data_type_controller.cc#newcode42 chrome/browser/sync/glue/bookmark_data_type_controller.cc:42: DCHECK_EQ(state_, MODEL_STARTING); where do we set |state_|? https://codereview.chromium.org/12084058/diff/8001/chrome/browser/sync/glue/bookmark_data_type_controller_unittest.cc File ...
7 years, 10 months ago (2013-01-31 03:28:36 UTC) #5
tfarina
https://codereview.chromium.org/12084058/diff/8001/chrome/browser/sync/glue/bookmark_data_type_controller_unittest.cc File chrome/browser/sync/glue/bookmark_data_type_controller_unittest.cc (right): https://codereview.chromium.org/12084058/diff/8001/chrome/browser/sync/glue/bookmark_data_type_controller_unittest.cc#newcode84 chrome/browser/sync/glue/bookmark_data_type_controller_unittest.cc:84: bookmark_model_ = static_cast<BookmarkModelMock*>( can we move away of this ...
7 years, 10 months ago (2013-01-31 03:42:36 UTC) #6
Nicolas Zea
https://codereview.chromium.org/12084058/diff/8001/chrome/browser/sync/glue/bookmark_data_type_controller_unittest.cc File chrome/browser/sync/glue/bookmark_data_type_controller_unittest.cc (right): https://codereview.chromium.org/12084058/diff/8001/chrome/browser/sync/glue/bookmark_data_type_controller_unittest.cc#newcode84 chrome/browser/sync/glue/bookmark_data_type_controller_unittest.cc:84: bookmark_model_ = static_cast<BookmarkModelMock*>( On 2013/01/31 03:42:36, tfarina wrote: > ...
7 years, 10 months ago (2013-01-31 20:48:27 UTC) #7
tfarina
Nicolas, would you be envision something like the following? class FakeBookmarkModel : public BookmarkModel { ...
7 years, 10 months ago (2013-01-31 21:05:42 UTC) #8
Nicolas Zea
On 2013/01/31 21:05:42, tfarina wrote: > Nicolas, would you be envision something like the following? ...
7 years, 10 months ago (2013-01-31 21:06:45 UTC) #9
tfarina
Nicolas, I think you can take a preliminary look at FakeBookmarkModel and see how I'm ...
7 years, 10 months ago (2013-02-01 20:16:12 UTC) #10
Nicolas Zea
The FakeBookmarkModel looks good. https://codereview.chromium.org/12084058/diff/17001/chrome/browser/sync/glue/bookmark_data_type_controller_unittest.cc File chrome/browser/sync/glue/bookmark_data_type_controller_unittest.cc (right): https://codereview.chromium.org/12084058/diff/17001/chrome/browser/sync/glue/bookmark_data_type_controller_unittest.cc#newcode118 chrome/browser/sync/glue/bookmark_data_type_controller_unittest.cc:118: EXPECT_TRUE(bookmark_model_->IsLoaded()); This isn't really right. ...
7 years, 10 months ago (2013-02-01 21:42:31 UTC) #11
Nicolas Zea
On 2013/02/01 21:42:31, Nicolas Zea wrote: > The FakeBookmarkModel looks good. > > https://codereview.chromium.org/12084058/diff/17001/chrome/browser/sync/glue/bookmark_data_type_controller_unittest.cc > ...
7 years, 10 months ago (2013-02-01 21:43:22 UTC) #12
tfarina
Nicolas, thanks a lot for the review! I made the suggested changes to SetStartExpectations() and ...
7 years, 10 months ago (2013-02-01 22:32:37 UTC) #13
tfarina
Oh, forgot to note that once this is finished I will add Scott (sky) as ...
7 years, 10 months ago (2013-02-01 22:33:29 UTC) #14
tfarina
Nicolas, I think this is finished! Yay! All SyncBookmarkDataTypeControllerTest tests passed. Please, could you take ...
7 years, 10 months ago (2013-02-01 23:14:11 UTC) #15
Nicolas Zea
https://codereview.chromium.org/12084058/diff/9006/chrome/browser/sync/glue/bookmark_data_type_controller.cc File chrome/browser/sync/glue/bookmark_data_type_controller.cc (right): https://codereview.chromium.org/12084058/diff/9006/chrome/browser/sync/glue/bookmark_data_type_controller.cc#newcode87 chrome/browser/sync/glue/bookmark_data_type_controller.cc:87: OnModelLoaded(); This isn't quite right. I think you should ...
7 years, 10 months ago (2013-02-01 23:46:27 UTC) #16
tfarina
https://codereview.chromium.org/12084058/diff/9006/chrome/browser/sync/glue/bookmark_data_type_controller.cc File chrome/browser/sync/glue/bookmark_data_type_controller.cc (right): https://codereview.chromium.org/12084058/diff/9006/chrome/browser/sync/glue/bookmark_data_type_controller.cc#newcode87 chrome/browser/sync/glue/bookmark_data_type_controller.cc:87: OnModelLoaded(); On 2013/02/01 23:46:27, Nicolas Zea wrote: > This ...
7 years, 10 months ago (2013-02-02 00:08:39 UTC) #17
tfarina
Ping?
7 years, 10 months ago (2013-02-04 18:53:14 UTC) #18
Nicolas Zea
https://codereview.chromium.org/12084058/diff/3006/chrome/browser/bookmarks/bookmark_model.h File chrome/browser/bookmarks/bookmark_model.h (right): https://codereview.chromium.org/12084058/diff/3006/chrome/browser/bookmarks/bookmark_model.h#newcode245 chrome/browser/bookmarks/bookmark_model.h:245: virtual void AddObserver(BookmarkModelObserver* observer); Why did you move these ...
7 years, 10 months ago (2013-02-04 18:58:27 UTC) #19
tfarina
Nicolas, thanks for the review! I reverted most of the style changes, and turns out ...
7 years, 10 months ago (2013-02-04 20:44:28 UTC) #20
tfarina
Hi Nicolas, does this L G T Y now? Can and send this to Scott ...
7 years, 10 months ago (2013-02-05 15:00:19 UTC) #21
Nicolas Zea
LGTM once the changes are made https://codereview.chromium.org/12084058/diff/28006/chrome/browser/sync/glue/bookmark_data_type_controller.cc File chrome/browser/sync/glue/bookmark_data_type_controller.cc (right): https://codereview.chromium.org/12084058/diff/28006/chrome/browser/sync/glue/bookmark_data_type_controller.cc#newcode47 chrome/browser/sync/glue/bookmark_data_type_controller.cc:47: registrar_.RemoveAll(); remove the ...
7 years, 10 months ago (2013-02-05 18:20:46 UTC) #22
tfarina
https://codereview.chromium.org/12084058/diff/28006/chrome/browser/sync/glue/bookmark_data_type_controller.cc File chrome/browser/sync/glue/bookmark_data_type_controller.cc (right): https://codereview.chromium.org/12084058/diff/28006/chrome/browser/sync/glue/bookmark_data_type_controller.cc#newcode47 chrome/browser/sync/glue/bookmark_data_type_controller.cc:47: registrar_.RemoveAll(); On 2013/02/05 18:20:47, Nicolas Zea wrote: > remove ...
7 years, 10 months ago (2013-02-05 18:32:13 UTC) #23
tfarina
+sky for final approval! Scott, could you review my changes to c/b/bookmarks? I think an ...
7 years, 10 months ago (2013-02-05 20:09:06 UTC) #24
sky
https://codereview.chromium.org/12084058/diff/36001/chrome/browser/sync/glue/bookmark_data_type_controller_unittest.cc File chrome/browser/sync/glue/bookmark_data_type_controller_unittest.cc (right): https://codereview.chromium.org/12084058/diff/36001/chrome/browser/sync/glue/bookmark_data_type_controller_unittest.cc#newcode47 chrome/browser/sync/glue/bookmark_data_type_controller_unittest.cc:47: class FakeBookmarkModel : public BookmarkModel { BookmarkModel isn't intended ...
7 years, 10 months ago (2013-02-05 21:43:58 UTC) #25
tfarina
https://codereview.chromium.org/12084058/diff/38002/chrome/browser/sync/glue/bookmark_data_type_controller_unittest.cc File chrome/browser/sync/glue/bookmark_data_type_controller_unittest.cc (right): https://codereview.chromium.org/12084058/diff/38002/chrome/browser/sync/glue/bookmark_data_type_controller_unittest.cc#newcode87 chrome/browser/sync/glue/bookmark_data_type_controller_unittest.cc:87: ui_test_utils::WaitForBookmarkModelToLoad(bookmark_model_); I'm getting a crash here: [0x7f94407b4ede] base::debug::StackTrace::StackTrace() [0x7f94407b4a15] ...
7 years, 10 months ago (2013-02-06 00:32:12 UTC) #26
tfarina
With patch set 18 I get this crash: Received signal 11 SEGV_MAPERR 0000000001d0 [0x7f2d82ef4ede] base::debug::StackTrace::StackTrace() ...
7 years, 10 months ago (2013-02-06 00:53:34 UTC) #27
tfarina
If I just remove the lines of: EXPECT_CALL(*bookmark_model_, IsLoaded()).WillRepeatedly(Return(true)); The test fails: [ RUN ] ...
7 years, 10 months ago (2013-02-06 02:52:59 UTC) #28
tfarina
Patch set 19 does not crash, but... [ RUN ] SyncBookmarkDataTypeControllerTest.StartBookmarkModelNotReady ../../chrome/browser/sync/glue/bookmark_data_type_controller_unittest.cc:158: Failure Value of: ...
7 years, 10 months ago (2013-02-06 03:23:36 UTC) #29
tfarina
https://codereview.chromium.org/12084058/diff/45005/chrome/browser/sync/glue/bookmark_data_type_controller_unittest.cc File chrome/browser/sync/glue/bookmark_data_type_controller_unittest.cc (right): https://codereview.chromium.org/12084058/diff/45005/chrome/browser/sync/glue/bookmark_data_type_controller_unittest.cc#newcode56 chrome/browser/sync/glue/bookmark_data_type_controller_unittest.cc:56: return new BookmarkModel(NULL); this, of course, causes BookmarkModel to ...
7 years, 10 months ago (2013-02-07 00:52:07 UTC) #30
tfarina
Nicolas, crazy idea, is it too bad to just through away this StartBookmarkModelNotReady? yeah, I ...
7 years, 10 months ago (2013-02-07 02:53:00 UTC) #31
Nicolas Zea
On 2013/02/07 02:53:00, tfarina wrote: > Nicolas, crazy idea, is it too bad to just ...
7 years, 10 months ago (2013-02-07 20:49:34 UTC) #32
sky
I don't like exposing a bunch of methods purely for subclassing and use in a ...
7 years, 10 months ago (2013-02-11 17:26:43 UTC) #33
tfarina
On 2013/02/06 03:23:36, tfarina wrote: > Patch set 19 does not crash, but... > > ...
7 years, 10 months ago (2013-02-15 13:42:42 UTC) #34
tfarina
Fred, are you familiar with the workflow of these DataTypeControllers, specially between BookmarkDataTypeController and FrontendDataTypeController.
7 years, 10 months ago (2013-02-15 17:34:49 UTC) #35
tfarina
On 2013/02/15 17:34:49, tfarina wrote: > Fred, are you familiar with the workflow of these ...
7 years, 10 months ago (2013-02-15 17:36:00 UTC) #36
akalin
I'm not too familiar with this code, sorry. Nicolas?
7 years, 10 months ago (2013-02-15 22:41:52 UTC) #37
Nicolas Zea
Thiago, passing the NULL param to BookmarkModel defeats the purpose of this test. The logic ...
7 years, 10 months ago (2013-02-15 23:05:14 UTC) #38
tfarina
On Fri, Feb 15, 2013 at 9:05 PM, <zea@chromium.org> wrote: > Thiago, passing the NULL ...
7 years, 10 months ago (2013-02-15 23:24:55 UTC) #39
tfarina
Nicolas, I'm happy! With the changes made in patch set 24 (ouch, sigh :/ ), ...
7 years, 10 months ago (2013-02-19 22:51:49 UTC) #40
tfarina
Oh also ignore the change I did in frontend_data_type_controller.cc, it was just my debugging code.
7 years, 10 months ago (2013-02-19 22:52:35 UTC) #41
Nicolas Zea
Looks pretty good, one style comment mainly. https://codereview.chromium.org/12084058/diff/65001/chrome/browser/sync/glue/bookmark_data_type_controller_unittest.cc File chrome/browser/sync/glue/bookmark_data_type_controller_unittest.cc (right): https://codereview.chromium.org/12084058/diff/65001/chrome/browser/sync/glue/bookmark_data_type_controller_unittest.cc#newcode79 chrome/browser/sync/glue/bookmark_data_type_controller_unittest.cc:79: void Prepare() ...
7 years, 10 months ago (2013-02-19 22:58:09 UTC) #42
tfarina
Nicolas, I think this is ready, please, take another look. Yeah, I notice I have ...
7 years, 10 months ago (2013-02-20 01:42:49 UTC) #43
Nicolas Zea
On 2013/02/20 01:42:49, tfarina wrote: > Nicolas, I think this is ready, please, take another ...
7 years, 10 months ago (2013-02-20 23:37:16 UTC) #44
tfarina
On 2013/02/20 23:37:16, Nicolas Zea wrote: > Don't the bookmark_data_type_controller changes need to be here ...
7 years, 10 months ago (2013-02-24 22:02:10 UTC) #45
Nicolas Zea
LGTM with a naming nit. Thanks for sticking with it! https://codereview.chromium.org/12084058/diff/74001/chrome/browser/sync/glue/bookmark_data_type_controller_unittest.cc File chrome/browser/sync/glue/bookmark_data_type_controller_unittest.cc (right): https://codereview.chromium.org/12084058/diff/74001/chrome/browser/sync/glue/bookmark_data_type_controller_unittest.cc#newcode93 ...
7 years, 10 months ago (2013-02-25 19:39:01 UTC) #46
tfarina
On 2013/02/25 19:39:01, Nicolas Zea wrote: > LGTM with a naming nit. Thanks for sticking ...
7 years, 10 months ago (2013-02-26 15:03:23 UTC) #47
tfarina
7 years, 10 months ago (2013-02-26 15:04:02 UTC) #48
Message was sent while issue was closed.
Committed manually as r184651 (presubmit successful).

Powered by Google App Engine
This is Rietveld 408576698