[ServiceWorker] CSP support for ServiceWorker environment.

According to the CSP spec, we have to check the Content-Security-Policy HTTP response header of the ServiceWorker script.
https://w3c.github.io/webappsec/specs/content-security-policy/#processing-model-workers

For example:
When "Content-Security-Policy: script-src 'self'" is set, "importScripts('https://othersite/'); must fail.
When "Content-Security-Policy: connect-src 'self'" is set, "fetch('https://othersite/data'); must fail.

The changes in WebEmbeddedWorkerImpl.cpp introduce CSP check for ServiceWorker environment.
The changes in FetchManager.cpp introduce CSP check for fech API.

We need to set the CSP not only to the ServiceWorkerGlobalScope but also to the shadow page's document.
The CSP in the shadow page's document will be used while handling the redirect responses in DocumentThreadableLoader::isAllowedByContentSecurityPolicy()

BUG=432069

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

git-svn-id: svn://svn.chromium.org/blink/trunk@185630 bbb929c8-8fbe-4397-9dbb-9b2b20218538
4 files changed