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

Side by Side Diff: Source/bindings/dart/DartController.cpp

Issue 468763003: Throw on spawnUri if we are not on the main thread (Closed) Base URL: svn://svn.chromium.org/blink/branches/dart/dartium
Patch Set: Created 6 years, 4 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 | no next file » | 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) 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
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
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 }
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698