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

Side by Side Diff: lib/compiler/implementation/apiimpl.dart

Issue 11188004: Add a content-security-policy (CSP) flag. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Minor comment changes and rebase. Created 8 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a 2 // for details. All rights reserved. Use of this source code is governed by a
3 // BSD-style license that can be found in the LICENSE file. 3 // BSD-style license that can be found in the LICENSE file.
4 4
5 #library('leg_apiimpl'); 5 #library('leg_apiimpl');
6 6
7 #import('dart:uri'); 7 #import('dart:uri');
8 8
9 #import('../compiler.dart', prefix: 'api'); 9 #import('../compiler.dart', prefix: 'api');
10 #import('leg.dart', prefix: 'leg'); 10 #import('leg.dart', prefix: 'leg');
(...skipping 13 matching lines...) Expand all
24 24
25 Compiler(this.provider, this.handler, this.libraryRoot, this.packageRoot, 25 Compiler(this.provider, this.handler, this.libraryRoot, this.packageRoot,
26 List<String> options) 26 List<String> options)
27 : this.options = options, 27 : this.options = options,
28 super( 28 super(
29 tracer: new ssa.HTracer(), 29 tracer: new ssa.HTracer(),
30 enableTypeAssertions: hasOption(options, '--enable-checked-mode'), 30 enableTypeAssertions: hasOption(options, '--enable-checked-mode'),
31 enableUserAssertions: hasOption(options, '--enable-checked-mode'), 31 enableUserAssertions: hasOption(options, '--enable-checked-mode'),
32 enableMinification: hasOption(options, '--minify'), 32 enableMinification: hasOption(options, '--minify'),
33 emitJavaScript: !hasOption(options, '--output-type=dart'), 33 emitJavaScript: !hasOption(options, '--output-type=dart'),
34 enableContentSecurityPolicy:
kasperl 2012/10/17 09:37:11 This is probably fine, but essentially you could a
floitsch 2012/10/17 21:15:01 Done.
35 hasOption(options, '--enable-content-security-policy'),
34 strips: getStrips(options), 36 strips: getStrips(options),
35 enableConcreteTypeInference: 37 enableConcreteTypeInference:
36 hasOption(options, '--enable-concrete-type-inference')); 38 hasOption(options, '--enable-concrete-type-inference'));
37 39
38 static List<String> getStrips(List<String> options) { 40 static List<String> getStrips(List<String> options) {
39 for (String option in options) { 41 for (String option in options) {
40 if (option.startsWith('--force-strip=')) { 42 if (option.startsWith('--force-strip=')) {
41 return option.substring('--force-strip='.length).split(','); 43 return option.substring('--force-strip='.length).split(',');
42 } 44 }
43 } 45 }
(...skipping 115 matching lines...) Expand 10 before | Expand all | Expand 10 after
159 handler(translateUri(span.uri, null), span.begin, span.end, 161 handler(translateUri(span.uri, null), span.begin, span.end,
160 message, kind); 162 message, kind);
161 } 163 }
162 } 164 }
163 165
164 bool get isMockCompilation { 166 bool get isMockCompilation {
165 return mockableLibraryUsed 167 return mockableLibraryUsed
166 && (options.indexOf('--allow-mock-compilation') !== -1); 168 && (options.indexOf('--allow-mock-compilation') !== -1);
167 } 169 }
168 } 170 }
OLDNEW
« no previous file with comments | « no previous file | lib/compiler/implementation/compiler.dart » ('j') | lib/compiler/implementation/js_backend/emitter.dart » ('J')

Powered by Google App Engine
This is Rietveld 408576698