OLD | NEW |
1 // Copyright (c) 2009, Google Inc. | 1 // Copyright (c) 2009, Google Inc. |
2 // All rights reserved. | 2 // All rights reserved. |
3 // | 3 // |
4 // Redistribution and use in source and binary forms, with or without | 4 // Redistribution and use in source and binary forms, with or without |
5 // modification, are permitted provided that the following conditions are | 5 // modification, are permitted provided that the following conditions are |
6 // met: | 6 // met: |
7 // | 7 // |
8 // * Redistributions of source code must retain the above copyright | 8 // * Redistributions of source code must retain the above copyright |
9 // notice, this list of conditions and the following disclaimer. | 9 // notice, this list of conditions and the following disclaimer. |
10 // * Redistributions in binary form must reproduce the above | 10 // * Redistributions in binary form must reproduce the above |
(...skipping 409 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
420 domData->setIsObservatoryFakeDartDOMData(true); | 420 domData->setIsObservatoryFakeDartDOMData(true); |
421 Dart_ExitIsolate(); | 421 Dart_ExitIsolate(); |
422 return serviceIsolate; | 422 return serviceIsolate; |
423 } | 423 } |
424 | 424 |
425 | 425 |
426 Dart_Isolate DartController::createPureIsolateCallback(const char* scriptURL, co
nst char* entryPoint, void* data, char** errorMsg) | 426 Dart_Isolate DartController::createPureIsolateCallback(const char* scriptURL, co
nst char* entryPoint, void* data, char** errorMsg) |
427 { | 427 { |
428 bool isSpawnUri = scriptURL ? true : false; | 428 bool isSpawnUri = scriptURL ? true : false; |
429 | 429 |
| 430 if (isSpawnUri && !WTF::isMainThread()) { |
| 431 // FIXME(14463): We need to forward this request to the main thread to f
etch the URI. |
| 432 *errorMsg = strdup("spawnUri is not yet supported on background isolates
."); |
| 433 return 0; |
| 434 } |
| 435 |
430 if (!isSpawnUri) { | 436 if (!isSpawnUri) { |
431 // Determine the parent Isolate's URL as we will be using the same for c
reating | 437 // Determine the parent Isolate's URL as we will be using the same for c
reating |
432 // the isolate being spawned using spawnFunction. | 438 // the isolate being spawned using spawnFunction. |
433 DartApiScope apiScope; | 439 DartApiScope apiScope; |
434 Dart_Handle parentIsolateRootLibrary = Dart_RootLibrary(); | 440 Dart_Handle parentIsolateRootLibrary = Dart_RootLibrary(); |
435 if (Dart_IsError(parentIsolateRootLibrary)) { | 441 if (Dart_IsError(parentIsolateRootLibrary)) { |
436 *errorMsg = strdup(Dart_GetError(parentIsolateRootLibrary)); | 442 *errorMsg = strdup(Dart_GetError(parentIsolateRootLibrary)); |
437 return 0; | 443 return 0; |
438 } | 444 } |
439 Dart_Handle parentIsolateURLHandle = Dart_LibraryUrl(parentIsolateRootLi
brary); | 445 Dart_Handle parentIsolateURLHandle = Dart_LibraryUrl(parentIsolateRootLi
brary); |
(...skipping 492 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
932 Dart_ExitIsolate(); | 938 Dart_ExitIsolate(); |
933 loader->processSingleRequest(isolate, url, callback); | 939 loader->processSingleRequest(isolate, url, callback); |
934 | 940 |
935 // Restore caller isolate. | 941 // Restore caller isolate. |
936 Dart_EnterIsolate(caller); | 942 Dart_EnterIsolate(caller); |
937 | 943 |
938 // FIXME: We need some way to return a Dart_Handle to the isolate we just cr
eated. | 944 // FIXME: We need some way to return a Dart_Handle to the isolate we just cr
eated. |
939 } | 945 } |
940 | 946 |
941 } | 947 } |
OLD | NEW |