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

Issue 2262423002: Use a vector of smart pointers for callback return type. (Closed)

Created:
4 years, 4 months ago by Pete Williamson
Modified:
4 years, 3 months ago
CC:
chromium-reviews, romax+watch_chromium.org, fgorski+watch_chromium.org, dewittj+watch_chromium.org, petewil+watch_chromium.org, chili+watch_chromium.org, dimich+watch_chromium.org
Base URL:
https://chromium.googlesource.com/chromium/src.git@master
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

Use a vector of smart pointers for callback return type. We can't use references to large objects with std::move, so change the code to use the vector of pointers itself instead of a reference to a vector of pointers. BUG=637077 Committed: https://crrev.com/2f65c71a4b658c5555806222dda7fd3a1e39c31c Cr-Commit-Position: refs/heads/master@{#417462}

Patch Set 1 #

Patch Set 2 : Merge with tip of tree #

Patch Set 3 : Logical merge fixes #

Patch Set 4 : Fix build problems #

Patch Set 5 : Logical merge fixes #

Total comments: 4

Patch Set 6 : CR fixes per Dimich #

Patch Set 7 : Merge fixup #

Patch Set 8 : More compile fixes #

Total comments: 2

Patch Set 9 : still more merging #

Patch Set 10 : another merge. #

Total comments: 6

Patch Set 11 : for -> for_each #

Patch Set 12 : CR feedback per BauerB #

Total comments: 15

Patch Set 13 : More CR feedback per BauerB #

Patch Set 14 : Fix compile and test #

Patch Set 15 : Merge #

Total comments: 5
Unified diffs Side-by-side diffs Delta from patch set Stats (+248 lines, -211 lines) Patch
M chrome/browser/android/offline_pages/downloads/offline_page_download_bridge.cc View 1 2 3 4 5 6 7 3 chunks +23 lines, -18 lines 0 comments Download
M chrome/browser/android/offline_pages/offline_page_bridge.cc View 1 2 3 4 5 6 7 8 9 10 3 chunks +6 lines, -5 lines 0 comments Download
M chrome/browser/ui/webui/offline/offline_internals_ui_message_handler.h View 1 2 3 1 chunk +1 line, -1 line 0 comments Download
M chrome/browser/ui/webui/offline/offline_internals_ui_message_handler.cc View 1 2 3 4 5 6 7 8 1 chunk +7 lines, -6 lines 0 comments Download
M components/offline_pages/background/request_coordinator.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 3 chunks +10 lines, -11 lines 0 comments Download
M components/offline_pages/background/request_coordinator.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 4 chunks +16 lines, -16 lines 0 comments Download
M components/offline_pages/background/request_coordinator_unittest.cc View 1 2 3 4 5 6 7 8 9 10 9 chunks +18 lines, -17 lines 0 comments Download
M components/offline_pages/background/request_picker.h View 1 2 3 4 5 6 7 8 9 10 11 2 chunks +11 lines, -8 lines 0 comments Download
M components/offline_pages/background/request_picker.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 7 chunks +32 lines, -30 lines 5 comments Download
M components/offline_pages/background/request_queue.h View 1 2 3 4 3 chunks +8 lines, -6 lines 0 comments Download
M components/offline_pages/background/request_queue.cc View 5 chunks +9 lines, -9 lines 0 comments Download
M components/offline_pages/background/request_queue_in_memory_store.cc View 7 chunks +20 lines, -11 lines 0 comments Download
M components/offline_pages/background/request_queue_store.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 1 chunk +3 lines, -3 lines 0 comments Download
M components/offline_pages/background/request_queue_store_sql.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 12 chunks +50 lines, -36 lines 0 comments Download
M components/offline_pages/background/request_queue_store_unittest.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 chunks +19 lines, -19 lines 0 comments Download
M components/offline_pages/background/request_queue_unittest.cc View 8 chunks +15 lines, -15 lines 0 comments Download

Messages

Total messages: 82 (55 generated)
Pete Williamson
As you requested, making sure we only make a single copy of each SavePageRequest as ...
4 years, 4 months ago (2016-08-22 22:19:51 UTC) #2
Dmitry Titov
Nice. I think it improves readability as well and std::unique_ptr is very explicit. https://codereview.chromium.org/2262423002/diff/80001/components/offline_pages/background/request_coordinator.cc File ...
4 years, 3 months ago (2016-08-26 23:39:20 UTC) #14
Pete Williamson
https://codereview.chromium.org/2262423002/diff/80001/components/offline_pages/background/request_coordinator.cc File components/offline_pages/background/request_coordinator.cc (right): https://codereview.chromium.org/2262423002/diff/80001/components/offline_pages/background/request_coordinator.cc#newcode211 components/offline_pages/background/request_coordinator.cc:211: std::vector<std::unique_ptr<SavePageRequest>>::iterator request; On 2016/08/26 23:39:20, Dmitry Titov wrote: > ...
4 years, 3 months ago (2016-08-27 00:11:59 UTC) #17
Dmitry Titov
lgtm
4 years, 3 months ago (2016-08-31 01:07:54 UTC) #30
Pete Williamson
dpapad: PTAL at offline_internals_ui_message_handler.cc/h Thanks! Base idea of this change is to mininmize copying structs ...
4 years, 3 months ago (2016-08-31 01:11:51 UTC) #32
fgorski
drive by for style. https://codereview.chromium.org/2262423002/diff/140001/components/offline_pages/background/request_queue_store_sql.cc File components/offline_pages/background/request_queue_store_sql.cc (right): https://codereview.chromium.org/2262423002/diff/140001/components/offline_pages/background/request_queue_store_sql.cc#newcode413 components/offline_pages/background/request_queue_store_sql.cc:413: base::Passed(std::vector<std::unique_ptr<SavePageRequest>>())))) nit: because some of ...
4 years, 3 months ago (2016-08-31 23:27:23 UTC) #38
Pete Williamson
https://codereview.chromium.org/2262423002/diff/140001/components/offline_pages/background/request_queue_store_sql.cc File components/offline_pages/background/request_queue_store_sql.cc (right): https://codereview.chromium.org/2262423002/diff/140001/components/offline_pages/background/request_queue_store_sql.cc#newcode413 components/offline_pages/background/request_queue_store_sql.cc:413: base::Passed(std::vector<std::unique_ptr<SavePageRequest>>())))) On 2016/08/31 23:27:23, fgorski wrote: > nit: because ...
4 years, 3 months ago (2016-09-06 22:01:55 UTC) #39
Pete Williamson
Adding bauerb (perhaps dpapad is out of office, bauerb seems to be returning). BauerB: Please ...
4 years, 3 months ago (2016-09-07 01:02:36 UTC) #47
Bernhard Bauer
Hm, in principle should be able to move vectors of objects as well, no? https://codereview.chromium.org/2262423002/diff/180001/components/offline_pages/background/request_coordinator.cc ...
4 years, 3 months ago (2016-09-07 10:13:41 UTC) #51
Dmitry Titov
On 2016/09/07 10:13:41, Bernhard Bauer wrote: > Hm, in principle should be able to move ...
4 years, 3 months ago (2016-09-07 16:18:00 UTC) #52
Pete Williamson
Thanks for the review! Answers below. https://codereview.chromium.org/2262423002/diff/180001/components/offline_pages/background/request_coordinator.cc File components/offline_pages/background/request_coordinator.cc (right): https://codereview.chromium.org/2262423002/diff/180001/components/offline_pages/background/request_coordinator.cc#newcode325 components/offline_pages/background/request_coordinator.cc:325: for (request = ...
4 years, 3 months ago (2016-09-07 20:21:01 UTC) #53
Pete Williamson
-dpapad
4 years, 3 months ago (2016-09-07 20:21:28 UTC) #55
Bernhard Bauer
On 2016/09/07 16:18:00, Dmitry Titov wrote: > On 2016/09/07 10:13:41, Bernhard Bauer wrote: > > ...
4 years, 3 months ago (2016-09-07 21:43:53 UTC) #60
Pete Williamson
https://codereview.chromium.org/2262423002/diff/180001/components/offline_pages/background/request_picker.h File components/offline_pages/background/request_picker.h (right): https://codereview.chromium.org/2262423002/diff/180001/components/offline_pages/background/request_picker.h#newcode74 components/offline_pages/background/request_picker.h:74: std::vector<std::unique_ptr<SavePageRequest>>& requests, On 2016/09/07 21:43:52, Bernhard Bauer wrote: > ...
4 years, 3 months ago (2016-09-07 22:37:07 UTC) #61
Bernhard Bauer
https://codereview.chromium.org/2262423002/diff/220001/components/offline_pages/background/request_coordinator.cc File components/offline_pages/background/request_coordinator.cc (right): https://codereview.chromium.org/2262423002/diff/220001/components/offline_pages/background/request_coordinator.cc#newcode325 components/offline_pages/background/request_coordinator.cc:325: for (const auto & request : requests) No space ...
4 years, 3 months ago (2016-09-08 09:01:58 UTC) #62
Pete Williamson
https://codereview.chromium.org/2262423002/diff/220001/components/offline_pages/background/request_coordinator.cc File components/offline_pages/background/request_coordinator.cc (right): https://codereview.chromium.org/2262423002/diff/220001/components/offline_pages/background/request_coordinator.cc#newcode325 components/offline_pages/background/request_coordinator.cc:325: for (const auto & request : requests) On 2016/09/08 ...
4 years, 3 months ago (2016-09-08 17:27:00 UTC) #63
Pete Williamson
Oops, this is not quite ready yet - I tested the wrong compile, have to ...
4 years, 3 months ago (2016-09-08 18:02:26 UTC) #64
Pete Williamson
OK, fixed now, OK to review.
4 years, 3 months ago (2016-09-08 18:32:16 UTC) #65
Bernhard Bauer
LGTM! https://codereview.chromium.org/2262423002/diff/220001/components/offline_pages/background/request_queue_store_sql.cc File components/offline_pages/background/request_queue_store_sql.cc (right): https://codereview.chromium.org/2262423002/diff/220001/components/offline_pages/background/request_queue_store_sql.cc#newcode186 components/offline_pages/background/request_queue_store_sql.cc:186: std::vector<std::unique_ptr<SavePageRequest>>& requests) { On 2016/09/08 17:27:00, Pete Williamson ...
4 years, 3 months ago (2016-09-08 19:14:57 UTC) #66
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.org/2262423002/260001
4 years, 3 months ago (2016-09-08 20:38:33 UTC) #69
commit-bot: I haz the power
Try jobs failed on following builders: mac_chromium_compile_dbg_ng on master.tryserver.chromium.mac (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.mac/builders/mac_chromium_compile_dbg_ng/builds/265511) mac_chromium_rel_ng on master.tryserver.chromium.mac (JOB_FAILED, ...
4 years, 3 months ago (2016-09-08 20:41:21 UTC) #71
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.org/2262423002/280001
4 years, 3 months ago (2016-09-08 23:42:56 UTC) #74
commit-bot: I haz the power
Committed patchset #15 (id:280001)
4 years, 3 months ago (2016-09-09 00:50:45 UTC) #76
commit-bot: I haz the power
Patchset 15 (id:??) landed as https://crrev.com/2f65c71a4b658c5555806222dda7fd3a1e39c31c Cr-Commit-Position: refs/heads/master@{#417462}
4 years, 3 months ago (2016-09-09 00:53:31 UTC) #78
brucedawson
https://codereview.chromium.org/2262423002/diff/280001/components/offline_pages/background/request_picker.cc File components/offline_pages/background/request_picker.cc (right): https://codereview.chromium.org/2262423002/diff/280001/components/offline_pages/background/request_picker.cc#newcode243 components/offline_pages/background/request_picker.cc:243: std::vector<std::unique_ptr<SavePageRequest>>::iterator request; This local variable is not used and ...
4 years, 3 months ago (2016-09-12 17:20:06 UTC) #80
Pete Williamson
https://codereview.chromium.org/2262423002/diff/280001/components/offline_pages/background/request_picker.cc File components/offline_pages/background/request_picker.cc (right): https://codereview.chromium.org/2262423002/diff/280001/components/offline_pages/background/request_picker.cc#newcode243 components/offline_pages/background/request_picker.cc:243: std::vector<std::unique_ptr<SavePageRequest>>::iterator request; On 2016/09/12 17:20:04, brucedawson wrote: > This ...
4 years, 3 months ago (2016-09-12 20:25:57 UTC) #81
brucedawson
4 years, 3 months ago (2016-09-12 20:48:40 UTC) #82
Message was sent while issue was closed.
https://codereview.chromium.org/2262423002/diff/280001/components/offline_pag...
File components/offline_pages/background/request_picker.cc (right):

https://codereview.chromium.org/2262423002/diff/280001/components/offline_pag...
components/offline_pages/background/request_picker.cc:260: for (request =
requests.begin(); request != requests.end(); ++request)
On 2016/09/12 20:25:57, Pete Williamson wrote:
> On 2016/09/12 17:20:06, brucedawson wrote:
> > I'm confused as to why this was changed to an explicit for loop - the
> > inconsistency with the previous function seems odd, and I'm failing to see
the
> > reason. What am I missing?
> 
> Due to CR feedback, I changed some places to use the for_each style, but
forgot
> to check the file for all other uses.  Fixed in
> https://codereview.chromium.org/2332923003.

Although, this one *started out* using for-each style, so that's curious. But,
no matter.

Powered by Google App Engine
This is Rietveld 408576698