Deduplicate copied code in Android memory usage accounting

A big helper function was present both in newly added code and
in older code and that prevented jumbo compilation of
blink's controller (not yet enabled on master). This CL
deduplicates the code, and to not add the helper function
to to public API, makes it a private static member, with a
friend declaration that allows the other class to use it.

Bug: 920922
Change-Id: Ib24a2d9438a3e73c3f11276bb703516f67e75c23
Reviewed-on: https://chromium-review.googlesource.com/c/1433248
Reviewed-by: Daniel Cheng <dcheng@chromium.org>
Reviewed-by: Kentaro Hara <haraken@chromium.org>
Reviewed-by: Keishi Hattori <keishi@chromium.org>
Commit-Queue: Daniel Bratell <bratell@opera.com>
Cr-Commit-Position: refs/heads/master@{#626025}
4 files changed