ServiceWorker: Reject registration access from script created documents
commit3bccffa2e535ca442b6a4ddf9fb2917670755a2d
authorksakamoto <ksakamoto@chromium.org>
Thu, 11 Dec 2014 06:58:57 +0000 (10 22:58 -0800)
committerCommit bot <commit-bot@chromium.org>
Thu, 11 Dec 2014 06:59:16 +0000 (11 06:59 +0000)
tree3ba7d3038b21d1f7f55934a0db67c87e437dfc86
parentfe62ca8a995c9ded8d985511b403a5c7ff79c8d8
ServiceWorker: Reject registration access from script created documents

This fixes DCHECK failure (BadMessageReceived on release) when attempting
to register/unregister/lookup SW from a document in an iframe using
frame.contentDocument.write(...).

The origin check should be done against the iframe's origin, which is the
same as its container document's origin. But as a quick fix for the crash,
this patch rejects registration access from such iframe documents.

BUG=436034,439696

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

Cr-Commit-Position: refs/heads/master@{#307874}
content/browser/service_worker/service_worker_dispatcher_host.cc