Restrict persistent client hints to first party origins

With this CL, if an origin has provided persistent client hint
settings in the past, the persistent client hints would be
attached with
(i) Main frame request headers
(ii) Subresource request headers for subresources that have the
same origin as the document origin.

Before this CL, the client hints would have attached for subresource
origins as well (regardless of the opt-in of the document level
origin).

Discussion here of restricting client hints to first party origins only:
https://github.com/httpwg/http-extensions/issues/372#issuecomment-359038699

In the future, feature policy may be used by 1P origins to allow
attaching of client hints to 3P hosts.

Bug: 735518
Change-Id: I74ba430bd5403b23535022ded87d24695be5bd70
Reviewed-on: https://chromium-review.googlesource.com/892486
Commit-Queue: Tarun Bansal <tbansal@chromium.org>
Reviewed-by: Kinuko Yasuda <kinuko@chromium.org>
Reviewed-by: Lei Zhang <thestig@chromium.org>
Reviewed-by: Ryan Sturm <ryansturm@chromium.org>
Cr-Commit-Position: refs/heads/master@{#535776}
10 files changed