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

Side by Side Diff: pkg/analyzer/lib/src/generated/source_io.dart

Issue 179123010: Add timing info for file IO into Dart based analyzer. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 6 years, 9 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) 2014, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2014, 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 // This code was auto-generated, is not intended to be edited, and is subject to 5 // This code was auto-generated, is not intended to be edited, and is subject to
6 // significant change. Please see the README file for more information. 6 // significant change. Please see the README file for more information.
7 7
8 library engine.source.io; 8 library engine.source.io;
9 9
10 import 'source.dart'; 10 import 'source.dart';
11 import 'java_core.dart'; 11 import 'java_core.dart';
12 import 'java_io.dart'; 12 import 'java_io.dart';
13 import 'engine.dart' show AnalysisContext, AnalysisEngine, TimestampedData; 13 import 'engine.dart';
14 import 'utilities_general.dart';
14 export 'source.dart'; 15 export 'source.dart';
15 16
16 /** 17 /**
17 * Instances of interface `LocalSourcePredicate` are used to determine if the gi ven 18 * Instances of interface `LocalSourcePredicate` are used to determine if the gi ven
18 * [Source] is "local" in some sense, so can be updated. 19 * [Source] is "local" in some sense, so can be updated.
19 * 20 *
20 * @coverage dart.engine.source 21 * @coverage dart.engine.source
21 */ 22 */
22 abstract class LocalSourcePredicate { 23 abstract class LocalSourcePredicate {
23 /** 24 /**
(...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after
94 */ 95 */
95 FileBasedSource.con2(JavaFile file, UriKind uriKind) { 96 FileBasedSource.con2(JavaFile file, UriKind uriKind) {
96 this._file = file; 97 this._file = file;
97 this._uriKind = uriKind; 98 this._uriKind = uriKind;
98 } 99 }
99 100
100 bool operator ==(Object object) => object != null && this.runtimeType == objec t.runtimeType && _file == (object as FileBasedSource)._file; 101 bool operator ==(Object object) => object != null && this.runtimeType == objec t.runtimeType && _file == (object as FileBasedSource)._file;
101 102
102 bool exists() => _file.isFile(); 103 bool exists() => _file.isFile();
103 104
104 TimestampedData<String> get contents => contentsFromFile; 105 TimestampedData<String> get contents {
106 TimeCounter_TimeCounterHandle handle = PerformanceStatistics.io.start();
107 try {
108 return contentsFromFile;
109 } finally {
110 handle.stop();
111 }
112 }
105 113
106 void getContentsToReceiver(Source_ContentReceiver receiver) { 114 void getContentsToReceiver(Source_ContentReceiver receiver) {
107 getContentsFromFileToReceiver(receiver); 115 TimeCounter_TimeCounterHandle handle = PerformanceStatistics.io.start();
116 try {
117 getContentsFromFileToReceiver(receiver);
118 } finally {
119 handle.stop();
120 }
108 } 121 }
109 122
110 String get encoding { 123 String get encoding {
111 if (_encoding == null) { 124 if (_encoding == null) {
112 _encoding = "${_uriKind.encoding}${_file.toURI().toString()}"; 125 _encoding = "${_uriKind.encoding}${_file.toURI().toString()}";
113 } 126 }
114 return _encoding; 127 return _encoding;
115 } 128 }
116 129
117 String get fullName => _file.getAbsolutePath(); 130 String get fullName => _file.getAbsolutePath();
(...skipping 300 matching lines...) Expand 10 before | Expand all | Expand 10 after
418 return null; 431 return null;
419 } 432 }
420 433
421 Source resolveAbsolute(Uri uri) { 434 Source resolveAbsolute(Uri uri) {
422 if (!isFileUri(uri)) { 435 if (!isFileUri(uri)) {
423 return null; 436 return null;
424 } 437 }
425 return new FileBasedSource.con1(new JavaFile.fromUri(uri)); 438 return new FileBasedSource.con1(new JavaFile.fromUri(uri));
426 } 439 }
427 } 440 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698