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

Issue 242693003: Introduce BookmarkClient interface to abstract embedder (Closed)

Created:
6 years, 8 months ago by sdefresne
Modified:
6 years, 8 months ago
Reviewers:
droger, tfarina, sky
CC:
chromium-reviews, tfarina, browser-components-watch_chromium.org, extensions-reviews_chromium.org, chromium-apps-reviews_chromium.org
Base URL:
https://chromium.googlesource.com/chromium/src.git@master
Visibility:
Public.

Description

Introduce BookmarkClient interface to abstract embedder The BookmarkClient interface abstracts the embedder. Once bookmarks is componentized, the code will have to go through BookmarkClient methods instead of accessing methods from chrome/browser or chrome/content (as they are not accessible from iOS). Wrapped methods from chrome/browser/: - FaviconService::GetFaviconImageForURL - HistoryService::InMemoryDatabase BookmarkClient also wraps content::RecordAction, as it is a simple wrapper around base::RecordAction and can easily be reimplemented in the client without dependency on the content/ API. Port all the client code to pass the BookmarkClient interface to the method that need it (mostly bookmark_utils::AddIfNotBookmarked and functions in bookmark_stats.cc, the rest are internal to the component). BUG=364433 R=sky@chromium.org,tfarina@chromium.org,droger@chromium.org Committed: https://src.chromium.org/viewvc/chrome?view=rev&revision=266376

Patch Set 1 #

Total comments: 8

Patch Set 2 : Addressing reviewer comments #

Total comments: 14

Patch Set 3 : Introduce ChromeBookmarkClient #

Total comments: 3

Patch Set 4 : Rebase #

Patch Set 5 : Fix compilation of unit tests #

Total comments: 10

Patch Set 6 : Fix unit tests (and introduce a TestBookmarkClient) #

Patch Set 7 : Add comments to BookmarkStorage methods #

Patch Set 8 : Rebase #

Total comments: 18

Patch Set 9 : Rebase #

Patch Set 10 : Fix typos #

Patch Set 11 : Rebase #

Total comments: 8

Patch Set 12 : Rebase & address comments #

Patch Set 13 : Work around STL android bug #

Unified diffs Side-by-side diffs Delta from patch set Stats (+1033 lines, -657 lines) Patch
M chrome/browser/autocomplete/bookmark_provider_unittest.cc View 1 2 3 4 5 6 7 8 9 10 11 12 4 chunks +4 lines, -3 lines 0 comments Download
M chrome/browser/bookmarks/bookmark_codec_unittest.cc View 1 2 3 4 5 6 7 8 10 chunks +35 lines, -30 lines 0 comments Download
M chrome/browser/bookmarks/bookmark_index.h View 1 2 3 4 5 6 7 8 9 4 chunks +10 lines, -37 lines 0 comments Download
M chrome/browser/bookmarks/bookmark_index.cc View 1 2 3 4 5 6 7 8 9 10 11 12 5 chunks +61 lines, -51 lines 0 comments Download
M chrome/browser/bookmarks/bookmark_index_unittest.cc View 1 2 3 4 5 6 7 8 9 10 11 8 chunks +8 lines, -7 lines 0 comments Download
M chrome/browser/bookmarks/bookmark_model.h View 1 2 3 4 5 6 7 8 9 10 11 8 chunks +29 lines, -30 lines 0 comments Download
M chrome/browser/bookmarks/bookmark_model.cc View 1 2 3 4 5 6 7 8 9 10 11 15 chunks +64 lines, -104 lines 0 comments Download
M chrome/browser/bookmarks/bookmark_model_factory.cc View 1 2 3 4 5 6 7 8 3 chunks +20 lines, -8 lines 0 comments Download
M chrome/browser/bookmarks/bookmark_model_unittest.cc View 1 2 3 4 5 6 7 8 9 10 11 27 chunks +160 lines, -159 lines 0 comments Download
M chrome/browser/bookmarks/bookmark_storage.h View 1 2 3 4 5 6 7 8 9 10 11 2 chunks +11 lines, -5 lines 0 comments Download
M chrome/browser/bookmarks/bookmark_storage.cc View 1 2 3 4 5 6 7 8 9 10 11 6 chunks +18 lines, -16 lines 0 comments Download
M chrome/browser/bookmarks/bookmark_utils.cc View 1 2 3 4 5 6 7 8 9 10 11 3 chunks +2 lines, -2 lines 0 comments Download
M chrome/browser/bookmarks/bookmark_utils_unittest.cc View 1 2 3 4 5 6 7 8 9 chunks +109 lines, -101 lines 0 comments Download
A chrome/browser/bookmarks/chrome_bookmark_client.h View 1 2 3 4 5 6 7 8 1 chunk +62 lines, -0 lines 0 comments Download
A chrome/browser/bookmarks/chrome_bookmark_client.cc View 1 2 3 4 5 6 7 8 9 10 11 1 chunk +113 lines, -0 lines 0 comments Download
A chrome/browser/bookmarks/test_bookmark_client.h View 1 2 3 4 5 6 7 8 9 10 11 1 chunk +45 lines, -0 lines 0 comments Download
A chrome/browser/bookmarks/test_bookmark_client.cc View 1 2 3 4 5 6 7 8 9 10 11 1 chunk +44 lines, -0 lines 0 comments Download
M chrome/browser/extensions/api/bookmarks/bookmark_api_helpers_unittest.cc View 1 2 3 4 5 6 7 8 9 10 11 3 chunks +3 lines, -1 line 0 comments Download
M chrome/browser/history/DEPS View 1 2 3 4 5 6 7 8 1 chunk +1 line, -0 lines 0 comments Download
M chrome/browser/history/expire_history_backend_unittest.cc View 1 2 3 4 5 6 7 8 5 chunks +9 lines, -8 lines 0 comments Download
M chrome/browser/history/history_backend_unittest.cc View 1 2 3 4 5 6 7 8 12 chunks +20 lines, -20 lines 0 comments Download
M chrome/browser/sync/glue/bookmark_data_type_controller_unittest.cc View 1 2 3 4 5 6 7 8 4 chunks +33 lines, -12 lines 0 comments Download
M chrome/browser/sync/test/integration/bookmarks_helper.cc View 1 2 3 4 5 6 7 8 16 chunks +32 lines, -23 lines 0 comments Download
M chrome/browser/ui/bookmarks/bookmark_editor_unittest.cc View 1 2 3 4 5 6 7 8 4 chunks +9 lines, -7 lines 0 comments Download
M chrome/browser/ui/bookmarks/bookmark_ui_utils_unittest.cc View 1 2 3 4 5 6 7 8 4 chunks +32 lines, -26 lines 0 comments Download
M chrome/browser/ui/cocoa/bookmarks/bookmark_name_folder_controller.h View 1 2 3 4 5 6 7 8 1 chunk +2 lines, -1 line 0 comments Download
M chrome/browser/ui/cocoa/bookmarks/bookmark_name_folder_controller_unittest.mm View 1 2 3 4 5 6 7 8 1 chunk +1 line, -0 lines 0 comments Download
M chrome/chrome_browser.gypi View 1 2 3 4 5 6 7 8 9 10 11 12 1 chunk +2 lines, -0 lines 0 comments Download
M chrome/chrome_tests_unit.gypi View 1 2 3 4 5 6 7 8 9 10 11 1 chunk +2 lines, -0 lines 0 comments Download
M chrome/test/base/testing_profile.cc View 1 2 3 4 5 6 7 8 3 chunks +15 lines, -6 lines 0 comments Download
M components/bookmarks.gypi View 1 2 3 4 5 6 7 8 1 chunk +1 line, -0 lines 0 comments Download
A components/bookmarks/core/browser/bookmark_client.h View 1 2 3 4 5 6 7 8 9 10 11 1 chunk +76 lines, -0 lines 0 comments Download

Messages

Total messages: 28 (0 generated)
sdefresne
Please have a look. Please note that I used clang-format on the code.
6 years, 8 months ago (2014-04-18 14:14:53 UTC) #1
sky
https://codereview.chromium.org/242693003/diff/1/components/bookmarks/core/browser/bookmark_client.h File components/bookmarks/core/browser/bookmark_client.h (right): https://codereview.chromium.org/242693003/diff/1/components/bookmarks/core/browser/bookmark_client.h#newcode33 components/bookmarks/core/browser/bookmark_client.h:33: virtual ~BookmarkClient() {}; nit: no ';' https://codereview.chromium.org/242693003/diff/1/components/bookmarks/core/browser/bookmark_client.h#newcode54 components/bookmarks/core/browser/bookmark_client.h:54: typedef ...
6 years, 8 months ago (2014-04-18 14:21:56 UTC) #2
sdefresne
Please take another look. https://codereview.chromium.org/242693003/diff/1/components/bookmarks/core/browser/bookmark_client.h File components/bookmarks/core/browser/bookmark_client.h (right): https://codereview.chromium.org/242693003/diff/1/components/bookmarks/core/browser/bookmark_client.h#newcode33 components/bookmarks/core/browser/bookmark_client.h:33: virtual ~BookmarkClient() {}; On 2014/04/18 ...
6 years, 8 months ago (2014-04-18 15:05:32 UTC) #3
sky
https://codereview.chromium.org/242693003/diff/20001/chrome/browser/bookmarks/bookmark_index.cc File chrome/browser/bookmarks/bookmark_index.cc (right): https://codereview.chromium.org/242693003/diff/20001/chrome/browser/bookmarks/bookmark_index.cc#newcode139 chrome/browser/bookmarks/bookmark_index.cc:139: client->GetTypedCountForNodes(nodes, node_typed_counts); If the intention is that some clients ...
6 years, 8 months ago (2014-04-18 17:05:04 UTC) #4
tfarina
Sylvain, how Client relates to Service? You also plan to add a Driver, no? If ...
6 years, 8 months ago (2014-04-18 19:35:08 UTC) #5
sdefresne
The plan is to have in the component (I'll see if I can remove BookmarkService): ...
6 years, 8 months ago (2014-04-18 22:25:48 UTC) #6
sdefresne
https://codereview.chromium.org/242693003/diff/40001/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/242693003/diff/40001/chrome/browser/sync/glue/bookmark_data_type_controller_unittest.cc#newcode60 chrome/browser/sync/glue/bookmark_data_type_controller_unittest.cc:60: bookmark_model->Load(profile->GetIOTaskRunner(), This won't compile. https://codereview.chromium.org/242693003/diff/40001/chrome/browser/sync/glue/bookmark_data_type_controller_unittest.cc#newcode185 chrome/browser/sync/glue/bookmark_data_type_controller_unittest.cc:185: bookmark_model_->Load(profile_.GetIOTaskRunner(), This won't ...
6 years, 8 months ago (2014-04-18 22:31:47 UTC) #7
sky
On 2014/04/18 22:25:48, sdefresne wrote: > The plan is to have in the component (I'll ...
6 years, 8 months ago (2014-04-21 15:22:40 UTC) #8
sky
https://codereview.chromium.org/242693003/diff/20001/chrome/browser/bookmarks/bookmark_index.cc File chrome/browser/bookmarks/bookmark_index.cc (right): https://codereview.chromium.org/242693003/diff/20001/chrome/browser/bookmarks/bookmark_index.cc#newcode139 chrome/browser/bookmarks/bookmark_index.cc:139: client->GetTypedCountForNodes(nodes, node_typed_counts); On 2014/04/18 22:25:49, sdefresne wrote: > On ...
6 years, 8 months ago (2014-04-21 15:24:19 UTC) #9
tfarina
https://codereview.chromium.org/242693003/diff/80001/chrome/browser/bookmarks/bookmark_model.h File chrome/browser/bookmarks/bookmark_model.h (right): https://codereview.chromium.org/242693003/diff/80001/chrome/browser/bookmarks/bookmark_model.h#newcode395 chrome/browser/bookmarks/bookmark_model.h:395: class ChromeBookmarkClient : public content::NotificationObserver, No, don't do that. ...
6 years, 8 months ago (2014-04-22 17:22:34 UTC) #10
sdefresne
Please have a look. https://codereview.chromium.org/242693003/diff/80001/chrome/browser/bookmarks/bookmark_model.h File chrome/browser/bookmarks/bookmark_model.h (right): https://codereview.chromium.org/242693003/diff/80001/chrome/browser/bookmarks/bookmark_model.h#newcode395 chrome/browser/bookmarks/bookmark_model.h:395: class ChromeBookmarkClient : public content::NotificationObserver, ...
6 years, 8 months ago (2014-04-22 20:25:48 UTC) #11
tfarina
More comments below. It would be good if it would be possible to do a ...
6 years, 8 months ago (2014-04-22 21:19:57 UTC) #12
tfarina
https://codereview.chromium.org/242693003/diff/130001/chrome/browser/ui/cocoa/bookmarks/bookmark_name_folder_controller.h File chrome/browser/ui/cocoa/bookmarks/bookmark_name_folder_controller.h (right): https://codereview.chromium.org/242693003/diff/130001/chrome/browser/ui/cocoa/bookmarks/bookmark_name_folder_controller.h#newcode12 chrome/browser/ui/cocoa/bookmarks/bookmark_name_folder_controller.h:12: #include "chrome/browser/bookmarks/bookmark_model.h" Can you remove this include?
6 years, 8 months ago (2014-04-22 21:23:44 UTC) #13
sdefresne
OK, I've addressed the comments, and rebased on top of the recent changes to BookmarkModel. ...
6 years, 8 months ago (2014-04-23 16:10:17 UTC) #14
sky
https://codereview.chromium.org/242693003/diff/190001/chrome/browser/bookmarks/bookmark_index.cc File chrome/browser/bookmarks/bookmark_index.cc (right): https://codereview.chromium.org/242693003/diff/190001/chrome/browser/bookmarks/bookmark_index.cc#newcode100 chrome/browser/bookmarks/bookmark_index.cc:100: : client_(client), languages_(languages), index_urls_(index_urls) { nit: one member per ...
6 years, 8 months ago (2014-04-23 20:32:07 UTC) #15
sdefresne
PTAL https://codereview.chromium.org/242693003/diff/190001/chrome/browser/bookmarks/bookmark_index.cc File chrome/browser/bookmarks/bookmark_index.cc (right): https://codereview.chromium.org/242693003/diff/190001/chrome/browser/bookmarks/bookmark_index.cc#newcode100 chrome/browser/bookmarks/bookmark_index.cc:100: : client_(client), languages_(languages), index_urls_(index_urls) { On 2014/04/23 20:32:07, ...
6 years, 8 months ago (2014-04-24 12:30:14 UTC) #16
sky
LGTM
6 years, 8 months ago (2014-04-24 16:22:27 UTC) #17
sdefresne
The CQ bit was checked by sdefresne@chromium.org
6 years, 8 months ago (2014-04-24 16:44:59 UTC) #18
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/sdefresne@chromium.org/242693003/210001
6 years, 8 months ago (2014-04-24 16:46:37 UTC) #19
commit-bot: I haz the power
The CQ bit was unchecked by commit-bot@chromium.org
6 years, 8 months ago (2014-04-24 21:07:22 UTC) #20
commit-bot: I haz the power
Try jobs failed on following builders: tryserver.chromium on win_chromium_rel
6 years, 8 months ago (2014-04-24 21:07:23 UTC) #21
sdefresne
The CQ bit was checked by sdefresne@chromium.org
6 years, 8 months ago (2014-04-25 10:57:16 UTC) #22
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/sdefresne@chromium.org/242693003/230001
6 years, 8 months ago (2014-04-25 12:52:05 UTC) #23
commit-bot: I haz the power
The CQ bit was unchecked by commit-bot@chromium.org
6 years, 8 months ago (2014-04-26 06:27:16 UTC) #24
tfarina
The CQ bit was checked by tfarina@chromium.org
6 years, 8 months ago (2014-04-26 13:44:00 UTC) #26
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/sdefresne@chromium.org/242693003/230001
6 years, 8 months ago (2014-04-26 13:44:36 UTC) #27
commit-bot: I haz the power
6 years, 8 months ago (2014-04-26 22:06:58 UTC) #28
Message was sent while issue was closed.
Change committed as 266376

Powered by Google App Engine
This is Rietveld 408576698