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

Issue 2340813003: Switch base::IDMap to use unique_ptr. (Closed)

Created:
4 years, 3 months ago by aelias_OOO_until_Jul13
Modified:
4 years, 3 months ago
Reviewers:
danakj, michaeln
CC:
blink-worker-reviews_chromium.org, chromium-reviews, darin-cc_chromium.org, horo+watch_chromium.org, jam, jsbell+serviceworker_chromium.org, kinuko+watch, kinuko+serviceworker, mdjones, michaeln, nhiroki, serviceworker-reviews, shimazu+serviceworker_chromium.org, tzik
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

Switch base::IDMap to use unique_ptr. This old base class is a thin wrapper around STL hashmap, providing A) less easily invalidated iterators and B) a unique_ptr equivalent. At this point there is nothing stopping this from *actually* using unique_ptr, so I switch it over to using that in its IDMapOwnPointer mode. I made one semantic change, to Replace(), which used to "leak" the return pointer. I changed it to instead directly return a unique_ptr when in that mode, and also to not support replacing an invalid ID. Both of those changes suit the only user of Replace (in ServiceWorkerContextCore). BUG=647091 Committed: https://crrev.com/aed214d0ef7a3da3efa968dd6646e126efe91963 Cr-Commit-Position: refs/heads/master@{#420809}

Patch Set 1 #

Total comments: 9

Patch Set 2 : Switch to 'using' #

Patch Set 3 : unique_ptr<> versions of Add/AddWithId #

Unified diffs Side-by-side diffs Delta from patch set Stats (+71 lines, -72 lines) Patch
M base/id_map.h View 1 2 8 chunks +49 lines, -50 lines 0 comments Download
M content/browser/service_worker/service_worker_context_core.cc View 1 2 3 chunks +16 lines, -16 lines 0 comments Download
M content/browser/service_worker/service_worker_dispatcher_host.cc View 1 2 1 chunk +2 lines, -2 lines 0 comments Download
M content/browser/service_worker/service_worker_version.cc View 1 2 1 chunk +4 lines, -4 lines 0 comments Download

Messages

Total messages: 34 (22 generated)
aelias_OOO_until_Jul13
Hi, danakj@ for base/ and michaeln@ for service_worker/. I ran into this last week and ...
4 years, 3 months ago (2016-09-15 02:03:25 UTC) #6
danakj
https://codereview.chromium.org/2340813003/diff/1/base/id_map.h File base/id_map.h (right): https://codereview.chromium.org/2340813003/diff/1/base/id_map.h#newcode46 base/id_map.h:46: typedef typename std::conditional<OS == IDMapExternalPointer, can you change these ...
4 years, 3 months ago (2016-09-15 20:08:40 UTC) #7
aelias_OOO_until_Jul13
https://codereview.chromium.org/2340813003/diff/1/base/id_map.h File base/id_map.h (right): https://codereview.chromium.org/2340813003/diff/1/base/id_map.h#newcode46 base/id_map.h:46: typedef typename std::conditional<OS == IDMapExternalPointer, On 2016/09/15 at 20:08:40, ...
4 years, 3 months ago (2016-09-15 21:09:36 UTC) #10
danakj
LGTM https://codereview.chromium.org/2340813003/diff/1/base/id_map.h File base/id_map.h (right): https://codereview.chromium.org/2340813003/diff/1/base/id_map.h#newcode72 base/id_map.h:72: KeyType Add(T* data) { On 2016/09/15 21:09:35, aelias ...
4 years, 3 months ago (2016-09-16 00:30:28 UTC) #13
aelias_OOO_until_Jul13
All done, I just need service_worker/ OWNERS review from michaeln@ to land. https://codereview.chromium.org/2340813003/diff/1/base/id_map.h File base/id_map.h ...
4 years, 3 months ago (2016-09-16 01:39:19 UTC) #16
aelias_OOO_until_Jul13
Ping michaeln@ for OWNERS for no-op changes in components/service_worker/.
4 years, 3 months ago (2016-09-21 18:39:46 UTC) #23
michaeln
lgtm
4 years, 3 months ago (2016-09-23 21:11:18 UTC) #24
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/2340813003/40001
4 years, 3 months ago (2016-09-23 21:39:48 UTC) #27
commit-bot: I haz the power
Try jobs failed on following builders: win_chromium_x64_rel_ng on master.tryserver.chromium.win (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.win/builders/win_chromium_x64_rel_ng/builds/285442)
4 years, 3 months ago (2016-09-23 23:30:57 UTC) #29
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/2340813003/40001
4 years, 3 months ago (2016-09-23 23:37:20 UTC) #31
commit-bot: I haz the power
Committed patchset #3 (id:40001)
4 years, 3 months ago (2016-09-24 01:27:02 UTC) #32
commit-bot: I haz the power
4 years, 3 months ago (2016-09-24 01:30:38 UTC) #34
Message was sent while issue was closed.
Patchset 3 (id:??) landed as
https://crrev.com/aed214d0ef7a3da3efa968dd6646e126efe91963
Cr-Commit-Position: refs/heads/master@{#420809}

Powered by Google App Engine
This is Rietveld 408576698