Rewrite Java histograms API implementation.

The previous version used System.identityHashCode() as a key to
cache histogram objects - but we've found that this is not safe
to do because there may be collisions.

Instead, this CL changes the code to do the caching on the Java
side, keeping pointers to the C++ Histogram objects in the cache.
This is safe to do because histogram objects are never freed, so the
pointers are guaranteed to stay valid.

BUG=535043

Review URL: https://codereview.chromium.org/1828293002

Cr-Commit-Position: refs/heads/master@{#385310}


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