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

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

Issue 954013002: Replace try/finally with PerformanceTag.makeCurrentWhile(). (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 5 years, 10 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 'engine.dart'; 10 import 'engine.dart';
(...skipping 111 matching lines...) Expand 10 before | Expand all | Expand 10 after
122 /** 122 /**
123 * Initialize a newly created source object. 123 * Initialize a newly created source object.
124 * 124 *
125 * @param file the file represented by this source 125 * @param file the file represented by this source
126 * @param uri the URI from which this source was originally derived 126 * @param uri the URI from which this source was originally derived
127 */ 127 */
128 FileBasedSource.con2(this.uri, this.file); 128 FileBasedSource.con2(this.uri, this.file);
129 129
130 @override 130 @override
131 TimestampedData<String> get contents { 131 TimestampedData<String> get contents {
132 PerformanceTag prevTag = PerformanceStatistics.io.makeCurrent(); 132 return PerformanceStatistics.io.makeCurrentWhile(() {
133 try {
134 return contentsFromFile; 133 return contentsFromFile;
135 } finally { 134 });
136 prevTag.makeCurrent();
137 }
138 } 135 }
139 136
140 /** 137 /**
141 * Get the contents and timestamp of the underlying file. 138 * Get the contents and timestamp of the underlying file.
142 * 139 *
143 * Clients should consider using the the method [AnalysisContext.getContents] 140 * Clients should consider using the the method [AnalysisContext.getContents]
144 * because contexts can have local overrides of the content of a source that t he source is not 141 * because contexts can have local overrides of the content of a source that t he source is not
145 * aware of. 142 * aware of.
146 * 143 *
147 * @return the contents of the source paired with the modification stamp of th e source 144 * @return the contents of the source paired with the modification stamp of th e source
(...skipping 373 matching lines...) Expand 10 before | Expand all | Expand 10 after
521 } 518 }
522 519
523 /** 520 /**
524 * Return `true` if the given URI is a `file` URI. 521 * Return `true` if the given URI is a `file` URI.
525 * 522 *
526 * @param uri the URI being tested 523 * @param uri the URI being tested
527 * @return `true` if the given URI is a `file` URI 524 * @return `true` if the given URI is a `file` URI
528 */ 525 */
529 static bool isFileUri(Uri uri) => uri.scheme == FILE_SCHEME; 526 static bool isFileUri(Uri uri) => uri.scheme == FILE_SCHEME;
530 } 527 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698