Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(190)

Issue 183883004: Let ContentSecurityPolicy shared between imports and the master. (Closed)

Created:
6 years, 9 months ago by Hajime Morrita
Modified:
6 years, 9 months ago
CC:
blink-reviews, sof, eae+blinkwatch, dglazkov+blink, adamk+blink_chromium.org, Inactive, rwlbuis
Visibility:
Public.

Description

Let ContentSecurityPolicy shared between imports and the master. This change is to match Blink's HTML Imports implementation match the spec change [1] which says that all imported document should follow CSP of the master document, instead of its own. The implementation is straightforward. It: - Makes ContentSecurityPolicy object ref-counted and passes one of the master to its imported document. - Disables <meta> directive for CSP when the document is an import. Tests have to be changed much. As one CSP constraints all the scripts in each test, things like shouldBe() is no longer usable in many test. Also, many imports are now need to be servced via CORS so the change turns some of them from HTML to CGI. Removed tests are ones that is no longer relevant: if script-src is unsafe-inline, we cannot load any imports thus cannot test scripts in such imports. [1] https://www.w3.org/Bugs/Public/show_bug.cgi?id=24268 BUG=334210 TEST=http/tests/htmlimports/ R=abarth@chromium.org, dglazkov@chromium.org Committed: https://src.chromium.org/viewvc/blink?view=rev&revision=168331

Patch Set 1 #

Patch Set 2 : Adding guardRef()/guardDeref() #

Unified diffs Side-by-side diffs Delta from patch set Stats (+290 lines, -278 lines) Patch
M LayoutTests/http/tests/htmlimports/csp-import-block-but-domain.html View 1 chunk +3 lines, -12 lines 0 comments Download
M LayoutTests/http/tests/htmlimports/csp-import-block-but-domain-expected.txt View 1 chunk +14 lines, -9 lines 0 comments Download
M LayoutTests/http/tests/htmlimports/csp-import-block-but-domain-nested.html View 1 chunk +3 lines, -13 lines 0 comments Download
M LayoutTests/http/tests/htmlimports/csp-import-block-but-domain-nested-expected.txt View 1 chunk +14 lines, -9 lines 0 comments Download
M LayoutTests/http/tests/htmlimports/csp-import-block-but-nonce.html View 1 chunk +22 lines, -13 lines 0 comments Download
M LayoutTests/http/tests/htmlimports/csp-import-block-but-nonce-expected.txt View 1 chunk +20 lines, -11 lines 0 comments Download
M LayoutTests/http/tests/htmlimports/csp-import-block-but-nonce-nested.html View 1 chunk +22 lines, -13 lines 0 comments Download
M LayoutTests/http/tests/htmlimports/csp-import-block-but-nonce-nested-expected.txt View 1 chunk +20 lines, -11 lines 0 comments Download
M LayoutTests/http/tests/htmlimports/csp-import-block-but-self.html View 1 chunk +2 lines, -11 lines 0 comments Download
M LayoutTests/http/tests/htmlimports/csp-import-block-but-self-expected.txt View 1 chunk +16 lines, -9 lines 0 comments Download
M LayoutTests/http/tests/htmlimports/csp-import-block-but-self-nested.html View 1 chunk +2 lines, -11 lines 0 comments Download
M LayoutTests/http/tests/htmlimports/csp-import-block-but-self-nested-expected.txt View 1 chunk +16 lines, -9 lines 0 comments Download
D LayoutTests/http/tests/htmlimports/csp-import-block-but-unsafe-inline.html View 1 chunk +0 lines, -19 lines 0 comments Download
D LayoutTests/http/tests/htmlimports/csp-import-block-but-unsafe-inline-and-eval.html View 1 chunk +0 lines, -19 lines 0 comments Download
D LayoutTests/http/tests/htmlimports/csp-import-block-but-unsafe-inline-and-eval-expected.txt View 1 chunk +0 lines, -10 lines 0 comments Download
D LayoutTests/http/tests/htmlimports/csp-import-block-but-unsafe-inline-and-eval-nested.html View 1 chunk +0 lines, -19 lines 0 comments Download
D LayoutTests/http/tests/htmlimports/csp-import-block-but-unsafe-inline-and-eval-nested-expected.txt View 1 chunk +0 lines, -10 lines 0 comments Download
D LayoutTests/http/tests/htmlimports/csp-import-block-but-unsafe-inline-expected.txt View 1 chunk +0 lines, -10 lines 0 comments Download
D LayoutTests/http/tests/htmlimports/csp-import-block-but-unsafe-inline-nested.html View 1 chunk +0 lines, -19 lines 0 comments Download
D LayoutTests/http/tests/htmlimports/csp-import-block-but-unsafe-inline-nested-expected.txt View 1 chunk +0 lines, -10 lines 0 comments Download
M LayoutTests/http/tests/htmlimports/csp-in-imports.html View 1 chunk +4 lines, -4 lines 0 comments Download
M LayoutTests/http/tests/htmlimports/csp-not-block-import-in-import.html View 1 chunk +3 lines, -2 lines 0 comments Download
M LayoutTests/http/tests/htmlimports/csp-not-block-import-in-import-expected.txt View 1 chunk +2 lines, -0 lines 0 comments Download
A + LayoutTests/http/tests/htmlimports/resources/child-having-domain-policy.cgi View 1 chunk +8 lines, -2 lines 0 comments Download
A + LayoutTests/http/tests/htmlimports/resources/child-having-nonce-policy.cgi View 1 chunk +8 lines, -2 lines 0 comments Download
A LayoutTests/http/tests/htmlimports/resources/csp-import-block-but-domain.js View 1 chunk +18 lines, -0 lines 0 comments Download
A LayoutTests/http/tests/htmlimports/resources/csp-import-block-but-self.js View 1 chunk +18 lines, -0 lines 0 comments Download
M LayoutTests/http/tests/htmlimports/resources/external-script.js View 1 chunk +1 line, -1 line 0 comments Download
A LayoutTests/http/tests/htmlimports/resources/having-domain-policy.cgi View 1 chunk +21 lines, -0 lines 0 comments Download
M LayoutTests/http/tests/htmlimports/resources/having-domain-policy.html View 1 chunk +2 lines, -3 lines 0 comments Download
A LayoutTests/http/tests/htmlimports/resources/having-nonce-policy.cgi View 1 chunk +25 lines, -0 lines 0 comments Download
M LayoutTests/http/tests/htmlimports/resources/having-nonce-policy.html View 1 chunk +0 lines, -1 line 0 comments Download
M LayoutTests/http/tests/htmlimports/resources/having-self-policy.html View 1 chunk +0 lines, -1 line 0 comments Download
M LayoutTests/http/tests/htmlimports/resources/having-unsafe-inline-policy.html View 1 chunk +0 lines, -4 lines 0 comments Download
M Source/core/dom/Document.cpp View 3 chunks +10 lines, -1 line 0 comments Download
M Source/core/dom/SecurityContext.h View 2 chunks +2 lines, -2 lines 0 comments Download
M Source/core/dom/SecurityContext.cpp View 1 chunk +1 line, -1 line 0 comments Download
M Source/core/frame/ContentSecurityPolicy.h View 2 chunks +5 lines, -3 lines 0 comments Download
M Source/core/html/imports/HTMLImportChild.h View 1 2 chunks +2 lines, -1 line 0 comments Download
M Source/core/html/imports/HTMLImportChild.cpp View 1 2 chunks +5 lines, -1 line 0 comments Download
M Source/core/html/imports/HTMLImportLoader.cpp View 1 chunk +0 lines, -1 line 0 comments Download
M Source/core/html/imports/HTMLImportsController.cpp View 1 1 chunk +1 line, -1 line 0 comments Download

Messages

Total messages: 16 (0 generated)
Hajime Morrita
PTAL?
6 years, 9 months ago (2014-02-27 23:36:42 UTC) #1
abarth-chromium
What is the lifetime relationship between an imported Document and its master? The ContentSecurityPolicy object ...
6 years, 9 months ago (2014-02-28 06:54:34 UTC) #2
abarth-chromium
(I should say that I didn't review the tests. Maybe Dimitri should check those for ...
6 years, 9 months ago (2014-02-28 06:54:58 UTC) #3
dglazkov
I find these tests amazing.
6 years, 9 months ago (2014-02-28 16:34:32 UTC) #4
Hajime Morrita
On 2014/02/28 06:54:34, abarth wrote: > What is the lifetime relationship between an imported Document ...
6 years, 9 months ago (2014-02-28 18:05:53 UTC) #5
Hajime Morrita
The CQ bit was checked by morrita@chromium.org
6 years, 9 months ago (2014-02-28 22:40:59 UTC) #6
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/morrita@chromium.org/183883004/20001
6 years, 9 months ago (2014-02-28 22:41:17 UTC) #7
commit-bot: I haz the power
The CQ bit was unchecked by commit-bot@chromium.org
6 years, 9 months ago (2014-03-01 00:19:42 UTC) #8
commit-bot: I haz the power
Retried try job too often on blink_android_compile_rel for step(s) webkit_lint http://build.chromium.org/p/tryserver.chromium/buildstatus?builder=blink_android_compile_rel&number=1133
6 years, 9 months ago (2014-03-01 00:19:42 UTC) #9
Hajime Morrita
The CQ bit was checked by morrita@chromium.org
6 years, 9 months ago (2014-03-01 00:56:53 UTC) #10
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/morrita@chromium.org/183883004/20001
6 years, 9 months ago (2014-03-01 00:57:03 UTC) #11
commit-bot: I haz the power
The CQ bit was unchecked by commit-bot@chromium.org
6 years, 9 months ago (2014-03-01 02:15:40 UTC) #12
commit-bot: I haz the power
Retried try job too often on blink_android_compile_rel for step(s) webkit_lint http://build.chromium.org/p/tryserver.chromium/buildstatus?builder=blink_android_compile_rel&number=1161
6 years, 9 months ago (2014-03-01 02:15:40 UTC) #13
Hajime Morrita
The CQ bit was checked by morrita@chromium.org
6 years, 9 months ago (2014-03-03 21:27:03 UTC) #14
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/morrita@chromium.org/183883004/20001
6 years, 9 months ago (2014-03-03 21:27:19 UTC) #15
commit-bot: I haz the power
6 years, 9 months ago (2014-03-03 21:28:03 UTC) #16
Message was sent while issue was closed.
Change committed as 168331

Powered by Google App Engine
This is Rietveld 408576698