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

Side by Side Diff: lib/compiler/implementation/compiler.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 5
6 /** 6 /**
7 * If true, print a warning for each method that was resolved, but not 7 * If true, print a warning for each method that was resolved, but not
8 * compiled. 8 * compiled.
9 */ 9 */
10 const bool REPORT_EXCESS_RESOLUTION = false; 10 const bool REPORT_EXCESS_RESOLUTION = false;
(...skipping 183 matching lines...) Expand 10 before | Expand all | Expand 10 after
194 194
195 bool hasCrashed = false; 195 bool hasCrashed = false;
196 196
197 Compiler({this.tracer: const Tracer(), 197 Compiler({this.tracer: const Tracer(),
198 this.enableTypeAssertions: false, 198 this.enableTypeAssertions: false,
199 this.enableUserAssertions: false, 199 this.enableUserAssertions: false,
200 this.enableConcreteTypeInference: false, 200 this.enableConcreteTypeInference: false,
201 this.enableMinification: false, 201 this.enableMinification: false,
202 bool emitJavaScript: true, 202 bool emitJavaScript: true,
203 bool generateSourceMap: true, 203 bool generateSourceMap: true,
204 bool enableContentSecurityPolicy: false,
204 List<String> strips: const []}) 205 List<String> strips: const []})
205 : libraries = new Map<String, LibraryElement>(), 206 : libraries = new Map<String, LibraryElement>(),
206 progress = new Stopwatch() { 207 progress = new Stopwatch() {
207 progress.start(); 208 progress.start();
208 world = new World(this); 209 world = new World(this);
209 scanner = new ScannerTask(this); 210 scanner = new ScannerTask(this);
210 dietParser = new DietParserTask(this); 211 dietParser = new DietParserTask(this);
211 parser = new ParserTask(this); 212 parser = new ParserTask(this);
212 patchParser = new PatchParserTask(this); 213 patchParser = new PatchParserTask(this);
213 libraryLoader = new LibraryLoaderTask(this); 214 libraryLoader = new LibraryLoaderTask(this);
214 validator = new TreeValidatorTask(this); 215 validator = new TreeValidatorTask(this);
215 resolver = new ResolverTask(this); 216 resolver = new ResolverTask(this);
216 closureToClassMapper = new closureMapping.ClosureTask(this); 217 closureToClassMapper = new closureMapping.ClosureTask(this);
217 checker = new TypeCheckerTask(this); 218 checker = new TypeCheckerTask(this);
218 typesTask = new ti.TypesTask(this, enableConcreteTypeInference); 219 typesTask = new ti.TypesTask(this, enableConcreteTypeInference);
219 backend = emitJavaScript ? 220 backend = emitJavaScript ?
220 new js_backend.JavaScriptBackend(this, generateSourceMap) : 221 new js_backend.JavaScriptBackend(this,
222 generateSourceMap,
223 enableContentSecurityPolicy) :
221 new dart_backend.DartBackend(this, strips); 224 new dart_backend.DartBackend(this, strips);
222 constantHandler = new ConstantHandler(this, backend.constantSystem); 225 constantHandler = new ConstantHandler(this, backend.constantSystem);
223 enqueuer = new EnqueueTask(this); 226 enqueuer = new EnqueueTask(this);
224 tasks = [scanner, dietParser, parser, resolver, closureToClassMapper, 227 tasks = [scanner, dietParser, parser, resolver, closureToClassMapper,
225 checker, typesTask, constantHandler, enqueuer]; 228 checker, typesTask, constantHandler, enqueuer];
226 tasks.addAll(backend.tasks); 229 tasks.addAll(backend.tasks);
227 } 230 }
228 231
229 Universe get resolverWorld => enqueuer.resolution.universe; 232 Universe get resolverWorld => enqueuer.resolution.universe;
230 Universe get codegenWorld => enqueuer.codegen.universe; 233 Universe get codegenWorld => enqueuer.codegen.universe;
(...skipping 624 matching lines...) Expand 10 before | Expand all | Expand 10 after
855 // TODO(johnniwinther): Use [spannable] and [message] to provide better 858 // TODO(johnniwinther): Use [spannable] and [message] to provide better
856 // information on assertion errors. 859 // information on assertion errors.
857 if (condition is Function){ 860 if (condition is Function){
858 condition = condition(); 861 condition = condition();
859 } 862 }
860 if (!condition && message != null) { 863 if (!condition && message != null) {
861 print('assertion failed: $message'); 864 print('assertion failed: $message');
862 } 865 }
863 return spannable != null && condition; 866 return spannable != null && condition;
864 } 867 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698