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

Issue 1958163002: [NTP Snippets] Refactor home-grown container API (Closed)

Created:
4 years, 7 months ago by mastiz
Modified:
4 years, 7 months ago
CC:
chromium-reviews, mcwilliams+watch_chromium.org, dgn+watch_chromium.org
Base URL:
https://chromium.googlesource.com/chromium/src.git@master
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

[NTP Snippets] Refactor home-grown container API The service was originally a much simpler class but it nowadays doesn't make sense to expose home-grown begin/end/size signatures. The only downside is that constness is lost for exposed snippets due to std::unique_ptr exposing non-const raw pointers. The alternative is std::reference_wrapper which is not yet allowed by the style guide, but the issue is not important enough to maintain inner_iterator.h. BUG=584428 Committed: https://crrev.com/8c7889b1c478cbe766a57cd14845ba0bbd16a936 Cr-Commit-Position: refs/heads/master@{#392631}

Patch Set 1 #

Patch Set 2 : Removed broken test. #

Total comments: 2

Patch Set 3 : Used front() instead of begin(). #

Patch Set 4 : Moved getters up as suggested. #

Patch Set 5 : Updated client code. #

Total comments: 4

Patch Set 6 : Avoided auto as suggested. #

Unified diffs Side-by-side diffs Delta from patch set Stats (+97 lines, -308 lines) Patch
M chrome/browser/android/ntp/ntp_snippets_bridge.cc View 1 2 3 4 5 1 chunk +9 lines, -8 lines 0 comments Download
M chrome/browser/ui/webui/snippets_internals_message_handler.cc View 1 2 3 4 5 2 chunks +4 lines, -3 lines 0 comments Download
M components/components_tests.gyp View 1 chunk +0 lines, -1 line 0 comments Download
M components/ntp_snippets.gypi View 1 chunk +0 lines, -1 line 0 comments Download
M components/ntp_snippets/BUILD.gn View 2 chunks +0 lines, -2 lines 0 comments Download
D components/ntp_snippets/inner_iterator.h View 1 chunk +0 lines, -96 lines 0 comments Download
D components/ntp_snippets/inner_iterator_unittest.cc View 1 chunk +0 lines, -73 lines 0 comments Download
M components/ntp_snippets/ntp_snippets_service.h View 1 2 3 5 chunks +9 lines, -22 lines 0 comments Download
M components/ntp_snippets/ntp_snippets_service_unittest.cc View 1 2 18 chunks +75 lines, -102 lines 0 comments Download

Messages

Total messages: 19 (8 generated)
mastiz
4 years, 7 months ago (2016-05-09 15:36:55 UTC) #2
Marc Treib
LGTM with one semi-related optional nit below. My second comment (front instead of begin) you ...
4 years, 7 months ago (2016-05-10 07:28:50 UTC) #3
mastiz
https://codereview.chromium.org/1958163002/diff/20001/components/ntp_snippets/ntp_snippets_service.h File components/ntp_snippets/ntp_snippets_service.h (right): https://codereview.chromium.org/1958163002/diff/20001/components/ntp_snippets/ntp_snippets_service.h#newcode123 components/ntp_snippets/ntp_snippets_service.h:123: const NTPSnippetStorage& snippets() const { return snippets_; } On ...
4 years, 7 months ago (2016-05-10 07:35:16 UTC) #4
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1958163002/60001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1958163002/60001
4 years, 7 months ago (2016-05-10 07:36:10 UTC) #7
commit-bot: I haz the power
Try jobs failed on following builders: android_chromium_gn_compile_rel on tryserver.chromium.android (JOB_FAILED, https://build.chromium.org/p/tryserver.chromium.android/builders/android_chromium_gn_compile_rel/builds/63704)
4 years, 7 months ago (2016-05-10 07:51:01 UTC) #9
mastiz
bauerb@chromium.org: Please review changes in chrome/browser/ui/webui/snippets_internals_message_handler.cc
4 years, 7 months ago (2016-05-10 08:24:09 UTC) #11
Bernhard Bauer
lgtm https://codereview.chromium.org/1958163002/diff/80001/chrome/browser/android/ntp/ntp_snippets_bridge.cc File chrome/browser/android/ntp/ntp_snippets_bridge.cc (right): https://codereview.chromium.org/1958163002/diff/80001/chrome/browser/android/ntp/ntp_snippets_bridge.cc#newcode140 chrome/browser/android/ntp/ntp_snippets_bridge.cc:140: for (const auto& snippet : ntp_snippets_service_->snippets()) { Could ...
4 years, 7 months ago (2016-05-10 14:48:56 UTC) #12
mastiz
https://codereview.chromium.org/1958163002/diff/80001/chrome/browser/android/ntp/ntp_snippets_bridge.cc File chrome/browser/android/ntp/ntp_snippets_bridge.cc (right): https://codereview.chromium.org/1958163002/diff/80001/chrome/browser/android/ntp/ntp_snippets_bridge.cc#newcode140 chrome/browser/android/ntp/ntp_snippets_bridge.cc:140: for (const auto& snippet : ntp_snippets_service_->snippets()) { On 2016/05/10 ...
4 years, 7 months ago (2016-05-10 15:59:52 UTC) #13
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1958163002/100001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1958163002/100001
4 years, 7 months ago (2016-05-10 16:00:15 UTC) #16
commit-bot: I haz the power
Committed patchset #6 (id:100001)
4 years, 7 months ago (2016-05-10 17:08:33 UTC) #17
commit-bot: I haz the power
4 years, 7 months ago (2016-05-10 17:09:55 UTC) #19
Message was sent while issue was closed.
Patchset 6 (id:??) landed as
https://crrev.com/8c7889b1c478cbe766a57cd14845ba0bbd16a936
Cr-Commit-Position: refs/heads/master@{#392631}

Powered by Google App Engine
This is Rietveld 408576698