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

Side by Side Diff: dart/runtime/bin/builtin.dart

Issue 1011033003: Fix buildbot on trunk: (Closed) Base URL: http://dart.googlecode.com/svn/trunk/
Patch Set: Created 5 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
« no previous file with comments | « no previous file | dart/tests/language/language.status » ('j') | no next file with comments »
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 builtin; 5 library builtin;
6 import 'dart:async'; 6 import 'dart:async';
7 import 'dart:convert'; 7 import 'dart:convert';
8 import 'dart:isolate'; 8 import 'dart:isolate';
9 9
10 10
(...skipping 332 matching lines...) Expand 10 before | Expand all | Expand 10 after
343 native "Builtin_AsyncLoadError"; 343 native "Builtin_AsyncLoadError";
344 344
345 void _loadScript(int tag, String uri, String libraryUri, List<int> data) { 345 void _loadScript(int tag, String uri, String libraryUri, List<int> data) {
346 // TODO: Currently a compilation error while loading the script is 346 // TODO: Currently a compilation error while loading the script is
347 // fatal for the isolate. _loadScriptCallback() does not return and 347 // fatal for the isolate. _loadScriptCallback() does not return and
348 // the _numOutstandingLoadRequests counter remains out of sync. 348 // the _numOutstandingLoadRequests counter remains out of sync.
349 _loadScriptCallback(tag, uri, libraryUri, data); 349 _loadScriptCallback(tag, uri, libraryUri, data);
350 _finishedOneLoadRequest(uri); 350 _finishedOneLoadRequest(uri);
351 } 351 }
352 352
353 void _asyncLoadError(int tag, String uri, String libraryUri, LoadError error) { 353 void _asyncLoadError(tag, uri, libraryUri, error) {
354 if (_logBuiltin) { 354 if (_logBuiltin) {
355 _print("_asyncLoadError($uri), error: $error"); 355 _print("_asyncLoadError($uri), error: $error");
356 } 356 }
357 if (tag == Dart_kImportTag) { 357 if (tag == Dart_kImportTag) {
358 // When importing a library, the libraryUri is the imported 358 // When importing a library, the libraryUri is the imported
359 // uri. 359 // uri.
360 libraryUri = uri; 360 libraryUri = uri;
361 } 361 }
362 _asyncLoadErrorCallback(uri, libraryUri, error); 362 _asyncLoadErrorCallback(uri, libraryUri, new LoadError(error.toString()));
363 _finishedOneLoadRequest(uri); 363 _finishedOneLoadRequest(uri);
364 } 364 }
365 365
366 366
367 _loadDataAsyncLoadPort(int tag, 367 _loadDataAsyncLoadPort(int tag,
368 String uri, 368 String uri,
369 String libraryUri, 369 String libraryUri,
370 Uri resourceUri) { 370 Uri resourceUri) {
371 var receivePort = new ReceivePort(); 371 var receivePort = new ReceivePort();
372 receivePort.first.then((dataOrError) { 372 receivePort.first.then((dataOrError) {
373 if (dataOrError is List<int>) { 373 if (dataOrError is List<int>) {
374 _loadScript(tag, uri, libraryUri, dataOrError); 374 _loadScript(tag, uri, libraryUri, dataOrError);
375 } else { 375 } else {
376 assert(dataOrError is String); 376 _asyncLoadError(tag, uri, libraryUri, dataOrError);
377 var error = new LoadError(dataOrError.toString());
378 _asyncLoadError(tag, uri, libraryUri, error);
379 } 377 }
380 }).catchError((e) { 378 }).catchError((e) {
381 // Wrap inside a LoadError unless we are already propagating a previously 379 _asyncLoadError(tag, uri, libraryUri, e.toString());
382 // seen LoadError.
383 var error = (e is LoadError) ? e : new LoadError(e.toString);
384 _asyncLoadError(tag, uri, libraryUri, error);
385 }); 380 });
386 381
387 try { 382 try {
388 var msg = [receivePort.sendPort, resourceUri.toString()]; 383 var msg = [receivePort.sendPort, resourceUri.toString()];
389 _loadPort.send(msg); 384 _loadPort.send(msg);
390 _startingOneLoadRequest(uri); 385 _startingOneLoadRequest(uri);
391 } catch (e) { 386 } catch (e) {
392 if (_logBuiltin) { 387 if (_logBuiltin) {
393 _print("Exception when communicating with service isolate: $e"); 388 _print("Exception when communicating with service isolate: $e");
394 } 389 }
395 // Wrap inside a LoadError unless we are already propagating a previously 390 _asyncLoadError(tag, uri, libraryUri, e.toString());
396 // seen LoadError.
397 var error = (e is LoadError) ? e : new LoadError(e.toString);
398 _asyncLoadError(tag, uri, libraryUri, error);
399 receivePort.close(); 391 receivePort.close();
400 } 392 }
401 } 393 }
402 394
403 // Asynchronously loads script data through a http[s] or file uri. 395 // Asynchronously loads script data through a http[s] or file uri.
404 _loadDataAsync(int tag, String uri, String libraryUri) { 396 _loadDataAsync(int tag, String uri, String libraryUri) {
405 if (tag == Dart_kScriptTag) { 397 if (tag == Dart_kScriptTag) {
406 uri = _resolveScriptUri(uri); 398 uri = _resolveScriptUri(uri);
407 } 399 }
408 400
(...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after
482 } else { 474 } else {
483 name = userUri.substring(index + 1); 475 name = userUri.substring(index + 1);
484 path = userUri.substring(0, index + 1); 476 path = userUri.substring(0, index + 1);
485 } 477 }
486 478
487 path = _filePathFromUri(path); 479 path = _filePathFromUri(path);
488 var filename = _platformExtensionFileName(name); 480 var filename = _platformExtensionFileName(name);
489 481
490 return [path, filename, name]; 482 return [path, filename, name];
491 } 483 }
OLDNEW
« no previous file with comments | « no previous file | dart/tests/language/language.status » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698