Use a more compact HSTS representation.

The current, preloaded HSTS table is nearly 80KB now. We match it linearly so
we trash the D1 cache with it for every lookup. Additionally, we have to do
multiple passes through it, removing a label from the target each time.

This changes the HSTS information to be a trie. The trie only consumes about
10KB and only a single lookup is needed for a given hostname since the
organisation of the trie means that all matches (from least to most specific)
for a given hostname will be found with a single walk.

BUG=none
R=palmer@chromium.org

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

Cr-Commit-Position: refs/heads/master@{#298580}
3 files changed