memory-infra: ensure that shared -> global edges have highest importance

For shared memory, we have 2 edges. First, from the user of the shared
memory to a shared memory dump within the same process. Next, we create
an edge from the shared memory dump to a global memory dump.

Up till this point, if two users of shared memory within the same
process both add edges, the importance of the user which added the edge
second would end up setting the importance of the shared -> global edge.
E.g. if user 1 has importance 2 and user 2 has importance 1 and user 1
creates the edge first, the shared -> global edge would have importance
1 rather than the correct importance of 2.

Amend this behaviour by only updating importance of an edge in this
situation if the importance is truly higher than the existing
importance.

Bug: TODO
Change-Id: Id958c5f647a3ee5816d9eea2dc8a7f6202a54fc2
Reviewed-on: https://chromium-review.googlesource.com/749384
Commit-Queue: Lalit Maganti <lalitm@chromium.org>
Reviewed-by: Primiano Tucci <primiano@chromium.org>
Reviewed-by: Siddhartha S <ssid@chromium.org>
Cr-Commit-Position: refs/heads/master@{#514114}

CrOS-Libchrome-Original-Commit: 4abf070769524d3724daa8d467710f8df24202fe
3 files changed
tree: 206b2430fb55acc57bc2875840706eb5f4dadb2b
  1. base/
  2. build/
  3. components/
  4. dbus/
  5. device/
  6. ipc/
  7. mojo/
  8. testing/
  9. third_party/
  10. ui/