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

Issue 11188004: Add a content-security-policy (CSP) flag. (Closed)

Created:
8 years, 2 months ago by floitsch
Modified:
8 years, 2 months ago
Reviewers:
kasperl
CC:
reviews_dartlang.org, ngeoffray
Visibility:
Public.

Description

Add a content-security-policy (CSP) flag. https://codereview.chromium.org/11183040/ contains before and after comparisons. BUG=http://dartbug.com/3436 Committed: https://code.google.com/p/dart/source/detail?r=13771

Patch Set 1 #

Patch Set 2 : Update flag description. #

Patch Set 3 : Minor comment changes and rebase. #

Total comments: 11

Patch Set 4 : rebase #

Patch Set 5 : Split CSP code into separate class. #

Total comments: 17

Patch Set 6 : Address comments. #

Patch Set 7 : Address comments. #

Patch Set 8 : Reuploading due to upload error. #

Patch Set 9 : More fixes. #

Unified diffs Side-by-side diffs Delta from patch set Stats (+374 lines, -137 lines) Patch
M lib/compiler/implementation/apiimpl.dart View 1 2 3 4 5 6 7 8 1 chunk +1 line, -0 lines 0 comments Download
M lib/compiler/implementation/compiler.dart View 1 2 3 4 5 6 7 8 2 chunks +4 lines, -1 line 0 comments Download
M lib/compiler/implementation/dart2js.dart View 1 2 3 4 5 6 7 8 2 chunks +9 lines, -2 lines 0 comments Download
M lib/compiler/implementation/js_backend/backend.dart View 1 2 3 4 1 chunk +6 lines, -2 lines 0 comments Download
M lib/compiler/implementation/js_backend/emitter.dart View 1 2 3 4 9 chunks +169 lines, -110 lines 0 comments Download
A lib/compiler/implementation/js_backend/emitter_no_eval.dart View 1 2 3 4 5 6 7 8 1 chunk +142 lines, -0 lines 0 comments Download
M lib/compiler/implementation/js_backend/js_backend.dart View 1 2 3 4 1 chunk +1 line, -0 lines 0 comments Download
M lib/compiler/implementation/js_backend/native_emitter.dart View 1 2 3 4 2 chunks +36 lines, -14 lines 0 comments Download
M tests/compiler/dart2js/class_codegen_test.dart View 1 2 3 4 2 chunks +5 lines, -7 lines 0 comments Download
M tests/compiler/dart2js/no_constructor_body_test.dart View 1 2 3 4 1 chunk +1 line, -1 line 0 comments Download

Messages

Total messages: 6 (0 generated)
floitsch
https://codereview.chromium.org/11188004/diff/4001/lib/compiler/implementation/js_backend/emitter.dart File lib/compiler/implementation/js_backend/emitter.dart (right): https://codereview.chromium.org/11188004/diff/4001/lib/compiler/implementation/js_backend/emitter.dart#newcode279 lib/compiler/implementation/js_backend/emitter.dart:279: // Use the newly created object as prototype. In ...
8 years, 2 months ago (2012-10-16 18:15:36 UTC) #1
floitsch
8 years, 2 months ago (2012-10-16 18:15:36 UTC) #2
kasperl
Maybe you should add a small comparison between the code with and without the CSP ...
8 years, 2 months ago (2012-10-17 09:37:11 UTC) #3
floitsch
PTAL. https://codereview.chromium.org/11183040/ contains before and after comparisons. https://codereview.chromium.org/11188004/diff/4001/lib/compiler/implementation/apiimpl.dart File lib/compiler/implementation/apiimpl.dart (right): https://codereview.chromium.org/11188004/diff/4001/lib/compiler/implementation/apiimpl.dart#newcode34 lib/compiler/implementation/apiimpl.dart:34: enableContentSecurityPolicy: On ...
8 years, 2 months ago (2012-10-17 21:15:00 UTC) #4
kasperl
LGTM! https://codereview.chromium.org/11188004/diff/13001/lib/compiler/implementation/apiimpl.dart File lib/compiler/implementation/apiimpl.dart (right): https://codereview.chromium.org/11188004/diff/13001/lib/compiler/implementation/apiimpl.dart#newcode34 lib/compiler/implementation/apiimpl.dart:34: disableEval: hasOption(options, '--disable-eval'), I think this would be ...
8 years, 2 months ago (2012-10-18 09:36:21 UTC) #5
floitsch
8 years, 2 months ago (2012-10-18 11:08:11 UTC) #6
thanks.

https://codereview.chromium.org/11188004/diff/13001/lib/compiler/implementati...
File lib/compiler/implementation/apiimpl.dart (right):

https://codereview.chromium.org/11188004/diff/13001/lib/compiler/implementati...
lib/compiler/implementation/apiimpl.dart:34: disableEval: hasOption(options,
'--disable-eval'),
On 2012/10/18 09:36:21, kasperl wrote:
> I think this would be even nicer if it was called 
> 
>    --disallow-unsafe-eval
> 
> because that matches the CSP restriction description better. See
> http://www.w3.org/TR/CSP/.

Done.

https://codereview.chromium.org/11188004/diff/13001/lib/compiler/implementati...
File lib/compiler/implementation/dart2js.dart (right):

https://codereview.chromium.org/11188004/diff/13001/lib/compiler/implementati...
lib/compiler/implementation/dart2js.dart:399: Disables dynamic generation of
code in the generated output. This is
On 2012/10/18 09:36:21, kasperl wrote:
> Maybe get some of the text from http://www.w3.org/TR/CSP/ and/or link to it?

Done.

https://codereview.chromium.org/11188004/diff/13001/lib/compiler/implementati...
File lib/compiler/implementation/js_backend/emitter_no_eval.dart (right):

https://codereview.chromium.org/11188004/diff/13001/lib/compiler/implementati...
lib/compiler/implementation/js_backend/emitter_no_eval.dart:29: return 'var
$supportsProtoName = !!{}.__proto__;';
On 2012/10/18 09:36:21, kasperl wrote:
> Missing newline at end?

Done.

https://codereview.chromium.org/11188004/diff/13001/lib/compiler/implementati...
lib/compiler/implementation/js_backend/emitter_no_eval.dart:65: function
$mangledName(self, target) { this.self = self; this.target = target; },
On 2012/10/18 09:36:21, kasperl wrote:
> I'd prefer to stuff the 'function $mangledName(self, target) {' on the
previous
> line and add newline after the ;.

Done.

https://codereview.chromium.org/11188004/diff/13001/lib/compiler/implementati...
lib/compiler/implementation/js_backend/emitter_no_eval.dart:92: buffer.add(")
{");
On 2012/10/18 09:36:21, kasperl wrote:
> Newline after {.

Done.

https://codereview.chromium.org/11188004/diff/13001/lib/compiler/implementati...
lib/compiler/implementation/js_backend/emitter_no_eval.dart:94: buffer.add("
this.$field = $field;");
On 2012/10/18 09:36:21, kasperl wrote:
> Two space indent and newline after ;.

Done.

Powered by Google App Engine
This is Rietveld 408576698