|
|
Created:
3 years, 7 months ago by Primiano Tucci (use gerrit) Modified:
3 years, 7 months ago CC:
chromium-reviews, chrome-grc-reviews_chromium.org, asvitkine+watch_chromium.org Target Ref:
refs/heads/master Project:
chromium Visibility:
Public. |
Descriptionmemory instrumentation service: minor cleanups
Minor cleanups lefts from the previous CL in preparation
of larger upcoming refactoring.
BUG=703184
Review-Url: https://codereview.chromium.org/2891113003
Cr-Commit-Position: refs/heads/master@{#473436}
Committed: https://chromium.googlesource.com/chromium/src/+/4d1e2198851b4731e2c19fa6d36fcb0329f806fd
Patch Set 1 #Patch Set 2 : . #Patch Set 3 : . #Patch Set 4 : . #Patch Set 5 : . #Patch Set 6 : . #
Total comments: 7
Patch Set 7 : const& #Patch Set 8 : dskiba suggestion #Patch Set 9 : remove dcheck #
Dependent Patchsets: Messages
Total messages: 52 (33 generated)
The CQ bit was checked by primiano@chromium.org to run a CQ dry run
Description was changed from ========== memory instrumentation service: minor cleanups Minor cleanups lefts from the previous CL BUG=703184 ========== to ========== memory instrumentation service: minor cleanups Minor cleanups lefts from the previous CL in preparation of larger upcoming refactoring. BUG=703184 ==========
Dry run: CQ is trying da patch. Follow status at: https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.or...
The CQ bit was checked by primiano@chromium.org to run a CQ dry run
Dry run: CQ is trying da patch. Follow status at: https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.or...
The CQ bit was checked by primiano@chromium.org to run a CQ dry run
Dry run: CQ is trying da patch. Follow status at: https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.or...
The CQ bit was checked by primiano@chromium.org to run a CQ dry run
Dry run: CQ is trying da patch. Follow status at: https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.or...
The CQ bit was checked by primiano@chromium.org to run a CQ dry run
Dry run: CQ is trying da patch. Follow status at: https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.or...
The CQ bit was checked by primiano@chromium.org to run a CQ dry run
Dry run: CQ is trying da patch. Follow status at: https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.or...
primiano@chromium.org changed reviewers: + erikchen@chromium.org, fmeawad@chromium.org
lgtm
dskiba@chromium.org changed reviewers: + dskiba@chromium.org
https://codereview.chromium.org/2891113003/diff/100001/services/resource_coor... File services/resource_coordinator/memory/coordinator/coordinator_impl.h (right): https://codereview.chromium.org/2891113003/diff/100001/services/resource_coor... services/resource_coordinator/memory/coordinator/coordinator_impl.h:104: std::map<mojom::ProcessLocalDumpManager*, std::unique_ptr<ClientInfo>> What is the reason for not storing ClientInfo by value?
https://codereview.chromium.org/2891113003/diff/100001/services/resource_coor... File services/resource_coordinator/memory/coordinator/coordinator_impl.h (right): https://codereview.chromium.org/2891113003/diff/100001/services/resource_coor... services/resource_coordinator/memory/coordinator/coordinator_impl.h:104: std::map<mojom::ProcessLocalDumpManager*, std::unique_ptr<ClientInfo>> On 2017/05/19 00:40:21, DmitrySkiba wrote: > What is the reason for not storing ClientInfo by value? because: 1) the ProcessLocalDumpManagerPtr is non copiable (is like a a unique-ptr) 2) I could make ClientInfo move-only, but that would imply: - more code, less readability - the deep string move of all the strings in the Identity struct. (and no, given our fragmented story of c++ libs std::move(std::string) doesn't the right thing on all platforms)
https://codereview.chromium.org/2891113003/diff/100001/services/resource_coor... File services/resource_coordinator/memory/coordinator/coordinator_impl.cc (right): https://codereview.chromium.org/2891113003/diff/100001/services/resource_coor... services/resource_coordinator/memory/coordinator/coordinator_impl.cc:155: size_t num_deleted = clients_.erase(process_manager); As I understand, this deletes process_manager, so all code below works with a dead pointer (including dead pointer in pending_clients_for_current_dump_). It might be a good idea to move this line to the end, just to protect from future surprises. https://codereview.chromium.org/2891113003/diff/100001/services/resource_coor... File services/resource_coordinator/memory/coordinator/coordinator_impl.h (right): https://codereview.chromium.org/2891113003/diff/100001/services/resource_coor... services/resource_coordinator/memory/coordinator/coordinator_impl.h:104: std::map<mojom::ProcessLocalDumpManager*, std::unique_ptr<ClientInfo>> On 2017/05/19 00:54:05, Primiano (slow - traveling) wrote: > On 2017/05/19 00:40:21, DmitrySkiba wrote: > > What is the reason for not storing ClientInfo by value? > > because: > 1) the ProcessLocalDumpManagerPtr is non copiable (is like a a unique-ptr) > 2) I could make ClientInfo move-only, but that would imply: > - more code, less readability > - the deep string move of all the strings in the Identity struct. (and no, > given our fragmented story of c++ libs std::move(std::string) doesn't the right > thing on all platforms) I see your point (although ClientInfo(ClientInfo&&) = default doesn't seems like a lot of code). But I'm curious about the last part - on which platform std::string doesn't do the right thing when moved?
The CQ bit was unchecked by commit-bot@chromium.org
Dry run: Try jobs failed on following builders: linux_chromium_rel_ng on master.tryserver.chromium.linux (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.linux/builders/linux_chromium_...)
lgtm https://codereview.chromium.org/2891113003/diff/100001/services/resource_coor... File services/resource_coordinator/memory/coordinator/coordinator_impl.h (right): https://codereview.chromium.org/2891113003/diff/100001/services/resource_coor... services/resource_coordinator/memory/coordinator/coordinator_impl.h:70: QueuedMemoryDumpRequest(const base::trace_event::MemoryDumpRequestArgs args, should these be passed by const&?
On 2017/05/19 01:19:50, DmitrySkiba wrote: > https://codereview.chromium.org/2891113003/diff/100001/services/resource_coor... > File services/resource_coordinator/memory/coordinator/coordinator_impl.cc > (right): > > https://codereview.chromium.org/2891113003/diff/100001/services/resource_coor... > services/resource_coordinator/memory/coordinator/coordinator_impl.cc:155: size_t > num_deleted = clients_.erase(process_manager); > As I understand, this deletes process_manager, so all code below works with a > dead pointer (including dead pointer in pending_clients_for_current_dump_). It > might be a good idea to move this line to the end, just to protect from future > surprises. > > https://codereview.chromium.org/2891113003/diff/100001/services/resource_coor... > File services/resource_coordinator/memory/coordinator/coordinator_impl.h > (right): > > https://codereview.chromium.org/2891113003/diff/100001/services/resource_coor... > services/resource_coordinator/memory/coordinator/coordinator_impl.h:104: > std::map<mojom::ProcessLocalDumpManager*, std::unique_ptr<ClientInfo>> > On 2017/05/19 00:54:05, Primiano (slow - traveling) wrote: > > On 2017/05/19 00:40:21, DmitrySkiba wrote: > > > What is the reason for not storing ClientInfo by value? > > > > because: > > 1) the ProcessLocalDumpManagerPtr is non copiable (is like a a unique-ptr) > > 2) I could make ClientInfo move-only, but that would imply: > > - more code, less readability > > - the deep string move of all the strings in the Identity struct. (and no, > > given our fragmented story of c++ libs std::move(std::string) doesn't the > right > > thing on all platforms) > > I see your point (although ClientInfo(ClientInfo&&) = default doesn't seems like > a lot of code). But I'm curious about the last part - on which platform > std::string doesn't do the right thing when moved? whichever uses inline storage for short strings (don't remember if that was libcxx or sdlibc++)
https://codereview.chromium.org/2891113003/diff/100001/services/resource_coor... File services/resource_coordinator/memory/coordinator/coordinator_impl.h (right): https://codereview.chromium.org/2891113003/diff/100001/services/resource_coor... services/resource_coordinator/memory/coordinator/coordinator_impl.h:70: QueuedMemoryDumpRequest(const base::trace_event::MemoryDumpRequestArgs args, On 2017/05/19 16:21:37, erikchen wrote: > should these be passed by const&? aha, well spotted. Done.
The CQ bit was checked by primiano@chromium.org
The patchset sent to the CQ was uploaded after l-g-t-m from erikchen@chromium.org, fmeawad@chromium.org Link to the patchset: https://codereview.chromium.org/2891113003/#ps120001 (title: "const&")
CQ is trying da patch. Follow status at: https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.or...
The CQ bit was unchecked by dskiba@chromium.org
https://codereview.chromium.org/2891113003/diff/100001/services/resource_coor... File services/resource_coordinator/memory/coordinator/coordinator_impl.cc (right): https://codereview.chromium.org/2891113003/diff/100001/services/resource_coor... services/resource_coordinator/memory/coordinator/coordinator_impl.cc:155: size_t num_deleted = clients_.erase(process_manager); On 2017/05/19 01:19:50, DmitrySkiba wrote: > As I understand, this deletes process_manager, so all code below works with a > dead pointer (including dead pointer in pending_clients_for_current_dump_). It > might be a good idea to move this line to the end, just to protect from future > surprises. sorry, missed this comment. makes perfect sense. done.
The CQ bit was checked by primiano@chromium.org
The patchset sent to the CQ was uploaded after l-g-t-m from erikchen@chromium.org, fmeawad@chromium.org Link to the patchset: https://codereview.chromium.org/2891113003/#ps140001 (title: "dskiba suggestion")
CQ is trying da patch. Follow status at: https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.or...
The CQ bit was unchecked by commit-bot@chromium.org
Try jobs failed on following builders: linux_chromium_asan_rel_ng on master.tryserver.chromium.linux (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.linux/builders/linux_chromium_...)
The CQ bit was checked by primiano@chromium.org
CQ is trying da patch. Follow status at: https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.or...
The CQ bit was unchecked by commit-bot@chromium.org
Try jobs failed on following builders: linux_chromium_asan_rel_ng on master.tryserver.chromium.linux (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.linux/builders/linux_chromium_...)
The CQ bit was checked by primiano@chromium.org
The CQ bit was unchecked by primiano@chromium.org
CQ is trying da patch. Follow status at: https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.or...
The CQ bit was checked by primiano@chromium.org
The patchset sent to the CQ was uploaded after l-g-t-m from erikchen@chromium.org, fmeawad@chromium.org Link to the patchset: https://codereview.chromium.org/2891113003/#ps160001 (title: "remove dcheck")
CQ is trying da patch. Follow status at: https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.or...
The CQ bit was unchecked by commit-bot@chromium.org
Try jobs failed on following builders: linux_android_rel_ng on master.tryserver.chromium.android (JOB_FAILED, https://build.chromium.org/p/tryserver.chromium.android/builders/linux_androi...)
The CQ bit was checked by primiano@chromium.org
CQ is trying da patch. Follow status at: https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.or...
CQ is committing da patch. Bot data: {"patchset_id": 160001, "attempt_start_ts": 1495287324255930, "parent_rev": "5553b9f830b3f917d2500762a9455cb1f28dd0b1", "commit_rev": "4d1e2198851b4731e2c19fa6d36fcb0329f806fd"}
Message was sent while issue was closed.
Description was changed from ========== memory instrumentation service: minor cleanups Minor cleanups lefts from the previous CL in preparation of larger upcoming refactoring. BUG=703184 ========== to ========== memory instrumentation service: minor cleanups Minor cleanups lefts from the previous CL in preparation of larger upcoming refactoring. BUG=703184 Review-Url: https://codereview.chromium.org/2891113003 Cr-Commit-Position: refs/heads/master@{#473436} Committed: https://chromium.googlesource.com/chromium/src/+/4d1e2198851b4731e2c19fa6d36f... ==========
Message was sent while issue was closed.
Committed patchset #9 (id:160001) as https://chromium.googlesource.com/chromium/src/+/4d1e2198851b4731e2c19fa6d36f... |