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

Side by Side Diff: pkg/compiler/lib/src/apiimpl.dart

Issue 1454373002: Use Zone to correctly measure async operations. (Closed) Base URL: git@github.com:dart-lang/sdk.git@_temporary_fletch_patches
Patch Set: Created 5 years, 1 month 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
« no previous file with comments | « no previous file | pkg/compiler/lib/src/compiler.dart » ('j') | pkg/compiler/lib/src/compiler.dart » ('J')
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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:async'; 7 import 'dart:async';
8 import 'dart:convert'; 8 import 'dart:convert';
9 9
10 import '../compiler_new.dart' as api; 10 import '../compiler_new.dart' as api;
(...skipping 468 matching lines...) Expand 10 before | Expand all | Expand 10 after
479 }); 479 });
480 } catch (ex, s) { 480 } catch (ex, s) {
481 diagnoseCrashInUserCode( 481 diagnoseCrashInUserCode(
482 'Uncaught exception in diagnostic handler', ex, s); 482 'Uncaught exception in diagnostic handler', ex, s);
483 rethrow; 483 rethrow;
484 } 484 }
485 } 485 }
486 486
487 Future callUserProvider(Uri uri) { 487 Future callUserProvider(Uri uri) {
488 try { 488 try {
489 return userProviderTask.measure(() => provider.readFromUri(uri)); 489 return userProviderTask.measureIo(() => provider.readFromUri(uri));
490 } catch (ex, s) { 490 } catch (ex, s) {
491 diagnoseCrashInUserCode('Uncaught exception in input provider', ex, s); 491 diagnoseCrashInUserCode('Uncaught exception in input provider', ex, s);
492 rethrow; 492 rethrow;
493 } 493 }
494 } 494 }
495 495
496 Future<Packages> callUserPackagesDiscovery(Uri uri) { 496 Future<Packages> callUserPackagesDiscovery(Uri uri) {
497 try { 497 try {
498 return userPackagesDiscoveryTask.measure( 498 return userPackagesDiscoveryTask.measureIo(
499 () => packagesDiscoveryProvider(uri)); 499 () => packagesDiscoveryProvider(uri));
500 } catch (ex, s) { 500 } catch (ex, s) {
501 diagnoseCrashInUserCode('Uncaught exception in package discovery', ex, s); 501 diagnoseCrashInUserCode('Uncaught exception in package discovery', ex, s);
502 rethrow; 502 rethrow;
503 } 503 }
504 } 504 }
505 505
506 void diagnoseCrashInUserCode(String message, exception, stackTrace) { 506 void diagnoseCrashInUserCode(String message, exception, stackTrace) {
507 hasCrashed = true; 507 hasCrashed = true;
508 print('$message: ${tryToString(exception)}'); 508 print('$message: ${tryToString(exception)}');
509 print(tryToString(stackTrace)); 509 print(tryToString(stackTrace));
510 } 510 }
511 511
512 fromEnvironment(String name) => environment[name]; 512 fromEnvironment(String name) => environment[name];
513 513
514 library_info.LibraryInfo lookupLibraryInfo(String libraryName) { 514 library_info.LibraryInfo lookupLibraryInfo(String libraryName) {
515 return library_info.libraries[libraryName]; 515 return library_info.libraries[libraryName];
516 } 516 }
517 } 517 }
OLDNEW
« no previous file with comments | « no previous file | pkg/compiler/lib/src/compiler.dart » ('j') | pkg/compiler/lib/src/compiler.dart » ('J')

Powered by Google App Engine
This is Rietveld 408576698