Add SyncXHR as an experimental policy-controlled feature

This CL disables synchronous XHR in documents by throwing an
InvalidAccessError on open() if it is disallowed by feature policy.

SyncXHR is allowed by default in all frames; to disable in a particular
iframe, use the allow attribute, like

<iframe src="..." allow="sync-xhr 'none'"></iframe>

Or include a Feature-Policy HTTP header with a document which either
only allows synchronous XHR in certain origins:

Feature-Policy: sync-xhr 'self' https://example.com

or disallows it completely:

Feature-Policy: sync-xhr 'none'

The feature currently requires the 'FeaturePolicyExperimentalFeatures'
runtime flag.


Bug: 661283
Change-Id: If511e5990623670128f63f9c1d7233bca659b7e6
Reviewed-on: https://chromium-review.googlesource.com/656722
Commit-Queue: Ian Clelland <iclelland@chromium.org>
Reviewed-by: Raymes Khoury <raymes@chromium.org>
Reviewed-by: Rick Byers <rbyers@chromium.org>
Cr-Commit-Position: refs/heads/master@{#508370}
5 files changed