Reland: Refactor and shorten in-memory cache.

Previously this code was maintaining a complex doubly-linked list
manually, rather than using base::linked_list, which does the same thing.

A number of uses of vector were strictly speaking violating the C++98
specification, also fixed.

Too many functions were short redirectors into other functions. Now fixed.

The originally landed version contained a significant double free bug
which caused reversion, now fixed.

R=mmenke
BUG=581791,586440

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

Cr-Commit-Position: refs/heads/master@{#377124}
9 files changed